Version in base suite: 17.0.13+11-2~deb12u1 Base version: openjdk-17_17.0.13+11-2~deb12u1 Target version: openjdk-17_17.0.14+7-1~deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/o/openjdk-17/openjdk-17_17.0.13+11-2~deb12u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/o/openjdk-17/openjdk-17_17.0.14+7-1~deb12u1.dsc /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/crash.jar |binary /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/input.jar |binary /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/input.zip |binary /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/javax/sound/midi/SysexMessage/zerosysex.mid |binary openjdk-17-17.0.14+7/.jcheck/conf | 2 openjdk-17-17.0.14+7/README.md | 9 openjdk-17-17.0.14+7/SECURITY.md | 3 openjdk-17-17.0.14+7/debian/changelog | 35 openjdk-17-17.0.14+7/debian/copyright | 100 openjdk-17-17.0.14+7/debian/rules | 49 openjdk-17-17.0.14+7/debian/tests/problems.csv | 51 openjdk-17-17.0.14+7/doc/testing.html | 15 openjdk-17-17.0.14+7/doc/testing.md | 9 openjdk-17-17.0.14+7/make/RunTests.gmk | 43 openjdk-17-17.0.14+7/make/autoconf/lib-alsa.m4 | 19 openjdk-17-17.0.14+7/make/autoconf/lib-x11.m4 | 4 openjdk-17-17.0.14+7/make/autoconf/toolchain.m4 | 8 openjdk-17-17.0.14+7/make/common/NativeCompilation.gmk | 14 openjdk-17-17.0.14+7/make/conf/version-numbers.conf | 6 openjdk-17-17.0.14+7/make/data/publicsuffixlist/VERSION | 4 openjdk-17-17.0.14+7/make/data/publicsuffixlist/public_suffix_list.dat | 605 +++- openjdk-17-17.0.14+7/make/data/tzdata/VERSION | 2 openjdk-17-17.0.14+7/make/data/tzdata/africa | 73 openjdk-17-17.0.14+7/make/data/tzdata/antarctica | 58 openjdk-17-17.0.14+7/make/data/tzdata/asia | 442 +-- openjdk-17-17.0.14+7/make/data/tzdata/australasia | 130 - openjdk-17-17.0.14+7/make/data/tzdata/backward | 15 openjdk-17-17.0.14+7/make/data/tzdata/etcetera | 54 openjdk-17-17.0.14+7/make/data/tzdata/europe | 713 +++-- openjdk-17-17.0.14+7/make/data/tzdata/leapseconds | 8 openjdk-17-17.0.14+7/make/data/tzdata/northamerica | 145 - openjdk-17-17.0.14+7/make/data/tzdata/southamerica | 486 +-- openjdk-17-17.0.14+7/make/data/tzdata/zone.tab | 3 openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java | 16 openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java | 70 openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp | 5 openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp | 25 openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp | 3 openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/assembler_ppc.cpp | 8 openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 22 openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 2 openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/ppc.ad | 1 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp | 1 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp | 12 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 63 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp | 1 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/methodHandles_riscv.cpp | 5 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp | 12 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp | 35 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/riscv.ad | 4 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp | 16 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp | 27 openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp | 7 openjdk-17-17.0.14+7/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp | 20 openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.cpp | 2 openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.hpp | 2 openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.cpp | 10 openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.hpp | 4 openjdk-17-17.0.14+7/src/hotspot/os/bsd/os_bsd.cpp | 13 openjdk-17-17.0.14+7/src/hotspot/os/windows/os_windows.cpp | 8 openjdk-17-17.0.14+7/src/hotspot/share/classfile/classFileParser.cpp | 4 openjdk-17-17.0.14+7/src/hotspot/share/classfile/classLoaderData.cpp | 30 openjdk-17-17.0.14+7/src/hotspot/share/gc/shared/gcOverheadChecker.cpp | 6 openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp | 1 openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp | 6 openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp | 48 openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp | 45 openjdk-17-17.0.14+7/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp | 27 openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp | 18 openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp | 1 openjdk-17-17.0.14+7/src/hotspot/share/jfr/metadata/metadata.xml | 2 openjdk-17-17.0.14+7/src/hotspot/share/memory/guardedMemory.cpp | 4 openjdk-17-17.0.14+7/src/hotspot/share/oops/instanceKlass.cpp | 12 openjdk-17-17.0.14+7/src/hotspot/share/oops/method.cpp | 9 openjdk-17-17.0.14+7/src/hotspot/share/oops/symbol.cpp | 9 openjdk-17-17.0.14+7/src/hotspot/share/opto/compile.cpp | 4 openjdk-17-17.0.14+7/src/hotspot/share/opto/gcm.cpp | 14 openjdk-17-17.0.14+7/src/hotspot/share/opto/loopnode.cpp | 29 openjdk-17-17.0.14+7/src/hotspot/share/opto/node.hpp | 2 openjdk-17-17.0.14+7/src/hotspot/share/opto/subnode.cpp | 90 openjdk-17-17.0.14+7/src/hotspot/share/prims/jniCheck.cpp | 4 openjdk-17-17.0.14+7/src/hotspot/share/prims/unsafe.cpp | 10 openjdk-17-17.0.14+7/src/hotspot/share/prims/whitebox.cpp | 20 openjdk-17-17.0.14+7/src/hotspot/share/runtime/arguments.cpp | 8 openjdk-17-17.0.14+7/src/hotspot/share/runtime/deoptimization.cpp | 2 openjdk-17-17.0.14+7/src/hotspot/share/runtime/java.cpp | 3 openjdk-17-17.0.14+7/src/hotspot/share/runtime/os.cpp | 4 openjdk-17-17.0.14+7/src/hotspot/share/runtime/thread.cpp | 8 openjdk-17-17.0.14+7/src/hotspot/share/utilities/growableArray.hpp | 2 openjdk-17-17.0.14+7/src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c | 44 openjdk-17-17.0.14+7/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java | 45 openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/ThreadLocal.java | 2 openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/MethodHandle.java | 5 openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/VarHandles.java | 9 openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/charset/Charset.java | 8 openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/file/Files.java | 2 openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/MessageDigestSpi.java | 12 openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/cert/X509CertSelector.java | 8 openjdk-17-17.0.14+7/src/java.base/share/classes/java/time/format/DateTimeFormatter.java | 22 openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java | 2 openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/zip/ZipFile.java | 3 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java | 5 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java | 8 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/jca/JCAUtil.java | 5 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java | 7 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java | 4 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Builder.java | 3 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/CertId.java | 2 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java | 4 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java | 4 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java | 5 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java | 6 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java | 4 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/SSLLogger.java | 9 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java | 15 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java | 15 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/tools/keytool/Main.java | 2 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/util/Debug.java | 4 openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/x509/SerialNumber.java | 5 openjdk-17-17.0.14+7/src/java.base/share/legal/public_suffix.md | 2 openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c | 2 openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessImpl_md.c | 15 openjdk-17-17.0.14+7/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c | 36 openjdk-17-17.0.14+7/src/java.base/windows/classes/java/lang/ProcessImpl.java | 22 openjdk-17-17.0.14+7/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java | 15 openjdk-17-17.0.14+7/src/java.base/windows/native/libjava/java_props_md.c | 9 openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java | 59 openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java | 33 openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java | 15 openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java | 35 openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java | 31 openjdk-17-17.0.14+7/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m | 7 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/beans/introspect/MethodInfo.java | 40 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java | 22 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java | 26 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java | 20 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java | 17 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java | 43 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java | 21 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java | 17 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java | 12 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java | 22 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java | 12 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java | 3 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java | 84 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java | 4 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java | 12 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java | 13 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java | 6 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java | 571 ++-- openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java | 7 openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftTuning.java | 64 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java | 20 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java | 8 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JRootPane.java | 9 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JTree.java | 19 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java | 4 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java | 39 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java | 7 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java | 20 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java | 7 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java | 110 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/default.css | 2 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java | 15 openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java | 31 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/FontDescriptor.java | 12 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/SunToolkit.java | 4 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java | 65 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/font/Type1Font.java | 24 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/java2d/Disposer.java | 8 openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/print/PageableDoc.java | 10 openjdk-17-17.0.14+7/src/java.desktop/share/native/libawt/java2d/SurfaceData.h | 2 openjdk-17-17.0.14+7/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c | 6 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java | 22 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java | 19 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java | 11 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/XSettings.java | 13 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java | 91 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java | 9 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/NativeFont.java | 30 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/AttributeClass.java | 17 openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/IPPPrintService.java | 123 openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h | 4 openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h | 4 openjdk-17-17.0.14+7/src/java.desktop/windows/classes/sun/awt/windows/WDataTransferer.java | 39 openjdk-17-17.0.14+7/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java | 4 openjdk-17-17.0.14+7/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java | 46 openjdk-17-17.0.14+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java | 3 openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java | 8 openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/Main.java | 15 openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties | 18 openjdk-17-17.0.14+7/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java | 5 openjdk-17-17.0.14+7/src/jdk.jdwp.agent/share/native/libjdwp/util.c | 2 openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/default.jfc | 1 openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/profile.jfc | 1 openjdk-17-17.0.14+7/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java | 13 openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList-zgc.txt | 1 openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList.txt | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/TEST.groups | 3 openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java | 32 openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/TestGenerator.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/scimark/Scimark.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/Test7068051.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/TestBit.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java | 48 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/TestManyArgs.java | 65 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c | 69 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/SABase.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java | 88 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java | 45 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressCM.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/PrintInlining.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/Agent.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopopts/InfiniteLoopBadControlNeverBranch.java | 57 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/StartupOutput.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/types/correctness/OffTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/containers/cgroup/PlainRead.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAgeOutput.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAt.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestCardTablePageCommits.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestNumWorkerOutput.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestObjectAlignment.java | 33 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestSmallHeap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySilently.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySubSet.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/GCArguments.java | 18 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java | 9 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java | 16 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestAlignment.java | 13 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java | 17 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/Test2GbHeap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java | 18 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java | 96 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java | 38 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java | 28 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABOutput.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java | 22 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java | 22 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestGCId.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestPrintReferences.java | 24 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java | 9 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java | 117 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java | 18 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java | 52 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/compiler/TestLoadBypassesNullCheck.java | 73 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java | 32 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestG1.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/whitebox/TestWBGC.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestGarbageCollectorMXBean.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryMXBean.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryManagerMXBean.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestSmallHeap.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java | 216 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/TestUnloadClassError.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java | 30 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java | 36 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java | 85 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java | 15 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/TestResize.java | 11 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CDS.java | 9 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JMX.java | 7 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/NMT.java | 9 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUnlinkBatchTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java | 7 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithClassUnload.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java | 13 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java | 52 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c | 112 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/DeterministicDump.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/AppCDSOptions.java | 42 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java | 38 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBench.java | 76 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBenchApp.java | 228 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java | 75 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java | 31 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java | 83 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java | 49 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/C.java | 26 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/contended/Options.java | 24 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/execstack/Testexecstack.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jsig/Testjsig.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/BiasedLockingTest.java | 18 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java | 28 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java | 15 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java | 20 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java | 22 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java | 20 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java | 18 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java | 26 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReserveMemory.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/MethodAccessReadTwice.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p5/c5.jasm | 76 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p7/c7.jasm | 113 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java | 24 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java | 16 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/AvailableProcessors.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTimerSlack.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java | 13 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTrimNative.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java | 10 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/records/RedefineRecord.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack001.java | 77 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack002.java | 137 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack003.java | 83 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack004.java | 84 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack005.java | 80 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack006.java | 84 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack007.java | 86 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack008.java | 138 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack009.java | 78 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack010.java | 128 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack011.java | 127 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack012.java | 129 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack013.java | 140 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack014.java | 143 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack015.java | 166 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack016.java | 162 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack017.java | 141 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack018.java | 178 + openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack019.java | 103 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java | 12 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestANewArray.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java | 60 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java | 5 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java | 7 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestFullNames.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java | 16 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java | 14 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestClassDump.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java | 25 openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java | 3 openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/UnloadingTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp001.java | 28 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach004/attach004t.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareEvent/referenceType/refType001.java | 57 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareEvent/thread/thread001.java | 57 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadDeathRequests/thrdeathreq001.java | 21 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001.java | 7 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TEST.properties | 24 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TestDescription.java | 3 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/README | 2 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java | 172 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeArgumentHandler.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java | 8 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java | 3 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/SocketIOPipe.java | 20 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/test/Tests.java | 4 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java | 91 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack002.java | 153 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack003.java | 94 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack004.java | 97 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack005.java | 92 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack006.java | 96 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack007.java | 98 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack008.java | 149 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack009.java | 95 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack010.java | 145 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack011.java | 145 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack012.java | 147 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack013.java | 158 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack014.java | 161 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack015.java | 183 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java | 210 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java | 190 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java | 218 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java | 137 - openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java | 6 openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java | 4 openjdk-17-17.0.14+7/test/jdk/ProblemList-zgc.txt | 3 openjdk-17-17.0.14+7/test/jdk/ProblemList.txt | 29 openjdk-17-17.0.14+7/test/jdk/TEST.groups | 30 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java | 6 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java | 2 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java | 11 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java | 11 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java | 14 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java | 13 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java | 12 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java | 19 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/Sealtest.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java | 20 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java | 19 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java | 11 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java | 29 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java | 6 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java | 13 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java | 16 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java | 15 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java | 49 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java | 41 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java | 92 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java | 65 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java | 19 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java | 67 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java | 48 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java | 11 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java | 34 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java | 1 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java | 8 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java | 9 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacClone.java | 13 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java | 715 +++-- openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java | 3 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ClassesByName2Test.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JITDebug.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JdbLockTest.java | 2 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/NoLaunchOptionTest.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/PrivateTransportTest.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ProcessAttachTest.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/RunToExit.java | 4 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/cds/CDSJDITest.java | 6 openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java | 2 openjdk-17-17.0.14+7/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java | 7 openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest | 60 openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest.java | 60 openjdk-17-17.0.14+7/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java | 5 openjdk-17-17.0.14+7/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java | 55 openjdk-17-17.0.14+7/test/jdk/com/sun/tools/attach/RunnerUtil.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/PopupPosTest/PopupPosTest.java | 25 openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java | 134 - openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectCurrentItemTest.java | 207 + openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectNewItemTest.java | 69 openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java | 180 - openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java | 3 openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/RowToleranceTransitivityTest.java | 10 openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java | 3 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/DefaultSizeTest.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameRepackTest.java | 20 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_1.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_2.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java | 9 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java | 45 openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/RepaintTest.java | 188 - openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java | 72 openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java | 28 openjdk-17-17.0.14+7/test/jdk/java/awt/LightweightComponent/LightweightCliprect.java | 33 openjdk-17-17.0.14+7/test/jdk/java/awt/List/ActionEventTest/ActionEventTest.java | 98 openjdk-17-17.0.14+7/test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java | 280 +- openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest.java | 96 openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.html | 43 openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.java | 234 - openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java | 21 openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java | 16 openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Paint/ListRepaint.java | 49 openjdk-17-17.0.14+7/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java | 394 --- openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/NonEmptyErrorStream.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java | 3 openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.sh | 14 openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java | 11 openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java | 37 openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java | 3 openjdk-17-17.0.14+7/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java | 2 openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragSourceSerializationTest.java | 58 openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragTriggerEventTest.java | 187 + openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangeTest.java | 241 + openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangedTest.java | 253 + openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropPerformanceTest.java | 356 ++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java | 78 openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java | 60 openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html | 45 openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.java | 74 openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java | 151 - openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java | 178 + openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java | 32 openjdk-17-17.0.14+7/test/jdk/java/awt/geom/HitTest/PathHitTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/awt/print/PageFormat/CustomPaper.java | 354 +- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PageDlgPrnButton.java | 224 - openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintCompoundString.java | 281 -- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintImage.java | 374 -- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java | 105 openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintNullString.java | 430 +-- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintParenString.java | 281 -- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintTranslatedFont.java | 333 -- openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/SecurityDialogTest.java | 268 -- openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java | 825 +++++- openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/WindowLayouts.java | 237 + openjdk-17-17.0.14+7/test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java | 211 + openjdk-17-17.0.14+7/test/jdk/java/io/File/CheckPermission.java | 6 openjdk-17-17.0.14+7/test/jdk/java/io/File/MacPath.java | 4 openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/NegativeAvailable.java | 41 openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/ReadXBytes.java | 4 openjdk-17-17.0.14+7/test/jdk/java/io/InputStreamReader/ReadCharBuffer.java | 33 openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/class/NonSerializableTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java | 6 openjdk-17-17.0.14+7/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java | 78 openjdk-17-17.0.14+7/test/jdk/java/lang/ClassLoader/GetSystemPackage.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/Basic.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java | 5 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java | 25 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java | 13 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/SkipTest.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/OnExitTest.java | 21 openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/TreeTest.java | 1 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ArgWithSpaceAndFinalBackslash.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/Duped.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExecWithLotsOfArgs.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExitValue.java | 3 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java | 6 openjdk-17-17.0.14+7/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/StackWalker/CallerFromMain.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java | 2 openjdk-17-17.0.14+7/test/jdk/java/lang/annotation/LoaderLeakTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/NegativeAgentRunner.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java | 2 openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java | 70 openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/net/InetAddress/ptr/Lookup.java | 26 openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java | 5 openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptInheritHandle.java | 12 openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java | 34 openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java | 32 openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java | 25 openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/sealing/CheckSealedTest.java | 21 openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/6212146/TestDriver.java | 3 openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/ContentHandlers/ContentHandlersTest.java | 15 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AsFileDownloadTest.java | 5 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AuthFilterCacheTest.java | 5 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ConcurrentResponses.java | 6 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/CustomResponseSubscriber.java | 6 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ExpectContinue.java | 11 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpRedirectTest.java | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpSlowServerTest.java | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ImmutableFlowItems.java | 6 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeHandshakeTest.java | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeResponseTest.java | 8 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LightWeightHttpServer.java | 5 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/MappingResponseSubscriber.java | 6 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.java | 6 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.policy | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/ServerNameMatcher.java | 152 + openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/TestServerConfigurator.java | 75 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/security/Driver.java | 7 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java | 10 openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java | 11 openjdk-17-17.0.14+7/test/jdk/java/net/ipv6tests/Tests.java | 5 openjdk-17-17.0.14+7/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java | 12 openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceException.java | 4 openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceViews.java | 4 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/DatagramChannel/Disconnect.java | 4 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java | 51 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java | 20 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/Bind.java | 72 openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/NonBlockingAccept.java | 11 openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/AliasesCopy.java | 69 openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/CreateDirectories.java | 124 openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/Misc.java | 77 openjdk-17-17.0.14+7/test/jdk/java/nio/file/Path/MacPathTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySizeTest.java | 4 openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySpecTest.java | 8 openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/MultiThreadTest.java | 8 openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/NegativeTest.java | 9 openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/Failover.java | 10 openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java | 5 openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java | 3 openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java | 9 openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java | 11 openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.java | 67 openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.policy | 1 openjdk-17-17.0.14+7/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java | 4 openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/ByteBuffers.java | 9 openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/TestCloneable.java | 70 openjdk-17-17.0.14+7/test/jdk/java/security/Provider/SupportsParameter.java | 9 openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultAlgo.java | 7 openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultProvider.java | 8 openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/GetInstanceTest.java | 19 openjdk-17-17.0.14+7/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java | 28 openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh | 4 openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/Deadlock.sh | 4 openjdk-17-17.0.14+7/test/jdk/java/security/Security/SynchronizedAccess.java | 129 - openjdk-17-17.0.14+7/test/jdk/java/security/Signature/ByteBuffers.java | 16 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/NONEwithRSA.java | 17 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/ResetAfterException.java | 11 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/SignWithOutputBuffer.java | 17 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/SignatureGetInstance.java | 18 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/TestCloneable.java | 34 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/TestInitSignWithMyOwnRandom.java | 20 openjdk-17-17.0.14+7/test/jdk/java/security/Signature/VerifyRangeCheckOverflow.java | 11 openjdk-17-17.0.14+7/test/jdk/java/security/SignedJar/SignedJarWithCustomClassLoader.java | 6 openjdk-17-17.0.14+7/test/jdk/java/security/SignedObject/Chain.java | 17 openjdk-17-17.0.14+7/test/jdk/java/security/SignedObject/Copy.java | 16 openjdk-17-17.0.14+7/test/jdk/java/security/cert/CertificateFactory/slowstream.sh | 6 openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509CertSelectorTest.java | 13 openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java | 6 openjdk-17-17.0.14+7/test/jdk/java/security/misc/GetInstanceNullsEmpties.java | 197 - openjdk-17-17.0.14+7/test/jdk/java/security/testlibrary/HumanInputStream.java | 192 + openjdk-17-17.0.14+7/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java | 36 openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.java | 51 openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.sh | 50 openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/BasicTestLauncher.java | 100 openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java | 4 openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/VERSION | 2 openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt | 1 openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java | 83 openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java | 1 openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/SystemTest.java | 75 openjdk-17-17.0.14+7/test/jdk/java/util/zip/CopyZipFile.java | 291 +- openjdk-17-17.0.14+7/test/jdk/java/util/zip/DeflaterDictionaryTests.java | 26 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/Available.java | 37 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java | 226 + openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CopyJar.java | 48 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumAfterClose.java | 49 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumerateAfterClose.java | 94 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/FinalizeInflater.java | 67 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/GetDirEntry.java | 43 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java | 117 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadZip.java | 472 ++- openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReleaseInflater.java | 85 openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/StreamZipEntriesTest.java | 157 - openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ZeroDate.java | 58 openjdk-17-17.0.14+7/test/jdk/javax/accessibility/JComboBox/TestJComboBoxScreenMagnifier.java | 91 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/ByteBuffers.java | 15 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java | 14 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java | 5 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestCipherMode.java | 6 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestGetInstance.java | 46 openjdk-17-17.0.14+7/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java | 13 openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java | 9 openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java | 6 openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java | 8 openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java | 16 openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java | 22 openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java | 12 openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java | 11 openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java | 23 openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java | 8 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/ByteBuffers.java | 11 openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/TestGetInstance.java | 20 openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java | 9 openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java | 9 openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java | 5 openjdk-17-17.0.14+7/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java | 2 openjdk-17-17.0.14+7/test/jdk/javax/management/security/HashedPasswordFileTest.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/DTLS/DTLSWontNegotiateV10.java | 7 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/AbstractServer.java | 14 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java | 6 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java | 6 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/DisabledAlgorithms.java | 216 - openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java | 148 + openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java | 92 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java | 12 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/TLSBase.java | 3 openjdk-17-17.0.14+7/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java | 7 openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstance.java | 22 openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy | 1 openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java | 15 openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy | 2 openjdk-17-17.0.14+7/test/jdk/javax/sound/midi/SysexMessage/EmptySysExMessageTest.java | 82 openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java | 59 openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/bug4490179.java | 13 openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/ComboPopupBug.java | 86 openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java | 168 + openjdk-17-17.0.14+7/test/jdk/javax/swing/JFrame/DefaultCloseOperation.java | 36 openjdk-17-17.0.14+7/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java | 145 + openjdk-17-17.0.14+7/test/jdk/javax/swing/JLabel/4138746/JLabelMnemonicsTest.java | 3 openjdk-17-17.0.14+7/test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneArrowDirection.java | 108 openjdk-17-17.0.14+7/test/jdk/javax/swing/JToolBar/bug4203039.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/swing/MultiMonitor/MultimonVImage.java | 30 openjdk-17-17.0.14+7/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java | 4 openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java | 277 ++ openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java | 12 openjdk-17-17.0.14+7/test/jdk/javax/swing/text/JTextComponent/5074573/bug5074573.java | 34 openjdk-17-17.0.14+7/test/jdk/javax/swing/text/html/CSS/bug8234913.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java | 42 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestOrdered.java | 6 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestReuse.java | 5 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/Application.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java | 10 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java | 2 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java | 2 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java | 2 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java | 69 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestModularImage.java | 184 + openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java | 24 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java | 10 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java | 2 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartDuration.java | 6 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartName.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartupMessage.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/nio/zipfs/ZeroDate.java | 58 openjdk-17-17.0.14+7/test/jdk/jdk/security/JavaDotSecurity/MakeJavaSecurityTest.java | 4 openjdk-17-17.0.14+7/test/jdk/jdk/security/jarsigner/Spec.java | 13 openjdk-17-17.0.14+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/awt/PaletteTester.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/management/jdp/DynamicLauncher.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java | 32 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java | 14 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java | 47 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java | 195 - openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java | 9 openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java | 10 openjdk-17-17.0.14+7/test/jdk/sun/net/www/B8185898.java | 16 openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java | 251 + openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B8291637.java | 67 openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java | 34 openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java | 23 openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java | 21 openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/GetContentTypeTest.java | 12 openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jrt/OtherResourcesTest.java | 19 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/InvalidCurve.java | 3 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureDigestTruncate.java | 11 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureKAT.java | 11 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignedObjectChain.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/TestEC.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdCRLSign.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeySize.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSATest.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/TestEdDSA.java | 14 openjdk-17-17.0.14+7/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/ModuleName.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/Renew.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/runNameEquals.sh | 6 openjdk-17-17.0.14+7/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java | 8 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java | 33 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java | 15 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java | 11 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java | 11 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java | 14 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java | 73 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyStore/Basic.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/PKCS11Test.java | 56 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java | 3 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/policy | 3 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy | 3 openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs12/P12SecretKey.java | 40 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA2.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java | 8 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java | 9 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/DKSTest.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/Offsets.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/NSASuiteB/TestDSAGenParameterSpec.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/NSASuiteB/TestSHAOids.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java | 10 openjdk-17-17.0.14+7/test/jdk/sun/security/provider/PolicyFile/getinstance/getinstance.sh | 6 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/GenKeyStore.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/KeySizeTest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SignatureTest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SpecTest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestCACerts.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyFactory.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGenerator.java | 29 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java | 16 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java | 10 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java | 13 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestRSAOidSupport.java | 8 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSigGen15.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSignatures.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/WithoutNULL.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/InitAgain.java | 18 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSParametersTest.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java | 9 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTest2.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java | 17 openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java | 5 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java | 166 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java | 307 -- openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java | 195 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeOutStream/NullCerts.java | 214 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java | 197 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseStart.java | 58 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/DelegatedTaskWrongException.java | 162 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EmptyExtensionData.java | 72 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java | 208 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java | 64 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineDeadlock.java | 137 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineFailedALPN.java | 171 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java | 42 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java | 109 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/HashCodeMissing.java | 230 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java | 45 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java | 1 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java | 43 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java | 1 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java | 32 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/NotifyHandshakeTest.sh | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java | 249 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem | 77 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem | 76 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem | 88 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem | 63 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem | 76 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem | 79 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem | 66 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem | 80 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem | 92 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java | 1276 ++++++---- openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java | 1263 ++++++--- openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java | 292 -- openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem | 64 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem | 55 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem | 67 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem | 66 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem | 51 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem | 67 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem | 56 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem | 170 - openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem | 73 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java | 228 + openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java | 68 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java | 95 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem | 77 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem | 76 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem | 88 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem | 63 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem | 76 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem | 79 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem | 66 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem | 80 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem | 92 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem | 64 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem | 55 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem | 67 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem | 66 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem | 51 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem | 67 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem | 56 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem | 71 openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem | 170 + openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem | 73 openjdk-17-17.0.14+7/test/jdk/sun/security/tools/keytool/KeyToolTest.java | 222 - openjdk-17-17.0.14+7/test/jdk/sun/security/tools/keytool/NssTest.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/util/Pem/encoding.sh | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/util/RegisteredDomain/ParseNames.java | 2 openjdk-17-17.0.14+7/test/jdk/sun/security/util/RegisteredDomain/tests.dat | 11 openjdk-17-17.0.14+7/test/jdk/sun/security/validator/certreplace.sh | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/validator/samedn.sh | 4 openjdk-17-17.0.14+7/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java | 9 openjdk-17-17.0.14+7/test/jdk/sun/security/x509/X509CRLImpl/Verify.java | 92 openjdk-17-17.0.14+7/test/jdk/sun/security/x509/X509CertImpl/Verify.java | 78 openjdk-17-17.0.14+7/test/jdk/sun/tools/jcmd/TestProcessHelper.java | 3 openjdk-17-17.0.14+7/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java | 14 openjdk-17-17.0.14+7/test/jdk/sun/tools/jhsdb/JStackStressTest.java | 6 openjdk-17-17.0.14+7/test/jdk/sun/tools/jinfo/JInfoTest.java | 12 openjdk-17-17.0.14+7/test/jdk/sun/tools/jstat/JStatInterval.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Month.java | 37 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleDay.java | 30 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleRec.java | 9 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java | 4 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Zoneinfo.java | 7 openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones | 36 openjdk-17-17.0.14+7/test/jdk/tools/jar/ExtractFilesTest.java | 265 ++ openjdk-17-17.0.14+7/test/jdk/tools/jar/MultipleManifestTest.java | 224 + openjdk-17-17.0.14+7/test/jdk/tools/jimage/JImageToolTest.java | 4 openjdk-17-17.0.14+7/test/jdk/tools/jlink/JLinkReproducibleTest.java | 8 openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java | 145 + openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/com/foo/Main.java | 49 openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/module-info.java | 26 openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/module-info.java | 25 openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/net/foo/Main.java | 50 openjdk-17-17.0.14+7/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java | 42 openjdk-17-17.0.14+7/test/jdk/tools/jpackage/windows/WinChildProcessTest.java | 87 openjdk-17-17.0.14+7/test/jdk/tools/launcher/TestXcheckJNIWarnings.java | 24 openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/basic/BasicTest.java | 4 openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java | 2 openjdk-17-17.0.14+7/test/langtools/jdk/jshell/ExceptionMessageTest.java | 1 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path.sh | 198 - openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path2.sh | 111 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/ClassPath.java | 218 + openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/ClassPath2.java | 126 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Diagnostics.java | 253 + openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Diagnostics.sh | 210 - openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.java | 82 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.sh | 69 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.java | 352 ++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.sh | 277 -- openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.java | 560 ++++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.sh | 115 openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/WildcardMineField.java | 340 ++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/wcMineField.sh | 296 -- openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/StringAppendEvaluatesInOrder.java | 66 openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypeSignatures.java | 119 openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypes.java | 81 openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/access/Test.java | 66 openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/ParametricException.java | 103 openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/parametricException/ParametricException.java | 103 openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.java | 54 openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.out | 5 openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.java | 54 openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.out | 5 openjdk-17-17.0.14+7/test/langtools/tools/lib/toolbox/ToolBox.java | 2 openjdk-17-17.0.14+7/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java | 70 openjdk-17-17.0.14+7/test/lib-test/jdk/test/whitebox/vm_flags/BooleanTest.java | 2 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/StringArrayUtils.java | 63 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/Utils.java | 227 + openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSAppTester.java | 240 + openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSOptions.java | 13 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java | 4 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/classloader/ClassUnloadCommon.java | 7 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java | 8 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java | 4 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/OutputBuffer.java | 10 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/ProcessTools.java | 64 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/StreamPumper.java | 22 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java | 109 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/SecurityUtils.java | 62 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestCertificate.java | 4 openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestTLSHandshake.java | 6 openjdk-17-17.0.14+7/test/lib/jdk/test/whitebox/WhiteBox.java | 7 openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/SSLHandshake.java | 9 openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/TestCertificates.java | 8 1404 files changed, 29452 insertions(+), 21334 deletions(-) diff -Nru openjdk-17-17.0.13+11/.jcheck/conf openjdk-17-17.0.14+7/.jcheck/conf --- openjdk-17-17.0.13+11/.jcheck/conf 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/.jcheck/conf 2025-01-04 20:25:18.000000000 +0000 @@ -1,7 +1,7 @@ [general] project=jdk-updates jbs=JDK -version=17.0.13 +version=17.0.14 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists diff -Nru openjdk-17-17.0.13+11/README.md openjdk-17-17.0.14+7/README.md --- openjdk-17-17.0.13+11/README.md 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/README.md 2025-01-04 20:25:18.000000000 +0000 @@ -1,4 +1,11 @@ -# Welcome to the JDK! +# Welcome to OpenJDK 17 Updates! + +The JDK 17 Updates project uses two GitHub repositories. +Updates are continuously developed in the repository [jdk17u-dev](https://github.com/openjdk/jdk17u-dev). This is the repository usually targeted by contributors. +The [jdk17u](https://github.com/openjdk/jdk17u) repository is used for rampdown of the update releases of jdk17u and only accepts critical changes that must make the next release during rampdown. (You probably do not want to target jdk17u). + +For more OpenJDK 17 updates specific information such as timelines and contribution guidelines see the [project wiki page](https://wiki.openjdk.org/display/JDKUpdates/JDK+17u/). + For build instructions please see the [online documentation](https://openjdk.java.net/groups/build/doc/building.html), diff -Nru openjdk-17-17.0.13+11/SECURITY.md openjdk-17-17.0.14+7/SECURITY.md --- openjdk-17-17.0.13+11/SECURITY.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/SECURITY.md 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,3 @@ +# JDK Vulnerabilities + +Please follow the process outlined in the [OpenJDK Vulnerability Policy](https://openjdk.org/groups/vulnerability/report) to disclose vulnerabilities in the JDK. diff -Nru openjdk-17-17.0.13+11/debian/changelog openjdk-17-17.0.14+7/debian/changelog --- openjdk-17-17.0.13+11/debian/changelog 2024-10-17 20:50:46.000000000 +0000 +++ openjdk-17-17.0.14+7/debian/changelog 2025-01-30 23:01:36.000000000 +0000 @@ -1,8 +1,37 @@ -openjdk-17 (17.0.13+11-2~deb12u1) bookworm-security; urgency=medium +openjdk-17 (17.0.14+7-1~deb12u1) bookworm-security; urgency=medium - * Rebuild for bookworm + * Rebuild for Bookworm - -- Moritz Mühlenhoff Thu, 17 Oct 2024 22:50:46 +0200 + -- Moritz Muehlenhoff Fri, 31 Jan 2025 00:01:36 +0100 + +openjdk-17 (17.0.14+7-1) unstable; urgency=medium + + * OpenJDK 17.0.14 release, build 7. Release notes: + https://mail.openjdk.org/pipermail/jdk-updates-dev/2025-January/040827.html + + - CVEs: + + CVE-2025-21502 - 8330045: Enhance array handling. + + [ Vladimir Petko ] + * d/rules: Dump complete hs_err_pid and replay_pid logs to stdout. + * d/t/problems.csv: Add openjdk-24 and openjdk-25 to the problems.csv. + * d/rules: Create link to jquery-3.7.1.min.js instead of jquery-3.6.1.min.js + (LP: #2095455). + * d/copyright: Regenerate. + + [ Matthias Klose ] + * d/rules: Also dump logs for zero builds and for build failures. + + -- Matthias Klose Wed, 22 Jan 2025 10:17:58 +0100 + +openjdk-17 (17.0.14~6ea-1) unstable; urgency=medium + + * OpenJDK 17.0.14 early access, build 6. + + [ Pushkar Kulkarni ] + * d/t/problems.csv: Update based on recent JTREG runs. + + -- Matthias Klose Fri, 20 Dec 2024 11:09:22 +0100 openjdk-17 (17.0.13+11-2) unstable; urgency=high diff -Nru openjdk-17-17.0.13+11/debian/copyright openjdk-17-17.0.14+7/debian/copyright --- openjdk-17-17.0.13+11/debian/copyright 2024-07-20 08:43:54.000000000 +0000 +++ openjdk-17-17.0.14+7/debian/copyright 2025-01-22 09:17:58.000000000 +0000 @@ -826,7 +826,7 @@ . The Source Code of this file is available under the Mozilla Public License, v. 2.0 and is located at - https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat. + https://raw.githubusercontent.com/publicsuffix/list/1cbd6e71a9b83620b1d0b11e49d3d9ff48c27e22/public_suffix_list.dat. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/. . @@ -2121,6 +2121,54 @@ --- end of LICENSE --- . ------------------------------------------------------------------------------ + %% This notice is provided with respect to PipeWire 0.3.68, + which may be included with JRE 17, JDK 17 and OpenJDK 17 + . + --- begin of LICENSE --- + . + PipeWire license: + . + All PipeWire header files are licensed under the MIT License: + . + . + . + Copyright © 2018-2023 Wim Taymans + . + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + . + . + The below copyright applies to the following files: + . + spa/include/spa/monitor/type-info.h + . + Copyright © 2021 Collabora Ltd. + . + . + spa/include/spa/utils/string.h + . + Copyright © 2021 Red Hat, Inc. + . + . + --- end of LICENSE --- + . + ------------------------------------------------------------------------------ %% This notice is provided with respect to xwd v1.0.7, which may be included with JRE 17, JDK 17 and OpenJDK 17 . @@ -2657,14 +2705,14 @@ --- end of LICENSE --- . ------------------------------------------------------------------------------ - %% This notice is provided with respect to jQuery v3.6.1, + %% This notice is provided with respect to jQuery v3.7.1, which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . jQuery License . - jQuery v 3.6.1 + jQuery v 3.7.1 Copyright OpenJS Foundation and other contributors, https://openjsf.org/ . Permission is hereby granted, free of charge, to any person obtaining @@ -2686,52 +2734,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . - ****************************************** - . - The jQuery JavaScript Library v3.6.1 also includes Sizzle.js - . - Sizzle.js includes the following license: - . - Copyright JS Foundation and other contributors, https://js.foundation/ - . - This software consists of voluntary contributions made by many - individuals. For exact contribution history, see the revision history - available at https://github.com/jquery/sizzle - . - The following license applies to all parts of this software except as - documented below: - . - ==== - . - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - . - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - . - ==== - . - All files located in the node_modules and external directories are - externally maintained libraries used by this software which have their - own licenses; we recommend you read them, as their terms may differ from - the terms above. - . - ********************* - . - . . --- end of LICENSE --- . diff -Nru openjdk-17-17.0.13+11/debian/rules openjdk-17-17.0.14+7/debian/rules --- openjdk-17-17.0.13+11/debian/rules 2024-10-17 08:58:43.000000000 +0000 +++ openjdk-17-17.0.14+7/debian/rules 2025-01-22 09:17:58.000000000 +0000 @@ -388,9 +388,11 @@ DEFAULT_CONFIGURE_ARGS = ZERO_CONFIGURE_ARGS = -# S390x does not support dtrace probes +no_dtrace_archs = powerpc ppc64 ppc64el sh4 s390x + +# PPC*, S390x and SH do not support dtrace probes # https://github.com/openjdk/jdk/pull/13228 -ifeq (,$(filter $(DEB_HOST_ARCH), powerpc ppc64 ppc64el s390x)) +ifeq (,$(filter $(DEB_HOST_ARCH),$(no_dtrace_archs))) COMMON_CONFIGURE_ARGS += --enable-dtrace endif @@ -717,7 +719,7 @@ bd_nss = libnss3-dev (>= 2:3.17.1), endif endif -bd_systemtap = systemtap-sdt-dev [!powerpc !ppc64 !ppc64el !sh4 !s390x], +bd_systemtap = systemtap-sdt-dev [$(foreach a,$(no_dtrace_archs),!$(a))], ifeq (,$(filter $(distrel),jessie stretch buster precise trusty xenial bionic focal groovy)) with_debugedit = yes @@ -1147,22 +1149,39 @@ ifneq (,$(filter $(DEB_HOST_ARCH), alpha armel armhf ia64 loong64 m68k mips mipsel mips64 mips64el powerpc riscv64 s390x sh4 sparc sparc64)) sh -c 'sh debian/buildwatch.sh $(CURDIR)/$(builddir) &' endif - if $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(builddir) $(build_target); then \ - : ; \ - else \ - if [ -f buildwatch.pid ]; then \ - pid=$$(cat buildwatch.pid); \ - kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \ - fi; \ - false; \ - fi + $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(builddir) $(build_target); \ + rv=$$?; \ + for log in `find $(builddir) -name 'hs_err_pid*.log' -o -name 'replay_pid*.log'`; do \ + [ -f $$log ] || continue; \ + echo "=== $$log ==="; \ + cat $$log; \ + echo "======"; \ + done; \ + if [ -f buildwatch.pid ]; then \ + pid=$$(cat buildwatch.pid); \ + kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \ + fi; \ + exit $$rv touch $@ stamps/zero-build: stamps/zero-configure @echo '========== $@ ==========' : # FIXME: build using the just built jdk, and build the vm only - $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(zbuilddir) $(zbuild_target) + $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(zbuilddir) $(zbuild_target); \ + rv=$$?; \ + for log in `find $(zbuilddir) -name 'hs_err_pid*.log' -o -name 'replay_pid*.log'`; do \ + [ -f $$log ] || continue; \ + echo "=== $$log ==="; \ + cat $$log; \ + echo "======"; \ + done; \ + if [ -f buildwatch.pid ]; then \ + pid=$$(cat buildwatch.pid); \ + kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \ + fi; \ + exit $$rv + rm -rf $(builddir)/$(sdkimg)/lib/zero cp -a $(zbuilddir)/$(zsdkimg)/lib/server \ $(builddir)/$(sdkimg)/lib/zero @@ -1864,7 +1883,7 @@ rm -v $(d_doc)/usr/share/doc/$(p_jrehl)/api/script-dir/{jquery-3.7.1.min.js,jquery-ui.min.css,jquery-ui.min.js} dh_link -p$(p_doc) \ /usr/share/javascript/jquery/jquery.min.js \ - /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-3.6.1.min.js \ + /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-3.7.1.min.js \ /usr/share/javascript/jquery-ui/themes/base/jquery-ui.min.css \ /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-ui.min.css \ /usr/share/javascript/jquery-ui/jquery-ui.min.js \ @@ -1968,7 +1987,7 @@ dh_builddeb -a $(nodemo) $(nojrez) #$(bd_options) git_project = jdk17u -git_tag = jdk-17.0.13+11 +git_tag = jdk-17.0.14+7 package_version = $(subst jdk-,,$(git_tag)) package_version = $(shell echo $(PKGVERSION) | sed 's/-[^-][^-]*$$//') ifneq ($(is_upstream_release),yes) diff -Nru openjdk-17-17.0.13+11/debian/tests/problems.csv openjdk-17-17.0.14+7/debian/tests/problems.csv --- openjdk-17-17.0.13+11/debian/tests/problems.csv 2024-10-10 12:16:00.000000000 +0000 +++ openjdk-17-17.0.14+7/debian/tests/problems.csv 2025-01-17 08:14:54.000000000 +0000 @@ -1,7 +1,7 @@ Test,Bug,Comment,Packages,Arch,Release -Error: runtime/Unsafe/InternalErrorTest.java,JDK-8335238,"To investigate, not critical for security release – JDK-22 will expire before OO release",:openjdk-22,i386,:release-all +Error: runtime/Unsafe/InternalErrorTest.java,JDK-8335238,"To investigate, not critical for security release – JDK-22 will expire before OO release",:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,i386,:release-all Error: serviceability/jvmti/vthread/SuspendResume1/SuspendResume1.java#default,,"Deadlock, new failure, not critical – JDK-22 will expire before OO release",:openjdk-22,ppc64el,:release-all -FAILED: compiler/arguments/CheckCICompilerCount.java,,"Existing failure (exit code 0, expected 1)",:openjdk-17:openjdk-21:openjdk-22,i386,:release-all +FAILED: compiler/arguments/CheckCICompilerCount.java,,"Existing failure (exit code 0, expected 1)",:openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,i386,:release-all FAILED: compiler/codecache/MHIntrinsicAllocFailureTest.java,JDK-8298947,The issue only happens on armhf platform. ,:openjdk-17:openjdk-21,armhf,:release-all FAILED: gtest/GTestWrapper.java,,"17:UninitializedDoubleElementWorkerDataArrayTest.print_summary_on_test_vm, ",:openjdk-17:openjdk-21,i386,:release-all FAILED: java/foreign/critical/TestCritical.java,,"SEGSEGV in test, submit bug, not critical for security release",:openjdk-22,s390x,:release-all @@ -12,37 +12,37 @@ FAILED: java/foreign/TestSegments.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all FAILED: java/foreign/TestUpcallHighArity.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all FAILED: java/foreign/TestUpcallStructScope.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all -FAILED: java/io/File/createTempFile/TargetDirectory.java,JDK-8166162,Container issue,:openjdk-21:openjdk-22,:arch-all,:release-all +FAILED: java/io/File/createTempFile/TargetDirectory.java,JDK-8166162,Container issue,:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all FAILED: java/io/File/GetXSpace.java,,"Container issue, disk space size exceeds 32 bit integer",:openjdk-17:openjdk-21:openjdk-22,:i386:armhf,:release-all -FAILED: java/nio/channels/FileChannel/directio/DirectIOTest.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/channels/FileChannel/directio/PreadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/channels/FileChannel/directio/PwriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/channels/FileChannel/directio/ReadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/channels/FileChannel/directio/WriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/attribute/AclFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +FAILED: java/nio/channels/FileChannel/directio/DirectIOTest.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/channels/FileChannel/directio/PreadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/channels/FileChannel/directio/PwriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/channels/FileChannel/directio/ReadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/channels/FileChannel/directio/WriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/attribute/AclFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all FAILED: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java,JDK-8166162,Container issue,:openjdk-22,i386,:release-all -FAILED: java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/attribute/DosFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/attribute/PosixFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/CheckPermissions.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/CopyAndMove.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/CopyMoveVariations.java,JDK-8166162,Container issue,:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/FileAttributes.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/InterruptCopy.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/Misc.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/Files/TemporaryFiles.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all -FAILED: java/nio/file/FileStore/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +FAILED: java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/attribute/DosFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/attribute/PosixFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/CheckPermissions.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/CopyAndMove.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/CopyMoveVariations.java,JDK-8166162,Container issue,:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/FileAttributes.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/InterruptCopy.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/Misc.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/Files/TemporaryFiles.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all +FAILED: java/nio/file/FileStore/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all FAILED: runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java,,flaky test (?) existing comment,:openjdk-17,:arch-all,:release-all FAILED: runtime/cds/appcds/jcmd/JCmdTestFileSafety.java,,flaky test (?) existing comment,:openjdk-17,i386:arm64:amd64:ppc64el,:release-all FAILED: runtime/cds/appcds/jcmd/JCmdTestStaticDump.java,,flaky test (?) existing comment,:openjdk-17,:arch-all,:release-all FAILED: runtime/ErrorHandling/MachCodeFramesInErrorFile.java,,java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code at java.base/java.lang.Long.toHexString(Long.java:309) at,:openjdk-17:openjdk-21,armhf,:release-all FAILED: runtime/jni/nativeStack/TestNativeStack.java,JDK-8312016,"Backport fix (do not add patch, the fix just disables the test)",:openjdk-lts:openjdk-11:openjdk-17,armhf,:release-all -FAILED: runtime/LoadClass/LongBCP.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11:openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +FAILED: runtime/LoadClass/LongBCP.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11:openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all FAILED: runtime/Monitor/ConcurrentDeflation.java,,LockingMode == 0 (LM_MONITOR) is not fully implemented on this architectureError: Could not create the Java Virtual Machine.,:openjdk-21,armhf,:release-all -FAILED: runtime/NMT/VirtualAllocCommitMerge.java,JDK-8309698,P4 bug (existing issue),:openjdk-21:openjdk-22,s390x,:release-all +FAILED: runtime/NMT/VirtualAllocCommitMerge.java,JDK-8309698,P4 bug (existing issue),:openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,s390x,:release-all FAILED: serviceability/AsyncGetCallTrace/MyPackage/ASGCTBaseTest.java,JDK-8303168,Existing bug,:openjdk-21,armhf,:release-all -FAILED: tools/jlink/JLinkTest.java,JDK-8240349,Bugfix failed for i386 (P4 bug),:openjdk-17:openjdk-21:openjdk-22,i386,:release-all +FAILED: tools/jlink/JLinkTest.java,JDK-8240349,Bugfix failed for i386 (P4 bug),:openjdk-17:openjdk-21:openjdk-22:openjdk-23:openjdk-24:openjdk-25:,i386,:release-all FAILED: jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all FAILED: jdk/javadoc/doclet/T6735320/T6735320.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all FAILED: jdk/javadoc/doclet/testBadHtml/TestBadHtml.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all @@ -82,4 +82,5 @@ FAILED: java/foreign/TestUpcallStack.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all FAILED: java/foreign/TestVarArgs.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all FAILED: runtime/os/TestTrimNative.java#trimNative,, java.lang.RuntimeException: We found fewer (periodic) trim lines in UL log than expected (expected at least 13 found 11). This looks like a flaky test - it asserts number of lines from the periodic trimmer e.g. src/hotspot/share/runtime/trimNativeHeap.hpp:56 which causes the test to fail due to the slow VM. Test passes locally.,:openjdk-21,:armhf,:release-all -FAILED: jdk/sun/security/util/Debug/DebugOptions.java,JDK-8339713,Stack overflow error on 32-bit platforms,:openjdk-21:openjdk-23,:armhf:i386,:release-all +FAILED: jdk/sun/security/util/Debug/DebugOptions.java,JDK-8339713,Stack overflow error on 32-bit platforms,:openjdk-17:openjdk-21:openjdk-23:openjdk-24:openjdk-25:,:armhf:i386:s390x,:release-all +Error: jdk/jshell/TerminalNoExecTest.java,,BackingStoreException: Couldn't get file lock - possibly because the LP (non-root) container has no home directory,:openjdk-23:openjdk-24:openjdk-25:,:arch-all,:release-all diff -Nru openjdk-17-17.0.13+11/doc/testing.html openjdk-17-17.0.14+7/doc/testing.html --- openjdk-17-17.0.13+11/doc/testing.html 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/doc/testing.html 2025-01-04 20:25:18.000000000 +0000 @@ -44,6 +44,9 @@
  • Docker Tests
  • Non-US locale
  • PKCS11 Tests
  • +
  • Testing with +alternative security providers
  • Client UI Tests
  • @@ -242,6 +245,18 @@
    $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
         JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs"

    For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.

    +

    Testing with +alternative security providers

    +

    Some security tests use a hardcoded provider for +KeyFactory, Cipher, +KeyPairGenerator, KeyGenerator, +AlgorithmParameterGenerator, KeyAgreement, +Mac, MessageDigest, SecureRandom, +Signature, AlgorithmParameters, +Configuration, Policy, or +SecretKeyFactory objects. Specify the +-Dtest.provider.name=NAME property to use a different +provider for the service(s).

    Client UI Tests

    System key shortcuts

    Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.

    diff -Nru openjdk-17-17.0.13+11/doc/testing.md openjdk-17-17.0.14+7/doc/testing.md --- openjdk-17-17.0.13+11/doc/testing.md 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/doc/testing.md 2025-01-04 20:25:18.000000000 +0000 @@ -551,6 +551,15 @@ For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README. +### Testing with alternative security providers + +Some security tests use a hardcoded provider for `KeyFactory`, `Cipher`, +`KeyPairGenerator`, `KeyGenerator`, `AlgorithmParameterGenerator`, +`KeyAgreement`, `Mac`, `MessageDigest`, `SecureRandom`, `Signature`, +`AlgorithmParameters`, `Configuration`, `Policy`, or `SecretKeyFactory` objects. +Specify the `-Dtest.provider.name=NAME` property to use a different provider for +the service(s). + ### Client UI Tests #### System key shortcuts diff -Nru openjdk-17-17.0.13+11/make/RunTests.gmk openjdk-17-17.0.14+7/make/RunTests.gmk --- openjdk-17-17.0.13+11/make/RunTests.gmk 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/RunTests.gmk 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, 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 @@ -200,9 +200,10 @@ $(eval $(call ParseKeywordVariable, JTREG, \ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \ TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \ - RETRY_COUNT REPEAT_COUNT MAX_OUTPUT, \ + RETRY_COUNT REPEAT_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \ STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \ - EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS, \ + EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS\ + $(CUSTOM_JTREG_STRING_KEYWORDS), \ )) ifneq ($(JTREG), ) @@ -738,8 +739,6 @@ # we may end up with a lot of JVM's $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }') - JTREG_TIMEOUT_FACTOR ?= 4 - JTREG_VERBOSE ?= fail,error,summary JTREG_RETAIN ?= fail,error JTREG_RUN_PROBLEM_LISTS ?= false @@ -814,6 +813,24 @@ $1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST)) endif + JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS) + + JTREG_AUTO_PROBLEM_LISTS := + JTREG_AUTO_TIMEOUT_FACTOR := 4 + + ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), ) + JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt + JTREG_AUTO_TIMEOUT_FACTOR := 10 + endif + + ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), ) + ifneq ($$(findstring -XX:-ZGenerational, $$(JTREG_ALL_OPTIONS)), ) + JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt + else + JTREG_AUTO_PROBLEM_LISTS += ProblemList-generational-zgc.txt + endif + endif + ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), ) # Accept both absolute paths as well as relative to the current test root. $1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \ @@ -843,6 +860,20 @@ endif endif + $$(eval $$(call SetupRunJtregTestCustom, $1)) + + # SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables + # so set the final results after setting values from custom setup + ifneq ($$(JTREG_AUTO_PROBLEM_LISTS), ) + # Accept both absolute paths as well as relative to the current test root. + $1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \ + $$(JTREG_AUTO_PROBLEM_LISTS) \ + $$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_AUTO_PROBLEM_LISTS)) \ + )) + endif + + JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR) + clean-outputdirs-$1: $$(RM) -r $$($1_TEST_SUPPORT_DIR) $$(RM) -r $$($1_TEST_RESULTS_DIR) @@ -945,7 +976,7 @@ $1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt $1_FULL_TEST_NAME := $$(strip $$(patsubst special:%, %, $$($1_TEST))) - ifneq ($$(findstring :, $$($1_FULL_TEST_NAME)), ) + ifneq ($$(findstring:, $$($1_FULL_TEST_NAME)), ) $1_TEST_NAME := $$(firstword $$(subst :, ,$$($1_FULL_TEST_NAME))) $1_TEST_ARGS := $$(strip $$(patsubst special:$$($1_TEST_NAME):%, %, $$($1_TEST))) else diff -Nru openjdk-17-17.0.13+11/make/autoconf/lib-alsa.m4 openjdk-17-17.0.14+7/make/autoconf/lib-alsa.m4 --- openjdk-17-17.0.13+11/make/autoconf/lib-alsa.m4 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/autoconf/lib-alsa.m4 2025-01-04 20:25:18.000000000 +0000 @@ -71,6 +71,25 @@ fi fi if test "x$ALSA_FOUND" = xno; then + # If we have sysroot set, and no explicit library location is set, + # look at known locations in sysroot. + if test "x$SYSROOT" != "x" && test "x${with_alsa_lib}" == x; then + if test -f "$SYSROOT/usr/lib64/libasound.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + ALSA_LIBS="-L$SYSROOT/usr/lib64 -lasound" + ALSA_FOUND=yes + elif test -f "$SYSROOT/usr/lib/libasound.so"; then + ALSA_LIBS="-L$SYSROOT/usr/lib -lasound" + ALSA_FOUND=yes + elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then + ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound" + ALSA_FOUND=yes + elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then + ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound" + ALSA_FOUND=yes + fi + fi + fi + if test "x$ALSA_FOUND" = xno; then AC_CHECK_HEADERS([alsa/asoundlib.h], [ ALSA_FOUND=yes diff -Nru openjdk-17-17.0.13+11/make/autoconf/lib-x11.m4 openjdk-17-17.0.14+7/make/autoconf/lib-x11.m4 --- openjdk-17-17.0.13+11/make/autoconf/lib-x11.m4 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/autoconf/lib-x11.m4 2025-01-04 20:25:18.000000000 +0000 @@ -71,9 +71,9 @@ elif test -f "$SYSROOT/usr/lib/libX11.so"; then x_libraries="$SYSROOT/usr/lib" elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then - x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so" + x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI" elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then - x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so" + x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI" fi fi fi diff -Nru openjdk-17-17.0.13+11/make/autoconf/toolchain.m4 openjdk-17-17.0.14+7/make/autoconf/toolchain.m4 --- openjdk-17-17.0.13+11/make/autoconf/toolchain.m4 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/autoconf/toolchain.m4 2025-01-04 20:25:18.000000000 +0000 @@ -429,6 +429,11 @@ # Copyright (C) 2013 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + # or look like + # gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32) + # Copyright (C) 2020 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` # Check that this is likely to be GCC. $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null @@ -442,7 +447,8 @@ COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ $SED -e 's/ *Copyright .*//'` COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ - $SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'` + $AWK -F ')' '{print [$]2}' | \ + $AWK '{print [$]1}'` elif test "x$TOOLCHAIN_TYPE" = xclang; then # clang --version output typically looks like # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) diff -Nru openjdk-17-17.0.13+11/make/common/NativeCompilation.gmk openjdk-17-17.0.14+7/make/common/NativeCompilation.gmk --- openjdk-17-17.0.13+11/make/common/NativeCompilation.gmk 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/common/NativeCompilation.gmk 2025-01-04 20:25:18.000000000 +0000 @@ -215,7 +215,21 @@ # The fix-deps-file macro is used to adjust the contents of the generated make # dependency files to contain paths compatible with make. # +REWRITE_PATHS_RELATIVE = false ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-) + REWRITE_PATHS_RELATIVE = true +endif + +# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for +# object files while CCACHE_BASEDIR will make ccache relativize all paths for +# its compiler. The compiler then produces relative dependency files. +# make does not know a relative and absolute filename is the same so it will +# ignore such dependencies. +ifneq ($(CCACHE), ) + REWRITE_PATHS_RELATIVE = true +endif + +ifeq ($(REWRITE_PATHS_RELATIVE), true) # Need to handle -I flags as both '-Ifoo' and '-I foo'. MakeCommandRelative = \ $(CD) $(WORKSPACE_ROOT) && \ diff -Nru openjdk-17-17.0.13+11/make/conf/version-numbers.conf openjdk-17-17.0.14+7/make/conf/version-numbers.conf --- openjdk-17-17.0.13+11/make/conf/version-numbers.conf 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/conf/version-numbers.conf 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2025, 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,12 +28,12 @@ DEFAULT_VERSION_FEATURE=17 DEFAULT_VERSION_INTERIM=0 -DEFAULT_VERSION_UPDATE=13 +DEFAULT_VERSION_UPDATE=14 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2024-10-15 +DEFAULT_VERSION_DATE=2025-01-21 DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_VERSION_DOCS_API_SINCE=11 diff -Nru openjdk-17-17.0.13+11/make/data/publicsuffixlist/VERSION openjdk-17-17.0.14+7/make/data/publicsuffixlist/VERSION --- openjdk-17-17.0.13+11/make/data/publicsuffixlist/VERSION 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/publicsuffixlist/VERSION 2025-01-04 20:25:18.000000000 +0000 @@ -1,2 +1,2 @@ -Github: https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat -Date: 2023-11-09 +Github: https://raw.githubusercontent.com/publicsuffix/list/1cbd6e71a9b83620b1d0b11e49d3d9ff48c27e22/public_suffix_list.dat +Date: 2024-05-07 diff -Nru openjdk-17-17.0.13+11/make/data/publicsuffixlist/public_suffix_list.dat openjdk-17-17.0.14+7/make/data/publicsuffixlist/public_suffix_list.dat --- openjdk-17-17.0.13+11/make/data/publicsuffixlist/public_suffix_list.dat 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/publicsuffixlist/public_suffix_list.dat 2025-01-04 20:25:18.000000000 +0000 @@ -6710,7 +6710,7 @@ // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-11-03T15:13:18Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2024-05-04T15:12:50Z // This list is auto-generated, don't edit it manually. // aaa : American Automobile Association, Inc. // https://www.iana.org/domains/root/db/aaa.html @@ -6896,7 +6896,7 @@ // https://www.iana.org/domains/root/db/anz.html anz -// aol : Oath Inc. +// aol : Yahoo Inc. // https://www.iana.org/domains/root/db/aol.html aol @@ -6988,10 +6988,6 @@ // https://www.iana.org/domains/root/db/autos.html autos -// avianca : Avianca Inc. -// https://www.iana.org/domains/root/db/avianca.html -avianca - // aws : AWS Registry LLC // https://www.iana.org/domains/root/db/aws.html aws @@ -7016,10 +7012,6 @@ // https://www.iana.org/domains/root/db/banamex.html banamex -// bananarepublic : The Gap, Inc. -// https://www.iana.org/domains/root/db/bananarepublic.html -bananarepublic - // band : Dog Beach, LLC // https://www.iana.org/domains/root/db/band.html band @@ -7544,10 +7536,6 @@ // https://www.iana.org/domains/root/db/cologne.html cologne -// comcast : Comcast IP Holdings I, LLC -// https://www.iana.org/domains/root/db/comcast.html -comcast - // commbank : COMMONWEALTH BANK OF AUSTRALIA // https://www.iana.org/domains/root/db/commbank.html commbank @@ -7752,6 +7740,10 @@ // https://www.iana.org/domains/root/db/dentist.html dentist +// desi +// https://www.iana.org/domains/root/db/desi.html +desi + // design : Registry Services, LLC // https://www.iana.org/domains/root/db/design.html design @@ -7796,7 +7788,7 @@ // https://www.iana.org/domains/root/db/dish.html dish -// diy : Lifestyle Domain Holdings, Inc. +// diy : Internet Naming Company LLC // https://www.iana.org/domains/root/db/diy.html diy @@ -7928,10 +7920,6 @@ // https://www.iana.org/domains/root/db/estate.html estate -// etisalat : Emirates Telecommunications Corporation (trading as Etisalat) -// https://www.iana.org/domains/root/db/etisalat.html -etisalat - // eurovision : European Broadcasting Union (EBU) // https://www.iana.org/domains/root/db/eurovision.html eurovision @@ -8104,7 +8092,7 @@ // https://www.iana.org/domains/root/db/foo.html foo -// food : Lifestyle Domain Holdings, Inc. +// food : Internet Naming Company LLC // https://www.iana.org/domains/root/db/food.html food @@ -8164,7 +8152,7 @@ // https://www.iana.org/domains/root/db/fujitsu.html fujitsu -// fun : Radix FZC DMCC +// fun : Radix Technologies Inc. // https://www.iana.org/domains/root/db/fun.html fun @@ -8312,7 +8300,7 @@ // https://www.iana.org/domains/root/db/golf.html golf -// goo : NTT Resonant Inc. +// goo : NTT DOCOMO, INC. // https://www.iana.org/domains/root/db/goo.html goo @@ -8364,10 +8352,6 @@ // https://www.iana.org/domains/root/db/group.html group -// guardian : The Guardian Life Insurance Company of America -// https://www.iana.org/domains/root/db/guardian.html -guardian - // gucci : Guccio Gucci S.p.a. // https://www.iana.org/domains/root/db/gucci.html gucci @@ -8500,7 +8484,7 @@ // https://www.iana.org/domains/root/db/hospital.html hospital -// host : Radix FZC DMCC +// host : Radix Technologies Inc. // https://www.iana.org/domains/root/db/host.html host @@ -8720,7 +8704,7 @@ // https://www.iana.org/domains/root/db/jprs.html jprs -// juegos : Internet Naming Company LLC +// juegos : Dog Beach, LLC // https://www.iana.org/domains/root/db/juegos.html juegos @@ -8908,7 +8892,7 @@ // https://www.iana.org/domains/root/db/lifeinsurance.html lifeinsurance -// lifestyle : Lifestyle Domain Holdings, Inc. +// lifestyle : Internet Naming Company LLC // https://www.iana.org/domains/root/db/lifestyle.html lifestyle @@ -8948,7 +8932,7 @@ // https://www.iana.org/domains/root/db/live.html live -// living : Lifestyle Domain Holdings, Inc. +// living : Internet Naming Company LLC // https://www.iana.org/domains/root/db/living.html living @@ -9392,10 +9376,6 @@ // https://www.iana.org/domains/root/db/olayangroup.html olayangroup -// oldnavy : The Gap, Inc. -// https://www.iana.org/domains/root/db/oldnavy.html -oldnavy - // ollo : Dish DBS Corporation // https://www.iana.org/domains/root/db/ollo.html ollo @@ -9416,7 +9396,7 @@ // https://www.iana.org/domains/root/db/onl.html onl -// online : Radix FZC DMCC +// online : Radix Technologies Inc. // https://www.iana.org/domains/root/db/online.html online @@ -9620,7 +9600,7 @@ // https://www.iana.org/domains/root/db/praxi.html praxi -// press : Radix FZC DMCC +// press : Radix Technologies Inc. // https://www.iana.org/domains/root/db/press.html press @@ -9928,10 +9908,6 @@ // https://www.iana.org/domains/root/db/sbs.html sbs -// sca : SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ) -// https://www.iana.org/domains/root/db/sca.html -sca - // scb : The Siam Commercial Bank Public Company Limited ("SCB") // https://www.iana.org/domains/root/db/scb.html scb @@ -10076,7 +10052,7 @@ // https://www.iana.org/domains/root/db/singles.html singles -// site : Radix FZC DMCC +// site : Radix Technologies Inc. // https://www.iana.org/domains/root/db/site.html site @@ -10156,7 +10132,7 @@ // https://www.iana.org/domains/root/db/spa.html spa -// space : Radix FZC DMCC +// space : Radix Technologies Inc. // https://www.iana.org/domains/root/db/space.html space @@ -10208,7 +10184,7 @@ // https://www.iana.org/domains/root/db/storage.html storage -// store : Radix FZC DMCC +// store : Radix Technologies Inc. // https://www.iana.org/domains/root/db/store.html store @@ -10324,7 +10300,7 @@ // https://www.iana.org/domains/root/db/team.html team -// tech : Radix FZC DMCC +// tech : Radix Technologies Inc. // https://www.iana.org/domains/root/db/tech.html tech @@ -10508,7 +10484,7 @@ // https://www.iana.org/domains/root/db/university.html university -// uno : Radix FZC DMCC +// uno : Radix Technologies Inc. // https://www.iana.org/domains/root/db/uno.html uno @@ -10524,7 +10500,7 @@ // https://www.iana.org/domains/root/db/vacations.html vacations -// vana : Lifestyle Domain Holdings, Inc. +// vana : Internet Naming Company LLC // https://www.iana.org/domains/root/db/vana.html vana @@ -10608,10 +10584,6 @@ // https://www.iana.org/domains/root/db/vodka.html vodka -// volkswagen : Volkswagen Group of America Inc. -// https://www.iana.org/domains/root/db/volkswagen.html -volkswagen - // volvo : Volvo Holding Sverige Aktiebolag // https://www.iana.org/domains/root/db/volvo.html volvo @@ -10676,10 +10648,14 @@ // https://www.iana.org/domains/root/db/weber.html weber -// website : Radix FZC DMCC +// website : Radix Technologies Inc. // https://www.iana.org/domains/root/db/website.html website +// wed +// https://www.iana.org/domains/root/db/wed.html +wed + // wedding : Registry Services, LLC // https://www.iana.org/domains/root/db/wedding.html wedding @@ -10768,10 +10744,6 @@ // https://www.iana.org/domains/root/db/xerox.html xerox -// xfinity : Comcast IP Holdings I, LLC -// https://www.iana.org/domains/root/db/xfinity.html -xfinity - // xihuan : Beijing Qihu Keji Co., Ltd. // https://www.iana.org/domains/root/db/xihuan.html xihuan @@ -11012,10 +10984,6 @@ // https://www.iana.org/domains/root/db/xn--mgba7c0bbn0a.html العليان -// xn--mgbaakc7dvf : Emirates Telecommunications Corporation (trading as Etisalat) -// https://www.iana.org/domains/root/db/xn--mgbaakc7dvf.html -اتصالات - // xn--mgbab2bd : CORE Association // https://www.iana.org/domains/root/db/xn--mgbab2bd.html بازار @@ -11152,7 +11120,7 @@ // https://www.iana.org/domains/root/db/yachts.html yachts -// yahoo : Oath Inc. +// yahoo : Yahoo Inc. // https://www.iana.org/domains/root/db/yahoo.html yahoo @@ -11217,6 +11185,12 @@ // ===BEGIN PRIVATE DOMAINS=== // (Note: these are in alphabetical order by company name) +// 12CHARS: https://12chars.com +// Submitted by Kenny Niehage +12chars.dev +12chars.it +12chars.pro + // 1GB LLC : https://www.1gb.ua/ // Submitted by 1GB LLC cc.ua @@ -11226,6 +11200,15 @@ // 611coin : https://611project.org/ 611.to +// AAA workspace : https://aaa.vodka +// Submitted by Kirill Rezraf +aaa.vodka + +// A2 Hosting +// Submitted by Tyler Hall +a2hosted.com +cpserver.com + // Aaron Marais' Gitlab pages: https://lab.aaronleem.co.za // Submitted by Aaron Marais graphox.us @@ -11242,12 +11225,18 @@ // Submitted by Ofer Kalaora activetrail.biz +// Adaptable.io : https://adaptable.io +// Submitted by Mark Terrel +adaptable.app + // Adobe : https://www.adobe.com/ // Submitted by Ian Boston and Lars Trieloff adobeaemcloud.com *.dev.adobeaemcloud.com +aem.live hlx.live adobeaemcloud.net +aem.page hlx.page hlx3.page @@ -11319,7 +11308,7 @@ // Amazon API Gateway // Submitted by AWS Security -// Reference: 4d863337-ff98-4501-a6f2-361eba8445d6 +// Reference: 9e37648f-a66c-4655-9ab1-5981f8737197 execute-api.cn-north-1.amazonaws.com.cn execute-api.cn-northwest-1.amazonaws.com.cn execute-api.af-south-1.amazonaws.com @@ -11334,6 +11323,7 @@ execute-api.ap-southeast-3.amazonaws.com execute-api.ap-southeast-4.amazonaws.com execute-api.ca-central-1.amazonaws.com +execute-api.ca-west-1.amazonaws.com execute-api.eu-central-1.amazonaws.com execute-api.eu-central-2.amazonaws.com execute-api.eu-north-1.amazonaws.com @@ -11360,23 +11350,28 @@ // Amazon Cognito // Submitted by AWS Security -// Reference: 7bee1013-f456-47df-bfe8-03c78d946d61 +// Reference: 09588633-91fe-49d8-b4e7-ec36496d11f3 auth.af-south-1.amazoncognito.com auth.ap-northeast-1.amazoncognito.com auth.ap-northeast-2.amazoncognito.com auth.ap-northeast-3.amazoncognito.com auth.ap-south-1.amazoncognito.com +auth.ap-south-2.amazoncognito.com auth.ap-southeast-1.amazoncognito.com auth.ap-southeast-2.amazoncognito.com auth.ap-southeast-3.amazoncognito.com +auth.ap-southeast-4.amazoncognito.com auth.ca-central-1.amazoncognito.com auth.eu-central-1.amazoncognito.com +auth.eu-central-2.amazoncognito.com auth.eu-north-1.amazoncognito.com auth.eu-south-1.amazoncognito.com +auth.eu-south-2.amazoncognito.com auth.eu-west-1.amazoncognito.com auth.eu-west-2.amazoncognito.com auth.eu-west-3.amazoncognito.com auth.il-central-1.amazoncognito.com +auth.me-central-1.amazoncognito.com auth.me-south-1.amazoncognito.com auth.sa-east-1.amazoncognito.com auth.us-east-1.amazoncognito.com @@ -11399,7 +11394,7 @@ // Amazon EMR // Submitted by AWS Security -// Reference: 597f3f8e-9283-4e48-8e32-7ee25a1ff6ab +// Reference: 82f43f9f-bbb8-400e-8349-854f5a62f20d emrappui-prod.cn-north-1.amazonaws.com.cn emrnotebooks-prod.cn-north-1.amazonaws.com.cn emrstudio-prod.cn-north-1.amazonaws.com.cn @@ -11424,6 +11419,9 @@ emrappui-prod.ap-south-1.amazonaws.com emrnotebooks-prod.ap-south-1.amazonaws.com emrstudio-prod.ap-south-1.amazonaws.com +emrappui-prod.ap-south-2.amazonaws.com +emrnotebooks-prod.ap-south-2.amazonaws.com +emrstudio-prod.ap-south-2.amazonaws.com emrappui-prod.ap-southeast-1.amazonaws.com emrnotebooks-prod.ap-southeast-1.amazonaws.com emrstudio-prod.ap-southeast-1.amazonaws.com @@ -11433,18 +11431,30 @@ emrappui-prod.ap-southeast-3.amazonaws.com emrnotebooks-prod.ap-southeast-3.amazonaws.com emrstudio-prod.ap-southeast-3.amazonaws.com +emrappui-prod.ap-southeast-4.amazonaws.com +emrnotebooks-prod.ap-southeast-4.amazonaws.com +emrstudio-prod.ap-southeast-4.amazonaws.com emrappui-prod.ca-central-1.amazonaws.com emrnotebooks-prod.ca-central-1.amazonaws.com emrstudio-prod.ca-central-1.amazonaws.com +emrappui-prod.ca-west-1.amazonaws.com +emrnotebooks-prod.ca-west-1.amazonaws.com +emrstudio-prod.ca-west-1.amazonaws.com emrappui-prod.eu-central-1.amazonaws.com emrnotebooks-prod.eu-central-1.amazonaws.com emrstudio-prod.eu-central-1.amazonaws.com +emrappui-prod.eu-central-2.amazonaws.com +emrnotebooks-prod.eu-central-2.amazonaws.com +emrstudio-prod.eu-central-2.amazonaws.com emrappui-prod.eu-north-1.amazonaws.com emrnotebooks-prod.eu-north-1.amazonaws.com emrstudio-prod.eu-north-1.amazonaws.com emrappui-prod.eu-south-1.amazonaws.com emrnotebooks-prod.eu-south-1.amazonaws.com emrstudio-prod.eu-south-1.amazonaws.com +emrappui-prod.eu-south-2.amazonaws.com +emrnotebooks-prod.eu-south-2.amazonaws.com +emrstudio-prod.eu-south-2.amazonaws.com emrappui-prod.eu-west-1.amazonaws.com emrnotebooks-prod.eu-west-1.amazonaws.com emrstudio-prod.eu-west-1.amazonaws.com @@ -11454,6 +11464,9 @@ emrappui-prod.eu-west-3.amazonaws.com emrnotebooks-prod.eu-west-3.amazonaws.com emrstudio-prod.eu-west-3.amazonaws.com +emrappui-prod.il-central-1.amazonaws.com +emrnotebooks-prod.il-central-1.amazonaws.com +emrstudio-prod.il-central-1.amazonaws.com emrappui-prod.me-central-1.amazonaws.com emrnotebooks-prod.me-central-1.amazonaws.com emrstudio-prod.me-central-1.amazonaws.com @@ -11484,9 +11497,11 @@ // Amazon Managed Workflows for Apache Airflow // Submitted by AWS Security -// Reference: 4ab55e6f-90c0-4a8d-b6a0-52ca5dbb1c2e +// Reference: 87f24ece-a77e-40e8-bb4a-f6b74fe9f975 *.cn-north-1.airflow.amazonaws.com.cn *.cn-northwest-1.airflow.amazonaws.com.cn +*.af-south-1.airflow.amazonaws.com +*.ap-east-1.airflow.amazonaws.com *.ap-northeast-1.airflow.amazonaws.com *.ap-northeast-2.airflow.amazonaws.com *.ap-south-1.airflow.amazonaws.com @@ -11495,17 +11510,20 @@ *.ca-central-1.airflow.amazonaws.com *.eu-central-1.airflow.amazonaws.com *.eu-north-1.airflow.amazonaws.com +*.eu-south-1.airflow.amazonaws.com *.eu-west-1.airflow.amazonaws.com *.eu-west-2.airflow.amazonaws.com *.eu-west-3.airflow.amazonaws.com +*.me-south-1.airflow.amazonaws.com *.sa-east-1.airflow.amazonaws.com *.us-east-1.airflow.amazonaws.com *.us-east-2.airflow.amazonaws.com +*.us-west-1.airflow.amazonaws.com *.us-west-2.airflow.amazonaws.com // Amazon S3 // Submitted by AWS Security -// Reference: 0e801048-08f2-4064-9cb8-e7373e0b57f4 +// Reference: cd5c8b3a-67b7-4b40-9236-c87ce81a3d10 s3.dualstack.cn-north-1.amazonaws.com.cn s3-accesspoint.dualstack.cn-north-1.amazonaws.com.cn s3-website.dualstack.cn-north-1.amazonaws.com.cn @@ -11604,6 +11622,16 @@ s3-fips.ca-central-1.amazonaws.com s3-object-lambda.ca-central-1.amazonaws.com s3-website.ca-central-1.amazonaws.com +s3.dualstack.ca-west-1.amazonaws.com +s3-accesspoint.dualstack.ca-west-1.amazonaws.com +s3-accesspoint-fips.dualstack.ca-west-1.amazonaws.com +s3-fips.dualstack.ca-west-1.amazonaws.com +s3-website.dualstack.ca-west-1.amazonaws.com +s3.ca-west-1.amazonaws.com +s3-accesspoint.ca-west-1.amazonaws.com +s3-accesspoint-fips.ca-west-1.amazonaws.com +s3-fips.ca-west-1.amazonaws.com +s3-website.ca-west-1.amazonaws.com s3.dualstack.eu-central-1.amazonaws.com s3-accesspoint.dualstack.eu-central-1.amazonaws.com s3-website.dualstack.eu-central-1.amazonaws.com @@ -11784,9 +11812,25 @@ s3-object-lambda.us-west-2.amazonaws.com s3-website.us-west-2.amazonaws.com +// Amazon SageMaker Ground Truth +// Submitted by AWS Security +// Reference: 98dbfde4-7802-48c3-8751-b60f204e0d9c +labeling.ap-northeast-1.sagemaker.aws +labeling.ap-northeast-2.sagemaker.aws +labeling.ap-south-1.sagemaker.aws +labeling.ap-southeast-1.sagemaker.aws +labeling.ap-southeast-2.sagemaker.aws +labeling.ca-central-1.sagemaker.aws +labeling.eu-central-1.sagemaker.aws +labeling.eu-west-1.sagemaker.aws +labeling.eu-west-2.sagemaker.aws +labeling.us-east-1.sagemaker.aws +labeling.us-east-2.sagemaker.aws +labeling.us-west-2.sagemaker.aws + // Amazon SageMaker Notebook Instances // Submitted by AWS Security -// Reference: fe8c9e94-5a22-486d-8750-991a3a9b13c6 +// Reference: b5ea56df-669e-43cc-9537-14aa172f5dfc notebook.af-south-1.sagemaker.aws notebook.ap-east-1.sagemaker.aws notebook.ap-northeast-1.sagemaker.aws @@ -11799,6 +11843,9 @@ notebook.ap-southeast-3.sagemaker.aws notebook.ap-southeast-4.sagemaker.aws notebook.ca-central-1.sagemaker.aws +notebook-fips.ca-central-1.sagemaker.aws +notebook.ca-west-1.sagemaker.aws +notebook-fips.ca-west-1.sagemaker.aws notebook.eu-central-1.sagemaker.aws notebook.eu-central-2.sagemaker.aws notebook.eu-north-1.sagemaker.aws @@ -11820,6 +11867,7 @@ notebook.us-gov-west-1.sagemaker.aws notebook-fips.us-gov-west-1.sagemaker.aws notebook.us-west-1.sagemaker.aws +notebook-fips.us-west-1.sagemaker.aws notebook.us-west-2.sagemaker.aws notebook-fips.us-west-2.sagemaker.aws notebook.cn-north-1.sagemaker.com.cn @@ -11827,7 +11875,7 @@ // Amazon SageMaker Studio // Submitted by AWS Security -// Reference: 057ee397-6bf8-4f20-b807-d7bc145ac980 +// Reference: 69c723d9-6e1a-4bff-a203-48eecd203183 studio.af-south-1.sagemaker.aws studio.ap-east-1.sagemaker.aws studio.ap-northeast-1.sagemaker.aws @@ -11841,6 +11889,7 @@ studio.eu-central-1.sagemaker.aws studio.eu-north-1.sagemaker.aws studio.eu-south-1.sagemaker.aws +studio.eu-south-2.sagemaker.aws studio.eu-west-1.sagemaker.aws studio.eu-west-2.sagemaker.aws studio.eu-west-3.sagemaker.aws @@ -11885,7 +11934,7 @@ // AWS Cloud9 // Submitted by: AWS Security -// Reference: 05c44955-977c-4b57-938a-f2af92733f9f +// Reference: 30717f72-4007-4f0f-8ed4-864c6f2efec9 webview-assets.aws-cloud9.af-south-1.amazonaws.com vfs.cloud9.af-south-1.amazonaws.com webview-assets.cloud9.af-south-1.amazonaws.com @@ -11931,6 +11980,8 @@ webview-assets.aws-cloud9.eu-west-3.amazonaws.com vfs.cloud9.eu-west-3.amazonaws.com webview-assets.cloud9.eu-west-3.amazonaws.com +webview-assets.aws-cloud9.il-central-1.amazonaws.com +vfs.cloud9.il-central-1.amazonaws.com webview-assets.aws-cloud9.me-south-1.amazonaws.com vfs.cloud9.me-south-1.amazonaws.com webview-assets.cloud9.me-south-1.amazonaws.com @@ -11950,6 +12001,11 @@ vfs.cloud9.us-west-2.amazonaws.com webview-assets.cloud9.us-west-2.amazonaws.com +// AWS Directory Service +// Submitted by AWS Security +// Reference: a13203e8-42dc-4045-a0d2-2ee67bed1068 +awsapps.com + // AWS Elastic Beanstalk // Submitted by AWS Security // Reference: bb5a965c-dec3-4967-aa22-e306ad064797 @@ -11993,6 +12049,11 @@ // Reference: d916759d-a08b-4241-b536-4db887383a6a awsglobalaccelerator.com +// AWS re:Post Private +// Submitted by AWS Security +// Reference: 83385945-225f-416e-9aa0-ad0632bfdcee +*.private.repost.aws + // eero // Submitted by Yue Kang // Reference: 264afe70-f62c-4c02-8ab9-b5281ed24461 @@ -12010,6 +12071,10 @@ // Submitted by Apigee Security Team apigee.io +// Apis Networks: https://apisnetworks.com +// Submitted by Matt Saladna +panel.dev + // Apphud : https://apphud.com // Submitted by Alexander Selivanov siiites.com @@ -12027,6 +12092,10 @@ // Submitted by Thomas Orozco on-aptible.com +// Aquapal : https://aquapal.net/ +// Submitted by Aki Ueno +f5.si + // ASEINet : https://www.aseinet.com/ // Submitted by Asei SEKIGUCHI user.aseinet.ne.jp @@ -12062,6 +12131,7 @@ // AVM : https://avm.de // Submitted by Andreas Weise +myfritz.link myfritz.net // AVStack Pte. Ltd. : https://avstack.io @@ -12121,10 +12191,18 @@ // Submitted by Lev Nekrasov *.beget.app +// Besties : https://besties.house +// Submitted by Hazel Cora +pages.gay + // BetaInABox // Submitted by Adrian betainabox.com +// University of Bielsko-Biala regional domain: http://dns.bielsko.pl/ +// Submitted by Marcin +bielsko.pl + // BinaryLane : http://www.binarylane.com // Submitted by Nathan O'Sullivan bnr.la @@ -12166,8 +12244,13 @@ bplaced.net square7.net +// Brave : https://brave.com +// Submitted by Andrea Brancaleoni +*.s.brave.io + // Brendly : https://brendly.rs -// Submitted by Dusan Radovanovic +// Submitted by Dusan Radovanovic +shop.brendly.hr shop.brendly.rs // BrowserSafetyMark @@ -12191,7 +12274,9 @@ // Canva Pty Ltd : https://canva.com/ // Submitted by Joel Aquilina canva-apps.cn +*.my.canvasite.cn canva-apps.com +*.my.canva.site // Carrd : https://carrd.co // Submitted by AJ @@ -12329,6 +12414,12 @@ r2.dev workers.dev +// cloudscale.ch AG : https://www.cloudscale.ch/ +// Submitted by Gaudenz Steinlin +cust.cloudscale.ch +objects.lpg.cloudscale.ch +objects.rma.cloudscale.ch + // Clovyr : https://clovyr.io // Submitted by Patrick Nielsen wnext.app @@ -12346,22 +12437,33 @@ // CDN77.com : http://www.cdn77.com // Submitted by Jan Krpes -c.cdn77.org +cdn77-storage.com +rsc.contentproxy9.cz cdn77-ssl.net r.cdn77.net -rsc.cdn77.org ssl.origin.cdn77-secure.org +c.cdn77.org +rsc.cdn77.org // Cloud DNS Ltd : http://www.cloudns.net -// Submitted by Aleksander Hristov +// Submitted by Aleksander Hristov & Boyan Peychev cloudns.asia +cloudns.be cloudns.biz -cloudns.club cloudns.cc +cloudns.ch +cloudns.cl +cloudns.club +dnsabr.com +cloudns.cx cloudns.eu cloudns.in cloudns.info +dns-cloud.net +dns-dynamic.net +cloudns.nz cloudns.org +cloudns.ph cloudns.pro cloudns.pw cloudns.us @@ -12374,6 +12476,11 @@ // Submitted by Moritz Marquardt codeberg.page +// CodeSandbox B.V. : https://codesandbox.io +// Submitted by Ives van Hoorne +csb.app +preview.csb.app + // CoDNS B.V. co.nl co.no @@ -12383,6 +12490,10 @@ webhosting.be hosting-cluster.nl +// Convex : https://convex.dev/ +// Submitted by James Cowling +convex.site + // Coordination Center for TLD RU and XN--P1AI : https://cctld.ru/en/domains/domens_ru/reserved/ // Submitted by George Georgievsky ac.ru @@ -12404,10 +12515,18 @@ knx-server.net static-access.net +// cPanel L.L.C. : https://www.cpanel.net/ +// Submitted by Dustin Scherer +*.cprapid.com + // Craynic, s.r.o. : http://www.craynic.com/ // Submitted by Ales Krajnik realm.cz +// Crisp IM SAS : https://crisp.chat/ +// Submitted by Baptiste Jamin +on.crisp.email + // Cryptonomic : https://cryptonomic.net/ // Submitted by Andrew Cady *.cryptonomic.net @@ -12428,6 +12547,13 @@ *.ocp.customer-oci.com *.ocs.customer-oci.com +// Cyclic Software : https://www.cyclic.sh +// Submitted by Kam Lasater +cyclic.app +cyclic.cloud +cyclic-app.com +cyclic.co.in + // cyon GmbH : https://www.cyon.ch/ // Submitted by Dominic Luechinger cyon.link @@ -12473,6 +12599,7 @@ // Dark, Inc. : https://darklang.com // Submitted by Paul Biggar builtwithdark.com +darklang.io // DataDetect, LLC. : https://datadetect.com // Submitted by Andrew Banchich @@ -12871,6 +12998,10 @@ // Submitted by Robin H. Johnson *.digitaloceanspaces.com +// DigitalPlat : https://www.digitalplat.org/ +// Submitted by Edward Hsing +us.kg + // dnstrace.pro : https://dnstrace.pro/ // Submitted by Chris Partridge bci.dnstrace.pro @@ -12908,6 +13039,18 @@ easypanel.app easypanel.host +// EasyWP : https://www.easywp.com +// Submitted by +*.ewp.live + +// Electromagnetic Field : https://www.emfcamp.org +// Submitted by +at.emf.camp + +// Elefunc, Inc. : https://elefunc.com +// Submitted by Cetin Sert +rt.ht + // Elementor : Elementor Ltd. // Submitted by Anton Barkan elementor.cloud @@ -13022,10 +13165,6 @@ // Submitted by Eric Jiang onfabrica.com -// Facebook, Inc. -// Submitted by Peter Ruibal -apps.fbsbx.com - // FAITID : https://faitid.org/ // Submitted by Maxim Alzoba // https://www.flexireg.net/stat_info @@ -13183,6 +13322,10 @@ onflashdrive.app fldrv.com +// FlutterFlow : https://flutterflow.io +// Submitted by Anton Emelyanov +flutterflow.app + // fly.io: https://fly.io // Submitted by Kurt Mackey fly.dev @@ -13193,13 +13336,14 @@ // Submitted by Jonathan Rudenberg flynnhosting.net -// Forgerock : https://www.forgerock.com +// Forgerock : https://www.forgerock.com // Submitted by Roderick Parr forgeblocks.com id.forgerock.io // Framer : https://www.framer.com -// Submitted by Koen Rouwhorst +// Submitted by Koen Rouwhorst +framer.ai framer.app framercanvas.com framer.media @@ -13240,6 +13384,24 @@ // Submitted by Daniel A. Maierhofer wien.funkfeuer.at +// Future Versatile Group. :https://www.fvg-on.net/ +// T.Kabu +daemon.asia +dix.asia +mydns.bz +0am.jp +0g0.jp +0j0.jp +0t0.jp +mydns.jp +pgw.jp +wjg.jp +keyword-on.net +live-on.net +server-on.net +mydns.tw +mydns.vc + // Futureweb GmbH : https://www.futureweb.at // Submitted by Andreas Schnederle-Wagner *.futurecms.at @@ -13251,6 +13413,10 @@ *.kunden.ortsinfo.at *.statics.cloud +// GCom Internet : https://www.gcom.net.au +// Submitted by Leo Julius +aliases121.com + // GDS : https://www.gov.uk/service-manual/technology/managing-domain-names // Submitted by Stephen Ford independent-commission.uk @@ -13279,9 +13445,11 @@ lab.ms cdn-edges.net -// Ghost Foundation : https://ghost.org -// Submitted by Matt Hanley -ghost.io +// Getlocalcert: https://www.getlocalcert.net +// Submitted by Robert Alexander +localcert.net +localhostcert.net +corpnet.work // GignoSystemJapan: http://gsj.bz // Submitted by GignoSystemJapan @@ -13425,6 +13593,10 @@ zombie.jp heteml.net +// GoDaddy Registry : https://registry.godaddy +// Submitted by Rohan Durrant +graphic.design + // GOV.UK Platform as a Service : https://www.cloud.service.gov.uk/ // Submitted by Tom Whitwell cloudapps.digital @@ -13434,10 +13606,6 @@ // Submitted by Richard Baker pymnt.uk -// UKHomeOffice : https://www.gov.uk/government/organisations/home-office -// Submitted by Jon Shanks -homeoffice.gov.uk - // GlobeHosting, Inc. // Submitted by Zoltan Egresi ro.im @@ -13448,8 +13616,7 @@ // Google, Inc. // Submitted by Eduardo Vela -run.app -a.run.app +*.run.app web.app *.0emm.com appspot.com @@ -13549,6 +13716,10 @@ // Submitted by gov.nl +// GrayJay Web Solutions Inc. : https://grayjaysports.ca +// Submitted by Matt Yamkowy +grayjayleagues.com + // Group 53, LLC : https://www.group53.com // Submitted by Tyler Todd awsmppl.com @@ -13583,6 +13754,11 @@ // Submitted by Richard Zowalla pages.it.hs-heilbronn.de +// Helio Networks : https://heliohost.org +// Submitted by Ben Frede +helioho.st +heliohost.us + // Hepforge : https://www.hepforge.org // Submitted by David Grellscheid hepforge.org @@ -13596,7 +13772,6 @@ // Submitted by Oren Eini ravendb.cloud ravendb.community -ravendb.me development.run ravendb.run @@ -13604,6 +13779,12 @@ // Submitted by Krzysztof Wolski homesklep.pl +// Homebase : https://homebase.id/ +// Submitted by Jason Babo +*.kin.one +*.id.pub +*.kin.pub + // Hong Kong Productivity Council: https://www.hkpc.org/ // Submitted by SECaaS Team secaas.hk @@ -13681,7 +13862,7 @@ info.at // info.cx : http://info.cx -// Submitted by Jacob Slater +// Submitted by June Slater info.cx // Interlegis : http://www.interlegis.leg.br @@ -13730,6 +13911,14 @@ // Submitted by Matthew Hardeman ipifony.net +// is-a.dev : https://www.is-a.dev +// Submitted by William Harrison +is-a.dev + +// ir.md : https://nic.ir.md +// Submitted by Ali Soizi +ir.md + // IServ GmbH : https://iserv.de // Submitted by Mario Hoberg iservschule.de @@ -13838,6 +14027,11 @@ // Submitted by Daniel Fariña jotelulu.cloud +// JouwWeb B.V. : https://www.jouwweb.nl +// Submitted by Camilo Sperberg +jouwweb.site +webadorsite.com + // Joyent : https://www.joyent.com/ // Submitted by Brian Bennett *.triton.zone @@ -13911,6 +14105,10 @@ // Submitted by Lelux Admin lelux.site +// Libre IT Ltd : https://libre.nz +// Submitted by Tomas Maggio +runcontainers.dev + // Lifetime Hosting : https://Lifetime.Hosting/ // Submitted by Mike Fillator co.business @@ -13921,10 +14119,6 @@ co.place co.technology -// Lightmaker Property Manager, Inc. : https://app.lmpm.com/ -// Submitted by Greg Holland -app.lmpm.com - // linkyard ldt: https://www.linkyard.ch/ // Submitted by Mario Siegenthaler linkyard.cloud @@ -14057,6 +14251,11 @@ // Submitted by Ruben Schmidmeister messerli.app +// Meta Platforms, Inc. : https://meta.com/ +// Submitted by Jacob Cordero +atmeta.com +apps.fbsbx.com + // MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/ // Submitted by Zdeněk Šustr *.cloud.metacentrum.cz @@ -14077,10 +14276,14 @@ // Microsoft Corporation : http://microsoft.com // Submitted by Public Suffix List Admin +// Managed by Corporate Domains +// Microsoft Azure : https://home.azure *.azurecontainer.io +azure-api.net +azureedge.net +azurefd.net azurewebsites.net azure-mobile.net -cloudapp.net azurestaticapps.net 1.azurestaticapps.net 2.azurestaticapps.net @@ -14094,6 +14297,10 @@ eastus2.azurestaticapps.net westeurope.azurestaticapps.net westus2.azurestaticapps.net +cloudapp.net +trafficmanager.net +blob.core.windows.net +servicebus.windows.net // minion.systems : http://minion.systems // Submitted by Robert Böttinger @@ -14107,6 +14314,10 @@ // Submitted by Grayson Martin forte.id +// MODX Systems LLC : https://modx.com +// Submitted by Elizabeth Southwell +modx.dev + // Mozilla Corporation : https://mozilla.com // Submitted by Ben Francis mozilla-iot.org @@ -14153,6 +14364,10 @@ // Submitted by Trung Tran 4u.com +// NGO.US Registry : https://nic.ngo.us +// Submitted by Alstra Solutions Ltd. Networking Team +ngo.us + // ngrok : https://ngrok.com/ // Submitted by Alan Shreve ngrok.app @@ -14168,18 +14383,24 @@ sa.ngrok.io us.ngrok.io ngrok.pizza +ngrok.pro // Nicolaus Copernicus University in Torun - MSK TORMAN (https://www.man.torun.pl) torun.pl // Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ -// Submitted by Nicholas Ford +// Submitted by Nicholas Ford nh-serv.co.uk +nimsite.uk // NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ // Submitted by Jeff Wheelhouse nfshost.com +// NFT.Storage : https://nft.storage/ +// Submitted by Vasco Santos or +ipfs.nftstorage.link + // Noop : https://noop.app // Submitted by Nathaniel Schweinberg *.developer.app @@ -14330,6 +14551,10 @@ // Submitted by Matthew Brown nyc.mn +// O3O.Foundation : https://o3o.foundation/ +// Submitted by the prvcy.page Registry Team +prvcy.page + // Observable, Inc. : https://observablehq.com // Submitted by Mike Bostock static.observableusercontent.com @@ -14359,7 +14584,6 @@ 123minsida.se 123miweb.es 123paginaweb.pt -123sait.ru 123siteweb.fr 123webseite.at 123webseite.de @@ -14377,6 +14601,13 @@ // Submitted by Eddie Jones nid.io +// Open Domains : https://open-domains.net +// Submitted by William Harrison +is-cool.dev +is-not-a.dev +localplayer.dev +is-local.org + // Open Social : https://www.getopensocial.com/ // Submitted by Alexander Varwijk opensocial.site @@ -14397,6 +14628,11 @@ // Submitted by Alexandre Linte tech.orange +// OsSav Technology Ltd. : https://ossav.com/ +// TLD Nic: http://nic.can.re - TLD Whois Server: whois.can.re +// Submitted by OsSav Technology Ltd. +can.re + // Oursky Limited : https://authgear.com/, https://skygear.io/ // Submitted by Authgear Team , Skygear Developer authgear-staging.com @@ -14447,10 +14683,11 @@ // pcarrier.ca Software Inc: https://pcarrier.ca/ // Submitted by Pierre Carrier -bar0.net -bar1.net -bar2.net -rdv.to +*.xmit.co +xmit.dev +srv.us +gh.srv.us +gl.srv.us // .pl domains (grandfathered) art.pl @@ -14483,7 +14720,8 @@ // Platform.sh : https://platform.sh // Submitted by Nikola Kotur -bc.platform.sh +*.upsun.app +upsunapp.com ent.platform.sh eu.platform.sh us.platform.sh @@ -14502,6 +14740,10 @@ plesk.page pleskns.com +// Pley AB : https://www.pley.com/ +// Submitted by Henning Pohl +pley.games + // Port53 : https://port53.io/ // Submitted by Maximilian Schieder dyn53.io @@ -14533,10 +14775,6 @@ // Submitted by registry priv.at -// privacytools.io : https://www.privacytools.io/ -// Submitted by Jonah Aragon -prvcy.page - // Protocol Labs : https://protocol.ai/ // Submitted by Michael Burns *.dweb.link @@ -14578,6 +14816,8 @@ // Rad Web Hosting: https://radwebhosting.com // Submitted by Scott Claeys cloudsite.builders +myradweb.net +servername.us // Redgate Software: https://red-gate.com // Submitted by Andrew Farries @@ -14601,9 +14841,12 @@ *.sys.qcx.io // QNAP System Inc : https://www.qnap.com -// Submitted by Nick Chang -dev-myqnapcloud.com +// Submitted by Nick Chang +myqnapcloud.cn alpha-myqnapcloud.com +dev-myqnapcloud.com +mycloudnas.com +mynascloud.com myqnapcloud.com // Quip : https://quip.com @@ -14644,11 +14887,40 @@ onrender.com // Repl.it : https://repl.it -// Submitted by Lincoln Bergeson +// Submitted by Lincoln Bergeson +replit.app +id.replit.app firewalledreplit.co id.firewalledreplit.co repl.co id.repl.co +replit.dev +archer.replit.dev +bones.replit.dev +canary.replit.dev +global.replit.dev +hacker.replit.dev +id.replit.dev +janeway.replit.dev +kim.replit.dev +kira.replit.dev +kirk.replit.dev +odo.replit.dev +paris.replit.dev +picard.replit.dev +pike.replit.dev +prerelease.replit.dev +reed.replit.dev +riker.replit.dev +sisko.replit.dev +spock.replit.dev +staging.replit.dev +sulu.replit.dev +tarpit.replit.dev +teams.replit.dev +tucker.replit.dev +wesley.replit.dev +worf.replit.dev repl.run // Resin.io : https://resin.io @@ -14745,10 +15017,11 @@ sakura.tv // Salesforce.com, Inc. https://salesforce.com/ -// Submitted by Michael Biven +// Submitted by Michael Biven and Aaron Romeo *.builder.code.com *.dev-builder.code.com *.stg-builder.code.com +*.001.test.code-builder-stg.platform.salesforce.com // Sandstorm Development Group, Inc. : https://sandcats.io/ // Submitted by Asheesh Laroia @@ -14764,6 +15037,7 @@ fr-par-1.baremetal.scw.cloud fr-par-2.baremetal.scw.cloud nl-ams-1.baremetal.scw.cloud +cockpit.fr-par.scw.cloud fnc.fr-par.scw.cloud functions.fnc.fr-par.scw.cloud k8s.fr-par.scw.cloud @@ -14774,11 +15048,13 @@ priv.instances.scw.cloud pub.instances.scw.cloud k8s.scw.cloud +cockpit.nl-ams.scw.cloud k8s.nl-ams.scw.cloud nodes.k8s.nl-ams.scw.cloud s3.nl-ams.scw.cloud s3-website.nl-ams.scw.cloud whm.nl-ams.scw.cloud +cockpit.pl-waw.scw.cloud k8s.pl-waw.scw.cloud nodes.k8s.pl-waw.scw.cloud s3.pl-waw.scw.cloud @@ -14800,6 +15076,10 @@ // Submitted by Shante Adam scrysec.com +// Scrypted : https://scrypted.app +// Submitted by Koushik Dutta +client.scrypted.io + // Securepoint GmbH : https://www.securepoint.de // Submitted by Erik Anders firewall-gateway.com @@ -14839,6 +15119,10 @@ co.ua pp.ua +// Sheezy.Art : https://sheezy.art +// Submitted by Nyoom +sheezy.games + // Shift Crypto AG : https://shiftcrypto.ch // Submitted by alex shiftcrypto.dev @@ -14887,7 +15171,7 @@ beta.bounty-full.com // Smallregistry by Promopixel SARL: https://www.smallregistry.net -// Former AFNIC's SLDs +// Former AFNIC's SLDs // Submitted by Jérôme Lipowicz aeroport.fr avocat.fr @@ -14909,9 +15193,9 @@ vp4.me // Snowflake Inc : https://www.snowflake.com/ -// Submitted by Faith Olapade -snowflake.app -privatelink.snowflake.app +// Submitted by Sam Haar +*.snowflake.app +*.privatelink.snowflake.app streamlit.app streamlitapp.com @@ -14923,10 +15207,24 @@ // Submitted by Drew DeVault srht.site +// StackBlitz : https://stackblitz.com +// Submitted by Dominic Elm +w-corp-staticblitz.com +w-credentialless-staticblitz.com +w-staticblitz.com + // Stackhero : https://www.stackhero.io // Submitted by Adrien Gillon stackhero-network.com +// STACKIT : https://www.stackit.de/en/ +// Submitted by STACKIT-DNS Team (Simon Stier) +runs.onstackit.cloud +stackit.gg +stackit.rocks +stackit.run +stackit.zone + // Staclar : https://staclar.com // Submitted by Q Misell musician.io @@ -14993,6 +15291,19 @@ // Submitted by Jacob Lee api.stdlib.com +// stereosense GmbH : https://www.involve.me +// Submitted by Florian Burmann +feedback.ac +forms.ac +assessments.cx +calculators.cx +funnels.cx +paynow.cx +quizzes.cx +researched.cx +tests.cx +surveys.so + // Storipress : https://storipress.com // Submitted by Benno Liu storipress.app @@ -15001,6 +15312,12 @@ // Submitted by Philip Hutchins storj.farm +// Streak : https://streak.com +// Submitted by Blake Kadatz +streak-link.com +streaklinks.com +streakusercontent.com + // Studenten Net Twente : http://www.snt.utwente.nl/ // Submitted by Silke Hofstra utwente.io @@ -15063,6 +15380,7 @@ // Submitted by David Anderson beta.tailscale.net ts.net +*.c.ts.net // TASK geographical domains (www.task.gda.pl/uslugi/dns) gda.pl @@ -15196,6 +15514,10 @@ // Submitted by ITComdomains it.com +// Unison Computing, PBC : https://unison.cloud +// Submitted by Simon Højberg +unison-services.cloud + // UNIVERSAL DOMAIN REGISTRY : https://www.udr.org.yt/ // see also: whois -h whois.udr.org.yt help // Submitted by Atanunu Igbunuroghene @@ -15245,48 +15567,6 @@ // Submitted by Nathan van Bakel voorloper.cloud -// Voxel.sh DNS : https://voxel.sh/dns/ -// Submitted by Mia Rehlinger -neko.am -nyaa.am -be.ax -cat.ax -es.ax -eu.ax -gg.ax -mc.ax -us.ax -xy.ax -nl.ci -xx.gl -app.gp -blog.gt -de.gt -to.gt -be.gy -cc.hn -blog.kg -io.kg -jp.kg -tv.kg -uk.kg -us.kg -de.ls -at.md -de.md -jp.md -to.md -indie.porn -vxl.sh -ch.tc -me.tc -we.tc -nyan.to -at.vg -blog.vu -dev.vu -me.vu - // V.UA Domain Administrator : https://domain.v.ua/ // Submitted by Serhii Rostilo v.ua @@ -15299,6 +15579,11 @@ // Submitted by Masayuki Note wafflecell.com +// Webflow, Inc. : https://www.webflow.com +// Submitted by Webflow Security Team +webflow.io +webflowtest.io + // WebHare bv: https://www.webhare.com/ // Submitted by Arnold Hendriks *.webhare.dev @@ -15310,6 +15595,10 @@ bookonline.app hotelwithflight.com +// WebWaddle Ltd: https://webwaddle.com/ +// Submitted by Merlin Glander +*.wadl.top + // WeDeploy by Liferay, Inc. : https://www.wedeploy.com // Submitted by Henrique Vicente wedeploy.io @@ -15418,6 +15707,10 @@ za.net za.org +// ZAP-Hosting GmbH & Co. KG : https://zap-hosting.com +// Submitted by Julian Alker +zap.cloud + // Zine EOOD : https://zine.bg/ // Submitted by Martin Angelov bss.design diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/VERSION openjdk-17-17.0.14+7/make/data/tzdata/VERSION --- openjdk-17-17.0.13+11/make/data/tzdata/VERSION 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/VERSION 2025-01-04 20:25:18.000000000 +0000 @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2024a +tzdata2024b diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/africa openjdk-17-17.0.14+7/make/data/tzdata/africa --- openjdk-17-17.0.13+11/make/data/tzdata/africa 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/africa 2025-01-04 20:25:18.000000000 +0000 @@ -126,17 +126,16 @@ # Cape Verde / Cabo Verde # -# From Paul Eggert (2018-02-16): -# Shanks gives 1907 for the transition to +02. -# For now, ignore that and follow the 1911-05-26 Portuguese decree -# (see Europe/Lisbon). +# From Tim Parenti (2024-07-01), per Paul Eggert (2018-02-16): +# For timestamps before independence, see commentary for Europe/Lisbon. +# Shanks gives 1907 instead for the transition to -02. # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia - -2:00 - -02 1942 Sep - -2:00 1:00 -01 1945 Oct 15 - -2:00 - -02 1975 Nov 25 2:00 - -1:00 - -01 + -2:00 - %z 1942 Sep + -2:00 1:00 %z 1945 Oct 15 + -2:00 - %z 1975 Nov 25 2:00 + -1:00 - %z # Chad # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -368,14 +367,12 @@ # Guinea-Bissau # -# From Paul Eggert (2018-02-16): -# Shanks gives 1911-05-26 for the transition to WAT, -# evidently confusing the date of the Portuguese decree -# (see Europe/Lisbon) with the date that it took effect. +# From Tim Parenti (2024-07-01), per Paul Eggert (2018-02-16): +# For timestamps before independence, see commentary for Europe/Lisbon. # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u - -1:00 - -01 1975 + -1:00 - %z 1975 0:00 - GMT # Comoros @@ -440,10 +437,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Nairobi 2:27:16 - LMT 1908 May - 2:30 - +0230 1928 Jun 30 24:00 + 2:30 - %z 1928 Jun 30 24:00 3:00 - EAT 1930 Jan 4 24:00 - 2:30 - +0230 1936 Dec 31 24:00 - 2:45 - +0245 1942 Jul 31 24:00 + 2:30 - %z 1936 Dec 31 24:00 + 2:45 - %z 1942 Jul 31 24:00 3:00 - EAT # Liberia @@ -614,7 +611,7 @@ Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis - 4:00 Mauritius +04/+05 + 4:00 Mauritius %z # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius @@ -1094,10 +1091,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 - 0:00 Morocco +00/+01 1984 Mar 16 - 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 28 3:00 - 1:00 Morocco +01/+00 + 0:00 Morocco %z 1984 Mar 16 + 1:00 - %z 1986 + 0:00 Morocco %z 2018 Oct 28 3:00 + 1:00 Morocco %z # Western Sahara # @@ -1111,9 +1108,9 @@ # since most of it was then controlled by Morocco. Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún - -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 28 3:00 - 1:00 Morocco +01/+00 + -1:00 - %z 1976 Apr 14 + 0:00 Morocco %z 2018 Oct 28 3:00 + 1:00 Morocco %z # Botswana # Burundi @@ -1124,13 +1121,27 @@ # Zambia # Zimbabwe # -# Shanks gives 1903-03-01 for the transition to CAT. -# Perhaps the 1911-05-26 Portuguese decree -# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf -# merely made it official? +# From Tim Parenti (2024-07-01): +# For timestamps before Mozambique's independence, see commentary for +# Europe/Lisbon. +# +# From Paul Eggert (2024-05-24): +# The London Gazette, 1903-04-03, page 2245, says that +# as of 1903-03-03 a time ball at the port of Lourenço Marques +# (as Maputo was then called) was dropped daily at 13:00:00 LMT, +# corresponding to 22:49:41.7 GMT, so local time was +02:10:18.3. +# Conversely, the newspaper South Africa, 1909-02-09, page 321, +# says the port had just installed an apparatus that communicated +# "from the controlling clock in the new Observatory at Reuben Point ... +# exact mean South African time, i.e., 30 deg., or 2 hours East of Greenwich". +# Although Shanks gives 1903-03-01 for the transition to CAT, +# evidently the port transitioned to CAT after 1903-03-03 but before +# the Portuguese legal transition of 1912-01-01 (see Europe/Lisbon commentary). +# For lack of better info, list 1909 as the transition date. # # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Maputo 2:10:20 - LMT 1903 Mar + #STDOFF 2:10:18.3 +Zone Africa/Maputo 2:10:18 - LMT 1909 2:00 - CAT # Namibia @@ -1195,7 +1206,7 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - +0130 1903 Mar + 1:30 - %z 1903 Mar 2:00 - SAST 1942 Sep 20 2:00 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence @@ -1283,7 +1294,7 @@ Zone Africa/Lagos 0:13:35 - LMT 1905 Jul 1 0:00 - GMT 1908 Jul 1 0:13:35 - LMT 1914 Jan 1 - 0:30 - +0030 1919 Sep 1 + 0:30 - %z 1919 Sep 1 1:00 - WAT # São Tomé and Príncipe diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/antarctica openjdk-17-17.0.14+7/make/data/tzdata/antarctica --- openjdk-17-17.0.13+11/make/data/tzdata/antarctica 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/antarctica 2025-01-04 20:25:18.000000000 +0000 @@ -110,34 +110,34 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - -00 1969 - 8:00 - +08 2009 Oct 18 2:00 - 11:00 - +11 2010 Mar 5 2:00 - 8:00 - +08 2011 Oct 28 2:00 - 11:00 - +11 2012 Feb 21 17:00u - 8:00 - +08 2016 Oct 22 - 11:00 - +11 2018 Mar 11 4:00 - 8:00 - +08 2018 Oct 7 4:00 - 11:00 - +11 2019 Mar 17 3:00 - 8:00 - +08 2019 Oct 4 3:00 - 11:00 - +11 2020 Mar 8 3:00 - 8:00 - +08 2020 Oct 4 0:01 - 11:00 - +11 2021 Mar 14 0:00 - 8:00 - +08 2021 Oct 3 0:01 - 11:00 - +11 2022 Mar 13 0:00 - 8:00 - +08 2022 Oct 2 0:01 - 11:00 - +11 2023 Mar 9 3:00 - 8:00 - +08 + 8:00 - %z 2009 Oct 18 2:00 + 11:00 - %z 2010 Mar 5 2:00 + 8:00 - %z 2011 Oct 28 2:00 + 11:00 - %z 2012 Feb 21 17:00u + 8:00 - %z 2016 Oct 22 + 11:00 - %z 2018 Mar 11 4:00 + 8:00 - %z 2018 Oct 7 4:00 + 11:00 - %z 2019 Mar 17 3:00 + 8:00 - %z 2019 Oct 4 3:00 + 11:00 - %z 2020 Mar 8 3:00 + 8:00 - %z 2020 Oct 4 0:01 + 11:00 - %z 2021 Mar 14 0:00 + 8:00 - %z 2021 Oct 3 0:01 + 11:00 - %z 2022 Mar 13 0:00 + 8:00 - %z 2022 Oct 2 0:01 + 11:00 - %z 2023 Mar 9 3:00 + 8:00 - %z Zone Antarctica/Davis 0 - -00 1957 Jan 13 - 7:00 - +07 1964 Nov + 7:00 - %z 1964 Nov 0 - -00 1969 Feb - 7:00 - +07 2009 Oct 18 2:00 - 5:00 - +05 2010 Mar 10 20:00u - 7:00 - +07 2011 Oct 28 2:00 - 5:00 - +05 2012 Feb 21 20:00u - 7:00 - +07 + 7:00 - %z 2009 Oct 18 2:00 + 5:00 - %z 2010 Mar 10 20:00u + 7:00 - %z 2011 Oct 28 2:00 + 5:00 - %z 2012 Feb 21 20:00u + 7:00 - %z Zone Antarctica/Mawson 0 - -00 1954 Feb 13 - 6:00 - +06 2009 Oct 18 2:00 - 5:00 - +05 + 6:00 - %z 2009 Oct 18 2:00 + 5:00 - %z # References: # Casey Weather (1998-02-26) # http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html @@ -313,10 +313,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Vostok 0 - -00 1957 Dec 16 - 7:00 - +07 1994 Feb + 7:00 - %z 1994 Feb 0 - -00 1994 Nov - 7:00 - +07 2023 Dec 18 2:00 - 5:00 - +05 + 7:00 - %z 2023 Dec 18 2:00 + 5:00 - %z # S Africa - year-round bases # Marion Island, -4653+03752 @@ -349,7 +349,7 @@ # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Rothera 0 - -00 1976 Dec 1 - -3:00 - -03 + -3:00 - %z # Uruguay - year round base # Artigas, King George Island, -621104-0585107 diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/asia openjdk-17-17.0.14+7/make/data/tzdata/asia --- openjdk-17-17.0.13+11/make/data/tzdata/asia 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/asia 2025-01-04 20:25:18.000000000 +0000 @@ -106,8 +106,8 @@ # Afghanistan # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Kabul 4:36:48 - LMT 1890 - 4:00 - +04 1945 - 4:30 - +0430 + 4:00 - %z 1945 + 4:30 - %z # Armenia # From Paul Eggert (2006-03-22): @@ -139,12 +139,12 @@ Rule Armenia 2011 only - Oct lastSun 2:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 - 3:00 - +03 1957 Mar - 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s - 3:00 RussiaAsia +03/+04 1995 Sep 24 2:00s - 4:00 - +04 1997 - 4:00 RussiaAsia +04/+05 2011 - 4:00 Armenia +04/+05 + 3:00 - %z 1957 Mar + 4:00 RussiaAsia %z 1991 Mar 31 2:00s + 3:00 RussiaAsia %z 1995 Sep 24 2:00s + 4:00 - %z 1997 + 4:00 RussiaAsia %z 2011 + 4:00 Armenia %z # Azerbaijan @@ -165,12 +165,12 @@ Rule Azer 1997 2015 - Oct lastSun 5:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 - 3:00 - +03 1957 Mar - 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s - 3:00 RussiaAsia +03/+04 1992 Sep lastSun 2:00s - 4:00 - +04 1996 - 4:00 EUAsia +04/+05 1997 - 4:00 Azer +04/+05 + 3:00 - %z 1957 Mar + 4:00 RussiaAsia %z 1991 Mar 31 2:00s + 3:00 RussiaAsia %z 1992 Sep lastSun 2:00s + 4:00 - %z 1996 + 4:00 EUAsia %z 1997 + 4:00 Azer %z # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -251,17 +251,17 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 5:53:20 - HMT 1941 Oct # Howrah Mean Time? - 6:30 - +0630 1942 May 15 - 5:30 - +0530 1942 Sep - 6:30 - +0630 1951 Sep 30 - 6:00 - +06 2009 - 6:00 Dhaka +06/+07 + 6:30 - %z 1942 May 15 + 5:30 - %z 1942 Sep + 6:30 - %z 1951 Sep 30 + 6:00 - %z 2009 + 6:00 Dhaka %z # Bhutan # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Thimphu 5:58:36 - LMT 1947 Aug 15 # or Thimbu - 5:30 - +0530 1987 Oct - 6:00 - +06 + 5:30 - %z 1987 Oct + 6:00 - %z # British Indian Ocean Territory # Whitman and the 1995 CIA time zone map say 5:00, but the @@ -271,8 +271,8 @@ # then contained the Chagos Archipelago). # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Chagos 4:49:40 - LMT 1907 - 5:00 - +05 1996 - 6:00 - +06 + 5:00 - %z 1996 + 6:00 - %z # Cocos (Keeling) Islands # Myanmar (Burma) @@ -288,9 +288,9 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon 6:24:47 - RMT 1920 # Rangoon local time - 6:30 - +0630 1942 May - 9:00 - +09 1945 May 3 - 6:30 - +0630 + 6:30 - %z 1942 May + 9:00 - %z 1945 May 3 + 6:30 - %z # China @@ -679,7 +679,7 @@ # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi # / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.) Zone Asia/Urumqi 5:50:20 - LMT 1928 - 6:00 - +06 + 6:00 - %z # Hong Kong @@ -1137,7 +1137,7 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30 8:00 - CST 1941 Dec 21 23:00 - 9:00 Macau +09/+10 1945 Sep 30 24:00 + 9:00 Macau %z 1945 Sep 30 24:00 8:00 Macau C%sT @@ -1180,7 +1180,7 @@ Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14 2:00 Cyprus EE%sT 1998 Sep 2:00 EUAsia EE%sT 2016 Sep 8 - 3:00 - +03 2017 Oct 29 1:00u + 3:00 - %z 2017 Oct 29 1:00u 2:00 EUAsia EE%sT # Georgia @@ -1221,18 +1221,25 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tbilisi 2:59:11 - LMT 1880 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time - 3:00 - +03 1957 Mar - 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s - 3:00 RussiaAsia +03/+04 1992 - 3:00 E-EurAsia +03/+04 1994 Sep lastSun - 4:00 E-EurAsia +04/+05 1996 Oct lastSun - 4:00 1:00 +05 1997 Mar lastSun - 4:00 E-EurAsia +04/+05 2004 Jun 27 - 3:00 RussiaAsia +03/+04 2005 Mar lastSun 2:00 - 4:00 - +04 + 3:00 - %z 1957 Mar + 4:00 RussiaAsia %z 1991 Mar 31 2:00s + 3:00 RussiaAsia %z 1992 + 3:00 E-EurAsia %z 1994 Sep lastSun + 4:00 E-EurAsia %z 1996 Oct lastSun + 4:00 1:00 %z 1997 Mar lastSun + 4:00 E-EurAsia %z 2004 Jun 27 + 3:00 RussiaAsia %z 2005 Mar lastSun 2:00 + 4:00 - %z # East Timor +# From Tim Parenti (2024-07-01): +# The 1912-01-01 transition occurred at 00:00 new time, per the 1911-05-24 +# Portuguese decree (see Europe/Lisbon). A provision in article 5(c) of the +# decree prescribed that Timor "will keep counting time in harmony with +# neighboring foreign colonies, [for] as long as they do not adopt the time +# that belongs to them in [the Washington Convention] system." + # See Indonesia for the 1945 transition. # From João Carrascalão, brother of the former governor of East Timor, in @@ -1256,11 +1263,11 @@ # midnight on Saturday, September 16. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 - 8:00 - +08 1942 Feb 21 23:00 - 9:00 - +09 1976 May 3 - 8:00 - +08 2000 Sep 17 0:00 - 9:00 - +09 +Zone Asia/Dili 8:22:20 - LMT 1911 Dec 31 16:00u + 8:00 - %z 1942 Feb 21 23:00 + 9:00 - %z 1976 May 3 + 8:00 - %z 2000 Sep 17 0:00 + 9:00 - %z # India @@ -1326,9 +1333,9 @@ 5:53:20 - HMT 1870 # Howrah Mean Time? 5:21:10 - MMT 1906 Jan 1 # Madras local time 5:30 - IST 1941 Oct - 5:30 1:00 +0630 1942 May 15 + 5:30 1:00 %z 1942 May 15 5:30 - IST 1942 Sep - 5:30 1:00 +0630 1945 Oct 15 + 5:30 1:00 %z 1945 Oct 15 5:30 - IST # Since 1970 the following are like Asia/Kolkata: # Andaman Is @@ -1380,33 +1387,33 @@ # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 16:40u # Batavia - 7:20 - +0720 1932 Nov - 7:30 - +0730 1942 Mar 23 - 9:00 - +09 1945 Sep 23 - 7:30 - +0730 1948 May - 8:00 - +08 1950 May - 7:30 - +0730 1964 + 7:20 - %z 1932 Nov + 7:30 - %z 1942 Mar 23 + 9:00 - %z 1945 Sep 23 + 7:30 - %z 1948 May + 8:00 - %z 1950 May + 7:30 - %z 1964 7:00 - WIB # west and central Borneo Zone Asia/Pontianak 7:17:20 - LMT 1908 May 7:17:20 - PMT 1932 Nov # Pontianak MT - 7:30 - +0730 1942 Jan 29 - 9:00 - +09 1945 Sep 23 - 7:30 - +0730 1948 May - 8:00 - +08 1950 May - 7:30 - +0730 1964 + 7:30 - %z 1942 Jan 29 + 9:00 - %z 1945 Sep 23 + 7:30 - %z 1948 May + 8:00 - %z 1950 May + 7:30 - %z 1964 8:00 - WITA 1988 Jan 1 7:00 - WIB # Sulawesi, Lesser Sundas, east and south Borneo Zone Asia/Makassar 7:57:36 - LMT 1920 7:57:36 - MMT 1932 Nov # Macassar MT - 8:00 - +08 1942 Feb 9 - 9:00 - +09 1945 Sep 23 + 8:00 - %z 1942 Feb 9 + 9:00 - %z 1945 Sep 23 8:00 - WITA # Maluku Islands, West Papua, Papua Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov - 9:00 - +09 1944 Sep 1 - 9:30 - +0930 1964 + 9:00 - %z 1944 Sep 1 + 9:30 - %z 1964 9:00 - WIT # Iran @@ -1642,9 +1649,9 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1935 Jun 13 # Tehran Mean Time - 3:30 Iran +0330/+0430 1977 Oct 20 24:00 - 4:00 Iran +04/+05 1979 - 3:30 Iran +0330/+0430 + 3:30 Iran %z 1977 Oct 20 24:00 + 4:00 Iran %z 1979 + 3:30 Iran %z # Iraq @@ -1687,8 +1694,8 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 2:57:36 - BMT 1918 # Baghdad Mean Time? - 3:00 - +03 1982 May - 3:00 Iraq +03/+04 + 3:00 - %z 1982 May + 3:00 Iraq %z ############################################################################### @@ -2285,7 +2292,7 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 2:00 Jordan EE%sT 2022 Oct 28 0:00s - 3:00 - +03 + 3:00 - %z # Kazakhstan @@ -2496,88 +2503,88 @@ # Almaty (formerly Alma-Ata), representing most locations in Kazakhstan # This includes Abai/Abay (ISO 3166-2 code KZ-10), Aqmola/Akmola (KZ-11), # Almaty (KZ-19), Almaty city (KZ-75), Astana city (KZ-71), -# East Kazkhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33), +# East Kazakhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33), # Karaganda (KZ-35), North Kazakhstan (KZ-59), Pavlodar (KZ-55), -# Shyumkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62). +# Shymkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62). Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata - 5:00 - +05 1930 Jun 21 - 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s - 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s - 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s - 6:00 - +06 2024 Mar 1 0:00 - 5:00 - +05 + 5:00 - %z 1930 Jun 21 + 6:00 RussiaAsia %z 1991 Mar 31 2:00s + 5:00 RussiaAsia %z 1992 Jan 19 2:00s + 6:00 RussiaAsia %z 2004 Oct 31 2:00s + 6:00 - %z 2024 Mar 1 0:00 + 5:00 - %z # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-43) Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 - 4:00 - +04 1930 Jun 21 - 5:00 - +05 1981 Apr 1 - 5:00 1:00 +06 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s - 4:00 RussiaAsia +04/+05 1991 Sep 29 2:00s - 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s - 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s - 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 2018 Dec 21 0:00 - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Apr 1 + 5:00 1:00 %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1991 Mar 31 2:00s + 4:00 RussiaAsia %z 1991 Sep 29 2:00s + 5:00 RussiaAsia %z 1992 Jan 19 2:00s + 6:00 RussiaAsia %z 1992 Mar 29 2:00s + 5:00 RussiaAsia %z 2004 Oct 31 2:00s + 6:00 - %z 2018 Dec 21 0:00 + 5:00 - %z # Qostanay (aka Kostanay, Kustanay) (KZ-39) # The 1991/2 rules are unclear partly because of the 1997 Turgai # reorganization. Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 - 4:00 - +04 1930 Jun 21 - 5:00 - +05 1981 Apr 1 - 5:00 1:00 +06 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s - 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 2024 Mar 1 0:00 - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Apr 1 + 5:00 1:00 %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1991 Mar 31 2:00s + 4:00 RussiaAsia %z 1992 Jan 19 2:00s + 5:00 RussiaAsia %z 2004 Oct 31 2:00s + 6:00 - %z 2024 Mar 1 0:00 + 5:00 - %z # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-15) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 - 4:00 - +04 1930 Jun 21 - 5:00 - +05 1981 Apr 1 - 5:00 1:00 +06 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s - 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Apr 1 + 5:00 1:00 %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1991 Mar 31 2:00s + 4:00 RussiaAsia %z 1992 Jan 19 2:00s + 5:00 RussiaAsia %z 2004 Oct 31 2:00s + 5:00 - %z # Mangghystaū (KZ-47) # Aqtau was not founded until 1963, but it represents an inhabited region, # so include timestamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 - 4:00 - +04 1930 Jun 21 - 5:00 - +05 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s - 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s - 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1991 Mar 31 2:00s + 4:00 RussiaAsia %z 1992 Jan 19 2:00s + 5:00 RussiaAsia %z 1994 Sep 25 2:00s + 4:00 RussiaAsia %z 2004 Oct 31 2:00s + 5:00 - %z # Atyraū (KZ-23) is like Mangghystaū except it switched from # +04/+05 to +05/+06 in spring 1999, not fall 1994. Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 - 3:00 - +03 1930 Jun 21 - 5:00 - +05 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s - 5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s - 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s - 5:00 - +05 + 3:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1991 Mar 31 2:00s + 4:00 RussiaAsia %z 1992 Jan 19 2:00s + 5:00 RussiaAsia %z 1999 Mar 28 2:00s + 4:00 RussiaAsia %z 2004 Oct 31 2:00s + 5:00 - %z # West Kazakhstan (KZ-27) # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk - 3:00 - +03 1930 Jun 21 - 5:00 - +05 1981 Apr 1 - 5:00 1:00 +06 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1989 Mar 26 2:00s - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s - 5:00 RussiaAsia +05/+06 1992 Mar 29 2:00s - 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s - 5:00 - +05 + 3:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Apr 1 + 5:00 1:00 %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1989 Mar 26 2:00s + 4:00 RussiaAsia %z 1992 Jan 19 2:00s + 5:00 RussiaAsia %z 1992 Mar 29 2:00s + 4:00 RussiaAsia %z 2004 Oct 31 2:00s + 5:00 - %z # Kyrgyzstan (Kirgizstan) # Transitions through 1991 are from Shanks & Pottenger. @@ -2598,11 +2605,11 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 - 5:00 - +05 1930 Jun 21 - 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s - 5:00 RussiaAsia +05/+06 1991 Aug 31 2:00 - 5:00 Kyrgyz +05/+06 2005 Aug 12 - 6:00 - +06 + 5:00 - %z 1930 Jun 21 + 6:00 RussiaAsia %z 1991 Mar 31 2:00s + 5:00 RussiaAsia %z 1991 Aug 31 2:00 + 5:00 Kyrgyz %z 2005 Aug 12 + 6:00 - %z ############################################################################### @@ -2809,16 +2816,16 @@ # and 1982 transition dates are from Mok Ly Yng. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - +0730 1933 - 8:00 NBorneo +08/+0820 1942 Feb 16 - 9:00 - +09 1945 Sep 12 - 8:00 - +08 + 7:30 - %z 1933 + 8:00 NBorneo %z 1942 Feb 16 + 9:00 - %z 1945 Sep 12 + 8:00 - %z # Maldives # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé 4:54:00 - MMT 1960 # Malé Mean Time - 5:00 - +05 + 5:00 - %z # Mongolia @@ -2920,9 +2927,37 @@ # From Arthur David Olson (2008-05-19): # Assume that Choibalsan is indeed offset by 8:00. -# XXX--in the absence of better information, assume that transition -# was at the start of 2008-03-31 (the day of Steffen Thorsen's report); -# this is almost surely wrong. + +# From Heitor David Pinto (2024-06-23): +# Sources about time zones in Mongolia seem to list one of two conflicting +# configurations. The first configuration, mentioned in a comment to the TZ +# database in 1999, citing a Mongolian government website, lists the provinces +# of Bayan-Ölgii, Khovd and Uvs in UTC+7, and the rest of the country in +# UTC+8. The second configuration, mentioned in a comment to the database in +# 2001, lists Bayan-Ölgii, Khovd, Uvs, Govi-Altai and Zavkhan in UTC+7, Dornod +# and Sükhbaatar in UTC+9, and the rest of the country in UTC+8. +# +# The first configuration is still mentioned by several Mongolian travel +# agencies: +# https://www.adventurerider.mn/en/page/about_mongolia +# http://www.naturetours.mn/nt/mongolia.php +# https://www.newjuulchin.mn/web/content/7506?unique=fa24a0f6e96e022a3578ee5195ac879638c734ce +# +# It also matches these flight schedules in 2013: +# http://web.archive.org/web/20130722023600/https://www.hunnuair.com/en/timetabled +# The flight times imply that the airports of Uliastai (Zavkhan), Choibalsan +# (Dornod) and Altai (Govi-Altai) are in the same time zone as Ulaanbaatar, +# and Khovd is one hour behind.... +# +# The second configuration was mentioned by an official of the Mongolian +# standards agency in an interview in 2014: https://ikon.mn/n/9v6 +# And it's still listed by the Mongolian aviation agency: +# https://ais.mn/files/aip/eAIP/2023-12-25/html/eSUP/ZM-eSUP-23-04-en-MN.html +# +# ... I believe that the first configuration is what is actually observed in +# Mongolia and has been so all along, at least since 1999. The second +# configuration closely matches the ideal time zone boundaries at 97.5° E and +# 112.5° E but it doesn't seem to be used in practice. # From Ganbold Tsagaankhuu (2015-03-10): # It seems like yesterday Mongolian Government meeting has concluded to use @@ -2961,25 +2996,18 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta Zone Asia/Hovd 6:06:36 - LMT 1905 Aug - 6:00 - +06 1978 - 7:00 Mongol +07/+08 + 6:00 - %z 1978 + 7:00 Mongol %z # Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga Zone Asia/Ulaanbaatar 7:07:32 - LMT 1905 Aug - 7:00 - +07 1978 - 8:00 Mongol +08/+09 -# Choibalsan, a.k.a. Bajan Tümen, Bajan Tumen, Chojbalsan, -# Choybalsan, Sanbejse, Tchoibalsan -Zone Asia/Choibalsan 7:38:00 - LMT 1905 Aug - 7:00 - +07 1978 - 8:00 - +08 1983 Apr - 9:00 Mongol +09/+10 2008 Mar 31 - 8:00 Mongol +08/+09 + 7:00 - %z 1978 + 8:00 Mongol %z # Nepal # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Kathmandu 5:41:16 - LMT 1920 - 5:30 - +0530 1986 - 5:45 - +0545 + 5:30 - %z 1986 + 5:45 - %z # Pakistan @@ -3125,10 +3153,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Karachi 4:28:12 - LMT 1907 - 5:30 - +0530 1942 Sep - 5:30 1:00 +0630 1945 Oct 15 - 5:30 - +0530 1951 Sep 30 - 5:00 - +05 1971 Mar 26 + 5:30 - %z 1942 Sep + 5:30 1:00 %z 1945 Oct 15 + 5:30 - %z 1951 Sep 30 + 5:00 - %z 1971 Mar 26 5:00 Pakistan PK%sT # Pakistan Time # Palestine @@ -3676,14 +3704,14 @@ # Philippine Star 2014-08-05 # http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time -# From Paul Goyette (2018-06-15): +# From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 # which declares the official time here as "Philippine Standard Time". # The act [1] even specifies use of PST as the abbreviation, although # the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish # it from the Pacific Standard Time (PST)." -# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/ -# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535 +# [1] https://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/ +# [2] https://prsd.pagasa.dost.gov.ph/index.php/28-astronomy/302-philippine-standard-time # # From Paul Eggert (2018-06-19): # I surveyed recent news reports, and my impression is that "PST" is @@ -3716,8 +3744,8 @@ # Qatar # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha - 4:00 - +04 1972 Jun - 3:00 - +03 + 4:00 - %z 1972 Jun + 3:00 - %z # Kuwait # Saudi Arabia @@ -3767,7 +3795,7 @@ # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 - 3:00 - +03 + 3:00 - %z # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -3775,13 +3803,13 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. - 7:00 - +07 1933 Jan 1 - 7:00 0:20 +0720 1936 Jan 1 - 7:20 - +0720 1941 Sep 1 - 7:30 - +0730 1942 Feb 16 - 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1981 Dec 31 16:00u - 8:00 - +08 + 7:00 - %z 1933 Jan 1 + 7:00 0:20 %z 1936 Jan 1 + 7:20 - %z 1941 Sep 1 + 7:30 - %z 1942 Feb 16 + 9:00 - %z 1945 Sep 12 + 7:30 - %z 1981 Dec 31 16:00u + 8:00 - %z # Spratly Is # no information @@ -3839,13 +3867,13 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Colombo 5:19:24 - LMT 1880 5:19:32 - MMT 1906 # Moratuwa Mean Time - 5:30 - +0530 1942 Jan 5 - 5:30 0:30 +06 1942 Sep - 5:30 1:00 +0630 1945 Oct 16 2:00 - 5:30 - +0530 1996 May 25 0:00 - 6:30 - +0630 1996 Oct 26 0:30 - 6:00 - +06 2006 Apr 15 0:30 - 5:30 - +0530 + 5:30 - %z 1942 Jan 5 + 5:30 0:30 %z 1942 Sep + 5:30 1:00 %z 1945 Oct 16 2:00 + 5:30 - %z 1996 May 25 0:00 + 6:30 - %z 1996 Oct 26 0:30 + 6:00 - %z 2006 Apr 15 0:30 + 5:30 - %z # Syria # Rule NAME FROM TO - IN ON AT SAVE LETTER/S @@ -4016,16 +4044,16 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq 2:00 Syria EE%sT 2022 Oct 28 0:00 - 3:00 - +03 + 3:00 - %z # Tajikistan # From Shanks & Pottenger. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2 - 5:00 - +05 1930 Jun 21 - 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s - 5:00 1:00 +06 1991 Sep 9 2:00s - 5:00 - +05 + 5:00 - %z 1930 Jun 21 + 6:00 RussiaAsia %z 1991 Mar 31 2:00s + 5:00 1:00 %z 1991 Sep 9 2:00s + 5:00 - %z # Cambodia # Christmas I @@ -4035,16 +4063,16 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Bangkok 6:42:04 - LMT 1880 6:42:04 - BMT 1920 Apr # Bangkok Mean Time - 7:00 - +07 + 7:00 - %z # Turkmenistan # From Shanks & Pottenger. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad - 4:00 - +04 1930 Jun 21 - 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00 - 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00 - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 RussiaAsia %z 1991 Mar 31 2:00 + 4:00 RussiaAsia %z 1992 Jan 19 2:00 + 5:00 - %z # Oman # Réunion @@ -4054,25 +4082,25 @@ # The Crozet Is also observe Réunion time; see the 'antarctica' file. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 - 4:00 - +04 + 4:00 - %z # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Samarkand 4:27:53 - LMT 1924 May 2 - 4:00 - +04 1930 Jun 21 - 5:00 - +05 1981 Apr 1 - 5:00 1:00 +06 1981 Oct 1 - 6:00 - +06 1982 Apr 1 - 5:00 RussiaAsia +05/+06 1992 - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 - %z 1981 Apr 1 + 5:00 1:00 %z 1981 Oct 1 + 6:00 - %z 1982 Apr 1 + 5:00 RussiaAsia %z 1992 + 5:00 - %z # Milne says Tashkent was 4:37:10.8. #STDOFF 4:37:10.8 Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 - 5:00 - +05 1930 Jun 21 - 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00 - 5:00 RussiaAsia +05/+06 1992 - 5:00 - +05 + 5:00 - %z 1930 Jun 21 + 6:00 RussiaAsia %z 1991 Mar 31 2:00 + 5:00 RussiaAsia %z 1992 + 5:00 - %z # Vietnam (southern) @@ -4130,7 +4158,7 @@ # Võ Nguyên Giáp, Việt Nam Dân Quốc Công Báo, No. 1 (1945-09-29), page 13 # http://baochi.nlv.gov.vn/baochi/cgi-bin/baochi?a=d&d=JwvzO19450929.2.5&dliv=none # It says that on 1945-09-01 at 24:00, Vietnam moved back two hours, to +07. -# It also mentions a 1945-03-29 decree (by a Japanese Goveror-General) +# It also mentions a 1945-03-29 decree (by a Japanese Governor-General) # to set the time zone to +09, but does not say whether that decree # merely legalized an earlier change to +09. # @@ -4151,14 +4179,14 @@ #STDOFF 7:06:30.13 Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1 7:06:30 - PLMT 1911 May 1 # Phù Liễn MT - 7:00 - +07 1942 Dec 31 23:00 - 8:00 - +08 1945 Mar 14 23:00 - 9:00 - +09 1945 Sep 1 24:00 - 7:00 - +07 1947 Apr 1 - 8:00 - +08 1955 Jul 1 01:00 - 7:00 - +07 1959 Dec 31 23:00 - 8:00 - +08 1975 Jun 13 - 7:00 - +07 + 7:00 - %z 1942 Dec 31 23:00 + 8:00 - %z 1945 Mar 14 23:00 + 9:00 - %z 1945 Sep 1 24:00 + 7:00 - %z 1947 Apr 1 + 8:00 - %z 1955 Jul 1 01:00 + 7:00 - %z 1959 Dec 31 23:00 + 8:00 - %z 1975 Jun 13 + 7:00 - %z # From Paul Eggert (2019-02-19): # diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/australasia openjdk-17-17.0.14+7/make/data/tzdata/australasia --- openjdk-17-17.0.13+11/make/data/tzdata/australasia 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/australasia 2025-01-04 20:25:18.000000000 +0000 @@ -66,8 +66,8 @@ 8:00 Aus AW%sT 1943 Jul 8:00 AW AW%sT Zone Australia/Eucla 8:35:28 - LMT 1895 Dec - 8:45 Aus +0845/+0945 1943 Jul - 8:45 AW +0845/+0945 + 8:45 Aus %z 1943 Jul + 8:45 AW %z # Queensland # @@ -232,8 +232,8 @@ Rule LH 2008 max - Oct Sun>=1 2:00 0:30 - Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb 10:00 - AEST 1981 Mar - 10:30 LH +1030/+1130 1985 Jul - 10:30 LH +1030/+11 + 10:30 LH %z 1985 Jul + 10:30 LH %z # Australian miscellany # @@ -439,16 +439,16 @@ Rule Fiji 2020 only - Dec 20 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva - 12:00 Fiji +12/+13 + 12:00 Fiji %z # French Polynesia # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct 1 # Rikitea - -9:00 - -09 + -9:00 - %z Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct 1 - -9:30 - -0930 + -9:30 - %z Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct 1 # Papeete - -10:00 - -10 + -10:00 - %z # Clipperton (near North America) is administered from French Polynesia; # it is uninhabited. @@ -491,7 +491,7 @@ Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana 10:00 - GST 1941 Dec 10 # Guam - 9:00 - +09 1944 Jul 31 + 9:00 - %z 1944 Jul 31 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time @@ -503,30 +503,30 @@ # Wallis & Futuna # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki - 12:00 - +12 + 12:00 - %z # Kiribati (except Gilbert Is) # See Pacific/Tarawa for the Gilbert Is. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Kanton 0 - -00 1937 Aug 31 - -12:00 - -12 1979 Oct - -11:00 - -11 1994 Dec 31 - 13:00 - +13 + -12:00 - %z 1979 Oct + -11:00 - %z 1994 Dec 31 + 13:00 - %z Zone Pacific/Kiritimati -10:29:20 - LMT 1901 - -10:40 - -1040 1979 Oct - -10:00 - -10 1994 Dec 31 - 14:00 - +14 + -10:40 - %z 1979 Oct + -10:00 - %z 1994 Dec 31 + 14:00 - %z # Marshall Is # See Pacific/Tarawa for most locations. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1937 - 10:00 - +10 1941 Apr 1 - 9:00 - +09 1944 Feb 6 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 24:00 - 12:00 - +12 + 11:00 - %z 1937 + 10:00 - %z 1941 Apr 1 + 9:00 - %z 1944 Feb 6 + 11:00 - %z 1969 Oct + -12:00 - %z 1993 Aug 20 24:00 + 12:00 - %z # Micronesia # For Chuuk and Yap see Pacific/Port_Moresby. @@ -534,22 +534,22 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 10:51:56 - LMT 1901 - 11:00 - +11 1914 Oct - 9:00 - +09 1919 Feb 1 - 11:00 - +11 1937 - 10:00 - +10 1941 Apr 1 - 9:00 - +09 1945 Aug - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 + 11:00 - %z 1914 Oct + 9:00 - %z 1919 Feb 1 + 11:00 - %z 1937 + 10:00 - %z 1941 Apr 1 + 9:00 - %z 1945 Aug + 11:00 - %z 1969 Oct + 12:00 - %z 1999 + 11:00 - %z # Nauru # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Aug 29 - 9:00 - +09 1945 Sep 8 - 11:30 - +1130 1979 Feb 10 2:00 - 12:00 - +12 + 11:30 - %z 1942 Aug 29 + 9:00 - %z 1945 Sep 8 + 11:30 - %z 1979 Feb 10 2:00 + 12:00 - %z # New Caledonia # Rule NAME FROM TO - IN ON AT SAVE LETTER/S @@ -560,7 +560,7 @@ Rule NC 1997 only - Mar 2 2:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 # Nouméa - 11:00 NC +11/+12 + 11:00 NC %z ############################################################################### @@ -604,8 +604,8 @@ 12:00 NZ NZ%sT Zone Pacific/Chatham 12:13:48 - LMT 1868 Nov 2 - 12:15 - +1215 1946 Jan 1 - 12:45 Chatham +1245/+1345 + 12:15 - %z 1946 Jan 1 + 12:45 Chatham %z # Auckland Is # uninhabited; Māori and Moriori, colonial settlers, pastoralists, sealers, @@ -658,8 +658,8 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Rarotonga 13:20:56 - LMT 1899 Dec 26 # Avarua -10:39:04 - LMT 1952 Oct 16 - -10:30 - -1030 1978 Nov 12 - -10:00 Cook -10/-0930 + -10:30 - %z 1978 Nov 12 + -10:00 Cook %z ############################################################################### @@ -676,30 +676,30 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Niue -11:19:40 - LMT 1952 Oct 16 # Alofi - -11:20 - -1120 1964 Jul - -11:00 - -11 + -11:20 - %z 1964 Jul + -11:00 - %z # Norfolk # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston - 11:12 - +1112 1951 - 11:30 - +1130 1974 Oct 27 02:00s - 11:30 1:00 +1230 1975 Mar 2 02:00s - 11:30 - +1130 2015 Oct 4 02:00s - 11:00 - +11 2019 Jul - 11:00 AN +11/+12 + 11:12 - %z 1951 + 11:30 - %z 1974 Oct 27 02:00s + 11:30 1:00 %z 1975 Mar 2 02:00s + 11:30 - %z 2015 Oct 4 02:00s + 11:00 - %z 2019 Jul + 11:00 AN %z # Palau (Belau) # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror 8:57:56 - LMT 1901 - 9:00 - +09 + 9:00 - %z # Papua New Guinea # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Port_Moresby 9:48:40 - LMT 1880 9:48:32 - PMMT 1895 # Port Moresby Mean Time - 10:00 - +10 + 10:00 - %z # # From Paul Eggert (2014-10-13): # Base the Bougainville entry on the Arawa-Kieta region, which appears to have @@ -720,16 +720,16 @@ # Zone Pacific/Bougainville 10:22:16 - LMT 1880 9:48:32 - PMMT 1895 - 10:00 - +10 1942 Jul - 9:00 - +09 1945 Aug 21 - 10:00 - +10 2014 Dec 28 2:00 - 11:00 - +11 + 10:00 - %z 1942 Jul + 9:00 - %z 1945 Aug 21 + 10:00 - %z 2014 Dec 28 2:00 + 11:00 - %z # Pitcairn # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Pitcairn -8:40:20 - LMT 1901 # Adamstown - -8:30 - -0830 1998 Apr 27 0:00 - -8:00 - -08 + -8:30 - %z 1998 Apr 27 0:00 + -8:00 - %z # American Samoa # Midway @@ -818,15 +818,15 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5 -11:26:56 - LMT 1911 - -11:30 - -1130 1950 - -11:00 WS -11/-10 2011 Dec 29 24:00 - 13:00 WS +13/+14 + -11:30 - %z 1950 + -11:00 WS %z 2011 Dec 29 24:00 + 13:00 WS %z # Solomon Is # excludes Bougainville, for which see Papua New Guinea # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara - 11:00 - +11 + 11:00 - %z # Tokelau # @@ -849,8 +849,8 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fakaofo -11:24:56 - LMT 1901 - -11:00 - -11 2011 Dec 30 - 13:00 - +13 + -11:00 - %z 2011 Dec 30 + 13:00 - %z # Tonga # Rule NAME FROM TO - IN ON AT SAVE LETTER/S @@ -862,9 +862,9 @@ Rule Tonga 2017 only - Jan Sun>=15 3:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Tongatapu 12:19:12 - LMT 1945 Sep 10 - 12:20 - +1220 1961 - 13:00 - +13 1999 - 13:00 Tonga +13/+14 + 12:20 - %z 1961 + 13:00 - %z 1999 + 13:00 Tonga %z # US minor outlying islands @@ -953,7 +953,7 @@ Rule Vanuatu 1992 only - Oct Sat>=22 24:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila - 11:00 Vanuatu +11/+12 + 11:00 Vanuatu %z ############################################################################### diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/backward openjdk-17-17.0.14+7/make/data/tzdata/backward --- openjdk-17-17.0.13+11/make/data/tzdata/backward 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/backward 2025-01-04 20:25:18.000000000 +0000 @@ -21,12 +21,13 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -# tzdb links for backward compatibility +# Links and zones for backward compatibility # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # This file provides links from old or merged timezone names to current ones. +# It also provides a few zone entries for old naming conventions. # Many names changed in 1993 and in 1995, and many merged names moved here # in the period from 2013 through 2022. Several of these names are # also present in the file 'backzone', which has data important only @@ -67,6 +68,8 @@ Link America/Noronha Brazil/DeNoronha Link America/Sao_Paulo Brazil/East Link America/Manaus Brazil/West +Link Europe/Brussels CET +Link America/Chicago CST6CDT Link America/Halifax Canada/Atlantic Link America/Winnipeg Canada/Central # This line is commented out, as the name exceeded the 14-character limit @@ -81,6 +84,9 @@ Link America/Santiago Chile/Continental Link Pacific/Easter Chile/EasterIsland Link America/Havana Cuba +Link Europe/Athens EET +Link America/Panama EST +Link America/New_York EST5EDT Link Africa/Cairo Egypt Link Europe/Dublin Eire # Vanguard section, for most .zi parsers. @@ -119,6 +125,9 @@ Link Asia/Tokyo Japan Link Pacific/Kwajalein Kwajalein Link Africa/Tripoli Libya +Link Europe/Brussels MET +Link America/Phoenix MST +Link America/Denver MST7MDT Link America/Tijuana Mexico/BajaNorte Link America/Mazatlan Mexico/BajaSur Link America/Mexico_City Mexico/General @@ -298,6 +307,7 @@ Link America/Toronto America/Thunder_Bay Link America/Edmonton America/Yellowknife Link Pacific/Auckland Antarctica/South_Pole +Link Asia/Ulaanbaatar Asia/Choibalsan Link Asia/Shanghai Asia/Chongqing Link Asia/Shanghai Asia/Harbin Link Asia/Urumqi Asia/Kashgar @@ -312,6 +322,7 @@ Link Pacific/Kanton Pacific/Enderbury Link Pacific/Honolulu Pacific/Johnston Link Pacific/Port_Moresby Pacific/Yap +Link Europe/Lisbon WET # Alternate names for the same location @@ -337,5 +348,7 @@ # Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72. # However, for various reasons many users expect to find it under Europe. Link Asia/Nicosia Europe/Nicosia +Link Pacific/Honolulu HST +Link America/Los_Angeles PST8PDT Link Pacific/Guadalcanal Pacific/Ponape #= Pacific/Pohnpei Link Pacific/Port_Moresby Pacific/Truk #= Pacific/Chuuk diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/etcetera openjdk-17-17.0.14+7/make/data/tzdata/etcetera --- openjdk-17-17.0.13+11/make/data/tzdata/etcetera 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/etcetera 2025-01-04 20:25:18.000000000 +0000 @@ -28,7 +28,7 @@ # These entries are for uses not otherwise covered by the tz database. # Their main practical use is for platforms like Android that lack -# support for POSIX.1-2017-style TZ strings. On such platforms these entries +# support for POSIX proleptic TZ strings. On such platforms these entries # can be useful if the timezone database is wrong or if a ship or # aircraft at sea is not in a timezone. @@ -74,29 +74,29 @@ # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. -Zone Etc/GMT-14 14 - +14 -Zone Etc/GMT-13 13 - +13 -Zone Etc/GMT-12 12 - +12 -Zone Etc/GMT-11 11 - +11 -Zone Etc/GMT-10 10 - +10 -Zone Etc/GMT-9 9 - +09 -Zone Etc/GMT-8 8 - +08 -Zone Etc/GMT-7 7 - +07 -Zone Etc/GMT-6 6 - +06 -Zone Etc/GMT-5 5 - +05 -Zone Etc/GMT-4 4 - +04 -Zone Etc/GMT-3 3 - +03 -Zone Etc/GMT-2 2 - +02 -Zone Etc/GMT-1 1 - +01 -Zone Etc/GMT+1 -1 - -01 -Zone Etc/GMT+2 -2 - -02 -Zone Etc/GMT+3 -3 - -03 -Zone Etc/GMT+4 -4 - -04 -Zone Etc/GMT+5 -5 - -05 -Zone Etc/GMT+6 -6 - -06 -Zone Etc/GMT+7 -7 - -07 -Zone Etc/GMT+8 -8 - -08 -Zone Etc/GMT+9 -9 - -09 -Zone Etc/GMT+10 -10 - -10 -Zone Etc/GMT+11 -11 - -11 -Zone Etc/GMT+12 -12 - -12 +Zone Etc/GMT-14 14 - %z +Zone Etc/GMT-13 13 - %z +Zone Etc/GMT-12 12 - %z +Zone Etc/GMT-11 11 - %z +Zone Etc/GMT-10 10 - %z +Zone Etc/GMT-9 9 - %z +Zone Etc/GMT-8 8 - %z +Zone Etc/GMT-7 7 - %z +Zone Etc/GMT-6 6 - %z +Zone Etc/GMT-5 5 - %z +Zone Etc/GMT-4 4 - %z +Zone Etc/GMT-3 3 - %z +Zone Etc/GMT-2 2 - %z +Zone Etc/GMT-1 1 - %z +Zone Etc/GMT+1 -1 - %z +Zone Etc/GMT+2 -2 - %z +Zone Etc/GMT+3 -3 - %z +Zone Etc/GMT+4 -4 - %z +Zone Etc/GMT+5 -5 - %z +Zone Etc/GMT+6 -6 - %z +Zone Etc/GMT+7 -7 - %z +Zone Etc/GMT+8 -8 - %z +Zone Etc/GMT+9 -9 - %z +Zone Etc/GMT+10 -10 - %z +Zone Etc/GMT+11 -11 - %z +Zone Etc/GMT+12 -12 - %z diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/europe openjdk-17-17.0.14+7/make/data/tzdata/europe --- openjdk-17-17.0.13+11/make/data/tzdata/europe 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/europe 2025-01-04 20:25:18.000000000 +0000 @@ -753,14 +753,6 @@ # Take "abolishing daylight saving time" to mean that time is now considered # to be standard. -# These are for backward compatibility with older versions. - -# Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone WET 0:00 EU WE%sT -Zone CET 1:00 C-Eur CE%sT -Zone MET 1:00 C-Eur ME%sT -Zone EET 2:00 EU EE%sT - # Previous editions of this database used abbreviations like MET DST # for Central European Summer Time, but this didn't agree with common usage. @@ -894,7 +886,7 @@ 3:00 Russia MSK/MSD 1990 3:00 - MSK 1991 Mar 31 2:00s 2:00 Russia EE%sT 2011 Mar 27 2:00s - 3:00 - +03 + 3:00 - %z # Belgium # Luxembourg @@ -1199,22 +1191,22 @@ # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28 - -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 1996 + -3:00 - %z 1980 Apr 6 2:00 + -3:00 EU %z 1996 0:00 - GMT # # Use the old name Scoresbysund, as the current name Ittoqqortoormiit # exceeds tzdb's 14-letter limit and has no common English abbreviation. Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit - -2:00 - -02 1980 Apr 6 2:00 - -2:00 C-Eur -02/-01 1981 Mar 29 - -1:00 EU -01/+00 2024 Mar 31 - -2:00 EU -02/-01 + -2:00 - %z 1980 Apr 6 2:00 + -2:00 C-Eur %z 1981 Mar 29 + -1:00 EU %z 2024 Mar 31 + -2:00 EU %z Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb - -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 2023 Mar 26 1:00u - -2:00 - -02 2023 Oct 29 1:00u - -2:00 EU -02/-01 + -3:00 - %z 1980 Apr 6 2:00 + -3:00 EU %z 2023 Mar 26 1:00u + -2:00 - %z 2023 Oct 29 1:00u + -2:00 EU %z Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT @@ -2086,10 +2078,39 @@ # Portugal -# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne: -# According to a Portuguese decree (1911-05-26) -# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf -# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00. +# From Tim Parenti (2024-07-01), per Alois Treindl (2021-02-07) and Michael +# Deckers (2021-02-10): +# http://oal.ul.pt/documentos/2018/01/hl1911a2018.pdf/ +# The Astronomical Observatory of Lisbon has published a list detailing the +# historical transitions in legal time within continental Portugal. It +# directly references many decrees and ordinances which are, in turn, +# referenced below. They can be viewed in the public archives of the Diário da +# República (until 1976-04-09 known as the Diário do Govêrno) at +# https://dre.pt/ (in Portuguese). +# +# Most of the Rules below have been updated simply to match the Observatory's +# listing for continental (mainland) Portugal. Although there are over 50 +# referenced decrees and ordinances, only the handful with comments below have +# been verified against the text, typically to provide additional confidence +# wherever dates provided by Whitman and Shanks & Pottenger had disagreed. +# See further below for the Azores and Madeira. + +# From Tim Parenti (2024-07-01), per Paul Eggert (2014-08-11), after a +# heads-up from Stephen Colebourne: +# According to a 1911-05-24 Portuguese decree, Lisbon was at -0:36:44.68, but +# switched to GMT on 1912-01-01 at 00:00. +# https://dre.pt/dr/detalhe/decreto/593090 +# https://dre.pt/application/conteudo/593090 +# The decree made legal time throughout Portugal and her possessions +# "subordinate to the Greenwich meridian, according to the principle adopted at +# the Washington Convention in 1884" and eliminated the "difference of five +# minutes between the internal and external clocks of railway stations". +# +# The decree was gazetted in the 1911-05-30 issue of Diário do Govêrno, and is +# considered to be dated 1911-05-24 by that issue's summary; however, the text +# of the decree itself is dated 1911-05-26. The Diário da República website +# notes the discrepancy, but later laws and the Observatory all seem to refer +# to this decree by the 1911-05-24 date. # # From Michael Deckers (2018-02-15): # article 5 [of the 1911 decree; Deckers's translation] ...: @@ -2097,37 +2118,62 @@ # according to the 2nd article, the civil day January 1, 1912 begins, # all clocks therefore having to be advanced or set back correspondingly ... -# From Rui Pedro Salgueiro (1992-11-12): -# Portugal has recently (September, 27) changed timezone -# (from WET to MET or CET) to harmonize with EEC. -# -# Martin Bruckmann (1996-02-29) reports via Peter Ilieve -# that Portugal is reverting to 0:00 by not moving its clocks this spring. -# The new Prime Minister was fed up with getting up in the dark in the winter. -# -# From Paul Eggert (1996-11-12): -# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions -# at 02:00u, not 01:00u. Assume that these are typos. -# IATA SSIM (1991/1992) reports that the Azores were at -1:00. -# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00. -# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal -# harmonized with EU rules), and that they stayed +0:00 that winter. -# # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not -# done every year, depending on what Spain did, because of railroad schedules. -# Go with Shanks & Pottenger. +# From Tim Parenti (2024-07-01), per Paul Eggert (1999-01-30): +# DSH writes in their history that Decreto 1469 of 1915-03-30 established +# summer time and that, "despite" this, the change to the clocks was not done +# every year, depending on what Spain did, because of railroad schedules. +# In fact, that decree had nothing to do with DST; rather, it regulated the +# sending of time signals. But we do see linkage to Spain in the 1920s below. +# https://dre.pt/dr/detalhe/decreto/1469-1915-285721 +# https://dre.pt/application/conteudo/285721 +# +# According to the Observatory, standard time was first advanced by Decreto +# 2433 of 1916-06-09 and restored by Decreto 2712 of 1916-10-28. While Whitman +# gives 1916-10-31 for the latter transition, Shanks & Pottenger agrees more +# closely with the decree, which stated that its provision "will start sixty +# minutes after the end of 31 October, according to the current time," i.e., +# 01:00 on 1 November. +# https://dre.pt/dr/detalhe/decreto/2433-1916-267192 +# https://dre.pt/application/conteudo/267192 +# https://dre.pt/dr/detalhe/decreto/2712-1916-590937 +# https://dre.pt/application/conteudo/590937 Rule Port 1916 only - Jun 17 23:00 1:00 S -# Whitman gives 1916 Oct 31; go with Shanks & Pottenger. Rule Port 1916 only - Nov 1 1:00 0 - -Rule Port 1917 only - Feb 28 23:00s 1:00 S -Rule Port 1917 1921 - Oct 14 23:00s 0 - -Rule Port 1918 only - Mar 1 23:00s 1:00 S -Rule Port 1919 only - Feb 28 23:00s 1:00 S -Rule Port 1920 only - Feb 29 23:00s 1:00 S -Rule Port 1921 only - Feb 28 23:00s 1:00 S +# From Tim Parenti (2024-07-01): +# Article 7 of Decreto 2922 of 1916-12-30 stated that "the legal time will be +# advanced by sixty minutes from 1 March to 31 October." Per Article 15, this +# came into force from 1917-01-01. Just before the first fall back, Decreto +# 3446 of 1917-10-11 changed the annual end date to 14 October. +# https://dre.pt/dr/detalhe/decreto/2922-1916-261894 +# https://dre.pt/application/conteudo/261894 +# https://dre.pt/dr/detalhe/decreto/3446-1917-495161 +# https://dre.pt/application/conteudo/495161 +# This annual change was revoked by Decreto 8038 of 1922-02-18. +# https://dre.pt/dr/detalhe/decreto/8038-1922-569751 +# https://dre.pt/application/conteudo/569751 +Rule Port 1917 1921 - Mar 1 0:00 1:00 S +Rule Port 1917 1921 - Oct 14 24:00 0 - +# From Tim Parenti (2024-07-01): +# Decreto 9592 of 1924-04-14 noted that "France maintains the advance of legal +# time in the summer and Spain has now adopted it for the first time" and +# considered "that the absence of similar measures would cause serious +# difficulties for international rail connections with consequent repercussions +# on domestic service hours..." along with "inconvenient analogues...for postal +# and telegraph services." Summer time would be in effect from 17 April to 4 +# October, with the spring change explicitly specified by bringing clocks +# forward from 16 April 23:00. +# https://dre.pt/dr/detalhe/decreto/9592-1924-652133 +# https://dre.pt/application/conteudo/652133 +# +# Decreto 10700, issued 1925-04-16, noted that Spain had not continued summer +# time, declared that "the current legal hour prior to 17 April remains +# unchanged from that day forward", and revoked legislation to the contrary, +# just a day before summer time would have otherwise resumed. +# https://dre.pt/dr/detalhe/decreto/10700-1925-437826 +# https://dre.pt/application/conteudo/437826 Rule Port 1924 only - Apr 16 23:00s 1:00 S -Rule Port 1924 only - Oct 14 23:00s 0 - +Rule Port 1924 only - Oct 4 23:00s 0 - Rule Port 1926 only - Apr 17 23:00s 1:00 S Rule Port 1926 1929 - Oct Sat>=1 23:00s 0 - Rule Port 1927 only - Apr 9 23:00s 1:00 S @@ -2139,6 +2185,8 @@ Rule Port 1932 only - Apr 2 23:00s 1:00 S Rule Port 1934 only - Apr 7 23:00s 1:00 S # Whitman gives 1934 Oct 5; go with Shanks & Pottenger. +# Note: The 1935 law specified 10-06 00:00, not 10-05 24:00, but the following +# is equivalent and more succinct. Rule Port 1934 1938 - Oct Sat>=1 23:00s 0 - # Shanks & Pottenger give 1935 Apr 30; go with Whitman. Rule Port 1935 only - Mar 30 23:00s 1:00 S @@ -2149,10 +2197,19 @@ Rule Port 1939 only - Apr 15 23:00s 1:00 S # Whitman gives 1939 Oct 7; go with Shanks & Pottenger. Rule Port 1939 only - Nov 18 23:00s 0 - +# From Tim Parenti (2024-07-01): +# Portaria 9465 of 1940-02-17 advanced clocks from Saturday 1940-02-24 23:00. +# The clocks were restored by Portaria 9658, issued Monday 1940-10-07, +# effective from 24:00 that very night, which agrees with Shanks & Pottenger; +# Whitman gives Saturday 1940-10-05 instead. +# https://dre.pt/dr/detalhe/portaria/9465-1940-189096 +# https://dre.pt/application/conteudo/189096 +# https://dre.pt/dr/detalhe/portaria/9658-1940-196729 +# https://dre.pt/application/conteudo/196729 Rule Port 1940 only - Feb 24 23:00s 1:00 S -# Shanks & Pottenger give 1940 Oct 7; go with Whitman. -Rule Port 1940 1941 - Oct 5 23:00s 0 - +Rule Port 1940 only - Oct 7 23:00s 0 - Rule Port 1941 only - Apr 5 23:00s 1:00 S +Rule Port 1941 only - Oct 5 23:00s 0 - Rule Port 1942 1945 - Mar Sat>=8 23:00s 1:00 S Rule Port 1942 only - Apr 25 22:00s 2:00 M # Midsummer Rule Port 1942 only - Aug 15 22:00s 1:00 S @@ -2162,66 +2219,195 @@ Rule Port 1944 1945 - Apr Sat>=21 22:00s 2:00 M Rule Port 1946 only - Apr Sat>=1 23:00s 1:00 S Rule Port 1946 only - Oct Sat>=1 23:00s 0 - -# Whitman says DST was not observed in 1950; go with Shanks & Pottenger. -# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger. -Rule Port 1947 1965 - Apr Sun>=1 2:00s 1:00 S +# From Tim Parenti (2024-07-01), per Alois Treindl (2021-02-07): +# The Astronomical Observatory of Lisbon cites Portaria 11767 of 1947-03-28 for +# 1947 and Portaria 12286 of 1948-02-19 for 1948. +# https://dre.pt/dr/detalhe/portaria/11767-1947-414787 +# https://dre.pt/application/conteudo/414787 +# https://dre.pt/dr/detalhe/portaria/12286-1948-152953 +# https://dre.pt/application/conteudo/152953 +# +# Although the latter ordinance explicitly had the 1948-10-03 transition +# scheduled for 02:00 rather than 03:00 as had been used in 1947, Decreto-Lei +# 37048 of 1948-09-07 recognized "that it is advisable to definitely set...the +# 'summer time' regime", and fixed the fall transition at 03:00 moving forward. +# https://dre.pt/dr/detalhe/decreto-lei/37048-1948-373810 +# https://dre.pt/application/conteudo/373810 +# While the Observatory only cites this act for 1949-1965 and not for 1948, it +# does not appear to have had any provision delaying its effect, so assume that +# it overrode the prior ordinance for 1948-10-03. +# +# Whitman says DST was not observed in 1950 and gives Oct lastSun for 1952 on. +# The Observatory, however, agrees with Shanks & Pottenger that 1950 was not an +# exception and that Oct Sun>=1 was maintained through 1965. +Rule Port 1947 1966 - Apr Sun>=1 2:00s 1:00 S Rule Port 1947 1965 - Oct Sun>=1 2:00s 0 - -Rule Port 1977 only - Mar 27 0:00s 1:00 S -Rule Port 1977 only - Sep 25 0:00s 0 - -Rule Port 1978 1979 - Apr Sun>=1 0:00s 1:00 S -Rule Port 1978 only - Oct 1 0:00s 0 - -Rule Port 1979 1982 - Sep lastSun 1:00s 0 - -Rule Port 1980 only - Mar lastSun 0:00s 1:00 S -Rule Port 1981 1982 - Mar lastSun 1:00s 1:00 S -Rule Port 1983 only - Mar lastSun 2:00s 1:00 S +# From Tim Parenti (2024-07-01): +# Decreto-Lei 47233 of 1966-10-01 considered that the "duality" in time was +# "the cause of serious disturbances" and noted that "the countries with which +# we have the most frequent contacts...have already adopted" a solution +# coinciding with the extant "summer time". It established that the former +# "summer time" would apply year-round on the mainland and adjacent islands +# with immediate effect, as the fall back would have otherwise occurred later +# that evening. +# https://dre.pt/dr/detalhe/decreto-lei/47233-1966-293729 +# Model this by changing zones without changing clocks at the +# previously-appointed fall back time. +# +# Decreto-Lei 309/76 of 1976-04-27 acknowledged that those international +# contacts had returned to adopting seasonal times, and considered that the +# year-round advancement "entails considerable sacrifices for the vast majority +# of the working population during the winter months", including morning +# visibility concerns for schoolchildren. It specified, beginning 1976-09-26 +# 01:00, an annual return to UT+00 on the mainland from 00:00 UT on Sep lastSun +# to 00:00 UT on Mar lastSun (unless the latter date fell on Easter, in which +# case it was to be brought forward to the preceding Sunday). It also assigned +# the Permanent Time Commission to study and propose revisions for the Azores +# and Madeira, neither of which resumed DST until 1982 (as described further +# below). +# https://dre.pt/dr/detalhe/decreto-lei/309-1976-502063 +Rule Port 1976 only - Sep lastSun 1:00 0 - +Rule Port 1977 only - Mar lastSun 0:00s 1:00 S +Rule Port 1977 only - Sep lastSun 0:00s 0 - +# From Tim Parenti (2024-07-01): +# Beginning in 1978, rather than triggering the Easter rule of the 1976 decree +# (Easter fell on 1978-03-26), Article 5 was used instead, which allowed DST +# dates to be changed by order of the Minister of Education and Scientific +# Research, upon consultation with the Permanent Time Commission, "whenever +# considered convenient." As such, a series of one-off ordinances were +# promulgated for the mainland in 1978 through 1980, after which the 1976 +# decree naturally came back into force from 1981. +Rule Port 1978 1980 - Apr Sun>=1 1:00s 1:00 S +Rule Port 1978 only - Oct 1 1:00s 0 - +Rule Port 1979 1980 - Sep lastSun 1:00s 0 - +Rule Port 1981 1986 - Mar lastSun 0:00s 1:00 S +Rule Port 1981 1985 - Sep lastSun 0:00s 0 - +# From Tim Parenti (2024-07-01): +# Decreto-Lei 44-B/86 of 1986-03-07 switched mainland Portugal's transition +# times from 0:00s to 1:00u to harmonize with the EEC from 1986-03-30. +# https://dre.pt/dr/detalhe/decreto-lei/44-b-1986-628280 +# (Transitions of 1:00s as previously reported and used by the W-Eur rules, +# though equivalent, appear to have been fiction here.) Madeira continued to +# use 0:00s for spring 1986 before joining with the mainland using 1:00u in the +# fall; meanwhile, in the Azores the two were equivalent, so the law specifying +# 0:00s wasn't touched until 1992. (See below for more on the islands.) +# +# From Rui Pedro Salgueiro (1992-11-12): +# Portugal has recently (September, 27) changed timezone +# (from WET to MET or CET) to harmonize with EEC. +# +# Martin Bruckmann (1996-02-29) reports via Peter Ilieve +# that Portugal is reverting to 0:00 by not moving its clocks this spring. +# The new Prime Minister was fed up with getting up in the dark in the winter. +# +# From Paul Eggert (1996-11-12): +# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions +# at 02:00u, not 01:00u. Assume that these are typos. # # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF -0:36:44.68 Zone Europe/Lisbon -0:36:45 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 0:00u # Lisbon MT - 0:00 Port WE%sT 1966 Apr 3 2:00 + 0:00 Port WE%sT 1966 Oct 2 2:00s 1:00 - CET 1976 Sep 26 1:00 - 0:00 Port WE%sT 1983 Sep 25 1:00s - 0:00 W-Eur WE%sT 1992 Sep 27 1:00s + 0:00 Port WE%sT 1986 + 0:00 EU WE%sT 1992 Sep 27 1:00u 1:00 EU CE%sT 1996 Mar 31 1:00u 0:00 EU WE%sT + +# From Tim Parenti (2024-07-01): +# For the Azores and Madeira, legislation was followed from the laws currently +# in force as listed at: +# https://oal.ul.pt/hora-legal/legislacao/ +# working backward through references of revocation and abrogation to +# Decreto-Lei 47233 of 1966-10-01, the last time DST was abolished across the +# mainland and its adjacent islands. Because of that reference, it is +# therefore assumed that DST rules in the islands prior to 1966 were like that +# of the mainland, though most legislation of the time didn't explicitly +# specify DST practices for the islands. Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada -1:54:32 - HMT 1912 Jan 1 2:00u # Horta MT # Vanguard section, for zic and other parsers that support %z. -# -2:00 Port %z 1966 Apr 3 2:00 -# -1:00 Port %z 1983 Sep 25 1:00s -# -1:00 W-Eur %z 1992 Sep 27 1:00s + -2:00 Port %z 1966 Oct 2 2:00s +# From Tim Parenti (2024-07-01): +# While Decreto-Lei 309/76 of 1976-04-27 reintroduced DST on the mainland by +# falling back on 1976-09-26, it assigned the Permanent Time Commission to +# study and propose revisions for the Azores and Madeira. Decreto Regional +# 9/77/A of 1977-05-17 affirmed that "the legal time remained unchanged in the +# Azores" at UT-1, and would remain there year-round. +# https://dre.pt/dr/detalhe/decreto-regional/9-1977-252066 +# +# Decreto Regional 2/82/A, published 1982-03-02, adopted DST in the same +# fashion as the mainland used at the time. +# https://dre.pt/dr/detalhe/decreto-regional/2-1982-599965 +# Though transitions in the Azores officially remained at 0:00s through 1992, +# this was equivalent to the EU-style 1:00u adopted by the mainland in 1986, so +# model it as such. + -1:00 - %z 1982 Mar 28 0:00s + -1:00 Port %z 1986 # Rearguard section, for parsers lacking %z; see ziguard.awk. - -2:00 Port -02/-01 1942 Apr 25 22:00s - -2:00 Port +00 1942 Aug 15 22:00s - -2:00 Port -02/-01 1943 Apr 17 22:00s - -2:00 Port +00 1943 Aug 28 22:00s - -2:00 Port -02/-01 1944 Apr 22 22:00s - -2:00 Port +00 1944 Aug 26 22:00s - -2:00 Port -02/-01 1945 Apr 21 22:00s - -2:00 Port +00 1945 Aug 25 22:00s - -2:00 Port -02/-01 1966 Apr 3 2:00 - -1:00 Port -01/+00 1983 Sep 25 1:00s - -1:00 W-Eur -01/+00 1992 Sep 27 1:00s +# -2:00 Port -02/-01 1942 Apr 25 22:00s +# -2:00 Port +00 1942 Aug 15 22:00s +# -2:00 Port -02/-01 1943 Apr 17 22:00s +# -2:00 Port +00 1943 Aug 28 22:00s +# -2:00 Port -02/-01 1944 Apr 22 22:00s +# -2:00 Port +00 1944 Aug 26 22:00s +# -2:00 Port -02/-01 1945 Apr 21 22:00s +# -2:00 Port +00 1945 Aug 25 22:00s +# -2:00 Port -02/-01 1966 Oct 2 2:00s +# -1:00 - -01 1982 Mar 28 0:00s +# -1:00 Port -01/+00 1986 # End of rearguard section. - 0:00 EU WE%sT 1993 Mar 28 1:00u - -1:00 EU -01/+00 +# +# From Paul Eggert (1996-11-12): +# IATA SSIM (1991/1992) reports that the Azores were at -1:00. +# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00. +# +# From Tim Parenti (2024-07-01): +# After mainland Portugal had shifted forward an hour from 1992-09-27, Decreto +# Legislativo Regional 29/92/A of 1992-12-23 sought to "reduce the time +# difference" by shifting the Azores forward as well from 1992-12-27. Just six +# months later, this was revoked by Decreto Legislativo Regional 9/93/A, citing +# "major changes in work habits and way of life." Though the revocation didn't +# give a transition time, it was signed Wednesday 1993-06-16; assume it took +# effect later that evening, and that an EU-style spring forward (to +01) was +# still observed in the interim on 1993-03-28. +# https://dre.pt/dr/detalhe/decreto-legislativo-regional/29-1992-621553 +# https://dre.pt/dr/detalhe/decreto-legislativo-regional/9-1993-389633 + -1:00 EU %z 1992 Dec 27 1:00s + 0:00 EU WE%sT 1993 Jun 17 1:00u + -1:00 EU %z + Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal -1:07:36 - FMT 1912 Jan 1 1:00u # Funchal MT # Vanguard section, for zic and other parsers that support %z. -# -1:00 Port %z 1966 Apr 3 2:00 + -1:00 Port %z 1966 Oct 2 2:00s # Rearguard section, for parsers lacking %z; see ziguard.awk. - -1:00 Port -01/+00 1942 Apr 25 22:00s - -1:00 Port +01 1942 Aug 15 22:00s - -1:00 Port -01/+00 1943 Apr 17 22:00s - -1:00 Port +01 1943 Aug 28 22:00s - -1:00 Port -01/+00 1944 Apr 22 22:00s - -1:00 Port +01 1944 Aug 26 22:00s - -1:00 Port -01/+00 1945 Apr 21 22:00s - -1:00 Port +01 1945 Aug 25 22:00s - -1:00 Port -01/+00 1966 Apr 3 2:00 +# -1:00 Port -01/+00 1942 Apr 25 22:00s +# -1:00 Port +01 1942 Aug 15 22:00s +# -1:00 Port -01/+00 1943 Apr 17 22:00s +# -1:00 Port +01 1943 Aug 28 22:00s +# -1:00 Port -01/+00 1944 Apr 22 22:00s +# -1:00 Port +01 1944 Aug 26 22:00s +# -1:00 Port -01/+00 1945 Apr 21 22:00s +# -1:00 Port +01 1945 Aug 25 22:00s +# -1:00 Port -01/+00 1966 Oct 2 2:00s # End of rearguard section. - 0:00 Port WE%sT 1983 Sep 25 1:00s +# +# From Tim Parenti (2024-07-01): +# Decreto Regional 5/82/M, published 1982-04-03, established DST transitions at +# 0:00u, which for Madeira is equivalent to the mainland's rules (0:00s) at the +# time. It came into effect the day following its publication, Sunday +# 1982-04-04, thus resuming Madeira's DST practice about a week later than the +# mainland and the Azores. +# https://dre.pt/dr/detalhe/decreto-regional/5-1982-608273 +# +# Decreto Legislativo Regional 18/86/M, published 1986-10-01, adopted EU-style +# rules (1:00u) and entered into immediate force after being signed on +# 1986-07-31. +# https://dre.pt/dr/detalhe/decreto-legislativo-regional/18-1986-221705 + 0:00 - WET 1982 Apr 4 + 0:00 Port WE%sT 1986 Jul 31 0:00 EU WE%sT # Romania @@ -2433,7 +2619,7 @@ 2:00 Poland EE%sT 1946 Apr 7 3:00 Russia MSK/MSD 1989 Mar 26 2:00s 2:00 Russia EE%sT 2011 Mar 27 2:00s - 3:00 - +03 2014 Oct 26 2:00s + 3:00 - %z 2014 Oct 26 2:00s 2:00 - EET @@ -2683,14 +2869,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201602150056 Zone Europe/Astrakhan 3:12:12 - LMT 1924 May - 3:00 - +03 1930 Jun 21 - 4:00 Russia +04/+05 1989 Mar 26 2:00s - 3:00 Russia +03/+04 1991 Mar 31 2:00s - 4:00 - +04 1992 Mar 29 2:00s - 3:00 Russia +03/+04 2011 Mar 27 2:00s - 4:00 - +04 2014 Oct 26 2:00s - 3:00 - +03 2016 Mar 27 2:00s - 4:00 - +04 + 3:00 - %z 1930 Jun 21 + 4:00 Russia %z 1989 Mar 26 2:00s + 3:00 Russia %z 1991 Mar 31 2:00s + 4:00 - %z 1992 Mar 29 2:00s + 3:00 Russia %z 2011 Mar 27 2:00s + 4:00 - %z 2014 Oct 26 2:00s + 3:00 - %z 2016 Mar 27 2:00s + 4:00 - %z # From Paul Eggert (2016-11-11): # Europe/Volgograd covers: @@ -2720,15 +2906,15 @@ # http://publication.pravo.gov.ru/Document/View/0001202012220002 Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 - 3:00 - +03 1930 Jun 21 - 4:00 - +04 1961 Nov 11 - 4:00 Russia +04/+05 1988 Mar 27 2:00s + 3:00 - %z 1930 Jun 21 + 4:00 - %z 1961 Nov 11 + 4:00 Russia %z 1988 Mar 27 2:00s 3:00 Russia MSK/MSD 1991 Mar 31 2:00s - 4:00 - +04 1992 Mar 29 2:00s + 4:00 - %z 1992 Mar 29 2:00s 3:00 Russia MSK/MSD 2011 Mar 27 2:00s 4:00 - MSK 2014 Oct 26 2:00s 3:00 - MSK 2018 Oct 28 2:00s - 4:00 - +04 2020 Dec 27 2:00s + 4:00 - %z 2020 Dec 27 2:00s 3:00 - MSK # From Paul Eggert (2016-11-11): @@ -2743,14 +2929,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201611220031 Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u - 3:00 - +03 1930 Jun 21 - 4:00 Russia +04/+05 1988 Mar 27 2:00s - 3:00 Russia +03/+04 1991 Mar 31 2:00s - 4:00 - +04 1992 Mar 29 2:00s - 3:00 Russia +03/+04 2011 Mar 27 2:00s - 4:00 - +04 2014 Oct 26 2:00s - 3:00 - +03 2016 Dec 4 2:00s - 4:00 - +04 + 3:00 - %z 1930 Jun 21 + 4:00 Russia %z 1988 Mar 27 2:00s + 3:00 Russia %z 1991 Mar 31 2:00s + 4:00 - %z 1992 Mar 29 2:00s + 3:00 Russia %z 2011 Mar 27 2:00s + 4:00 - %z 2014 Oct 26 2:00s + 3:00 - %z 2016 Dec 4 2:00s + 4:00 - %z # From Paul Eggert (2016-03-18): # Europe/Kirov covers: @@ -2758,10 +2944,10 @@ # The 1989 transition is from USSR act No. 227 (1989-03-14). # Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 0:00u - 3:00 - +03 1930 Jun 21 - 4:00 Russia +04/+05 1989 Mar 26 2:00s + 3:00 - %z 1930 Jun 21 + 4:00 Russia %z 1989 Mar 26 2:00s 3:00 Russia MSK/MSD 1991 Mar 31 2:00s - 4:00 - +04 1992 Mar 29 2:00s + 4:00 - %z 1992 Mar 29 2:00s 3:00 Russia MSK/MSD 2011 Mar 27 2:00s 4:00 - MSK 2014 Oct 26 2:00s 3:00 - MSK @@ -2776,15 +2962,15 @@ # The 1989 transition is from USSR act No. 227 (1989-03-14). Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 0:00u - 3:00 - +03 1930 Jun 21 - 4:00 - +04 1935 Jan 27 - 4:00 Russia +04/+05 1989 Mar 26 2:00s - 3:00 Russia +03/+04 1991 Mar 31 2:00s - 2:00 Russia +02/+03 1991 Sep 29 2:00s - 3:00 - +03 1991 Oct 20 3:00 - 4:00 Russia +04/+05 2010 Mar 28 2:00s - 3:00 Russia +03/+04 2011 Mar 27 2:00s - 4:00 - +04 + 3:00 - %z 1930 Jun 21 + 4:00 - %z 1935 Jan 27 + 4:00 Russia %z 1989 Mar 26 2:00s + 3:00 Russia %z 1991 Mar 31 2:00s + 2:00 Russia %z 1991 Sep 29 2:00s + 3:00 - %z 1991 Oct 20 3:00 + 4:00 Russia %z 2010 Mar 28 2:00s + 3:00 Russia %z 2011 Mar 27 2:00s + 4:00 - %z # From Paul Eggert (2016-03-18): # Europe/Ulyanovsk covers: @@ -2800,14 +2986,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201603090051 Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 0:00u - 3:00 - +03 1930 Jun 21 - 4:00 Russia +04/+05 1989 Mar 26 2:00s - 3:00 Russia +03/+04 1991 Mar 31 2:00s - 2:00 Russia +02/+03 1992 Jan 19 2:00s - 3:00 Russia +03/+04 2011 Mar 27 2:00s - 4:00 - +04 2014 Oct 26 2:00s - 3:00 - +03 2016 Mar 27 2:00s - 4:00 - +04 + 3:00 - %z 1930 Jun 21 + 4:00 Russia %z 1989 Mar 26 2:00s + 3:00 Russia %z 1991 Mar 31 2:00s + 2:00 Russia %z 1992 Jan 19 2:00s + 3:00 Russia %z 2011 Mar 27 2:00s + 4:00 - %z 2014 Oct 26 2:00s + 3:00 - %z 2016 Mar 27 2:00s + 4:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25): # Asia/Yekaterinburg covers... @@ -2832,12 +3018,12 @@ #STDOFF 4:02:32.9 Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3 3:45:05 - PMT 1919 Jul 15 4:00 - 4:00 - +04 1930 Jun 21 - 5:00 Russia +05/+06 1991 Mar 31 2:00s - 4:00 Russia +04/+05 1992 Jan 19 2:00s - 5:00 Russia +05/+06 2011 Mar 27 2:00s - 6:00 - +06 2014 Oct 26 2:00s - 5:00 - +05 + 4:00 - %z 1930 Jun 21 + 5:00 Russia %z 1991 Mar 31 2:00s + 4:00 Russia %z 1992 Jan 19 2:00s + 5:00 Russia %z 2011 Mar 27 2:00s + 6:00 - %z 2014 Oct 26 2:00s + 5:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25): @@ -2847,12 +3033,12 @@ # Byalokoz 1919 says Omsk was 4:53:30. Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14 - 5:00 - +05 1930 Jun 21 - 6:00 Russia +06/+07 1991 Mar 31 2:00s - 5:00 Russia +05/+06 1992 Jan 19 2:00s - 6:00 Russia +06/+07 2011 Mar 27 2:00s - 7:00 - +07 2014 Oct 26 2:00s - 6:00 - +06 + 5:00 - %z 1930 Jun 21 + 6:00 Russia %z 1991 Mar 31 2:00s + 5:00 Russia %z 1992 Jan 19 2:00s + 6:00 Russia %z 2011 Mar 27 2:00s + 7:00 - %z 2014 Oct 26 2:00s + 6:00 - %z # From Paul Eggert (2016-02-22): # Asia/Barnaul covers: @@ -2885,14 +3071,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201603090038 Zone Asia/Barnaul 5:35:00 - LMT 1919 Dec 10 - 6:00 - +06 1930 Jun 21 - 7:00 Russia +07/+08 1991 Mar 31 2:00s - 6:00 Russia +06/+07 1992 Jan 19 2:00s - 7:00 Russia +07/+08 1995 May 28 - 6:00 Russia +06/+07 2011 Mar 27 2:00s - 7:00 - +07 2014 Oct 26 2:00s - 6:00 - +06 2016 Mar 27 2:00s - 7:00 - +07 + 6:00 - %z 1930 Jun 21 + 7:00 Russia %z 1991 Mar 31 2:00s + 6:00 Russia %z 1992 Jan 19 2:00s + 7:00 Russia %z 1995 May 28 + 6:00 Russia %z 2011 Mar 27 2:00s + 7:00 - %z 2014 Oct 26 2:00s + 6:00 - %z 2016 Mar 27 2:00s + 7:00 - %z # From Paul Eggert (2016-03-18): # Asia/Novosibirsk covers: @@ -2906,14 +3092,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201607040064 Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00 - 6:00 - +06 1930 Jun 21 - 7:00 Russia +07/+08 1991 Mar 31 2:00s - 6:00 Russia +06/+07 1992 Jan 19 2:00s - 7:00 Russia +07/+08 1993 May 23 # say Shanks & P. - 6:00 Russia +06/+07 2011 Mar 27 2:00s - 7:00 - +07 2014 Oct 26 2:00s - 6:00 - +06 2016 Jul 24 2:00s - 7:00 - +07 + 6:00 - %z 1930 Jun 21 + 7:00 Russia %z 1991 Mar 31 2:00s + 6:00 Russia %z 1992 Jan 19 2:00s + 7:00 Russia %z 1993 May 23 # say Shanks & P. + 6:00 Russia %z 2011 Mar 27 2:00s + 7:00 - %z 2014 Oct 26 2:00s + 6:00 - %z 2016 Jul 24 2:00s + 7:00 - %z # From Paul Eggert (2016-03-18): # Asia/Tomsk covers: @@ -2958,14 +3144,14 @@ # http://publication.pravo.gov.ru/Document/View/0001201604260048 Zone Asia/Tomsk 5:39:51 - LMT 1919 Dec 22 - 6:00 - +06 1930 Jun 21 - 7:00 Russia +07/+08 1991 Mar 31 2:00s - 6:00 Russia +06/+07 1992 Jan 19 2:00s - 7:00 Russia +07/+08 2002 May 1 3:00 - 6:00 Russia +06/+07 2011 Mar 27 2:00s - 7:00 - +07 2014 Oct 26 2:00s - 6:00 - +06 2016 May 29 2:00s - 7:00 - +07 + 6:00 - %z 1930 Jun 21 + 7:00 Russia %z 1991 Mar 31 2:00s + 6:00 Russia %z 1992 Jan 19 2:00s + 7:00 Russia %z 2002 May 1 3:00 + 6:00 Russia %z 2011 Mar 27 2:00s + 7:00 - %z 2014 Oct 26 2:00s + 6:00 - %z 2016 May 29 2:00s + 7:00 - %z # From Tim Parenti (2014-07-03): @@ -2996,12 +3182,12 @@ # realigning itself with KRAT. Zone Asia/Novokuznetsk 5:48:48 - LMT 1924 May 1 - 6:00 - +06 1930 Jun 21 - 7:00 Russia +07/+08 1991 Mar 31 2:00s - 6:00 Russia +06/+07 1992 Jan 19 2:00s - 7:00 Russia +07/+08 2010 Mar 28 2:00s - 6:00 Russia +06/+07 2011 Mar 27 2:00s - 7:00 - +07 + 6:00 - %z 1930 Jun 21 + 7:00 Russia %z 1991 Mar 31 2:00s + 6:00 Russia %z 1992 Jan 19 2:00s + 7:00 Russia %z 2010 Mar 28 2:00s + 6:00 Russia %z 2011 Mar 27 2:00s + 7:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25): # Asia/Krasnoyarsk covers... @@ -3015,12 +3201,12 @@ # Byalokoz 1919 says Krasnoyarsk was 6:11:26. Zone Asia/Krasnoyarsk 6:11:26 - LMT 1920 Jan 6 - 6:00 - +06 1930 Jun 21 - 7:00 Russia +07/+08 1991 Mar 31 2:00s - 6:00 Russia +06/+07 1992 Jan 19 2:00s - 7:00 Russia +07/+08 2011 Mar 27 2:00s - 8:00 - +08 2014 Oct 26 2:00s - 7:00 - +07 + 6:00 - %z 1930 Jun 21 + 7:00 Russia %z 1991 Mar 31 2:00s + 6:00 Russia %z 1992 Jan 19 2:00s + 7:00 Russia %z 2011 Mar 27 2:00s + 8:00 - %z 2014 Oct 26 2:00s + 7:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25): @@ -3037,12 +3223,12 @@ Zone Asia/Irkutsk 6:57:05 - LMT 1880 6:57:05 - IMT 1920 Jan 25 # Irkutsk Mean Time - 7:00 - +07 1930 Jun 21 - 8:00 Russia +08/+09 1991 Mar 31 2:00s - 7:00 Russia +07/+08 1992 Jan 19 2:00s - 8:00 Russia +08/+09 2011 Mar 27 2:00s - 9:00 - +09 2014 Oct 26 2:00s - 8:00 - +08 + 7:00 - %z 1930 Jun 21 + 8:00 Russia %z 1991 Mar 31 2:00s + 7:00 Russia %z 1992 Jan 19 2:00s + 8:00 Russia %z 2011 Mar 27 2:00s + 9:00 - %z 2014 Oct 26 2:00s + 8:00 - %z # From Tim Parenti (2014-07-06): @@ -3059,13 +3245,13 @@ # http://publication.pravo.gov.ru/Document/View/0001201512300107 Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15 - 8:00 - +08 1930 Jun 21 - 9:00 Russia +09/+10 1991 Mar 31 2:00s - 8:00 Russia +08/+09 1992 Jan 19 2:00s - 9:00 Russia +09/+10 2011 Mar 27 2:00s - 10:00 - +10 2014 Oct 26 2:00s - 8:00 - +08 2016 Mar 27 2:00 - 9:00 - +09 + 8:00 - %z 1930 Jun 21 + 9:00 Russia %z 1991 Mar 31 2:00s + 8:00 Russia %z 1992 Jan 19 2:00s + 9:00 Russia %z 2011 Mar 27 2:00s + 10:00 - %z 2014 Oct 26 2:00s + 8:00 - %z 2016 Mar 27 2:00 + 9:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3105,12 +3291,12 @@ # Byalokoz 1919 says Yakutsk was 8:38:58. Zone Asia/Yakutsk 8:38:58 - LMT 1919 Dec 15 - 8:00 - +08 1930 Jun 21 - 9:00 Russia +09/+10 1991 Mar 31 2:00s - 8:00 Russia +08/+09 1992 Jan 19 2:00s - 9:00 Russia +09/+10 2011 Mar 27 2:00s - 10:00 - +10 2014 Oct 26 2:00s - 9:00 - +09 + 8:00 - %z 1930 Jun 21 + 9:00 Russia %z 1991 Mar 31 2:00s + 8:00 Russia %z 1992 Jan 19 2:00s + 9:00 Russia %z 2011 Mar 27 2:00s + 10:00 - %z 2014 Oct 26 2:00s + 9:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3128,12 +3314,12 @@ # Go with Byalokoz. Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15 - 9:00 - +09 1930 Jun 21 - 10:00 Russia +10/+11 1991 Mar 31 2:00s - 9:00 Russia +09/+10 1992 Jan 19 2:00s - 10:00 Russia +10/+11 2011 Mar 27 2:00s - 11:00 - +11 2014 Oct 26 2:00s - 10:00 - +10 + 9:00 - %z 1930 Jun 21 + 10:00 Russia %z 1991 Mar 31 2:00s + 9:00 Russia %z 1992 Jan 19 2:00s + 10:00 Russia %z 2011 Mar 27 2:00s + 11:00 - %z 2014 Oct 26 2:00s + 10:00 - %z # From Tim Parenti (2014-07-03): @@ -3151,14 +3337,14 @@ # This transition is no doubt wrong, but we have no better info. Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15 - 8:00 - +08 1930 Jun 21 - 9:00 Russia +09/+10 1991 Mar 31 2:00s - 8:00 Russia +08/+09 1992 Jan 19 2:00s - 9:00 Russia +09/+10 2004 - 10:00 Russia +10/+11 2011 Mar 27 2:00s - 11:00 - +11 2011 Sep 13 0:00s # Decree 725? - 10:00 - +10 2014 Oct 26 2:00s - 9:00 - +09 + 8:00 - %z 1930 Jun 21 + 9:00 Russia %z 1991 Mar 31 2:00s + 8:00 Russia %z 1992 Jan 19 2:00s + 9:00 Russia %z 2004 + 10:00 Russia %z 2011 Mar 27 2:00s + 11:00 - %z 2011 Sep 13 0:00s # Decree 725? + 10:00 - %z 2014 Oct 26 2:00s + 9:00 - %z # From Tim Parenti (2014-07-03): @@ -3174,14 +3360,14 @@ # The Zone name should be Asia/Yuzhno-Sakhalinsk, but that's too long. Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23 - 9:00 - +09 1945 Aug 25 - 11:00 Russia +11/+12 1991 Mar 31 2:00s # Sakhalin T - 10:00 Russia +10/+11 1992 Jan 19 2:00s - 11:00 Russia +11/+12 1997 Mar lastSun 2:00s - 10:00 Russia +10/+11 2011 Mar 27 2:00s - 11:00 - +11 2014 Oct 26 2:00s - 10:00 - +10 2016 Mar 27 2:00s - 11:00 - +11 + 9:00 - %z 1945 Aug 25 + 11:00 Russia %z 1991 Mar 31 2:00s # Sakhalin T + 10:00 Russia %z 1992 Jan 19 2:00s + 11:00 Russia %z 1997 Mar lastSun 2:00s + 10:00 Russia %z 2011 Mar 27 2:00s + 11:00 - %z 2014 Oct 26 2:00s + 10:00 - %z 2016 Mar 27 2:00s + 11:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3204,13 +3390,13 @@ # http://publication.pravo.gov.ru/Document/View/0001201604050038 Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 - 10:00 - +10 1930 Jun 21 # Magadan Time - 11:00 Russia +11/+12 1991 Mar 31 2:00s - 10:00 Russia +10/+11 1992 Jan 19 2:00s - 11:00 Russia +11/+12 2011 Mar 27 2:00s - 12:00 - +12 2014 Oct 26 2:00s - 10:00 - +10 2016 Apr 24 2:00s - 11:00 - +11 + 10:00 - %z 1930 Jun 21 # Magadan Time + 11:00 Russia %z 1991 Mar 31 2:00s + 10:00 Russia %z 1992 Jan 19 2:00s + 11:00 Russia %z 2011 Mar 27 2:00s + 12:00 - %z 2014 Oct 26 2:00s + 10:00 - %z 2016 Apr 24 2:00s + 11:00 - %z # From Tim Parenti (2014-07-06): @@ -3255,12 +3441,12 @@ # Go with Srednekolymsk. Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2 - 10:00 - +10 1930 Jun 21 - 11:00 Russia +11/+12 1991 Mar 31 2:00s - 10:00 Russia +10/+11 1992 Jan 19 2:00s - 11:00 Russia +11/+12 2011 Mar 27 2:00s - 12:00 - +12 2014 Oct 26 2:00s - 11:00 - +11 + 10:00 - %z 1930 Jun 21 + 11:00 Russia %z 1991 Mar 31 2:00s + 10:00 Russia %z 1992 Jan 19 2:00s + 11:00 Russia %z 2011 Mar 27 2:00s + 12:00 - %z 2014 Oct 26 2:00s + 11:00 - %z # From Tim Parenti (2014-07-03): @@ -3278,14 +3464,14 @@ # UTC+12 since at least then, too. Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15 - 8:00 - +08 1930 Jun 21 - 9:00 Russia +09/+10 1981 Apr 1 - 11:00 Russia +11/+12 1991 Mar 31 2:00s - 10:00 Russia +10/+11 1992 Jan 19 2:00s - 11:00 Russia +11/+12 2011 Mar 27 2:00s - 12:00 - +12 2011 Sep 13 0:00s # Decree 725? - 11:00 - +11 2014 Oct 26 2:00s - 10:00 - +10 + 8:00 - %z 1930 Jun 21 + 9:00 Russia %z 1981 Apr 1 + 11:00 Russia %z 1991 Mar 31 2:00s + 10:00 Russia %z 1992 Jan 19 2:00s + 11:00 Russia %z 2011 Mar 27 2:00s + 12:00 - %z 2011 Sep 13 0:00s # Decree 725? + 11:00 - %z 2014 Oct 26 2:00s + 10:00 - %z # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25): @@ -3298,12 +3484,12 @@ # The Zone name should be Asia/Petropavlovsk-Kamchatski or perhaps # Asia/Petropavlovsk-Kamchatsky, but these are too long. Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10 - 11:00 - +11 1930 Jun 21 - 12:00 Russia +12/+13 1991 Mar 31 2:00s - 11:00 Russia +11/+12 1992 Jan 19 2:00s - 12:00 Russia +12/+13 2010 Mar 28 2:00s - 11:00 Russia +11/+12 2011 Mar 27 2:00s - 12:00 - +12 + 11:00 - %z 1930 Jun 21 + 12:00 Russia %z 1991 Mar 31 2:00s + 11:00 Russia %z 1992 Jan 19 2:00s + 12:00 Russia %z 2010 Mar 28 2:00s + 11:00 Russia %z 2011 Mar 27 2:00s + 12:00 - %z # From Tim Parenti (2014-07-03): @@ -3311,13 +3497,13 @@ # 87 RU-CHU Chukotka Autonomous Okrug Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 - 12:00 - +12 1930 Jun 21 - 13:00 Russia +13/+14 1982 Apr 1 0:00s - 12:00 Russia +12/+13 1991 Mar 31 2:00s - 11:00 Russia +11/+12 1992 Jan 19 2:00s - 12:00 Russia +12/+13 2010 Mar 28 2:00s - 11:00 Russia +11/+12 2011 Mar 27 2:00s - 12:00 - +12 + 12:00 - %z 1930 Jun 21 + 13:00 Russia %z 1982 Apr 1 0:00s + 12:00 Russia %z 1991 Mar 31 2:00s + 11:00 Russia %z 1992 Jan 19 2:00s + 12:00 Russia %z 2010 Mar 28 2:00s + 11:00 Russia %z 2011 Mar 27 2:00s + 12:00 - %z # Bosnia & Herzegovina # Croatia @@ -3436,7 +3622,7 @@ 1:00 - CET 1986 1:00 EU CE%sT Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C. - -1:00 - -01 1946 Sep 30 1:00 + -1:00 - %z 1946 Sep 30 1:00 0:00 - WET 1980 Apr 6 0:00s 0:00 1:00 WEST 1980 Sep 28 1:00u 0:00 EU WE%sT @@ -3517,8 +3703,8 @@ # but if no one is present after 11 at night, could be postponed until one # hour before the beginning of service. -# From Paul Eggert (2013-09-11): -# Round BMT to the nearest even second, 0:29:46. +# From Paul Eggert (2024-05-24): +# Express BMT as 0:29:45.500, approximately the same precision 7° 26' 22.50". # # We can find no reliable source for Shanks's assertion that all of Switzerland # except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book: @@ -3557,6 +3743,7 @@ Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. + #STDOFF 0:29:45.500 0:29:46 - BMT 1894 Jun # Bern Mean Time 1:00 Swiss CE%sT 1981 1:00 EU CE%sT @@ -3754,7 +3941,7 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 1:56:56 - IMT 1910 Oct # Istanbul Mean Time? 2:00 Turkey EE%sT 1978 Jun 29 - 3:00 Turkey +03/+04 1984 Nov 1 2:00 + 3:00 Turkey %z 1984 Nov 1 2:00 2:00 Turkey EE%sT 2007 2:00 EU EE%sT 2011 Mar 27 1:00u 2:00 - EET 2011 Mar 28 1:00u @@ -3763,7 +3950,7 @@ 2:00 EU EE%sT 2015 Oct 25 1:00u 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT 2016 Sep 7 - 3:00 - +03 + 3:00 - %z # Ukraine # diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/leapseconds openjdk-17-17.0.14+7/make/data/tzdata/leapseconds --- openjdk-17-17.0.13+11/make/data/tzdata/leapseconds 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/leapseconds 2025-01-04 20:25:18.000000000 +0000 @@ -92,11 +92,11 @@ # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2024 Dec 28 00:00:00 +#Expires 2025 Jun 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1704708379 (2024-01-08 10:06:19 UTC) -#expires 1735344000 (2024-12-28 00:00:00 UTC) +#updated 1720104763 (2024-07-04 14:52:43 UTC) +#expires 1751068800 (2025-06-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 December 2024 +# File expires on 28 June 2025 diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/northamerica openjdk-17-17.0.14+7/make/data/tzdata/northamerica --- openjdk-17-17.0.13+11/make/data/tzdata/northamerica 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/northamerica 2025-01-04 20:25:18.000000000 +0000 @@ -208,26 +208,6 @@ Rule US 2007 max - Mar Sun>=8 2:00 1:00 D Rule US 2007 max - Nov Sun>=1 2:00 0 S -# From Arthur David Olson, 2005-12-19 -# We generate the files specified below to guard against old files with -# obsolete information being left in the time zone binary directory. -# We limit the list to names that have appeared in previous versions of -# this time zone package. -# We do these as separate Zones rather than as Links to avoid problems if -# a particular place changes whether it observes DST. -# We put these specifications here in the northamerica file both to -# increase the chances that they'll actually get compiled and to -# avoid the need to duplicate the US rules in another file. - -# Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone EST -5:00 - EST -Zone MST -7:00 - MST -Zone HST -10:00 - HST -Zone EST5EDT -5:00 US E%sT -Zone CST6CDT -6:00 US C%sT -Zone MST7MDT -7:00 US M%sT -Zone PST8PDT -8:00 US P%sT - # From U. S. Naval Observatory (1989-01-19): # USA EASTERN 5 H BEHIND UTC NEW YORK, WASHINGTON # USA EASTERN 4 H BEHIND UTC APR 3 - OCT 30 @@ -2396,6 +2376,81 @@ # the researchers who prepared the Decrees page failed to find some of # the relevant documents. +# From Heitor David Pinto (2024-08-04): +# In 1931, the decree implementing DST specified that it would take +# effect on 30 April.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=192270&pagina=2&seccion=1 +# +# In 1981, the decree changing Campeche, Yucatán and Quintana Roo to UTC-5 +# specified that it would enter into force on 26 December 1981 at 2:00.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4705667&fecha=23/12/1981&cod_diario=202796 +# +# In 1982, the decree returning Campeche and Yucatán to UTC-6 specified that +# it would enter into force on 2 November 1982 at 2:00.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=205689&pagina=3&seccion=0 +# +# Quintana Roo changed to UTC-6 on 4 January 1983 at 0:00, and again +# to UTC-5 on 26 October 1997 at 2:00.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4787355&fecha=28/12/1982&cod_diario=206112 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=209559&pagina=15&seccion=0 +# +# Durango, Coahuila, Nuevo León and Tamaulipas were set to UTC-7 on 1 January +# 1922, and changed to UTC-6 on 10 June 1927. Then Durango, Coahuila and +# Nuevo León (but not Tamaulipas) returned to UTC-7 on 15 November 1930, +# observed DST in 1931, and changed again to UTC-6 on 1 April 1932.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4441846&fecha=29/12/1921&cod_diario=187468 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4541520&fecha=09/06/1927&cod_diario=193920 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4491963&fecha=15/11/1930&cod_diario=190835 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4418437&fecha=21/01/1932&cod_diario=185588 +# +# ... the ... 10 June 1927 ... decree only said 10 June 1927, without +# specifying a time, so I suppose that it should be considered at 0:00. +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4541520&fecha=09/06/1927&cod_diario=193920 +# +# In 1942, the decree changing Baja California, Baja California Sur, Sonora, +# Sinaloa and Nayarit to UTC-7 was published on 24 April, but it said that it +# would apply from 1 April, so it's unclear when the change actually +# occurred. The database currently shows 24 April 1942. +# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=192203&pagina=2&seccion=1 +# +# Baja California Sur, Sonora, Sinaloa and Nayarit never used UTC-8. The ... +# 14 January 1949 ... change [to UTC-8] only occurred in Baja California. +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4515613&fecha=13/01/1949&cod_diario=192309 +# +# In 1945, the decree changing Baja California to UTC-8 specified that it +# would take effect on the third day from its publication. +# It was published on 12 November, so it would take effect on 15 November.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4555049&fecha=12/11/1945&cod_diario=194763 +# +# In 1948, the decree changing Baja California to UTC-7 specified that it +# would take effect on "this date". The decree was made on 13 March, +# but published on 5 April, so it's unclear when the change actually occurred. +# The database currently shows 5 April 1948. +# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=188624&pagina=2&seccion=0 +# +# In 1949, the decree changing Baja California to UTC-8 was published on 13 +# January, but it said that it would apply from 1 January, so it's unclear when +# the change actually occurred. The database currently shows 14 January 1949. +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4515613&fecha=13/01/1949&cod_diario=192309 +# +# Baja California also observed UTC-7 from 1 May to 24 September 1950, +# from 29 April to 30 September 1951 at 2:00, +# and from 27 April to 28 September 1952 at 2:00.... +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4600403&fecha=29/04/1950&cod_diario=197505 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4623553&fecha=23/09/1950&cod_diario=198805 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4469444&fecha=27/04/1951&cod_diario=189317 +# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4533868&fecha=10/03/1952&cod_diario=193465 +# +# All changes in Baja California from 1948 to 1952 match those in California, +# on the same dates or with a difference of one day. +# So it may be easier to implement these changes as DST with rule CA +# during this whole period. +# +# From Paul Eggert (2024-08-18): +# For now, maintain the slightly-different history for Baja California, +# as we have no information on whether 1948/1952 clocks in Tijuana followed +# the decrees or followed San Diego. + # From Alan Perry (1996-02-15): # A guy from our Mexico subsidiary finally found the Presidential Decree # outlining the timezone changes in Mexico. @@ -2599,7 +2654,7 @@ # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - May 1 23:00 1:00 D +Rule Mexico 1931 only - April 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2618,14 +2673,16 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] # Quintana Roo; represented by Cancún Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 6:00u - -6:00 - CST 1981 Dec 23 + -6:00 - CST 1981 Dec 26 2:00 + -5:00 - EST 1983 Jan 4 0:00 + -6:00 Mexico C%sT 1997 Oct 26 2:00 -5:00 Mexico E%sT 1998 Aug 2 2:00 -6:00 Mexico C%sT 2015 Feb 1 2:00 -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u - -6:00 - CST 1981 Dec 23 - -5:00 - EST 1982 Dec 2 + -6:00 - CST 1981 Dec 26 2:00 + -5:00 - EST 1982 Nov 2 2:00 -6:00 Mexico C%sT # Coahuila, Nuevo León, Tamaulipas (near US border) # This includes the following municipios: @@ -2642,12 +2699,15 @@ -6:00 US C%sT # Durango; Coahuila, Nuevo León, Tamaulipas (away from US border) Zone America/Monterrey -6:41:16 - LMT 1922 Jan 1 6:00u + -7:00 - MST 1927 Jun 10 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1988 -6:00 US C%sT 1989 -6:00 Mexico C%sT # Central Mexico Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 Mexico C%sT 2001 Sep 30 2:00 @@ -2658,7 +2718,7 @@ # Práxedis G Guerrero. # http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1996 @@ -2673,7 +2733,7 @@ # Benavides. # http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1996 @@ -2685,7 +2745,7 @@ -6:00 US C%sT # Chihuahua (away from US border) Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1996 @@ -2695,23 +2755,21 @@ -6:00 - CST # Sonora Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 + -7:00 - MST 1996 -7:00 Mexico M%sT 1999 -7:00 - MST # Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 + -7:00 - MST 1970 -7:00 Mexico M%sT # Bahía de Banderas @@ -2744,27 +2802,32 @@ # Use "Bahia_Banderas" to keep the name to fourteen characters. Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 + -7:00 - MST 1927 Jun 10 -6:00 - CST 1930 Nov 15 -7:00 Mexico M%sT 1932 Apr 1 -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 + -7:00 - MST 1970 -7:00 Mexico M%sT 2010 Apr 4 2:00 -6:00 Mexico C%sT # Baja California Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u -7:00 - MST 1924 - -8:00 - PST 1927 Jun 10 23:00 + -8:00 - PST 1927 Jun 10 -7:00 - MST 1930 Nov 15 -8:00 - PST 1931 Apr 1 -8:00 1:00 PDT 1931 Sep 30 -8:00 - PST 1942 Apr 24 -8:00 1:00 PWT 1945 Aug 14 23:00u - -8:00 1:00 PPT 1945 Nov 12 # Peace + -8:00 1:00 PPT 1945 Nov 15 # Peace -8:00 - PST 1948 Apr 5 -8:00 1:00 PDT 1949 Jan 14 + -8:00 - PST 1950 May 1 + -8:00 1:00 PDT 1950 Sep 24 + -8:00 - PST 1951 Apr 29 2:00 + -8:00 1:00 PDT 1951 Sep 30 2:00 + -8:00 - PST 1952 Apr 27 2:00 + -8:00 1:00 PDT 1952 Sep 28 2:00 -8:00 - PST 1954 -8:00 CA P%sT 1961 -8:00 - PST 1976 @@ -3573,8 +3636,8 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Miquelon -3:44:40 - LMT 1911 Jun 15 # St Pierre -4:00 - AST 1980 May - -3:00 - -03 1987 - -3:00 Canada -03/-02 + -3:00 - %z 1987 + -3:00 Canada %z # Turks and Caicos # diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/southamerica openjdk-17-17.0.14+7/make/data/tzdata/southamerica --- openjdk-17-17.0.13+11/make/data/tzdata/southamerica 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/southamerica 2025-01-04 20:25:18.000000000 +0000 @@ -425,11 +425,11 @@ Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May # Córdoba Mean Time - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 Arg -03/-02 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 Arg %z # # Córdoba (CB), Santa Fe (SF), Entre Ríos (ER), Corrientes (CN), Misiones (MN), # Chaco (CC), Formosa (FM), Santiago del Estero (SE) @@ -444,120 +444,120 @@ #STDOFF -4:16:48.25 Zone America/Argentina/Cordoba -4:16:48 - LMT 1894 Oct 31 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 3 - -4:00 - -04 1991 Oct 20 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 Arg -03/-02 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 3 + -4:00 - %z 1991 Oct 20 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 Arg %z # # Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN) Zone America/Argentina/Salta -4:21:40 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 3 - -4:00 - -04 1991 Oct 20 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 3 + -4:00 - %z 1991 Oct 20 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # Tucumán (TM) Zone America/Argentina/Tucuman -4:20:52 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 3 - -4:00 - -04 1991 Oct 20 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 Jun 1 - -4:00 - -04 2004 Jun 13 - -3:00 Arg -03/-02 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 3 + -4:00 - %z 1991 Oct 20 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 Jun 1 + -4:00 - %z 2004 Jun 13 + -3:00 Arg %z # # La Rioja (LR) Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 1 - -4:00 - -04 1991 May 7 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 Jun 1 - -4:00 - -04 2004 Jun 20 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 1 + -4:00 - %z 1991 May 7 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 Jun 1 + -4:00 - %z 2004 Jun 20 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # San Juan (SJ) Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 1 - -4:00 - -04 1991 May 7 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 May 31 - -4:00 - -04 2004 Jul 25 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 1 + -4:00 - %z 1991 May 7 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 May 31 + -4:00 - %z 2004 Jul 25 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # Jujuy (JY) Zone America/Argentina/Jujuy -4:21:12 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1990 Mar 4 - -4:00 - -04 1990 Oct 28 - -4:00 1:00 -03 1991 Mar 17 - -4:00 - -04 1991 Oct 6 - -3:00 1:00 -02 1992 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1990 Mar 4 + -4:00 - %z 1990 Oct 28 + -4:00 1:00 %z 1991 Mar 17 + -4:00 - %z 1991 Oct 6 + -3:00 1:00 %z 1992 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # Catamarca (CT), Chubut (CH) Zone America/Argentina/Catamarca -4:23:08 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1991 Mar 3 - -4:00 - -04 1991 Oct 20 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 Jun 1 - -4:00 - -04 2004 Jun 20 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1991 Mar 3 + -4:00 - %z 1991 Oct 20 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 Jun 1 + -4:00 - %z 2004 Jun 20 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # Mendoza (MZ) Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1990 Mar 4 - -4:00 - -04 1990 Oct 15 - -4:00 1:00 -03 1991 Mar 1 - -4:00 - -04 1991 Oct 15 - -4:00 1:00 -03 1992 Mar 1 - -4:00 - -04 1992 Oct 18 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 May 23 - -4:00 - -04 2004 Sep 26 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1990 Mar 4 + -4:00 - %z 1990 Oct 15 + -4:00 1:00 %z 1991 Mar 1 + -4:00 - %z 1991 Oct 15 + -4:00 1:00 %z 1992 Mar 1 + -4:00 - %z 1992 Oct 18 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 May 23 + -4:00 - %z 2004 Sep 26 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # San Luis (SL) @@ -567,53 +567,53 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1990 - -3:00 1:00 -02 1990 Mar 14 - -4:00 - -04 1990 Oct 15 - -4:00 1:00 -03 1991 Mar 1 - -4:00 - -04 1991 Jun 1 - -3:00 - -03 1999 Oct 3 - -4:00 1:00 -03 2000 Mar 3 - -3:00 - -03 2004 May 31 - -4:00 - -04 2004 Jul 25 - -3:00 Arg -03/-02 2008 Jan 21 - -4:00 SanLuis -04/-03 2009 Oct 11 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1990 + -3:00 1:00 %z 1990 Mar 14 + -4:00 - %z 1990 Oct 15 + -4:00 1:00 %z 1991 Mar 1 + -4:00 - %z 1991 Jun 1 + -3:00 - %z 1999 Oct 3 + -4:00 1:00 %z 2000 Mar 3 + -3:00 - %z 2004 May 31 + -4:00 - %z 2004 Jul 25 + -3:00 Arg %z 2008 Jan 21 + -4:00 SanLuis %z 2009 Oct 11 + -3:00 - %z # # Santa Cruz (SC) Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 Jun 1 - -4:00 - -04 2004 Jun 20 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 Jun 1 + -4:00 - %z 2004 Jun 20 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # # Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF) Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31 #STDOFF -4:16:48.25 -4:16:48 - CMT 1920 May - -4:00 - -04 1930 Dec - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1999 Oct 3 - -4:00 Arg -04/-03 2000 Mar 3 - -3:00 - -03 2004 May 30 - -4:00 - -04 2004 Jun 20 - -3:00 Arg -03/-02 2008 Oct 18 - -3:00 - -03 + -4:00 - %z 1930 Dec + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1999 Oct 3 + -4:00 Arg %z 2000 Mar 3 + -3:00 - %z 2004 May 30 + -4:00 - %z 2004 Jun 20 + -3:00 Arg %z 2008 Oct 18 + -3:00 - %z # Bolivia # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/La_Paz -4:32:36 - LMT 1890 -4:32:36 - CMT 1931 Oct 15 # Calamarca MT -4:32:36 1:00 BST 1932 Mar 21 # Bolivia ST - -4:00 - -04 + -4:00 - %z # Brazil @@ -984,12 +984,12 @@ # # Fernando de Noronha (administratively part of PE) Zone America/Noronha -2:09:40 - LMT 1914 - -2:00 Brazil -02/-01 1990 Sep 17 - -2:00 - -02 1999 Sep 30 - -2:00 Brazil -02/-01 2000 Oct 15 - -2:00 - -02 2001 Sep 13 - -2:00 Brazil -02/-01 2002 Oct 1 - -2:00 - -02 + -2:00 Brazil %z 1990 Sep 17 + -2:00 - %z 1999 Sep 30 + -2:00 Brazil %z 2000 Oct 15 + -2:00 - %z 2001 Sep 13 + -2:00 Brazil %z 2002 Oct 1 + -2:00 - %z # Other Atlantic islands have no permanent settlement. # These include Trindade and Martim Vaz (administratively part of ES), # Rocas Atoll (RN), and the St Peter and St Paul Archipelago (PE). @@ -1002,119 +1002,119 @@ # In the north a very small part from the river Javary (now Jari I guess, # the border with Amapá) to the Amazon, then to the Xingu. Zone America/Belem -3:13:56 - LMT 1914 - -3:00 Brazil -03/-02 1988 Sep 12 - -3:00 - -03 + -3:00 Brazil %z 1988 Sep 12 + -3:00 - %z # # west Pará (PA) # West Pará includes Altamira, Óbidos, Prainha, Oriximiná, and Santarém. Zone America/Santarem -3:38:48 - LMT 1914 - -4:00 Brazil -04/-03 1988 Sep 12 - -4:00 - -04 2008 Jun 24 0:00 - -3:00 - -03 + -4:00 Brazil %z 1988 Sep 12 + -4:00 - %z 2008 Jun 24 0:00 + -3:00 - %z # # Maranhão (MA), Piauí (PI), Ceará (CE), Rio Grande do Norte (RN), # Paraíba (PB) Zone America/Fortaleza -2:34:00 - LMT 1914 - -3:00 Brazil -03/-02 1990 Sep 17 - -3:00 - -03 1999 Sep 30 - -3:00 Brazil -03/-02 2000 Oct 22 - -3:00 - -03 2001 Sep 13 - -3:00 Brazil -03/-02 2002 Oct 1 - -3:00 - -03 + -3:00 Brazil %z 1990 Sep 17 + -3:00 - %z 1999 Sep 30 + -3:00 Brazil %z 2000 Oct 22 + -3:00 - %z 2001 Sep 13 + -3:00 Brazil %z 2002 Oct 1 + -3:00 - %z # # Pernambuco (PE) (except Atlantic islands) Zone America/Recife -2:19:36 - LMT 1914 - -3:00 Brazil -03/-02 1990 Sep 17 - -3:00 - -03 1999 Sep 30 - -3:00 Brazil -03/-02 2000 Oct 15 - -3:00 - -03 2001 Sep 13 - -3:00 Brazil -03/-02 2002 Oct 1 - -3:00 - -03 + -3:00 Brazil %z 1990 Sep 17 + -3:00 - %z 1999 Sep 30 + -3:00 Brazil %z 2000 Oct 15 + -3:00 - %z 2001 Sep 13 + -3:00 Brazil %z 2002 Oct 1 + -3:00 - %z # # Tocantins (TO) Zone America/Araguaina -3:12:48 - LMT 1914 - -3:00 Brazil -03/-02 1990 Sep 17 - -3:00 - -03 1995 Sep 14 - -3:00 Brazil -03/-02 2003 Sep 24 - -3:00 - -03 2012 Oct 21 - -3:00 Brazil -03/-02 2013 Sep - -3:00 - -03 + -3:00 Brazil %z 1990 Sep 17 + -3:00 - %z 1995 Sep 14 + -3:00 Brazil %z 2003 Sep 24 + -3:00 - %z 2012 Oct 21 + -3:00 Brazil %z 2013 Sep + -3:00 - %z # # Alagoas (AL), Sergipe (SE) Zone America/Maceio -2:22:52 - LMT 1914 - -3:00 Brazil -03/-02 1990 Sep 17 - -3:00 - -03 1995 Oct 13 - -3:00 Brazil -03/-02 1996 Sep 4 - -3:00 - -03 1999 Sep 30 - -3:00 Brazil -03/-02 2000 Oct 22 - -3:00 - -03 2001 Sep 13 - -3:00 Brazil -03/-02 2002 Oct 1 - -3:00 - -03 + -3:00 Brazil %z 1990 Sep 17 + -3:00 - %z 1995 Oct 13 + -3:00 Brazil %z 1996 Sep 4 + -3:00 - %z 1999 Sep 30 + -3:00 Brazil %z 2000 Oct 22 + -3:00 - %z 2001 Sep 13 + -3:00 Brazil %z 2002 Oct 1 + -3:00 - %z # # Bahia (BA) # There are too many Salvadors elsewhere, so use America/Bahia instead # of America/Salvador. Zone America/Bahia -2:34:04 - LMT 1914 - -3:00 Brazil -03/-02 2003 Sep 24 - -3:00 - -03 2011 Oct 16 - -3:00 Brazil -03/-02 2012 Oct 21 - -3:00 - -03 + -3:00 Brazil %z 2003 Sep 24 + -3:00 - %z 2011 Oct 16 + -3:00 Brazil %z 2012 Oct 21 + -3:00 - %z # # Goiás (GO), Distrito Federal (DF), Minas Gerais (MG), # Espírito Santo (ES), Rio de Janeiro (RJ), São Paulo (SP), Paraná (PR), # Santa Catarina (SC), Rio Grande do Sul (RS) Zone America/Sao_Paulo -3:06:28 - LMT 1914 - -3:00 Brazil -03/-02 1963 Oct 23 0:00 - -3:00 1:00 -02 1964 - -3:00 Brazil -03/-02 + -3:00 Brazil %z 1963 Oct 23 0:00 + -3:00 1:00 %z 1964 + -3:00 Brazil %z # # Mato Grosso do Sul (MS) Zone America/Campo_Grande -3:38:28 - LMT 1914 - -4:00 Brazil -04/-03 + -4:00 Brazil %z # # Mato Grosso (MT) Zone America/Cuiaba -3:44:20 - LMT 1914 - -4:00 Brazil -04/-03 2003 Sep 24 - -4:00 - -04 2004 Oct 1 - -4:00 Brazil -04/-03 + -4:00 Brazil %z 2003 Sep 24 + -4:00 - %z 2004 Oct 1 + -4:00 Brazil %z # # Rondônia (RO) Zone America/Porto_Velho -4:15:36 - LMT 1914 - -4:00 Brazil -04/-03 1988 Sep 12 - -4:00 - -04 + -4:00 Brazil %z 1988 Sep 12 + -4:00 - %z # # Roraima (RR) Zone America/Boa_Vista -4:02:40 - LMT 1914 - -4:00 Brazil -04/-03 1988 Sep 12 - -4:00 - -04 1999 Sep 30 - -4:00 Brazil -04/-03 2000 Oct 15 - -4:00 - -04 + -4:00 Brazil %z 1988 Sep 12 + -4:00 - %z 1999 Sep 30 + -4:00 Brazil %z 2000 Oct 15 + -4:00 - %z # # east Amazonas (AM): Boca do Acre, Jutaí, Manaus, Floriano Peixoto # The great circle line from Tabatinga to Porto Acre divides # east from west Amazonas. Zone America/Manaus -4:00:04 - LMT 1914 - -4:00 Brazil -04/-03 1988 Sep 12 - -4:00 - -04 1993 Sep 28 - -4:00 Brazil -04/-03 1994 Sep 22 - -4:00 - -04 + -4:00 Brazil %z 1988 Sep 12 + -4:00 - %z 1993 Sep 28 + -4:00 Brazil %z 1994 Sep 22 + -4:00 - %z # # west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant, # Eirunepé, Envira, Ipixuna Zone America/Eirunepe -4:39:28 - LMT 1914 - -5:00 Brazil -05/-04 1988 Sep 12 - -5:00 - -05 1993 Sep 28 - -5:00 Brazil -05/-04 1994 Sep 22 - -5:00 - -05 2008 Jun 24 0:00 - -4:00 - -04 2013 Nov 10 - -5:00 - -05 + -5:00 Brazil %z 1988 Sep 12 + -5:00 - %z 1993 Sep 28 + -5:00 Brazil %z 1994 Sep 22 + -5:00 - %z 2008 Jun 24 0:00 + -4:00 - %z 2013 Nov 10 + -5:00 - %z # # Acre (AC) Zone America/Rio_Branco -4:31:12 - LMT 1914 - -5:00 Brazil -05/-04 1988 Sep 12 - -5:00 - -05 2008 Jun 24 0:00 - -4:00 - -04 2013 Nov 10 - -5:00 - -05 + -5:00 Brazil %z 1988 Sep 12 + -5:00 - %z 2008 Jun 24 0:00 + -4:00 - %z 2013 Nov 10 + -5:00 - %z # Chile @@ -1382,36 +1382,36 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Santiago -4:42:45 - LMT 1890 -4:42:45 - SMT 1910 Jan 10 # Santiago Mean Time - -5:00 - -05 1916 Jul 1 + -5:00 - %z 1916 Jul 1 -4:42:45 - SMT 1918 Sep 10 - -4:00 - -04 1919 Jul 1 + -4:00 - %z 1919 Jul 1 -4:42:45 - SMT 1927 Sep 1 - -5:00 Chile -05/-04 1932 Sep 1 - -4:00 - -04 1942 Jun 1 - -5:00 - -05 1942 Aug 1 - -4:00 - -04 1946 Jul 14 24:00 - -4:00 1:00 -03 1946 Aug 28 24:00 # central CL - -5:00 1:00 -04 1947 Mar 31 24:00 - -5:00 - -05 1947 May 21 23:00 - -4:00 Chile -04/-03 + -5:00 Chile %z 1932 Sep 1 + -4:00 - %z 1942 Jun 1 + -5:00 - %z 1942 Aug 1 + -4:00 - %z 1946 Jul 14 24:00 + -4:00 1:00 %z 1946 Aug 28 24:00 # central CL + -5:00 1:00 %z 1947 Mar 31 24:00 + -5:00 - %z 1947 May 21 23:00 + -4:00 Chile %z Zone America/Punta_Arenas -4:43:40 - LMT 1890 -4:42:45 - SMT 1910 Jan 10 - -5:00 - -05 1916 Jul 1 + -5:00 - %z 1916 Jul 1 -4:42:45 - SMT 1918 Sep 10 - -4:00 - -04 1919 Jul 1 + -4:00 - %z 1919 Jul 1 -4:42:45 - SMT 1927 Sep 1 - -5:00 Chile -05/-04 1932 Sep 1 - -4:00 - -04 1942 Jun 1 - -5:00 - -05 1942 Aug 1 - -4:00 - -04 1946 Aug 28 24:00 - -5:00 1:00 -04 1947 Mar 31 24:00 - -5:00 - -05 1947 May 21 23:00 - -4:00 Chile -04/-03 2016 Dec 4 - -3:00 - -03 + -5:00 Chile %z 1932 Sep 1 + -4:00 - %z 1942 Jun 1 + -5:00 - %z 1942 Aug 1 + -4:00 - %z 1946 Aug 28 24:00 + -5:00 1:00 %z 1947 Mar 31 24:00 + -5:00 - %z 1947 May 21 23:00 + -4:00 Chile %z 2016 Dec 4 + -3:00 - %z Zone Pacific/Easter -7:17:28 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile -07/-06 1982 Mar 14 3:00u # Easter Time - -6:00 Chile -06/-05 + -7:00 Chile %z 1982 Mar 14 3:00u # Easter Time + -6:00 Chile %z # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, @@ -1431,10 +1431,10 @@ # # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - -00 1965 - -4:00 Arg -04/-03 1969 Oct 5 - -3:00 Arg -03/-02 1982 May - -4:00 Chile -04/-03 2016 Dec 4 - -3:00 - -03 + -4:00 Arg %z 1969 Oct 5 + -3:00 Arg %z 1982 May + -4:00 Chile %z 2016 Dec 4 + -3:00 - %z # Colombia @@ -1453,7 +1453,7 @@ #STDOFF -4:56:16.4 Zone America/Bogota -4:56:16 - LMT 1884 Mar 13 -4:56:16 - BMT 1914 Nov 23 # Bogotá Mean Time - -5:00 CO -05/-04 + -5:00 CO %z # Malpelo, Providencia, San Andres # no information; probably like America/Bogota @@ -1484,10 +1484,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Guayaquil -5:19:20 - LMT 1890 -5:14:00 - QMT 1931 # Quito Mean Time - -5:00 Ecuador -05/-04 + -5:00 Ecuador %z Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno - -5:00 - -05 1986 - -6:00 Ecuador -06/-05 + -5:00 - %z 1986 + -6:00 Ecuador %z # Falklands @@ -1587,10 +1587,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Atlantic/Stanley -3:51:24 - LMT 1890 -3:51:24 - SMT 1912 Mar 12 # Stanley Mean Time - -4:00 Falk -04/-03 1983 May - -3:00 Falk -03/-02 1985 Sep 15 - -4:00 Falk -04/-03 2010 Sep 5 2:00 - -3:00 - -03 + -4:00 Falk %z 1983 May + -3:00 Falk %z 1985 Sep 15 + -4:00 Falk %z 2010 Sep 5 2:00 + -3:00 - %z # French Guiana # For the 1911/1912 establishment of standard time in French possessions, see: @@ -1598,8 +1598,8 @@ # page 752, 18b. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1 - -4:00 - -04 1967 Oct - -3:00 - -03 + -4:00 - %z 1967 Oct + -3:00 - %z # Guyana @@ -1633,10 +1633,10 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Guyana -3:52:39 - LMT 1911 Aug 1 # Georgetown - -4:00 - -04 1915 Mar 1 - -3:45 - -0345 1975 Aug 1 - -3:00 - -03 1992 Mar 29 1:00 - -4:00 - -04 + -4:00 - %z 1915 Mar 1 + -3:45 - %z 1975 Aug 1 + -3:00 - %z 1992 Mar 29 1:00 + -4:00 - %z # Paraguay # @@ -1734,9 +1734,9 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time - -4:00 - -04 1972 Oct - -3:00 - -03 1974 Apr - -4:00 Para -04/-03 + -4:00 - %z 1972 Oct + -3:00 - %z 1974 Apr + -4:00 Para %z # Peru # @@ -1763,12 +1763,12 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Lima -5:08:12 - LMT 1890 -5:08:36 - LMT 1908 Jul 28 # Lima Mean Time? - -5:00 Peru -05/-04 + -5:00 Peru %z # South Georgia # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Atlantic/South_Georgia -2:26:08 - LMT 1890 # Grytviken - -2:00 - -02 + -2:00 - %z # South Sandwich Is # uninhabited; scientific personnel have wintered @@ -1778,8 +1778,8 @@ Zone America/Paramaribo -3:40:40 - LMT 1911 -3:40:52 - PMT 1935 # Paramaribo Mean Time -3:40:36 - PMT 1945 Oct # The capital moved? - -3:30 - -0330 1984 Oct - -3:00 - -03 + -3:30 - %z 1984 Oct + -3:00 - %z # Uruguay # From Paul Eggert (1993-11-18): @@ -1994,15 +1994,15 @@ # This Zone can be simplified once we assume zic %z. Zone America/Montevideo -3:44:51 - LMT 1908 Jun 10 -3:44:51 - MMT 1920 May 1 # Montevideo MT - -4:00 - -04 1923 Oct 1 - -3:30 Uruguay -0330/-03 1942 Dec 14 - -3:00 Uruguay -03/-0230 1960 - -3:00 Uruguay -03/-02 1968 - -3:00 Uruguay -03/-0230 1970 - -3:00 Uruguay -03/-02 1974 - -3:00 Uruguay -03/-0130 1974 Mar 10 - -3:00 Uruguay -03/-0230 1974 Dec 22 - -3:00 Uruguay -03/-02 + -4:00 - %z 1923 Oct 1 + -3:30 Uruguay %z 1942 Dec 14 + -3:00 Uruguay %z 1960 + -3:00 Uruguay %z 1968 + -3:00 Uruguay %z 1970 + -3:00 Uruguay %z 1974 + -3:00 Uruguay %z 1974 Mar 10 + -3:00 Uruguay %z 1974 Dec 22 + -3:00 Uruguay %z # Venezuela # @@ -2036,7 +2036,7 @@ # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Caracas -4:27:44 - LMT 1890 -4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time? - -4:30 - -0430 1965 Jan 1 0:00 - -4:00 - -04 2007 Dec 9 3:00 - -4:30 - -0430 2016 May 1 2:30 - -4:00 - -04 + -4:30 - %z 1965 Jan 1 0:00 + -4:00 - %z 2007 Dec 9 3:00 + -4:30 - %z 2016 May 1 2:30 + -4:00 - %z diff -Nru openjdk-17-17.0.13+11/make/data/tzdata/zone.tab openjdk-17-17.0.14+7/make/data/tzdata/zone.tab --- openjdk-17-17.0.13+11/make/data/tzdata/zone.tab 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/data/tzdata/zone.tab 2025-01-04 20:25:18.000000000 +0000 @@ -287,8 +287,7 @@ ML +1239-00800 Africa/Bamako MM +1647+09610 Asia/Yangon MN +4755+10653 Asia/Ulaanbaatar most of Mongolia -MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan -MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar +MN +4801+09139 Asia/Hovd Bayan-Olgii, Hovd, Uvs MO +221150+1133230 Asia/Macau MP +1512+14545 Pacific/Saipan MQ +1436-06105 America/Martinique diff -Nru openjdk-17-17.0.13+11/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java --- openjdk-17-17.0.13+11/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -273,7 +273,7 @@ // link version-region-rules out.writeShort(builtZones.size()); for (Map.Entry entry : builtZones.entrySet()) { - int regionIndex = Arrays.binarySearch(regionArray, entry.getKey()); + int regionIndex = findRegionIndex(regionArray, entry.getKey()); int rulesIndex = rulesList.indexOf(entry.getValue()); out.writeShort(regionIndex); out.writeShort(rulesIndex); @@ -281,8 +281,8 @@ // alias-region out.writeShort(links.size()); for (Map.Entry entry : links.entrySet()) { - int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey()); - int regionIndex = Arrays.binarySearch(regionArray, entry.getValue()); + int aliasIndex = findRegionIndex(regionArray, entry.getKey()); + int regionIndex = findRegionIndex(regionArray, entry.getValue()); out.writeShort(aliasIndex); out.writeShort(regionIndex); } @@ -294,6 +294,14 @@ } } + private static int findRegionIndex(String[] regionArray, String region) { + int index = Arrays.binarySearch(regionArray, region); + if (index < 0) { + throw new IllegalArgumentException("Unknown region: " + region); + } + return index; + } + /** Whether to output verbose messages. */ private boolean verbose; diff -Nru openjdk-17-17.0.13+11/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java --- openjdk-17-17.0.13+11/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -164,7 +164,8 @@ } continue; } - if (line.startsWith("Zone")) { // parse Zone line + int token0len = tokens.length > 0 ? tokens[0].length() : line.length(); + if (line.regionMatches(true, 0, "Zone", 0, token0len)) { // parse Zone line String name = tokens[1]; if (excludedZones.contains(name)){ continue; @@ -182,13 +183,13 @@ if (zLine.parse(tokens, 2)) { openZone = null; } - } else if (line.startsWith("Rule")) { // parse Rule line + } else if (line.regionMatches(true, 0, "Rule", 0, token0len)) { // parse Rule line String name = tokens[1]; if (!rules.containsKey(name)) { rules.put(name, new ArrayList(10)); } rules.get(name).add(new RuleLine().parse(tokens)); - } else if (line.startsWith("Link")) { // parse link line + } else if (line.regionMatches(true, 0, "Link", 0, token0len)) { // parse link line if (tokens.length >= 3) { String realId = tokens[1]; String aliasId = tokens[2]; @@ -304,7 +305,7 @@ month = parseMonth(tokens[off++]); if (off < tokens.length) { String dayRule = tokens[off++]; - if (dayRule.startsWith("last")) { + if (dayRule.regionMatches(true, 0, "last", 0, 4)) { dayOfMonth = -1; dayOfWeek = parseDayOfWeek(dayRule.substring(4)); adjustForwards = false; @@ -355,42 +356,45 @@ } int parseYear(String year, int defaultYear) { - switch (year.toLowerCase()) { - case "min": return 1900; - case "max": return Year.MAX_VALUE; - case "only": return defaultYear; - } + int len = year.length(); + + if (year.regionMatches(true, 0, "minimum", 0, len)) return 1900; + if (year.regionMatches(true, 0, "maximum", 0, len)) return Year.MAX_VALUE; + if (year.regionMatches(true, 0, "only", 0, len)) return defaultYear; + return Integer.parseInt(year); } Month parseMonth(String mon) { - switch (mon) { - case "Jan": return Month.JANUARY; - case "Feb": return Month.FEBRUARY; - case "Mar": return Month.MARCH; - case "Apr": return Month.APRIL; - case "May": return Month.MAY; - case "Jun": return Month.JUNE; - case "Jul": return Month.JULY; - case "Aug": return Month.AUGUST; - case "Sep": return Month.SEPTEMBER; - case "Oct": return Month.OCTOBER; - case "Nov": return Month.NOVEMBER; - case "Dec": return Month.DECEMBER; - } + int len = mon.length(); + + if (mon.regionMatches(true, 0, "January", 0, len)) return Month.JANUARY; + if (mon.regionMatches(true, 0, "February", 0, len)) return Month.FEBRUARY; + if (mon.regionMatches(true, 0, "March", 0, len)) return Month.MARCH; + if (mon.regionMatches(true, 0, "April", 0, len)) return Month.APRIL; + if (mon.regionMatches(true, 0, "May", 0, len)) return Month.MAY; + if (mon.regionMatches(true, 0, "June", 0, len)) return Month.JUNE; + if (mon.regionMatches(true, 0, "July", 0, len)) return Month.JULY; + if (mon.regionMatches(true, 0, "August", 0, len)) return Month.AUGUST; + if (mon.regionMatches(true, 0, "September", 0, len)) return Month.SEPTEMBER; + if (mon.regionMatches(true, 0, "October", 0, len)) return Month.OCTOBER; + if (mon.regionMatches(true, 0, "November", 0, len)) return Month.NOVEMBER; + if (mon.regionMatches(true, 0, "December", 0, len)) return Month.DECEMBER; + throw new IllegalArgumentException("Unknown month: " + mon); } DayOfWeek parseDayOfWeek(String dow) { - switch (dow) { - case "Mon": return DayOfWeek.MONDAY; - case "Tue": return DayOfWeek.TUESDAY; - case "Wed": return DayOfWeek.WEDNESDAY; - case "Thu": return DayOfWeek.THURSDAY; - case "Fri": return DayOfWeek.FRIDAY; - case "Sat": return DayOfWeek.SATURDAY; - case "Sun": return DayOfWeek.SUNDAY; - } + int len = dow.length(); + + if (dow.regionMatches(true, 0, "Monday", 0, len)) return DayOfWeek.MONDAY; + if (dow.regionMatches(true, 0, "Tuesday", 0, len)) return DayOfWeek.TUESDAY; + if (dow.regionMatches(true, 0, "Wednesday", 0, len)) return DayOfWeek.WEDNESDAY; + if (dow.regionMatches(true, 0, "Thursday", 0, len)) return DayOfWeek.THURSDAY; + if (dow.regionMatches(true, 0, "Friday", 0, len)) return DayOfWeek.FRIDAY; + if (dow.regionMatches(true, 0, "Saturday", 0, len)) return DayOfWeek.SATURDAY; + if (dow.regionMatches(true, 0, "Sunday", 0, len)) return DayOfWeek.SUNDAY; + throw new IllegalArgumentException("Unknown day-of-week: " + dow); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #include "asm/macroAssembler.hpp" #include "classfile/javaClasses.inline.hpp" #include "classfile/vmClasses.hpp" +#include "compiler/disassembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -36,7 +37,7 @@ #include "runtime/frame.inline.hpp" #include "runtime/stubRoutines.hpp" -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "classfile/javaClasses.hpp" +#include "compiler/disassembler.hpp" #include "compiler/compiler_globals.hpp" #include "gc/shared/barrierSetAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" @@ -66,7 +67,7 @@ // Max size with JVMTI int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> //----------------------------------------------------------------------------- @@ -1919,13 +1920,21 @@ address& vep) { assert(t->is_valid() && t->tos_in() == vtos, "illegal template"); Label L; - aep = __ pc(); __ push_ptr(); __ b(L); - fep = __ pc(); __ push_f(); __ b(L); - dep = __ pc(); __ push_d(); __ b(L); - lep = __ pc(); __ push_l(); __ b(L); - bep = cep = sep = - iep = __ pc(); __ push_i(); - vep = __ pc(); + aep = __ pc(); // atos entry point + __ push_ptr(); + __ b(L); + fep = __ pc(); // ftos entry point + __ push_f(); + __ b(L); + dep = __ pc(); // dtos entry point + __ push_d(); + __ b(L); + lep = __ pc(); // ltos entry point + __ push_l(); + __ b(L); + bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point + __ push_i(); + vep = __ pc(); // vtos entry point __ bind(L); generate_and_dispatch(t); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "compiler/disassembler.hpp" #include "gc/shared/barrierSetAssembler.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/tlab_globals.hpp" @@ -45,7 +46,7 @@ #include "runtime/synchronizer.hpp" #include "utilities/powerOfTwo.hpp" -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> // Address computation: local variables diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/assembler_ppc.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/assembler_ppc.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/assembler_ppc.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/assembler_ppc.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 SAP SE. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024 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 @@ -79,9 +79,9 @@ // Low-level andi-one-instruction-macro. void Assembler::andi(Register a, Register s, const long ui16) { - if (is_power_of_2(((jlong) ui16)+1)) { + if (is_power_of_2(((unsigned long) ui16)+1)) { // pow2minus1 - clrldi(a, s, 64 - log2i_exact((((jlong) ui16)+1))); + clrldi(a, s, 64 - log2i_exact((((unsigned long) ui16)+1))); } else if (is_power_of_2((jlong) ui16)) { // pow2 rlwinm(a, s, 0, 31 - log2i_exact((jlong) ui16), 31 - log2i_exact((jlong) ui16)); diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -133,9 +133,20 @@ // copied into place by code emitted in the IR. Register OSR_buf = osrBufferPointer()->as_register(); - { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); - int monitor_offset = BytesPerWord * method()->max_locals() + - (2 * BytesPerWord) * (number_of_locks - 1); + { + assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); + + const int locals_space = BytesPerWord * method()->max_locals(); + int monitor_offset = locals_space + (2 * BytesPerWord) * (number_of_locks - 1); + bool use_OSR_bias = false; + + if (!Assembler::is_simm16(monitor_offset + BytesPerWord) && number_of_locks > 0) { + // Offsets too large for ld instructions. Use bias. + __ add_const_optimized(OSR_buf, OSR_buf, locals_space); + monitor_offset -= locals_space; + use_OSR_bias = true; + } + // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in // the OSR buffer using 2 word entries: first the lock and then // the oop. @@ -161,6 +172,11 @@ __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf); __ std(R0, mo.disp(), mo.base()); } + + if (use_OSR_bias) { + // Restore. + __ sub_const_optimized(OSR_buf, OSR_buf, locals_space); + } } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -582,7 +582,7 @@ is_power_of_2(int_or_long_const) || is_power_of_2(-int_or_long_const))) return true; if (bc == Bytecodes::_land && - (is_power_of_2(int_or_long_const+1) || + (is_power_of_2((unsigned long)int_or_long_const+1) || (Assembler::is_uimm(int_or_long_const, 32) && is_power_of_2(int_or_long_const)) || (int_or_long_const != min_jlong && is_power_of_2(-int_or_long_const)))) return true; diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/ppc.ad openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/ppc.ad --- openjdk-17-17.0.13+11/src/hotspot/cpu/ppc/ppc.ad 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/ppc/ppc.ad 2025-01-04 20:25:18.000000000 +0000 @@ -3510,6 +3510,7 @@ call->_in_rms = _in_rms; call->_nesting = _nesting; call->_override_symbolic_info = _override_symbolic_info; + call->_arg_escape = _arg_escape; // New call needs all inputs of old call. // Req... diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/interp_masm_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/interp_masm_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -265,7 +265,6 @@ la(bytecode, Address(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset())); - membar(MacroAssembler::AnyAny); lwu(bytecode, bytecode); membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); const int shift_count = (1 + byte_no) * BitsPerByte; diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -74,6 +74,16 @@ _stack_offset = 0; } +// The C ABI specifies: +// "integer scalars narrower than XLEN bits are widened according to the sign +// of their type up to 32 bits, then sign-extended to XLEN bits." +// Applies for both passed in register and stack. +// +// Java uses 32-bit stack slots; jint, jshort, jchar, jbyte uses one slot. +// Native uses 64-bit stack slots for all integer scalar types. +// +// lw loads the Java stack slot, sign-extends and +// sd store this widened integer into a 64 bit native stack slot. void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { const Address src(from(), Interpreter::local_offset_in_bytes(offset())); @@ -82,7 +92,7 @@ __ lw(reg, src); } else { __ lw(x10, src); - __ sw(x10, Address(to(), next_stack_offset())); + __ sd(x10, Address(to(), next_stack_offset())); } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -696,37 +696,9 @@ upper = (int32_t)upper; // lui Rd, imm[31:12] + imm[11] lui(Rd, upper); - // use addiw to distinguish li32 to li64 addiw(Rd, Rd, lower); } -void MacroAssembler::li64(Register Rd, int64_t imm) { - // Load upper 32 bits. upper = imm[63:32], but if imm[31] == 1 or - // (imm[31:20] == 0x7ff && imm[19] == 1), upper = imm[63:32] + 1. - int64_t lower = imm & 0xffffffff; - lower -= ((lower << 44) >> 44); - int64_t tmp_imm = ((uint64_t)(imm & 0xffffffff00000000)) + (uint64_t)lower; - int32_t upper = (tmp_imm - (int32_t)lower) >> 32; - - // Load upper 32 bits - int64_t up = upper, lo = upper; - lo = (lo << 52) >> 52; - up -= lo; - up = (int32_t)up; - lui(Rd, up); - addi(Rd, Rd, lo); - - // Load the rest 32 bits. - slli(Rd, Rd, 12); - addi(Rd, Rd, (int32_t)lower >> 20); - slli(Rd, Rd, 12); - lower = ((int32_t)imm << 12) >> 20; - addi(Rd, Rd, lower); - slli(Rd, Rd, 8); - lower = imm & 0xff; - addi(Rd, Rd, lower); -} - void MacroAssembler::li(Register Rd, int64_t imm) { // int64_t is in range 0x8000 0000 0000 0000 ~ 0x7fff ffff ffff ffff // li -> c.li @@ -1315,27 +1287,6 @@ return MOVPTR_INSTRUCTIONS_NUM * NativeInstruction::instruction_size; } -static int patch_imm_in_li64(address branch, address target) { - const int LI64_INSTRUCTIONS_NUM = 8; // lui + addi + slli + addi + slli + addi + slli + addi - int64_t lower = (intptr_t)target & 0xffffffff; - lower = lower - ((lower << 44) >> 44); - int64_t tmp_imm = ((uint64_t)((intptr_t)target & 0xffffffff00000000)) + (uint64_t)lower; - int32_t upper = (tmp_imm - (int32_t)lower) >> 32; - int64_t tmp_upper = upper, tmp_lower = upper; - tmp_lower = (tmp_lower << 52) >> 52; - tmp_upper -= tmp_lower; - tmp_upper >>= 12; - // Load upper 32 bits. Upper = target[63:32], but if target[31] = 1 or (target[31:20] == 0x7ff && target[19] == 1), - // upper = target[63:32] + 1. - Assembler::patch(branch + 0, 31, 12, tmp_upper & 0xfffff); // Lui. - Assembler::patch(branch + 4, 31, 20, tmp_lower & 0xfff); // Addi. - // Load the rest 32 bits. - Assembler::patch(branch + 12, 31, 20, ((int32_t)lower >> 20) & 0xfff); // Addi. - Assembler::patch(branch + 20, 31, 20, (((intptr_t)target << 44) >> 52) & 0xfff); // Addi. - Assembler::patch(branch + 28, 31, 20, (intptr_t)target & 0xff); // Addi. - return LI64_INSTRUCTIONS_NUM * NativeInstruction::instruction_size; -} - static int patch_imm_in_li32(address branch, int32_t target) { const int LI32_INSTRUCTIONS_NUM = 2; // lui + addiw int64_t upper = (intptr_t)target; @@ -1390,16 +1341,6 @@ return (address) target_address; } -static address get_target_of_li64(address insn_addr) { - assert_cond(insn_addr != NULL); - intptr_t target_address = (((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12)) & 0xfffff) << 44; // Lui. - target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 4), 31, 20)) << 32; // Addi. - target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 12), 31, 20)) << 20; // Addi. - target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 20), 31, 20)) << 8; // Addi. - target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 28), 31, 20)); // Addi. - return (address)target_address; -} - static address get_target_of_li32(address insn_addr) { assert_cond(insn_addr != NULL); intptr_t target_address = (((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12)) & 0xfffff) << 12; // Lui. @@ -1420,8 +1361,6 @@ return patch_offset_in_pc_relative(branch, offset); } else if (NativeInstruction::is_movptr_at(branch)) { // movptr return patch_addr_in_movptr(branch, target); - } else if (NativeInstruction::is_li64_at(branch)) { // li64 - return patch_imm_in_li64(branch, target); } else if (NativeInstruction::is_li32_at(branch)) { // li32 int64_t imm = (intptr_t)target; return patch_imm_in_li32(branch, (int32_t)imm); @@ -1447,8 +1386,6 @@ offset = get_offset_of_pc_relative(insn_addr); } else if (NativeInstruction::is_movptr_at(insn_addr)) { // movptr return get_target_of_movptr(insn_addr); - } else if (NativeInstruction::is_li64_at(insn_addr)) { // li64 - return get_target_of_li64(insn_addr); } else if (NativeInstruction::is_li32_at(insn_addr)) { // li32 return get_target_of_li32(insn_addr); } else { diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -679,7 +679,6 @@ void la(Register Rd, const Address &adr); void li32(Register Rd, int32_t imm); - void li64(Register Rd, int64_t imm); void li (Register Rd, int64_t imm); // optimized load immediate // mv diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/methodHandles_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/methodHandles_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/methodHandles_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/methodHandles_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +28,7 @@ #include "asm/macroAssembler.hpp" #include "classfile/javaClasses.inline.hpp" #include "classfile/vmClasses.hpp" +#include "compiler/disassembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -37,7 +38,7 @@ #include "runtime/frame.inline.hpp" #include "runtime/stubRoutines.hpp" -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/nativeInst_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/nativeInst_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -103,18 +103,6 @@ check_li32_data_dependency(instr); } -bool NativeInstruction::is_li64_at(address instr) { - return is_lui_at(instr) && // lui - is_addi_at(instr + instruction_size) && // addi - is_slli_shift_at(instr + instruction_size * 2, 12) && // Slli Rd, Rs, 12 - is_addi_at(instr + instruction_size * 3) && // addi - is_slli_shift_at(instr + instruction_size * 4, 12) && // Slli Rd, Rs, 12 - is_addi_at(instr + instruction_size * 5) && // addi - is_slli_shift_at(instr + instruction_size * 6, 8) && // Slli Rd, Rs, 8 - is_addi_at(instr + instruction_size * 7) && // addi - check_li64_data_dependency(instr); -} - void NativeCall::verify() { assert(NativeCall::is_call_at((address)this), "unexpected code at call site"); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/nativeInst_riscv.hpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/nativeInst_riscv.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -114,40 +114,6 @@ extract_rs1(last_instr) == extract_rd(slli2); } - // the instruction sequence of li64 is as below: - // lui - // addi - // slli - // addi - // slli - // addi - // slli - // addi - static bool check_li64_data_dependency(address instr) { - address lui = instr; - address addi1 = lui + instruction_size; - address slli1 = addi1 + instruction_size; - address addi2 = slli1 + instruction_size; - address slli2 = addi2 + instruction_size; - address addi3 = slli2 + instruction_size; - address slli3 = addi3 + instruction_size; - address addi4 = slli3 + instruction_size; - return extract_rs1(addi1) == extract_rd(lui) && - extract_rs1(addi1) == extract_rd(addi1) && - extract_rs1(slli1) == extract_rd(addi1) && - extract_rs1(slli1) == extract_rd(slli1) && - extract_rs1(addi2) == extract_rd(slli1) && - extract_rs1(addi2) == extract_rd(addi2) && - extract_rs1(slli2) == extract_rd(addi2) && - extract_rs1(slli2) == extract_rd(slli2) && - extract_rs1(addi3) == extract_rd(slli2) && - extract_rs1(addi3) == extract_rd(addi3) && - extract_rs1(slli3) == extract_rd(addi3) && - extract_rs1(slli3) == extract_rd(slli3) && - extract_rs1(addi4) == extract_rd(slli3) && - extract_rs1(addi4) == extract_rd(addi4); - } - // the instruction sequence of li32 is as below: // lui // addiw @@ -182,7 +148,6 @@ static bool is_movptr_at(address instr); static bool is_li32_at(address instr); - static bool is_li64_at(address instr); static bool is_pc_relative_at(address branch); static bool is_load_pc_relative_at(address branch); diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/riscv.ad openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/riscv.ad --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/riscv.ad 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/riscv.ad 2025-01-04 20:25:18.000000000 +0000 @@ -84,8 +84,8 @@ reg_def R0_H ( NS, NS, Op_RegI, 0, x0->as_VMReg()->next() ); reg_def R1 ( NS, SOC, Op_RegI, 1, x1->as_VMReg() ); // ra reg_def R1_H ( NS, SOC, Op_RegI, 1, x1->as_VMReg()->next() ); -reg_def R2 ( NS, SOE, Op_RegI, 2, x2->as_VMReg() ); // sp -reg_def R2_H ( NS, SOE, Op_RegI, 2, x2->as_VMReg()->next() ); +reg_def R2 ( NS, NS, Op_RegI, 2, x2->as_VMReg() ); // sp +reg_def R2_H ( NS, NS, Op_RegI, 2, x2->as_VMReg()->next() ); reg_def R3 ( NS, NS, Op_RegI, 3, x3->as_VMReg() ); // gp reg_def R3_H ( NS, NS, Op_RegI, 3, x3->as_VMReg()->next() ); reg_def R4 ( NS, NS, Op_RegI, 4, x4->as_VMReg() ); // tp diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -758,15 +758,21 @@ return stk_args; } -// On 64 bit we will store integer like items to the stack as -// 64 bits items (riscv64 abi) even though java would only store -// 32bits for a parameter. On 32bit it will simply be 32 bits -// So this routine will do 32->32 on 32bit and 32->64 on 64bit +// The C ABI specifies: +// "integer scalars narrower than XLEN bits are widened according to the sign +// of their type up to 32 bits, then sign-extended to XLEN bits." +// Applies for both passed in register and stack. +// +// Java uses 32-bit stack slots; jint, jshort, jchar, jbyte uses one slot. +// Native uses 64-bit stack slots for all integer scalar types. +// +// lw loads the Java stack slot, sign-extends and +// sd store this widened integer into a 64 bit native stack slot. static void move32_64(MacroAssembler* masm, VMRegPair src, VMRegPair dst) { if (src.first()->is_stack()) { if (dst.first()->is_stack()) { // stack to stack - __ ld(t0, Address(fp, reg2offset_in(src.first()))); + __ lw(t0, Address(fp, reg2offset_in(src.first()))); __ sd(t0, Address(sp, reg2offset_out(dst.first()))); } else { // stack to reg diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,6 +27,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "classfile/javaClasses.hpp" +#include "compiler/disassembler.hpp" #include "gc/shared/barrierSetAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/bytecodeTracer.hpp" @@ -66,7 +67,7 @@ // Max size with JVMTI int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> //----------------------------------------------------------------------------- @@ -1691,13 +1692,21 @@ address& vep) { assert(t != NULL && t->is_valid() && t->tos_in() == vtos, "illegal template"); Label L; - aep = __ pc(); __ push_ptr(); __ j(L); - fep = __ pc(); __ push_f(); __ j(L); - dep = __ pc(); __ push_d(); __ j(L); - lep = __ pc(); __ push_l(); __ j(L); - bep = cep = sep = - iep = __ pc(); __ push_i(); - vep = __ pc(); + aep = __ pc(); // atos entry point + __ push_ptr(); + __ j(L); + fep = __ pc(); // ftos entry point + __ push_f(); + __ j(L); + dep = __ pc(); // dtos entry point + __ push_d(); + __ j(L); + lep = __ pc(); // ltos entry point + __ push_l(); + __ j(L); + bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point + __ push_i(); + vep = __ pc(); // vtos entry point __ bind(L); generate_and_dispatch(t); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/templateTable_riscv.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/riscv/templateTable_riscv.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "compiler/disassembler.hpp" #include "gc/shared/barrierSetAssembler.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/tlab_globals.hpp" @@ -46,7 +47,7 @@ #include "runtime/synchronizer.hpp" #include "utilities/powerOfTwo.hpp" -#define __ _masm-> +#define __ Disassembler::hook(__FILE__, __LINE__, _masm)-> // Address computation: local variables @@ -317,7 +318,6 @@ // get type __ addi(x13, x11, tags_offset); __ add(x13, x10, x13); - __ membar(MacroAssembler::AnyAny); __ lbu(x13, Address(x13, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -3491,7 +3491,6 @@ const int tags_offset = Array::base_offset_in_bytes(); __ add(t0, x10, x13); __ la(t0, Address(t0, tags_offset)); - __ membar(MacroAssembler::AnyAny); __ lbu(t0, t0); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t1, t0, (u1)JVM_CONSTANT_Class); @@ -3638,7 +3637,6 @@ // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class); @@ -3694,7 +3692,6 @@ // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class); diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -133,9 +133,19 @@ // copied into place by code emitted in the IR. Register OSR_buf = osrBufferPointer()->as_register(); - { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); - int monitor_offset = BytesPerWord * method()->max_locals() + - (2 * BytesPerWord) * (number_of_locks - 1); + { + assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); + + const int locals_space = BytesPerWord * method() -> max_locals(); + int monitor_offset = locals_space + (2 * BytesPerWord) * (number_of_locks - 1); + bool large_offset = !Immediate::is_simm20(monitor_offset + BytesPerWord) && number_of_locks > 0; + + if (large_offset) { + // z_lg can only handle displacement upto 20bit signed binary integer + __ z_algfi(OSR_buf, locals_space); + monitor_offset -= locals_space; + } + // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in // the OSR buffer using 2 word entries: first the lock and then // the oop. @@ -149,6 +159,10 @@ __ z_lg(Z_R1_scratch, slot_offset + 1*BytesPerWord, OSR_buf); __ z_stg(Z_R1_scratch, frame_map()->address_for_monitor_object(i)); } + + if (large_offset) { + __ z_slgfi(OSR_buf, locals_space); + } } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/x86/assembler_x86.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/x86/assembler_x86.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -3325,7 +3325,7 @@ emit_operand(as_Register(3), dst); } -void Assembler::nop(int i) { +void Assembler::nop(uint i) { #ifdef ASSERT assert(i > 0, " "); // The fancy nops aren't currently recognized by debuggers making it a diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/x86/assembler_x86.hpp openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.hpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/x86/assembler_x86.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/x86/assembler_x86.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -1644,7 +1644,7 @@ void negq(Address dst); #endif - void nop(int i = 1); + void nop(uint i = 1); void notl(Register dst); diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/x86/macroAssembler_x86.cpp openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.cpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1175,20 +1175,20 @@ // Stub code is generated once and never copied. // NMethods can't use this because they get copied and we can't force alignment > 32 bytes. void MacroAssembler::align64() { - align(64, (unsigned long long) pc()); + align(64, (uint)(uintptr_t)pc()); } void MacroAssembler::align32() { - align(32, (unsigned long long) pc()); + align(32, (uint)(uintptr_t)pc()); } -void MacroAssembler::align(int modulus) { +void MacroAssembler::align(uint modulus) { // 8273459: Ensure alignment is possible with current segment alignment - assert(modulus <= CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment"); + assert(modulus <= (uintx)CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment"); align(modulus, offset()); } -void MacroAssembler::align(int modulus, int target) { +void MacroAssembler::align(uint modulus, uint target) { if (target % modulus != 0) { nop(modulus - (target % modulus)); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/cpu/x86/macroAssembler_x86.hpp openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.hpp --- openjdk-17-17.0.13+11/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -196,8 +196,8 @@ // Alignment void align32(); void align64(); - void align(int modulus); - void align(int modulus, int target); + void align(uint modulus); + void align(uint modulus, uint target); // A 5 byte nop that is safe for patching (see patch_verified_entry) void fat_nop(); diff -Nru openjdk-17-17.0.13+11/src/hotspot/os/bsd/os_bsd.cpp openjdk-17-17.0.14+7/src/hotspot/os/bsd/os_bsd.cpp --- openjdk-17-17.0.13+11/src/hotspot/os/bsd/os_bsd.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/os/bsd/os_bsd.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -2091,13 +2091,12 @@ // On macOS according to setrlimit(2), OPEN_MAX must be used instead // of RLIM_INFINITY, but testing on macOS >= 10.6, reveals that - // we can, in fact, use even RLIM_INFINITY, so try the max value - // that the system claims can be used first, same as other BSD OSes. - // However, some terminals (ksh) will internally use "int" type - // to store this value and since RLIM_INFINITY overflows an "int" - // we might end up with a negative value, so cap the system limit max - // at INT_MAX instead, just in case, for everyone. - nbr_files.rlim_cur = MIN(INT_MAX, nbr_files.rlim_max); + // we can, in fact, use even RLIM_INFINITY. + // However, we need to limit the value to 0x100000 (which is the max value + // allowed on Linux) so that any existing code that iterates over all allowed + // file descriptors, finishes in a reasonable time, without appearing + // to hang. + nbr_files.rlim_cur = MIN(0x100000, nbr_files.rlim_max); status = setrlimit(RLIMIT_NOFILE, &nbr_files); if (status != 0) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/os/windows/os_windows.cpp openjdk-17-17.0.14+7/src/hotspot/os/windows/os_windows.cpp --- openjdk-17-17.0.13+11/src/hotspot/os/windows/os_windows.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/os/windows/os_windows.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1897,7 +1897,10 @@ // - 2016 GA 10/2016 build: 14393 // - 2019 GA 11/2018 build: 17763 // - 2022 GA 08/2021 build: 20348 - if (build_number > 20347) { + // - 2025 Preview build : 26040 + if (build_number > 26039) { + st->print("Server 2025"); + } else if (build_number > 20347) { st->print("Server 2022"); } else if (build_number > 17762) { st->print("Server 2019"); @@ -3352,7 +3355,8 @@ os::attempt_reserve_memory_at(aligned_base, size); } - assert(aligned_base != NULL, "Did not manage to re-map after %d attempts?", max_attempts); + assert(aligned_base != nullptr, + "Did not manage to re-map after %d attempts (size %zu, alignment %zu, file descriptor %d)", max_attempts, size, alignment, file_desc); return aligned_base; } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/classfile/classFileParser.cpp openjdk-17-17.0.14+7/src/hotspot/share/classfile/classFileParser.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/classfile/classFileParser.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/classfile/classFileParser.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -5803,8 +5803,8 @@ Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_NoClassDefFoundError(), "%s (wrong name: %s)", - class_name_in_cp->as_C_string(), - _class_name->as_C_string() + _class_name->as_C_string(), + class_name_in_cp->as_C_string() ); return; } else { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/classfile/classLoaderData.cpp openjdk-17-17.0.14+7/src/hotspot/share/classfile/classLoaderData.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/classfile/classLoaderData.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/classfile/classLoaderData.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -552,6 +552,21 @@ // after erroneous classes are released. classes_do(InstanceKlass::unload_class); + // Method::clear_jmethod_ids only sets the jmethod_ids to NULL without + // releasing the memory for related JNIMethodBlocks and JNIMethodBlockNodes. + // This is done intentionally because native code (e.g. JVMTI agent) holding + // jmethod_ids may access them after the associated classes and class loader + // are unloaded. The Java Native Interface Specification says "method ID + // does not prevent the VM from unloading the class from which the ID has + // been derived. After the class is unloaded, the method or field ID becomes + // invalid". In real world usages, the native code may rely on jmethod_ids + // being NULL after class unloading. Hence, it is unsafe to free the memory + // from the VM side without knowing when native code is going to stop using + // them. + if (_jmethod_ids != NULL) { + Method::clear_jmethod_ids(this); + } + // Clean up global class iterator for compiler ClassLoaderDataGraph::adjust_saved_class(this); } @@ -696,20 +711,7 @@ _metaspace = NULL; delete m; } - // Method::clear_jmethod_ids only sets the jmethod_ids to NULL without - // releasing the memory for related JNIMethodBlocks and JNIMethodBlockNodes. - // This is done intentionally because native code (e.g. JVMTI agent) holding - // jmethod_ids may access them after the associated classes and class loader - // are unloaded. The Java Native Interface Specification says "method ID - // does not prevent the VM from unloading the class from which the ID has - // been derived. After the class is unloaded, the method or field ID becomes - // invalid". In real world usages, the native code may rely on jmethod_ids - // being NULL after class unloading. Hence, it is unsafe to free the memory - // from the VM side without knowing when native code is going to stop using - // them. - if (_jmethod_ids != NULL) { - Method::clear_jmethod_ids(this); - } + // Delete lock delete _metaspace_lock; diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/gc/shared/gcOverheadChecker.cpp openjdk-17-17.0.14+7/src/hotspot/share/gc/shared/gcOverheadChecker.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/gc/shared/gcOverheadChecker.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/gc/shared/gcOverheadChecker.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,11 @@ bool is_full_gc, GCCause::Cause gc_cause, SoftRefPolicy* soft_ref_policy) { - + if (is_full_gc) { + // Explicit Full GC would do the clearing of soft-refs as well + // So reset in the beginning + soft_ref_policy->set_should_clear_all_soft_refs(false); + } // Ignore explicit GC's. Exiting here does not set the flag and // does not reset the count. if (GCCause::is_user_requested_gc(gc_cause) || diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1048,6 +1048,7 @@ Node* u = ctrl->fast_out(i); if (u->_idx < last && u != barrier && + !u->depends_only_on_test() && // preserve dependency on test !uses_to_ignore.member(u) && (u->in(0) != ctrl || (!u->is_Region() && !u->is_Phi())) && (ctrl->Opcode() != Op_CatchProj || u->Opcode() != Op_CreateEx)) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -894,7 +894,11 @@ } HeapWord* ShenandoahHeap::allocate_memory_under_lock(ShenandoahAllocRequest& req, bool& in_new_region) { - ShenandoahHeapLocker locker(lock()); + // If we are dealing with mutator allocation, then we may need to block for safepoint. + // We cannot block for safepoint for GC allocations, because there is a high chance + // we are already running at safepoint or from stack watermark machinery, and we cannot + // block again. + ShenandoahHeapLocker locker(lock(), req.is_mutator_alloc()); return _free_set->allocate(req, in_new_region); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -28,9 +28,57 @@ #include "gc/shenandoah/shenandoahLock.hpp" #include "runtime/atomic.hpp" +#include "runtime/interfaceSupport.inline.hpp" #include "runtime/os.inline.hpp" #include "runtime/thread.hpp" +void ShenandoahLock::contended_lock(bool allow_block_for_safepoint) { + Thread* thread = Thread::current(); + if (allow_block_for_safepoint && thread->is_Java_thread()) { + contended_lock_internal(thread->as_Java_thread()); + } else { + contended_lock_internal(nullptr); + } +} + +template +void ShenandoahLock::contended_lock_internal(JavaThread* java_thread) { + assert(!ALLOW_BLOCK || java_thread != nullptr, "Must have a Java thread when allowing block."); + // Spin this much, but only on multi-processor systems. + int ctr = os::is_MP() ? 0xFF : 0; + // Apply TTAS to avoid more expensive CAS calls if the lock is still held by other thread. + while (Atomic::load(&_state) == locked || + Atomic::cmpxchg(&_state, unlocked, locked) != unlocked) { + if (ctr > 0 && !SafepointSynchronize::is_synchronizing()) { + // Lightly contended, spin a little if no safepoint is pending. + SpinPause(); + ctr--; + } else if (ALLOW_BLOCK) { + ThreadBlockInVM block(java_thread); + if (SafepointSynchronize::is_synchronizing()) { + // If safepoint is pending, we want to block and allow safepoint to proceed. + // Normally, TBIVM above would block us in its destructor. + // + // But that blocking only happens when TBIVM knows the thread poll is armed. + // There is a window between announcing a safepoint and arming the thread poll + // during which trying to continuously enter TBIVM is counter-productive. + // Under high contention, we may end up going in circles thousands of times. + // To avoid it, we wait here until local poll is armed and then proceed + // to TBVIM exit for blocking. We do not SpinPause, but yield to let + // VM thread to arm the poll sooner. + while (SafepointSynchronize::is_synchronizing() && + !SafepointMechanism::local_poll_armed(java_thread)) { + os::naked_yield(); + } + } else { + os::naked_yield(); + } + } else { + os::naked_yield(); + } + } +} + ShenandoahSimpleLock::ShenandoahSimpleLock() { assert(os::mutex_init_done(), "Too early!"); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp --- openjdk-17-17.0.13+11/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -35,34 +35,41 @@ enum LockState { unlocked = 0, locked = 1 }; shenandoah_padding(0); - volatile int _state; + volatile LockState _state; shenandoah_padding(1); - volatile Thread* _owner; + Thread* volatile _owner; shenandoah_padding(2); + template + void contended_lock_internal(JavaThread* java_thread); public: ShenandoahLock() : _state(unlocked), _owner(NULL) {}; - void lock() { -#ifdef ASSERT - assert(_owner != Thread::current(), "reentrant locking attempt, would deadlock"); -#endif - Thread::SpinAcquire(&_state, "Shenandoah Heap Lock"); -#ifdef ASSERT - assert(_state == locked, "must be locked"); - assert(_owner == NULL, "must not be owned"); - _owner = Thread::current(); -#endif + void lock(bool allow_block_for_safepoint) { + assert(Atomic::load(&_owner) != Thread::current(), "reentrant locking attempt, would deadlock"); + + if ((allow_block_for_safepoint && SafepointSynchronize::is_synchronizing()) || + (Atomic::cmpxchg(&_state, unlocked, locked) != unlocked)) { + // 1. Java thread, and there is a pending safepoint. Dive into contended locking + // immediately without trying anything else, and block. + // 2. Fast lock fails, dive into contended lock handling. + contended_lock(allow_block_for_safepoint); + } + + assert(Atomic::load(&_state) == locked, "must be locked"); + assert(Atomic::load(&_owner) == NULL, "must not be owned"); + DEBUG_ONLY(Atomic::store(&_owner, Thread::current());) } void unlock() { -#ifdef ASSERT - assert (_owner == Thread::current(), "sanity"); - _owner = NULL; -#endif - Thread::SpinRelease(&_state); + assert(Atomic::load(&_owner) == Thread::current(), "sanity"); + DEBUG_ONLY(Atomic::store(&_owner, (Thread*)NULL);) + OrderAccess::fence(); + Atomic::store(&_state, unlocked); } + void contended_lock(bool allow_block_for_safepoint); + bool owned_by_self() { #ifdef ASSERT return _state == locked && _owner == Thread::current(); @@ -77,9 +84,9 @@ private: ShenandoahLock* const _lock; public: - ShenandoahLocker(ShenandoahLock* lock) : _lock(lock) { + ShenandoahLocker(ShenandoahLock* lock, bool allow_block_for_safepoint = false) : _lock(lock) { if (_lock != NULL) { - _lock->lock(); + _lock->lock(allow_block_for_safepoint); } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp openjdk-17-17.0.14+7/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -103,10 +103,6 @@ } }; -static bool is_module_available(outputStream* output, TRAPS) { - return JfrJavaSupport::is_jdk_jfr_module_available(output, THREAD); -} - static bool is_disabled(outputStream* output) { if (Jfr::is_disabled()) { if (output != NULL) { @@ -119,7 +115,28 @@ static bool invalid_state(outputStream* out, TRAPS) { DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD)); - return is_disabled(out) || !is_module_available(out, THREAD); + if (is_disabled(out)) { + return true; + } + if (!JfrJavaSupport::is_jdk_jfr_module_available()) { + JfrJavaSupport::load_jdk_jfr_module(THREAD); + if (HAS_PENDING_EXCEPTION) { + // Log exception here, but let is_jdk_jfr_module_available(out, THREAD) + // handle output to the user. + ResourceMark rm(THREAD); + oop throwable = PENDING_EXCEPTION; + assert(throwable != nullptr, "invariant"); + oop msg = java_lang_Throwable::message(throwable); + if (msg != nullptr) { + char* text = java_lang_String::as_utf8_string(msg); + if (text != nullptr) { + log_debug(jfr, startup)("Flight Recorder can not be enabled. %s", text); + } + } + CLEAR_PENDING_EXCEPTION; + } + } + return !JfrJavaSupport::is_jdk_jfr_module_available(out, THREAD); } static void handle_pending_exception(outputStream* output, bool startup, oop throwable) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -41,6 +41,7 @@ #include "runtime/handles.inline.hpp" #include "runtime/fieldDescriptor.inline.hpp" #include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/semaphore.inline.hpp" #include "runtime/synchronizer.hpp" @@ -607,6 +608,23 @@ const char* const JDK_JFR_MODULE_NAME = "jdk.jfr"; const char* const JDK_JFR_PACKAGE_NAME = "jdk/jfr"; + + +void JfrJavaSupport::load_jdk_jfr_module(TRAPS) { + DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD)); + ResourceMark rm(THREAD); + HandleMark hm(THREAD); + Handle h_module_name = java_lang_String::create_from_str(JDK_JFR_MODULE_NAME, CHECK); + JavaValue result(T_OBJECT); + JavaCalls::call_static(&result, + vmClasses::module_Modules_klass(), + vmSymbols::loadModule_name(), + vmSymbols::loadModule_signature(), + h_module_name, + CHECK + ); +} + static bool is_jdk_jfr_module_in_readability_graph() { // take one of the packages in the module to be located and query for its definition. TempNewSymbol pkg_sym = SymbolTable::new_symbol(JDK_JFR_PACKAGE_NAME); diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp --- openjdk-17-17.0.13+11/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -86,6 +86,7 @@ static void throw_class_format_error(const char* message, TRAPS); static void throw_runtime_exception(const char* message, TRAPS); + static void load_jdk_jfr_module(TRAPS); static bool is_jdk_jfr_module_available(); static bool is_jdk_jfr_module_available(outputStream* stream, TRAPS); diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/jfr/metadata/metadata.xml openjdk-17-17.0.14+7/src/hotspot/share/jfr/metadata/metadata.xml --- openjdk-17-17.0.13+11/src/hotspot/share/jfr/metadata/metadata.xml 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/jfr/metadata/metadata.xml 2025-01-04 20:25:18.000000000 +0000 @@ -1051,7 +1051,7 @@ - + diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/memory/guardedMemory.cpp openjdk-17-17.0.14+7/src/hotspot/share/memory/guardedMemory.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/memory/guardedMemory.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/memory/guardedMemory.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -33,7 +33,9 @@ if (outerp != NULL) { GuardedMemory guarded(outerp, len, tag); void* innerp = guarded.get_user_ptr(); - memcpy(innerp, ptr, len); + if (ptr != nullptr) { + memcpy(innerp, ptr, len); + } return innerp; } return NULL; // OOM diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/oops/instanceKlass.cpp openjdk-17-17.0.14+7/src/hotspot/share/oops/instanceKlass.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/oops/instanceKlass.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/oops/instanceKlass.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -3427,11 +3427,13 @@ } } st->print(BULLET"method ordering: "); method_ordering()->print_value_on(st); st->cr(); - st->print(BULLET"default_methods: "); default_methods()->print_value_on(st); st->cr(); - if (Verbose && default_methods() != NULL) { - Array* method_array = default_methods(); - for (int i = 0; i < method_array->length(); i++) { - st->print("%d : ", i); method_array->at(i)->print_value(); st->cr(); + if (default_methods() != nullptr) { + st->print(BULLET"default_methods: "); default_methods()->print_value_on(st); st->cr(); + if (Verbose) { + Array* method_array = default_methods(); + for (int i = 0; i < method_array->length(); i++) { + st->print("%d : ", i); method_array->at(i)->print_value(); st->cr(); + } } } if (default_vtable_indices() != NULL) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/oops/method.cpp openjdk-17-17.0.14+7/src/hotspot/share/oops/method.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/oops/method.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/oops/method.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -2242,10 +2242,15 @@ Method* Method::checked_resolve_jmethod_id(jmethodID mid) { if (mid == NULL) return NULL; Method* o = resolve_jmethod_id(mid); - if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) { + if (o == NULL || o == JNIMethodBlock::_free_method) { return NULL; } - return o; + // Method should otherwise be valid. Assert for testing. + assert(is_valid_method(o), "should be valid jmethodid"); + // If the method's class holder object is unreferenced, but not yet marked as + // unloaded, we need to return NULL here too because after a safepoint, its memory + // will be reclaimed. + return o->method_holder()->is_loader_alive() ? o : NULL; }; void Method::set_on_stack(const bool value) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/oops/symbol.cpp openjdk-17-17.0.14+7/src/hotspot/share/oops/symbol.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/oops/symbol.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/oops/symbol.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -22,7 +22,6 @@ * */ - #include "precompiled.hpp" #include "cds/metaspaceShared.hpp" #include "classfile/altHashing.hpp" @@ -388,11 +387,9 @@ // The print_value functions are present in all builds, to support the // disassembler and error reporting. void Symbol::print_value_on(outputStream* st) const { - st->print("'"); - for (int i = 0; i < utf8_length(); i++) { - st->print("%c", char_at(i)); - } - st->print("'"); + st->print_raw("'", 1); + st->print_raw((const char*)base(), utf8_length()); + st->print_raw("'", 1); } void Symbol::print_value() const { print_value_on(tty); } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/opto/compile.cpp openjdk-17-17.0.14+7/src/hotspot/share/opto/compile.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/opto/compile.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/opto/compile.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -3113,8 +3113,8 @@ bool is_oop = t->isa_oopptr() != nullptr; bool is_klass = t->isa_klassptr() != nullptr; - if ((is_oop && Matcher::const_oop_prefer_decode() ) || - (is_klass && Matcher::const_klass_prefer_decode())) { + if ((is_oop && UseCompressedOops && Matcher::const_oop_prefer_decode() ) || + (is_klass && UseCompressedClassPointers && Matcher::const_klass_prefer_decode())) { Node* nn = nullptr; int op = is_oop ? Op_ConN : Op_ConNKlass; diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/opto/gcm.cpp openjdk-17-17.0.14+7/src/hotspot/share/opto/gcm.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/opto/gcm.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/opto/gcm.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -648,6 +648,20 @@ // The anti-dependence constraints apply only to the fringe of this tree. Node* initial_mem = load->in(MemNode::Memory); + // We don't optimize the memory graph for pinned loads, so we may need to raise the + // root of our search tree through the corresponding slices of MergeMem nodes to + // get to the node that really creates the memory state for this slice. + if (load_alias_idx >= Compile::AliasIdxRaw) { + while (initial_mem->is_MergeMem()) { + MergeMemNode* mm = initial_mem->as_MergeMem(); + Node* p = mm->memory_at(load_alias_idx); + if (p != mm->base_memory()) { + initial_mem = p; + } else { + break; + } + } + } worklist_store.push(initial_mem); worklist_visited.push(initial_mem); worklist_mem.push(nullptr); diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/opto/loopnode.cpp openjdk-17-17.0.14+7/src/hotspot/share/opto/loopnode.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/opto/loopnode.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/opto/loopnode.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1478,12 +1478,28 @@ // Since stride > 0 and limit_correction <= stride + 1, we can restate this with no over- or underflow into: // max_int - canonicalized_correction - limit_correction >= limit // Since canonicalized_correction and limit_correction are both constants, we can replace them with a new constant: - // final_correction = canonicalized_correction + limit_correction + // (v) final_correction = canonicalized_correction + limit_correction + // // which gives us: // // Final predicate condition: // max_int - final_correction >= limit // + // However, we need to be careful that (v) does not over- or underflow. + // We know that: + // canonicalized_correction = stride - 1 + // and + // limit_correction <= stride + 1 + // and thus + // canonicalized_correction + limit_correction <= 2 * stride + // To prevent an over- or underflow of (v), we must ensure that + // 2 * stride <= max_int + // which can safely be checked without over- or underflow with + // (vi) stride != min_int AND abs(stride) <= max_int / 2 + // + // We could try to further optimize the cases where (vi) does not hold but given that such large strides are + // very uncommon and the loop would only run for a very few iterations anyway, we simply bail out if (vi) fails. + // // (2) Loop Limit Check Predicate for (ii): // Using (ii): init < limit // @@ -1514,6 +1530,10 @@ // there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii) // again and can skip the predicate. + // Check (vi) and bail out if the stride is too big. + if (stride_con == min_signed_integer(iv_bt) || (ABS(stride_con) > max_signed_integer(iv_bt) / 2)) { + return false; + } // Accounting for (LE3) and (LE4) where we use pre-incremented phis in the loop exit check. const jlong limit_correction_for_pre_iv_exit_check = (phi_incr != nullptr) ? stride_con : 0; @@ -4787,7 +4807,8 @@ } else { // Else not a nested loop if( !_nodes[m->_idx] ) continue; // Dead code has no loop - l = get_loop(m); // Get previously determined loop + IdealLoopTree* m_loop = get_loop(m); + l = m_loop; // Get previously determined loop // If successor is header of a loop (nest), move up-loop till it // is a member of some outer enclosing loop. Since there are no // shared headers (I've split them already) I only need to go up @@ -4813,10 +4834,10 @@ // Insert the NeverBranch between 'm' and it's control user. NeverBranchNode *iff = new NeverBranchNode( m ); _igvn.register_new_node_with_optimizer(iff); - set_loop(iff, l); + set_loop(iff, m_loop); Node *if_t = new CProjNode( iff, 0 ); _igvn.register_new_node_with_optimizer(if_t); - set_loop(if_t, l); + set_loop(if_t, m_loop); Node* cfg = nullptr; // Find the One True Control User of m for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax; j++) { diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/opto/node.hpp openjdk-17-17.0.14+7/src/hotspot/share/opto/node.hpp --- openjdk-17-17.0.13+11/src/hotspot/share/opto/node.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/opto/node.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -1515,8 +1515,8 @@ class SimpleDUIterator : public StackObj { private: Node* node; - DUIterator_Fast i; DUIterator_Fast imax; + DUIterator_Fast i; public: SimpleDUIterator(Node* n): node(n), i(n->fast_outs(imax)) {} bool has_next() { return i < imax; } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/opto/subnode.cpp openjdk-17-17.0.14+7/src/hotspot/share/opto/subnode.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/opto/subnode.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/opto/subnode.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1483,44 +1483,86 @@ return new BoolNode( ncmp, _test.negate() ); } - // Change ((x & m) u<= m) or ((m & x) u<= m) to always true - // Same with ((x & m) u< m+1) and ((m & x) u< m+1) + // We use the following Lemmas/insights for the following two transformations (1) and (2): + // x & y <=u y, for any x and y (Lemma 1, masking always results in a smaller unsigned number) + // y Opcode() == Op_AddI && cmp2->in(2)->find_int_con(0) == 1) { - bound = cmp2->in(1); + // (1b) "(x & m) in(1); + const TypeInt* rhs_m_type = phase->type(rhs_m)->isa_int(); + if (rhs_m_type->_lo > -1 || rhs_m_type->_hi < -1) { + // Exclude any case where m == -1 is possible. + m = rhs_m; + } } - if (cmp1->in(2) == bound || cmp1->in(1) == bound) { + if (cmp1->in(2) == m || cmp1->in(1) == m) { return ConINode::make(1); } } - // Change ((x & (m - 1)) u< m) into (m > 0) - // This is the off-by-one variant of the above + // (2) Change ((x & (m - 1)) u 0) + // This is the off-by-one variant of the above. + // + // We now prove that this replacement is correct. This is the same as proving + // "m >u 0" if and only if "x & (m - 1) u 0 <=> x & (m - 1) m >u 0": + // We prove this by contradiction: + // Assume m <=u 0 which is equivalent to m == 0: + // and thus + // x & (m - 1) u 0 => x & (m - 1) u 0, no underflow of "m - 1" + // + // + // Note that the signed version of "m > 0": + // m > 0 <=> x & (m - 1) 0 + // is false which is a contradiction. if (cop == Op_CmpU && _test._test == BoolTest::lt && cmp1_op == Op_AndI) { - Node* l = cmp1->in(1); - Node* r = cmp1->in(2); - for (int repeat = 0; repeat < 2; repeat++) { - bool match = r->Opcode() == Op_AddI && r->in(2)->find_int_con(0) == -1 && - r->in(1) == cmp2; - if (match) { - // arraylength known to be non-negative, so a (arraylength != 0) is sufficient, - // but to be compatible with the array range check pattern, use (arraylength u> 0) - Node* ncmp = cmp2->Opcode() == Op_LoadRange - ? phase->transform(new CmpUNode(cmp2, phase->intcon(0))) - : phase->transform(new CmpINode(cmp2, phase->intcon(0))); - return new BoolNode(ncmp, BoolTest::gt); - } else { - // commute and try again - l = cmp1->in(2); - r = cmp1->in(1); + Node* m = cmp2; // RHS: m + for (int add_idx = 1; add_idx <= 2; add_idx++) { // LHS: "(m + (-1)) & x" or "x & (m + (-1))"? + Node* maybe_m_minus_1 = cmp1->in(add_idx); + if (maybe_m_minus_1->Opcode() == Op_AddI && + maybe_m_minus_1->in(2)->find_int_con(0) == -1 && + maybe_m_minus_1->in(1) == m) { + Node* m_cmpu_0 = phase->transform(new CmpUNode(m, phase->intcon(0))); + return new BoolNode(m_cmpu_0, BoolTest::gt); } } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/prims/jniCheck.cpp openjdk-17-17.0.14+7/src/hotspot/share/prims/jniCheck.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/prims/jniCheck.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/prims/jniCheck.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -2316,7 +2316,7 @@ // make sure the last pointer in the checked table is not null, indicating // an addition to the JNINativeInterface_ structure without initializing // it in the checked table. - debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \ + debug_only(intptr_t *lastPtr = (intptr_t *)((char *)&checked_jni_NativeInterface + \ sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));) assert(*lastPtr != 0, "Mismatched JNINativeInterface tables, check for new entries"); diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/prims/unsafe.cpp openjdk-17-17.0.14+7/src/hotspot/share/prims/unsafe.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/prims/unsafe.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/prims/unsafe.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -130,13 +130,9 @@ static inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) { assert_field_offset_sane(p, field_offset); - jlong byte_offset = field_offset_to_byte_offset(field_offset); - - if (sizeof(char*) == sizeof(jint)) { // (this constant folds!) - return cast_from_oop
    (p) + (jint) byte_offset; - } else { - return cast_from_oop
    (p) + byte_offset; - } + uintptr_t base_address = cast_from_oop(p); + uintptr_t byte_offset = (uintptr_t)field_offset_to_byte_offset(field_offset); + return (void*)(base_address + byte_offset); } // Externally callable versions: diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/prims/whitebox.cpp openjdk-17-17.0.14+7/src/hotspot/share/prims/whitebox.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/prims/whitebox.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/prims/whitebox.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1782,6 +1782,12 @@ return cp->cache()->length(); WB_END +WB_ENTRY(jobjectArray, WB_GetResolvedReferences(JNIEnv* env, jobject wb, jclass klass)) + InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); + objArrayOop resolved_refs= ik->constants()->resolved_references(); + return (jobjectArray)JNIHandles::make_local(THREAD, resolved_refs); +WB_END + WB_ENTRY(jint, WB_ConstantPoolRemapInstructionOperandFromCache(JNIEnv* env, jobject wb, jclass klass, jint index)) InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); ConstantPool* cp = ik->constants(); @@ -1913,18 +1919,6 @@ return !HeapShared::closed_archive_heap_region_mapped(); WB_END -WB_ENTRY(jobject, WB_GetResolvedReferences(JNIEnv* env, jobject wb, jclass clazz)) - Klass *k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); - if (k->is_instance_klass()) { - InstanceKlass *ik = InstanceKlass::cast(k); - ConstantPool *cp = ik->constants(); - objArrayOop refs = cp->resolved_references(); - return (jobject)JNIHandles::make_local(THREAD, refs); - } else { - return NULL; - } -WB_END - WB_ENTRY(void, WB_LinkClass(JNIEnv* env, jobject wb, jclass clazz)) Klass *k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); if (!k->is_instance_klass()) { @@ -2553,6 +2547,7 @@ {CC"getConstantPool0", CC"(Ljava/lang/Class;)J", (void*)&WB_GetConstantPool }, {CC"getConstantPoolCacheIndexTag0", CC"()I", (void*)&WB_GetConstantPoolCacheIndexTag}, {CC"getConstantPoolCacheLength0", CC"(Ljava/lang/Class;)I", (void*)&WB_GetConstantPoolCacheLength}, + {CC"getResolvedReferences0", CC"(Ljava/lang/Class;)[Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, {CC"remapInstructionOperandFromCPCache0", CC"(Ljava/lang/Class;I)I", (void*)&WB_ConstantPoolRemapInstructionOperandFromCache}, {CC"encodeConstantPoolIndyIndex0", @@ -2578,7 +2573,6 @@ {CC"isShared", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsShared }, {CC"isSharedClass", CC"(Ljava/lang/Class;)Z", (void*)&WB_IsSharedClass }, {CC"areSharedStringsIgnored", CC"()Z", (void*)&WB_AreSharedStringsIgnored }, - {CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, {CC"linkClass", CC"(Ljava/lang/Class;)V", (void*)&WB_LinkClass}, {CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped}, {CC"isCDSIncluded", CC"()Z", (void*)&WB_IsCDSIncluded }, diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/runtime/arguments.cpp openjdk-17-17.0.14+7/src/hotspot/share/runtime/arguments.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/runtime/arguments.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/runtime/arguments.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -1996,6 +1996,14 @@ } #endif +#if INCLUDE_JFR + if (status && (FlightRecorderOptions || StartFlightRecording)) { + if (!create_numbered_module_property("jdk.module.addmods", "jdk.jfr", addmods_count++)) { + return false; + } + } +#endif + #ifndef SUPPORT_RESERVED_STACK_AREA if (StackReservedPages != 0) { FLAG_SET_CMDLINE(StackReservedPages, 0); diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/runtime/deoptimization.cpp openjdk-17-17.0.14+7/src/hotspot/share/runtime/deoptimization.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/runtime/deoptimization.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/runtime/deoptimization.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -429,7 +429,7 @@ #if COMPILER2_OR_JVMCI if ((jvmci_enabled COMPILER2_PRESENT( || ((DoEscapeAnalysis || EliminateNestedLocks) && EliminateLocks) )) && !EscapeBarrier::objs_are_deoptimized(current, deoptee.id())) { - bool unused; + bool unused = false; restore_eliminated_locks(current, chunk, realloc_failures, deoptee, exec_mode, unused); } #endif // COMPILER2_OR_JVMCI diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/runtime/java.cpp openjdk-17-17.0.14+7/src/hotspot/share/runtime/java.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/runtime/java.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/runtime/java.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -77,6 +77,7 @@ #include "runtime/vm_version.hpp" #include "services/memTracker.hpp" #include "utilities/dtrace.hpp" +#include "utilities/events.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" @@ -410,6 +411,8 @@ #define BEFORE_EXIT_DONE 2 static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN; + Events::log(thread, "Before exit entered"); + // Note: don't use a Mutex to guard the entire before_exit(), as // JVMTI post_thread_end_event and post_vm_death_event will run native code. // A CAS or OSMutex would work just fine but then we need to manipulate diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/runtime/os.cpp openjdk-17-17.0.14+7/src/hotspot/share/runtime/os.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/runtime/os.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/runtime/os.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -985,7 +985,9 @@ if (envvar != NULL) { st->print("%s", env_list[i]); st->print("="); - st->print_cr("%s", envvar); + st->print("%s", envvar); + // Use separate cr() printing to avoid unnecessary buffer operations that might cause truncation. + st->cr(); } } } diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/runtime/thread.cpp openjdk-17-17.0.14+7/src/hotspot/share/runtime/thread.cpp --- openjdk-17-17.0.13+11/src/hotspot/share/runtime/thread.cpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/runtime/thread.cpp 2025-01-04 20:25:18.000000000 +0000 @@ -3399,10 +3399,10 @@ // Threads::destroy_vm() is normally called from jni_DestroyJavaVM() when // the program falls off the end of main(). Another VM exit path is through -// vm_exit() when the program calls System.exit() to return a value or when -// there is a serious error in VM. The two shutdown paths are not exactly -// the same, but they share Shutdown.shutdown() at Java level and before_exit() -// and VM_Exit op at VM level. +// vm_exit(), when the program calls System.exit() to return a value, or when +// there is a serious error in VM. +// These two separate shutdown paths are not exactly the same, but they share +// Shutdown.shutdown() at Java level and before_exit() and VM_Exit op at VM level. // // Shutdown sequence: // + Shutdown native memory tracking if it is on diff -Nru openjdk-17-17.0.13+11/src/hotspot/share/utilities/growableArray.hpp openjdk-17-17.0.14+7/src/hotspot/share/utilities/growableArray.hpp --- openjdk-17-17.0.13+11/src/hotspot/share/utilities/growableArray.hpp 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/hotspot/share/utilities/growableArray.hpp 2025-01-04 20:25:18.000000000 +0000 @@ -270,10 +270,12 @@ } void sort(int f(E*, E*)) { + if (_data == nullptr) return; qsort(_data, length(), sizeof(E), (_sort_Fn)f); } // sort by fixed-stride sub arrays: void sort(int f(E*, E*), int stride) { + if (_data == nullptr) return; qsort(_data, length() / stride, sizeof(E) * stride, (_sort_Fn)f); } diff -Nru openjdk-17-17.0.13+11/src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c openjdk-17-17.0.14+7/src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c --- openjdk-17-17.0.13+11/src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c 2025-01-04 20:25:18.000000000 +0000 @@ -89,25 +89,35 @@ } } - // Get buffer size needed to read all processes - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0}; - if (sysctl(mib, 4, NULL, &bufSize, NULL, 0) < 0) { - JNU_ThrowByNameWithLastError(env, - "java/lang/RuntimeException", "sysctl failed"); - return -1; - } + int errsysctl; + int maxRetries = 100; + void *buffer = NULL; + do { + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0}; + if (buffer != NULL) free(buffer); + // Get buffer size needed to read all processes + if (sysctl(mib, 4, NULL, &bufSize, NULL, 0) < 0) { + JNU_ThrowByNameWithMessageAndLastError(env, + "java/lang/RuntimeException", "sysctl failed"); + return -1; + } - // Allocate buffer big enough for all processes - void *buffer = malloc(bufSize); - if (buffer == NULL) { - JNU_ThrowOutOfMemoryError(env, "malloc failed"); - return -1; - } + // Allocate buffer big enough for all processes; add a little + // bit of space to be able to hold a few more proc infos + // for processes started right after the first sysctl call + buffer = malloc(bufSize + 4 * sizeof(struct kinfo_proc)); + if (buffer == NULL) { + JNU_ThrowOutOfMemoryError(env, "malloc failed"); + return -1; + } + + // Read process info for all processes + errsysctl = sysctl(mib, 4, buffer, &bufSize, NULL, 0); + } while (errsysctl < 0 && errno == ENOMEM && maxRetries-- > 0); - // Read process info for all processes - if (sysctl(mib, 4, buffer, &bufSize, NULL, 0) < 0) { - JNU_ThrowByNameWithLastError(env, - "java/lang/RuntimeException", "sysctl failed"); + if (errsysctl < 0) { + JNU_ThrowByNameWithMessageAndLastError(env, + "java/lang/RuntimeException", "sysctl failed to get info about all processes"); free(buffer); return -1; } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java openjdk-17-17.0.14+7/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -123,6 +123,25 @@ } } + // validate the key algorithm/encoding and then returns the key bytes + // which callers should erase after use + private static byte[] checkKey(Key key, int fixedKeySize) + throws InvalidKeyException { + + byte[] keyBytes = key.getEncoded(); + if (keyBytes == null) { + throw new InvalidKeyException("Null key"); + } + int keyLen = keyBytes.length; + if (!key.getAlgorithm().equalsIgnoreCase("AES") || + !AESCrypt.isKeySizeValid(keyLen) || + (fixedKeySize != -1 && fixedKeySize != keyLen)) { + throw new InvalidKeyException("Invalid key length: " + + keyLen + " bytes"); + } + return keyBytes; + } + // store the specified bytes, e.g. in[inOfs...(inOfs+inLen-1)] into // 'dataBuf' starting at 'dataIdx'. // NOTE: if 'in' is null, this method will ensure that 'dataBuf' has enough @@ -294,10 +313,8 @@ // actual impl for various engineInit(...) methods private void implInit(int opmode, Key key, byte[] iv, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { - byte[] keyBytes = key.getEncoded(); - if (keyBytes == null) { - throw new InvalidKeyException("Null key"); - } + byte[] keyBytes = checkKey(key, fixedKeySize); + this.opmode = opmode; boolean decrypting = (opmode == Cipher.DECRYPT_MODE || opmode == Cipher.UNWRAP_MODE); @@ -658,21 +675,11 @@ * @exception InvalidKeyException if key is invalid. */ protected int engineGetKeySize(Key key) throws InvalidKeyException { - byte[] encoded = key.getEncoded(); - if (encoded == null) { - throw new InvalidKeyException("Cannot decide key length"); - } + byte[] keyBytes = checkKey(key, fixedKeySize); + // only need length; erase immediately + Arrays.fill(keyBytes, (byte) 0); + return Math.multiplyExact(keyBytes.length, 8); - // only need length - Arrays.fill(encoded, (byte) 0); - int keyLen = encoded.length; - if (!key.getAlgorithm().equalsIgnoreCase("AES") || - !AESCrypt.isKeySizeValid(keyLen) || - (fixedKeySize != -1 && fixedKeySize != keyLen)) { - throw new InvalidKeyException("Invalid key length: " + - keyLen + " bytes"); - } - return Math.multiplyExact(keyLen, 8); } /** diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/ThreadLocal.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/ThreadLocal.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/ThreadLocal.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/ThreadLocal.java 2025-01-04 20:25:18.000000000 +0000 @@ -90,7 +90,7 @@ * The next hash code to be given out. Updated atomically. Starts at * zero. */ - private static AtomicInteger nextHashCode = + private static final AtomicInteger nextHashCode = new AtomicInteger(); /** diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/invoke/MethodHandle.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/MethodHandle.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -1764,8 +1764,7 @@ if (oldForm != newForm) { assert (newForm.customized == null || newForm.customized == this); newForm.prepare(); // as in MethodHandle. - UNSAFE.putReference(this, FORM_OFFSET, newForm); - UNSAFE.fullFence(); + UNSAFE.putReferenceRelease(this, FORM_OFFSET, newForm); // properly publish newForm } } finally { updateInProgress = false; diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/invoke/VarHandles.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/VarHandles.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/lang/invoke/VarHandles.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/lang/invoke/VarHandles.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,8 +38,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import java.util.stream.Stream; import static java.lang.invoke.MethodHandleStatics.UNSAFE; @@ -50,13 +48,6 @@ final class VarHandles { - static ClassValue> ADDRESS_FACTORIES = new ClassValue<>() { - @Override - protected ConcurrentMap computeValue(Class type) { - return new ConcurrentHashMap<>(); - } - }; - static VarHandle makeFieldHandle(MemberName f, Class refc, Class type, boolean isWriteAllowedOnFinalFields) { if (!f.isStatic()) { long foffset = MethodHandleNatives.objectFieldOffset(f); diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/nio/charset/Charset.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/charset/Charset.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/nio/charset/Charset.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/charset/Charset.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,6 @@ import java.util.Locale; import java.util.Map; import java.util.NoSuchElementException; -import java.util.Objects; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; import java.util.Set; @@ -636,7 +635,12 @@ * If the canonical name or any of the aliases are illegal */ protected Charset(String canonicalName, String[] aliases) { - String[] as = Objects.requireNonNullElse(aliases, zeroAliases); + String[] as = + aliases == null ? + zeroAliases : + VM.isSystemDomainLoader(getClass().getClassLoader()) ? + aliases : + Arrays.copyOf(aliases, aliases.length); // Skip checks for the standard, built-in Charsets we always load // during initialization. diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/nio/file/Files.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/file/Files.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/nio/file/Files.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/nio/file/Files.java 2025-01-04 20:25:18.000000000 +0000 @@ -806,7 +806,7 @@ try { createDirectory(dir, attrs); } catch (FileAlreadyExistsException x) { - if (!isDirectory(dir, LinkOption.NOFOLLOW_LINKS)) + if (!isDirectory(dir)) throw x; } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/security/MessageDigestSpi.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/MessageDigestSpi.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/security/MessageDigestSpi.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/MessageDigestSpi.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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 @@ -204,7 +204,15 @@ */ public Object clone() throws CloneNotSupportedException { if (this instanceof Cloneable) { - return super.clone(); + MessageDigestSpi o = (MessageDigestSpi)super.clone(); + if (o.tempArray != null) { + // New byte arrays are allocated when the ByteBuffer argument + // to engineUpdate is not backed by a byte array. + // Here, the newly allocated byte array must also be cloned + // to prevent threads from sharing the same memory. + o.tempArray = tempArray.clone(); + } + return o; } else { throw new CloneNotSupportedException(); } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/security/cert/X509CertSelector.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/cert/X509CertSelector.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/security/cert/X509CertSelector.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/security/cert/X509CertSelector.java 2025-01-04 20:25:18.000000000 +0000 @@ -1970,10 +1970,10 @@ } if (debug != null) { - debug.println("X509CertSelector.match(SN: " - + (xcert.getSerialNumber()).toString(16) + "\n Issuer: " - + xcert.getIssuerX500Principal() + "\n Subject: " + xcert.getSubjectX500Principal() - + ")"); + debug.println("X509CertSelector.match(Serial number: " + + Debug.toString(xcert.getSerialNumber()) + + "\n Issuer: " + xcert.getIssuerX500Principal() + "\n Subject: " + + xcert.getSubjectX500Principal() + ")"); } /* match on X509Certificate */ diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/time/format/DateTimeFormatter.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/time/format/DateTimeFormatter.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/time/format/DateTimeFormatter.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/time/format/DateTimeFormatter.java 2025-01-04 20:25:18.000000000 +0000 @@ -2240,29 +2240,23 @@ DateTimeParseContext context; try { context = formatter.parseUnresolved0(text, pos); - } catch (IndexOutOfBoundsException ex) { - if (pos.getErrorIndex() < 0) { - pos.setErrorIndex(0); - } - return null; - } - if (context == null) { - if (pos.getErrorIndex() < 0) { - pos.setErrorIndex(0); + if (context == null) { + if (pos.getErrorIndex() < 0) { + pos.setErrorIndex(0); + } + return null; } - return null; - } - try { TemporalAccessor resolved = context.toResolved(formatter.resolverStyle, formatter.resolverFields); if (parseType == null) { return resolved; } return resolved.query(parseType); } catch (RuntimeException ex) { - pos.setErrorIndex(0); + if (pos.getErrorIndex() < 0) { + pos.setErrorIndex(0); + } return null; } } } - } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java 2025-01-04 20:25:18.000000000 +0000 @@ -2891,7 +2891,7 @@ final Future f; Canceller(Future f) { this.f = f; } public void accept(Object ignore, Throwable ex) { - if (ex == null && f != null && !f.isDone()) + if (f != null && !f.isDone()) f.cancel(false); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/java/util/zip/ZipFile.java openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/zip/ZipFile.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/java/util/zip/ZipFile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/java/util/zip/ZipFile.java 2025-01-04 20:25:18.000000000 +0000 @@ -1660,6 +1660,9 @@ zerror("invalid END header (bad central directory offset)"); } // read in the CEN and END + if (end.cenlen + ENDHDR >= Integer.MAX_VALUE) { + zerror("invalid END header (central directory size too large)"); + } cen = this.cen = new byte[(int)(end.cenlen + ENDHDR)]; if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) { zerror("read CEN tables failed"); diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2024, 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 @@ -303,7 +303,8 @@ } static final String httpVersion = "HTTP/1.1"; - static final String acceptString = "*/*"; + static final String acceptString = + "text/html, image/gif, image/jpeg, */*; q=0.2"; // the following http request headers should NOT have their values // returned for security reasons. diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java 2025-01-04 20:25:18.000000000 +0000 @@ -186,7 +186,13 @@ return n + 1; } - return n + implRead(cbuf, off, off + len); + // Read remaining characters + int nr = implRead(cbuf, off, off + len); + + // At this point, n is either 1 if a leftover character was read, + // or 0 if no leftover character was read. If n is 1 and nr is -1, + // indicating EOF, then we don't return their sum as this loses data. + return (nr < 0) ? (n == 1 ? 1 : nr) : (n + nr); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/jca/JCAUtil.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/jca/JCAUtil.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/jca/JCAUtil.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/jca/JCAUtil.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import jdk.internal.event.EventHelper; import jdk.internal.event.X509CertificateEvent; import sun.security.util.KeyUtil; +import sun.security.util.Debug; /** * Collection of static utility methods used by the security framework. @@ -105,7 +106,7 @@ (cert instanceof X509Certificate x509)) { PublicKey pKey = x509.getPublicKey(); String algId = x509.getSigAlgName(); - String serNum = x509.getSerialNumber().toString(16); + String serNum = Debug.toString(x509.getSerialNumber()); String subject = x509.getSubjectX500Principal().toString(); String issuer = x509.getIssuerX500Principal().toString(); String keyType = pKey.getAlgorithm(); diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -698,14 +698,15 @@ md.digest(encryptedDigest))) { throw new SignatureException("Signature timestamp (#" + - token.getSerialNumber() + ") generated on " + token.getDate() + - " is inapplicable"); + Debug.toString(token.getSerialNumber()) + + ") generated on " + token.getDate() + " is inapplicable"); } if (debug != null) { debug.println(); debug.println("Detected signature timestamp (#" + - token.getSerialNumber() + ") generated on " + token.getDate()); + Debug.toString(token.getSerialNumber()) + + ") generated on " + token.getDate()); debug.println(); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, 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 @@ -244,7 +244,7 @@ debug.println("BasicChecker.updateState issuer: " + currCert.getIssuerX500Principal().toString() + "; subject: " + currCert.getSubjectX500Principal() + "; serial#: " + - currCert.getSerialNumber().toString()); + Debug.toString(currCert.getSerialNumber())); } if (PKIX.isDSAPublicKeyWithoutParams(cKey)) { // cKey needs to inherit DSA parameters from prev key diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/Builder.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Builder.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/Builder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Builder.java 2025-01-04 20:25:18.000000000 +0000 @@ -435,8 +435,7 @@ if (debug != null) { debug.println("Builder.addMatchingCerts: " + "adding target cert" + - "\n SN: " + Debug.toHexString( - targetCert.getSerialNumber()) + + "\n SN: " + Debug.toString(targetCert.getSerialNumber()) + "\n Subject: " + targetCert.getSubjectX500Principal() + "\n Issuer: " + targetCert.getIssuerX500Principal()); } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/CertId.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/CertId.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/CertId.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/CertId.java 2025-01-04 20:25:18.000000000 +0000 @@ -108,7 +108,7 @@ encoder.encodeBuffer(issuerNameHash)); System.out.println("issuerKeyHash is " + encoder.encodeBuffer(issuerKeyHash)); - System.out.println("SerialNumber is " + serialNumber.getNumber()); + System.out.println("SerialNumber is " + Debug.toString(serialNumber.getNumber())); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, 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 @@ -349,7 +349,7 @@ if (debug != null) { debug.println("DistributionPointFetcher.verifyCRL: " + "checking revocation status for" + - "\n SN: " + Debug.toHexString(certImpl.getSerialNumber()) + + "\n SN: " + Debug.toString(certImpl.getSerialNumber()) + "\n Subject: " + certImpl.getSubjectX500Principal() + "\n Issuer: " + certImpl.getIssuerX500Principal()); } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2025-01-04 20:25:18.000000000 +0000 @@ -280,7 +280,7 @@ debug.println("ForwardBuilder.getMatchingCACerts: " + "found matching trust anchor." + "\n SN: " + - Debug.toHexString(trustedCert.getSerialNumber()) + + Debug.toString(trustedCert.getSerialNumber()) + "\n Subject: " + trustedCert.getSubjectX500Principal() + "\n Issuer: " + @@ -703,7 +703,7 @@ { if (debug != null) { debug.println("ForwardBuilder.verifyCert(SN: " - + Debug.toHexString(cert.getSerialNumber()) + + Debug.toString(cert.getSerialNumber()) + "\n Issuer: " + cert.getIssuerX500Principal() + ")" + "\n Subject: " + cert.getSubjectX500Principal() + ")"); } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ -404,7 +404,8 @@ } if (debug != null) { debug.println("Status of certificate (with serial number " + - certId.getSerialNumber() + ") is: " + sr.getCertStatus()); + Debug.toString(certId.getSerialNumber()) + + ") is: " + sr.getCertStatus()); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -351,7 +351,7 @@ { if (debug != null) { debug.println("RevocationChecker.check: checking cert" + - "\n SN: " + Debug.toHexString(xcert.getSerialNumber()) + + "\n SN: " + Debug.toString(xcert.getSerialNumber()) + "\n Subject: " + xcert.getSubjectX500Principal() + "\n Issuer: " + xcert.getIssuerX500Principal()); } @@ -647,7 +647,7 @@ debug.println("RevocationChecker.checkApprovedCRLs() " + "starting the final sweep..."); debug.println("RevocationChecker.checkApprovedCRLs()" + - " cert SN: " + sn.toString()); + " cert SN: " + Debug.toString(sn)); } CRLReason reasonCode = CRLReason.UNSPECIFIED; diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2022, 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 @@ -150,7 +150,7 @@ sb.append("Subject: ").append (x509Cert.getSubjectX500Principal()).append("\n"); sb.append("SerialNum: ").append - (x509Cert.getSerialNumber().toString(16)).append("\n"); + (Debug.toString(x509Cert.getSerialNumber())).append("\n"); sb.append("Expires: ").append (x509Cert.getNotAfter().toString()).append("\n"); boolean[] iUID = x509Cert.getIssuerUniqueID(); diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/SSLLogger.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/SSLLogger.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,7 @@ import sun.security.action.GetPropertyAction; import sun.security.util.HexDumpEncoder; +import sun.security.util.Debug; import sun.security.x509.*; import static java.nio.charset.StandardCharsets.UTF_8; @@ -471,8 +472,7 @@ if (certExts == null) { Object[] certFields = { x509.getVersion(), - Utilities.toHexString( - x509.getSerialNumber().toByteArray()), + Debug.toString(x509.getSerialNumber()), x509.getSigAlgName(), x509.getIssuerX500Principal().toString(), dateTimeFormat.format(x509.getNotBefore().toInstant()), @@ -496,8 +496,7 @@ } Object[] certFields = { x509.getVersion(), - Utilities.toHexString( - x509.getSerialNumber().toByteArray()), + Debug.toString(x509.getSerialNumber()), x509.getSigAlgName(), x509.getIssuerX500Principal().toString(), dateTimeFormat.format(x509.getNotBefore().toInstant()), diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -53,6 +53,7 @@ import sun.security.provider.certpath.OCSPResponse; import sun.security.provider.certpath.ResponderId; import sun.security.util.Cache; +import sun.security.util.Debug; import sun.security.x509.PKIXExtensions; import sun.security.x509.SerialNumber; import sun.security.ssl.X509Authentication.X509Possession; @@ -419,8 +420,8 @@ if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { SSLLogger.fine( - "Check cache for SN" + cid.getSerialNumber() + ": " + - (respEntry != null ? "HIT" : "MISS")); + "Check cache for SN" + Debug.toString(cid.getSerialNumber()) + + ": " + (respEntry != null ? "HIT" : "MISS")); } return respEntry; } @@ -516,7 +517,7 @@ StringBuilder sb = new StringBuilder("StatusInfo:"); sb.append("\n\tCert: ").append( this.cert.getSubjectX500Principal()); - sb.append("\n\tSerial: ").append(this.cert.getSerialNumber()); + sb.append("\n\tSerial: ").append(Debug.toString(this.cert.getSerialNumber())); sb.append("\n\tResponder: ").append(this.responder); sb.append("\n\tResponse data: ").append( this.responseData != null ? @@ -563,7 +564,7 @@ } else { throw new IOException( "Unable to find SingleResponse for SN " + - cid.getSerialNumber()); + Debug.toString(cid.getSerialNumber())); } } else { nextUpdate = null; @@ -614,7 +615,7 @@ if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { SSLLogger.fine( "Starting fetch for SN " + - statInfo.cid.getSerialNumber()); + Debug.toString(statInfo.cid.getSerialNumber())); } try { ResponseCacheEntry cacheEntry; @@ -706,7 +707,7 @@ if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { SSLLogger.fine( "Added response for SN " + - certId.getSerialNumber() + + Debug.toString(certId.getSerialNumber()) + " to cache"); } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -429,8 +429,17 @@ } if (!identifiable) { - checkIdentity(peerHost, - trustedChain[0], algorithm, chainsToPublicCA); + try { + checkIdentity(peerHost, + trustedChain[0], algorithm, chainsToPublicCA); + } catch(CertificateException ce) { + if (checkClientTrusted && "HTTPS".equalsIgnoreCase(algorithm)) { + throw new CertificateException("Endpoint Identification Algorithm " + + "HTTPS is not supported on the server side"); + } else { + throw ce; + } + } } } diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/tools/keytool/Main.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/tools/keytool/Main.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/tools/keytool/Main.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/tools/keytool/Main.java 2025-01-04 20:25:18.000000000 +0000 @@ -1125,7 +1125,6 @@ } } - KeyStore cakstore = buildTrustedCerts(); // -trustcacerts can be specified on -importcert, -printcert or -printcrl. // Reset it so that warnings on CA cert will remain for other command. if (command != IMPORTCERT && command != PRINTCERT @@ -1134,6 +1133,7 @@ } if (trustcacerts) { + KeyStore cakstore = buildTrustedCerts(); if (cakstore != null) { caks = cakstore; } else { diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/util/Debug.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/util/Debug.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/util/Debug.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/util/Debug.java 2025-01-04 20:25:18.000000000 +0000 @@ -398,6 +398,10 @@ return HexFormat.ofDelimiter(":").formatHex(b); } + public static String toString(BigInteger b) { + return toString(b.toByteArray()); + } + // Holder class to break cyclic dependency seen during build private static class FormatHolder { private static final String PATTERN = "yyyy-MM-dd kk:mm:ss.SSS"; diff -Nru openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/x509/SerialNumber.java openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/x509/SerialNumber.java --- openjdk-17-17.0.13+11/src/java.base/share/classes/sun/security/x509/SerialNumber.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/classes/sun/security/x509/SerialNumber.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; +import java.util.HexFormat; import sun.security.util.*; @@ -101,7 +102,7 @@ * Return the SerialNumber as user readable string. */ public String toString() { - return "SerialNumber: [" + Debug.toHexString(serialNum) + ']'; + return "SerialNumber: " + Debug.toString(serialNum); } /** diff -Nru openjdk-17-17.0.13+11/src/java.base/share/legal/public_suffix.md openjdk-17-17.0.14+7/src/java.base/share/legal/public_suffix.md --- openjdk-17-17.0.13+11/src/java.base/share/legal/public_suffix.md 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/share/legal/public_suffix.md 2025-01-04 20:25:18.000000000 +0000 @@ -11,7 +11,7 @@ The Source Code of this file is available under the Mozilla Public License, v. 2.0 and is located at -https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat. +https://raw.githubusercontent.com/publicsuffix/list/1cbd6e71a9b83620b1d0b11e49d3d9ff48c27e22/public_suffix_list.dat. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/. diff -Nru openjdk-17-17.0.13+11/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c --- openjdk-17-17.0.13+11/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c 2025-01-04 20:25:18.000000000 +0000 @@ -537,7 +537,7 @@ * position integer as a filename. */ if ((dir = opendir("/proc")) == NULL) { - JNU_ThrowByNameWithLastError(env, + JNU_ThrowByNameWithMessageAndLastError(env, "java/lang/RuntimeException", "Unable to open /proc"); return -1; } diff -Nru openjdk-17-17.0.13+11/src/java.base/unix/native/libjava/ProcessImpl_md.c openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessImpl_md.c --- openjdk-17-17.0.13+11/src/java.base/unix/native/libjava/ProcessImpl_md.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/unix/native/libjava/ProcessImpl_md.c 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2024, 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 @@ -562,8 +562,17 @@ } offset = copystrings(buf, 0, &c->argv[0]); offset = copystrings(buf, offset, &c->envv[0]); - memcpy(buf+offset, c->pdir, sp.dirlen); - offset += sp.dirlen; + if (c->pdir != NULL) { + if (sp.dirlen > 0) { + memcpy(buf+offset, c->pdir, sp.dirlen); + offset += sp.dirlen; + } + } else { + if (sp.dirlen > 0) { + free(buf); + return -1; + } + } offset = copystrings(buf, offset, parentPathv); assert(offset == bufsize); diff -Nru openjdk-17-17.0.13+11/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c openjdk-17-17.0.14+7/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c --- openjdk-17-17.0.13+11/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c 2025-01-04 20:25:18.000000000 +0000 @@ -703,14 +703,16 @@ if (my_statx_func != NULL) { // Prefer statx over stat64 on Linux if it's available + // statx is not allowed on the old Docker versions and returns EPERM, + // fallback to stat64 in this case RESTARTABLE(statx_wrapper(AT_FDCWD, path, flags, mask, &statx_buf), err); if (err == 0) { copy_statx_attributes(env, &statx_buf, attrs); - } else { + return; + } else if (errno != EPERM) { throwUnixException(env, errno); + return; } - // statx was available, so return now - return; } #endif RESTARTABLE(stat64(path, &buf), err); @@ -734,10 +736,12 @@ if (my_statx_func != NULL) { // Prefer statx over stat64 on Linux if it's available + // statx is not allowed on the old Docker versions and returns EPERM, + // fallback to stat64 in this case RESTARTABLE(statx_wrapper(AT_FDCWD, path, flags, mask, &statx_buf), err); if (err == 0) { return (jint)statx_buf.stx_mode; - } else { + } else if (errno != EPERM) { return 0; } } @@ -764,14 +768,16 @@ if (my_statx_func != NULL) { // Prefer statx over stat64 on Linux if it's available + // statx is not allowed on the old Docker versions and returns EPERM, + // fallback to lstat64 in this case RESTARTABLE(statx_wrapper(AT_FDCWD, path, flags, mask, &statx_buf), err); if (err == 0) { copy_statx_attributes(env, &statx_buf, attrs); - } else { + return; + } else if (errno != EPERM) { throwUnixException(env, errno); + return; } - // statx was available, so return now - return; } #endif RESTARTABLE(lstat64(path, &buf), err); @@ -796,14 +802,16 @@ if (my_statx_func != NULL) { // statx supports FD use via dirfd iff pathname is an empty string and the // AT_EMPTY_PATH flag is specified in flags + // statx is not allowed on the old Docker versions and returns EPERM, + // fallback to fstat64 in this case RESTARTABLE(statx_wrapper((int)fd, "", flags, mask, &statx_buf), err); if (err == 0) { copy_statx_attributes(env, &statx_buf, attrs); - } else { + return; + } else if (errno != EPERM) { throwUnixException(env, errno); + return; } - // statx was available, so return now - return; } #endif RESTARTABLE(fstat64((int)fd, &buf), err); @@ -831,14 +839,16 @@ if (((int)flag & AT_SYMLINK_NOFOLLOW) > 0) { // flag set in java code flags |= AT_SYMLINK_NOFOLLOW; } + // statx is not allowed on the old Docker versions and returns EPERM, + // fallback to fstatat64 in this case RESTARTABLE(statx_wrapper((int)dfd, path, flags, mask, &statx_buf), err); if (err == 0) { copy_statx_attributes(env, &statx_buf, attrs); - } else { + return; + } else if (errno != EPERM) { throwUnixException(env, errno); + return; } - // statx was available, so return now - return; } #endif diff -Nru openjdk-17-17.0.13+11/src/java.base/windows/classes/java/lang/ProcessImpl.java openjdk-17-17.0.14+7/src/java.base/windows/classes/java/lang/ProcessImpl.java --- openjdk-17-17.0.13+11/src/java.base/windows/classes/java/lang/ProcessImpl.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/windows/classes/java/lang/ProcessImpl.java 2025-01-04 20:25:18.000000000 +0000 @@ -216,13 +216,14 @@ private static final int VERIFICATION_LEGACY = 3; // See Command shell overview for documentation of special characters. // https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490954(v=technet.10) - private static final char ESCAPE_VERIFICATION[][] = { + private static final String ESCAPE_VERIFICATION[] = { // We guarantee the only command file execution for implicit [cmd.exe] run. // http://technet.microsoft.com/en-us/library/bb490954.aspx - {' ', '\t', '\"', '<', '>', '&', '|', '^'}, - {' ', '\t', '\"', '<', '>'}, - {' ', '\t', '\"', '<', '>'}, - {' ', '\t'} + // All space characters require quoting are checked in needsEscaping(). + "\"<>&|^", + "\"<>", + "\"<>", + "" }; private static String createCommandLine(int verificationType, @@ -337,9 +338,14 @@ } if (!argIsQuoted) { - char testEscape[] = ESCAPE_VERIFICATION[verificationType]; - for (int i = 0; i < testEscape.length; ++i) { - if (arg.indexOf(testEscape[i]) >= 0) { + for (int i = 0; i < arg.length(); i++) { + char ch = arg.charAt(i); + if (Character.isLetterOrDigit(ch)) + continue; // skip over common characters + // All space chars require quotes and other mode specific characters + if (Character.isSpaceChar(ch) || + Character.isWhitespace(ch) || + ESCAPE_VERIFICATION[verificationType].indexOf(ch) >= 0) { return true; } } diff -Nru openjdk-17-17.0.13+11/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java openjdk-17-17.0.14+7/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java --- openjdk-17-17.0.13+11/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2022, 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 @@ -374,8 +374,19 @@ } } + // check file exists only + if (!(r || w || x)) { + file.checkRead(); + try { + WindowsFileAttributes.get(file, true); + return; + } catch (WindowsException exc) { + exc.rethrowAsIOException(file); + } + } + // special-case read access to avoid needing to determine effective - // access to file; default if modes not specified + // access to file if (!w && !x) { checkReadAccess(file); return; diff -Nru openjdk-17-17.0.13+11/src/java.base/windows/native/libjava/java_props_md.c openjdk-17-17.0.14+7/src/java.base/windows/native/libjava/java_props_md.c --- openjdk-17-17.0.13+11/src/java.base/windows/native/libjava/java_props_md.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.base/windows/native/libjava/java_props_md.c 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -474,6 +474,8 @@ * where (buildNumber > 17762) * Windows Server 2022 10 0 (!VER_NT_WORKSTATION) * where (buildNumber > 20347) + * Windows Server 2025 10 0 (!VER_NT_WORKSTATION) + * where (buildNumber > 26039) * * This mapping will presumably be augmented as new Windows * versions are released. @@ -557,7 +559,10 @@ case 0: /* Windows server 2019 GA 10/2018 build number is 17763 */ /* Windows server 2022 build number is 20348 */ - if (buildNumber > 20347) { + /* Windows server 2025 Preview build is 26040 */ + if (buildNumber > 26039) { + sprops.os_name = "Windows Server 2025"; + } else if (buildNumber > 20347) { sprops.os_name = "Windows Server 2022"; } else if (buildNumber > 17762) { sprops.os_name = "Windows Server 2019"; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java --- openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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,13 +25,32 @@ package com.apple.laf; -import java.awt.*; - -import javax.swing.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Insets; + +import javax.accessibility.AccessibleContext; +import javax.swing.ButtonModel; +import javax.swing.CellRendererPane; +import javax.swing.DefaultButtonModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.ListCellRenderer; +import javax.swing.UIManager; import javax.swing.plaf.UIResource; +import apple.laf.JRSUIConstants.AlignmentHorizontal; +import apple.laf.JRSUIConstants.AlignmentVertical; +import apple.laf.JRSUIConstants.ArrowsOnly; +import apple.laf.JRSUIConstants.Focused; +import apple.laf.JRSUIConstants.IndicatorOnly; +import apple.laf.JRSUIConstants.Size; +import apple.laf.JRSUIConstants.State; +import apple.laf.JRSUIConstants.Widget; import apple.laf.JRSUIState; -import apple.laf.JRSUIConstants.*; @SuppressWarnings("serial") // Superclass is not serializable across versions class AquaComboBoxButton extends JButton { @@ -169,12 +188,15 @@ } } - protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) { + private Component getRendererComponent() { final ListCellRenderer renderer = comboBox.getRenderer(); + return renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); + } + + protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) { // fake it out! not renderPressed - final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); - // System.err.println("Renderer: " + renderer); + final Component c = getRendererComponent(); if (!editable && !AquaComboBoxUI.isTableCellEditor(comboBox)) { final int indentLeft = 10; @@ -233,4 +255,25 @@ // Remove component from renderer pane, allowing it to be gc'ed. rendererPane.remove(c); } + + @Override + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleAquaComboBoxButton(); + } + return accessibleContext; + } + + private final class AccessibleAquaComboBoxButton extends AccessibleJButton { + @Override + public String getAccessibleName() { + String name = super.getAccessibleName(); + if ((name == null || name.isEmpty()) + && (!comboBox.isEditable() && comboBox.getSelectedItem() != null)) { + Component c = getRendererComponent(); + name = c.getAccessibleContext().getAccessibleName(); + } + return name; + } + } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java --- openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -729,4 +729,35 @@ static ClientPropertyApplicator, AquaComboBoxUI> getApplicator() { return APPLICATOR.get(); } + + @Override + public int getAccessibleChildrenCount(JComponent c) { + return 2; + } + + @Override + public Accessible getAccessibleChild(JComponent c, int i) { + // 0 = the popup + // 1 = the editor for editable combobox and the arrow button for non-editable combobox + switch ( i ) { + case 0: + if (popup instanceof Accessible accessiblePopup) { + AccessibleContext ac = accessiblePopup.getAccessibleContext(); + ac.setAccessibleParent(comboBox); + return accessiblePopup; + } + break; + case 1: + if (comboBox.isEditable() + && (editor instanceof Accessible accessibleEditor)) { + AccessibleContext ac = accessibleEditor.getAccessibleContext(); + ac.setAccessibleParent(comboBox); + return accessibleEditor; + } else if (!comboBox.isEditable()) { + return arrowButton; + } + break; + } + return null; + } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java --- openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,8 +25,11 @@ package com.apple.laf; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.Map; import java.util.Map.Entry; import javax.swing.Icon; @@ -34,6 +37,8 @@ import com.apple.laf.AquaUtils.RecyclableSingleton; +import static java.nio.charset.StandardCharsets.UTF_8; + @SuppressWarnings("serial") // JDK implementation class class AquaFileView extends FileView { private static final boolean DEBUG = false; @@ -111,11 +116,7 @@ FileInfo(final File file){ isDirectory = file.isDirectory(); absolutePath = file.getAbsolutePath(); - try { - pathBytes = absolutePath.getBytes("UTF-8"); - } catch (final UnsupportedEncodingException e) { - pathBytes = new byte[0]; - } + pathBytes = absolutePath.getBytes(UTF_8); } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java --- openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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,20 +25,27 @@ package sun.lwawt.macosx; -import java.awt.*; - -import java.io.*; -import java.net.URI; -import java.net.URISyntaxException; +import java.awt.Image; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; import java.text.Normalizer; import java.text.Normalizer.Form; -import java.util.*; -import java.util.regex.*; -import java.awt.datatransfer.*; -import java.nio.charset.StandardCharsets; -import sun.awt.datatransfer.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import sun.awt.datatransfer.DataTransferer; +import sun.awt.datatransfer.ToolkitThreadBlockedHandler; + +import static java.nio.charset.StandardCharsets.UTF_8; public class CDataTransferer extends DataTransferer { private static final Map predefinedClipboardNameMap; @@ -133,7 +139,7 @@ String charset = Charset.defaultCharset().name(); if (transferable != null && transferable.isDataFlavorSupported(javaTextEncodingFlavor)) { try { - charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), StandardCharsets.UTF_8); + charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), UTF_8); } catch (UnsupportedFlavorException cannotHappen) { } } @@ -160,7 +166,8 @@ // class by base method format = CF_STRING; } else if (format == CF_STRING) { - bytes = Normalizer.normalize(new String(bytes, "UTF8"), Form.NFC).getBytes("UTF8"); + String src = new String(bytes, UTF_8); + bytes = Normalizer.normalize(src, Form.NFC).getBytes(UTF_8); } return super.translateBytes(bytes, flavor, format, transferable); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java --- openjdk-17-17.0.13+11/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2025-01-04 20:25:18.000000000 +0000 @@ -42,6 +42,7 @@ import java.awt.Window; import java.awt.event.FocusEvent; import java.awt.event.WindowEvent; +import java.awt.event.WindowStateListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.lang.reflect.InvocationTargetException; @@ -964,6 +965,33 @@ return isFullScreenMode; } + private void waitForWindowState(int state) { + if (peer.getState() == state) { + return; + } + + Object lock = new Object(); + WindowStateListener wsl = new WindowStateListener() { + public void windowStateChanged(WindowEvent e) { + synchronized (lock) { + if (e.getNewState() == state) { + lock.notifyAll(); + } + } + } + }; + + target.addWindowStateListener(wsl); + if (peer.getState() != state) { + synchronized (lock) { + try { + lock.wait(); + } catch (InterruptedException ie) {} + } + } + target.removeWindowStateListener(wsl); + } + @Override public void setWindowState(int windowState) { if (peer == null || !peer.isVisible()) { @@ -985,6 +1013,7 @@ // let's return into the normal states first // the zoom call toggles between the normal and the max states unmaximize(); + waitForWindowState(Frame.NORMAL); } execute(CWrapper.NSWindow::miniaturize); break; @@ -992,6 +1021,8 @@ if (prevWindowState == Frame.ICONIFIED) { // let's return into the normal states first execute(CWrapper.NSWindow::deminiaturize); + waitForWindowState(Frame.NORMAL); + } maximize(); break; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m openjdk-17-17.0.14+7/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m --- openjdk-17-17.0.13+11/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2025-01-04 20:25:18.000000000 +0000 @@ -38,6 +38,9 @@ // keyboard layout static NSString *kbdLayout; +// Constant for keyman layouts +#define KEYMAN_LAYOUT "keyman" + @interface AWTView() @property (retain) CDropTarget *_dropTarget; @property (retain) CDragSource *_dragSource; @@ -259,7 +262,7 @@ - (void) keyDown: (NSEvent *)event { fProcessingKeystroke = YES; - fKeyEventsNeeded = YES; + fKeyEventsNeeded = ![(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT]; // Allow TSM to look at the event and potentially send back NSTextInputClient messages. [self interpretKeyEvents:[NSArray arrayWithObject:event]]; @@ -961,7 +964,7 @@ if ((utf16Length > 2) || ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) || - ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) { + [(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT]) { aStringIsComplex = YES; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/beans/introspect/MethodInfo.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/beans/introspect/MethodInfo.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/beans/introspect/MethodInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/beans/introspect/MethodInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,18 +25,35 @@ package com.sun.beans.introspect; +import java.io.Closeable; +import java.io.Externalizable; +import java.io.Serializable; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Set; import com.sun.beans.TypeResolver; import com.sun.beans.finder.MethodFinder; final class MethodInfo { + + // These are some common interfaces that we know a priori + // will not contain any bean property getters or setters. + static final Set> IGNORABLE_INTERFACES = Set.of( + AutoCloseable.class, + Cloneable.class, + Closeable.class, + Comparable.class, + Externalizable.class, + Serializable.class + ); + final Method method; final Class type; @@ -66,6 +83,8 @@ static List get(Class type) { List list = null; if (type != null) { + + // Add declared methods boolean inaccessible = !Modifier.isPublic(type.getModifiers()); for (Method method : type.getMethods()) { if (method.getDeclaringClass().equals(type)) { @@ -81,10 +100,19 @@ } } if (method != null) { - if (list == null) { - list = new ArrayList<>(); - } - list.add(method); + (list = createIfNeeded(list)).add(method); + } + } + } + + // Add default methods inherited from interfaces + for (Class iface : type.getInterfaces()) { + if (IGNORABLE_INTERFACES.contains(iface)) { + continue; + } + for (Method method : iface.getMethods()) { + if (!Modifier.isAbstract(method.getModifiers())) { + (list = createIfNeeded(list)).add(method); } } } @@ -96,6 +124,10 @@ return Collections.emptyList(); } + private static List createIfNeeded(List list) { + return list != null ? list : new ArrayList<>(); + } + /** * A comparator that defines a total order so that methods have the same * name and identical signatures appear next to each others. diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,19 +25,15 @@ package com.sun.imageio.plugins.bmp; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataFormatImpl; -import org.w3c.dom.Node; -import com.sun.imageio.plugins.common.I18N; +import javax.imageio.metadata.IIOMetadataNode; +import com.sun.imageio.plugins.common.I18N; import com.sun.imageio.plugins.common.ImageUtil; +import org.w3c.dom.Node; + +import static java.nio.charset.StandardCharsets.ISO_8859_1; public class BMPMetadata extends IIOMetadata implements BMPConstants { public static final String nativeMetadataFormatName = @@ -114,11 +110,7 @@ } private String toISO8859(byte[] data) { - try { - return new String(data, "ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - return ""; - } + return new String(data, ISO_8859_1); } private Node getNativeTree() { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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,18 +25,17 @@ package com.sun.imageio.plugins.gif; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import javax.imageio.ImageTypeSpecifier; + import javax.imageio.metadata.IIOInvalidTreeException; -import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataFormatImpl; +import javax.imageio.metadata.IIOMetadataNode; + import org.w3c.dom.Node; +import static java.nio.charset.StandardCharsets.ISO_8859_1; + public class GIFImageMetadata extends GIFMetadata { // package scope @@ -132,11 +131,7 @@ } private String toISO8859(byte[] data) { - try { - return new String(data, "ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - return ""; - } + return new String(data, ISO_8859_1); } private Node getNativeTree() { @@ -384,12 +379,7 @@ while (commentIter.hasNext()) { byte[] comment = commentIter.next(); - String s = null; - try { - s = new String(comment, "ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("Encoding ISO-8859-1 unknown!"); - } + String s = new String(comment, ISO_8859_1); node = new IIOMetadataNode("TextEntry"); node.setAttribute("value", s); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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,19 +25,17 @@ package com.sun.imageio.plugins.gif; -import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import javax.imageio.ImageTypeSpecifier; + import javax.imageio.metadata.IIOInvalidTreeException; -import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataFormatImpl; +import javax.imageio.metadata.IIOMetadataNode; + import org.w3c.dom.Node; +import static java.nio.charset.StandardCharsets.ISO_8859_1; + class GIFWritableImageMetadata extends GIFImageMetadata { // package scope @@ -95,11 +93,7 @@ } private byte[] fromISO8859(String data) { - try { - return data.getBytes("ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - return "".getBytes(); - } + return data.getBytes(ISO_8859_1); } protected void mergeNativeTree(Node root) throws IIOInvalidTreeException { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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,15 +25,16 @@ package com.sun.imageio.plugins.jpeg; +import java.io.IOException; + +import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadataNode; import javax.imageio.stream.ImageOutputStream; -import javax.imageio.metadata.IIOInvalidTreeException; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; import org.w3c.dom.Node; +import static java.nio.charset.StandardCharsets.ISO_8859_1; + /** * A Comment marker segment. Retains an array of bytes representing the * comment data as it is read from the stream. If the marker segment is @@ -45,7 +46,6 @@ * byte array, again assuming the default local encoding. */ class COMMarkerSegment extends MarkerSegment { - private static final String ENCODING = "ISO-8859-1"; /** * Constructs a marker segment from the given buffer, which contains @@ -96,10 +96,7 @@ * consulted directly. */ String getComment() { - try { - return new String (data, ENCODING); - } catch (UnsupportedEncodingException e) {} // Won't happen - return null; + return new String(data, ISO_8859_1); } /** diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,40 +25,41 @@ package com.sun.imageio.plugins.jpeg; -import javax.imageio.IIOException; -import javax.imageio.IIOImage; -import javax.imageio.ImageTypeSpecifier; -import javax.imageio.ImageReader; -import javax.imageio.metadata.IIOInvalidTreeException; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadata; -import javax.imageio.stream.ImageInputStream; -import javax.imageio.stream.ImageOutputStream; -import javax.imageio.stream.MemoryCacheImageOutputStream; -import javax.imageio.event.IIOReadProgressListener; - import java.awt.Graphics; -import java.awt.color.ICC_Profile; -import java.awt.color.ICC_ColorSpace; import java.awt.color.ColorSpace; +import java.awt.color.ICC_ColorSpace; +import java.awt.color.ICC_Profile; +import java.awt.image.BufferedImage; import java.awt.image.ColorModel; -import java.awt.image.SampleModel; -import java.awt.image.IndexColorModel; import java.awt.image.ComponentColorModel; -import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.awt.image.DataBufferByte; +import java.awt.image.IndexColorModel; import java.awt.image.Raster; +import java.awt.image.SampleModel; import java.awt.image.WritableRaster; -import java.io.IOException; import java.io.ByteArrayOutputStream; -import java.util.List; +import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; +import javax.imageio.IIOException; +import javax.imageio.IIOImage; +import javax.imageio.ImageReader; +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.event.IIOReadProgressListener; +import javax.imageio.metadata.IIOInvalidTreeException; +import javax.imageio.metadata.IIOMetadataNode; +import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.ImageOutputStream; +import javax.imageio.stream.MemoryCacheImageOutputStream; + +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.NamedNodeMap; + +import static java.nio.charset.StandardCharsets.US_ASCII; /** * A JFIF (JPEG File Interchange Format) APP0 (Application-Specific) @@ -1353,7 +1354,7 @@ ios.write(0xff); ios.write(JPEG.APP2); MarkerSegment.write2bytes(ios, segLength); - byte [] id = ID.getBytes("US-ASCII"); + byte[] id = ID.getBytes(US_ASCII); ios.write(id); ios.write(0); // Null-terminate the string ios.write(chunkNum++); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -36,10 +36,11 @@ import java.awt.image.WritableRaster; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.EOFException; -import java.io.InputStream; import java.io.IOException; +import java.io.InputStream; import java.io.SequenceInputStream; import java.util.ArrayList; import java.util.Arrays; @@ -47,19 +48,23 @@ import java.util.Iterator; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; + import javax.imageio.IIOException; -import javax.imageio.ImageReader; import javax.imageio.ImageReadParam; +import javax.imageio.ImageReader; import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOMetadata; import javax.imageio.spi.ImageReaderSpi; import javax.imageio.stream.ImageInputStream; + import com.sun.imageio.plugins.common.InputStreamAdapter; import com.sun.imageio.plugins.common.ReaderUtil; import com.sun.imageio.plugins.common.SubImageInputStream; -import java.io.ByteArrayOutputStream; import sun.awt.image.ByteInterleavedRaster; +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; + class PNGImageDataEnumeration implements Enumeration { boolean firstTime = true; @@ -486,9 +491,9 @@ stream.readFully(b); if (compressionFlag == 1) { // Decompress the text - text = new String(inflate(b), "UTF8"); + text = new String(inflate(b), UTF_8); } else { - text = new String(b, "UTF8"); + text = new String(b, UTF_8); } metadata.iTXt_text.add(text); @@ -589,7 +594,7 @@ byte[] b = new byte[textLength]; stream.readFully(b); - metadata.tEXt_text.add(new String(b, "ISO-8859-1")); + metadata.tEXt_text.add(new String(b, ISO_8859_1)); // Check if the text chunk contains image creation time if (keyword.equals(PNGMetadata.tEXt_creationTimeKey)) { @@ -690,7 +695,7 @@ byte[] b = new byte[textLength]; stream.readFully(b); - metadata.zTXt_text.add(new String(inflate(b), "ISO-8859-1")); + metadata.zTXt_text.add(new String(inflate(b), ISO_8859_1)); // Check if the text chunk contains image creation time if (keyword.equals(PNGMetadata.tEXt_creationTimeKey)) { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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,15 +28,16 @@ import java.awt.Rectangle; import java.awt.image.IndexColorModel; import java.awt.image.Raster; -import java.awt.image.WritableRaster; import java.awt.image.RenderedImage; import java.awt.image.SampleModel; +import java.awt.image.WritableRaster; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.Locale; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; + import javax.imageio.IIOException; import javax.imageio.IIOImage; import javax.imageio.ImageTypeSpecifier; @@ -47,6 +48,9 @@ import javax.imageio.stream.ImageOutputStream; import javax.imageio.stream.ImageOutputStreamImpl; +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; + final class CRC { private static final int[] crcTable = new int[256]; @@ -801,15 +805,14 @@ cs.writeBytes(languageIter.next()); cs.writeByte(0); - - cs.write(translatedKeywordIter.next().getBytes("UTF8")); + cs.write(translatedKeywordIter.next().getBytes(UTF_8)); cs.writeByte(0); String text = textIter.next(); if (compressed) { - cs.write(deflate(text.getBytes("UTF8"))); + cs.write(deflate(text.getBytes(UTF_8))); } else { - cs.write(text.getBytes("UTF8")); + cs.write(text.getBytes(UTF_8)); } cs.finish(); } @@ -833,7 +836,7 @@ cs.writeByte(compressionMethod); String text = textIter.next(); - cs.write(deflate(text.getBytes("ISO-8859-1"))); + cs.write(deflate(text.getBytes(ISO_8859_1))); cs.finish(); } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java 2025-01-04 20:25:18.000000000 +0000 @@ -22,24 +22,27 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.imageio.plugins.tiff; import java.io.EOFException; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Set; + import javax.imageio.IIOException; -import javax.imageio.stream.ImageInputStream; -import javax.imageio.stream.ImageOutputStream; import javax.imageio.plugins.tiff.BaselineTIFFTagSet; import javax.imageio.plugins.tiff.TIFFDirectory; import javax.imageio.plugins.tiff.TIFFField; import javax.imageio.plugins.tiff.TIFFTag; import javax.imageio.plugins.tiff.TIFFTagSet; +import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.ImageOutputStream; + +import static java.nio.charset.StandardCharsets.US_ASCII; public class TIFFIFD extends TIFFDirectory { private static final long MAX_SAMPLES_PER_PIXEL = 0xffff; @@ -283,8 +286,7 @@ if (inString) { // end of string String s = new String(bvalues, prevIndex, - index - prevIndex, - StandardCharsets.US_ASCII); + index - prevIndex, US_ASCII); v.add(s); inString = false; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.imageio.plugins.tiff; import java.awt.Point; @@ -34,8 +35,8 @@ import java.awt.image.DataBuffer; import java.awt.image.DataBufferByte; import java.awt.image.IndexColorModel; -import java.awt.image.RenderedImage; import java.awt.image.Raster; +import java.awt.image.RenderedImage; import java.awt.image.SampleModel; import java.awt.image.WritableRaster; import java.io.EOFException; @@ -44,27 +45,30 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import javax.imageio.IIOException; import javax.imageio.IIOImage; +import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; -import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadata; import javax.imageio.metadata.IIOMetadataFormatImpl; -import javax.imageio.spi.ImageWriterSpi; -import javax.imageio.stream.ImageOutputStream; -import org.w3c.dom.Node; -import com.sun.imageio.plugins.common.ImageUtil; import javax.imageio.plugins.tiff.BaselineTIFFTagSet; import javax.imageio.plugins.tiff.ExifParentTIFFTagSet; import javax.imageio.plugins.tiff.ExifTIFFTagSet; import javax.imageio.plugins.tiff.TIFFField; import javax.imageio.plugins.tiff.TIFFTag; import javax.imageio.plugins.tiff.TIFFTagSet; +import javax.imageio.spi.ImageWriterSpi; +import javax.imageio.stream.ImageOutputStream; + +import com.sun.imageio.plugins.common.ImageUtil; import com.sun.imageio.plugins.common.SimpleRenderedImage; import com.sun.imageio.plugins.common.SingleTileRenderedImage; -import java.nio.charset.StandardCharsets; +import org.w3c.dom.Node; + +import static java.nio.charset.StandardCharsets.US_ASCII; public class TIFFImageWriter extends ImageWriter { @@ -1512,7 +1516,7 @@ (exifTags.getTag(ExifTIFFTagSet.TAG_EXIF_VERSION), TIFFTag.TIFF_UNDEFINED, 4, - ExifTIFFTagSet.EXIF_VERSION_2_2.getBytes(StandardCharsets.US_ASCII)); + ExifTIFFTagSet.EXIF_VERSION_2_2.getBytes(US_ASCII)); exifIFD.addTIFFField(f); } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,19 +25,13 @@ package com.sun.imageio.plugins.wbmp; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataFormatImpl; -import org.w3c.dom.Node; -import com.sun.imageio.plugins.common.I18N; +import javax.imageio.metadata.IIOMetadataNode; +import com.sun.imageio.plugins.common.I18N; import com.sun.imageio.plugins.common.ImageUtil; +import org.w3c.dom.Node; public class WBMPMetadata extends IIOMetadata { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java 2025-01-04 20:25:18.000000000 +0000 @@ -337,7 +337,8 @@ return widgets[0]; } } else if (id == Region.ARROW_BUTTON) { - if (c.getParent() instanceof JScrollBar) { + if (c.getParent() instanceof JScrollBar + || c.getParent() instanceof JTabbedPane) { Integer prop = (Integer) c.getClientProperty("__arrow_direction__"); int dir = (prop != null) ? diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2025-01-04 20:25:18.000000000 +0000 @@ -22,29 +22,76 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.sun.java.swing.plaf.gtk; -import sun.swing.SwingUtilities2; -import com.sun.java.swing.plaf.gtk.GTKConstants.ArrowType; -import com.sun.java.swing.plaf.gtk.GTKConstants.ShadowType; +package com.sun.java.swing.plaf.gtk; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Composite; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Insets; +import java.awt.LayoutManager; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.geom.AffineTransform; +import java.awt.geom.PathIterator; +import java.awt.geom.Rectangle2D; +import java.awt.geom.RectangularShape; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageProducer; +import java.awt.image.RGBImageFilter; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.StringTokenizer; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JInternalFrame; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.basic.BasicInternalFrameTitlePane; -import javax.swing.plaf.synth.*; - -import java.awt.*; -import java.awt.geom.*; -import java.awt.image.*; -import java.io.*; -import java.net.*; -import java.security.*; -import java.util.*; +import javax.swing.plaf.synth.ColorType; +import javax.swing.plaf.synth.SynthConstants; +import javax.swing.plaf.synth.SynthContext; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; -import javax.swing.*; - -import javax.xml.parsers.*; +import com.sun.java.swing.plaf.gtk.GTKConstants.ArrowType; +import com.sun.java.swing.plaf.gtk.GTKConstants.ShadowType; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import org.w3c.dom.*; +import sun.swing.SwingUtilities2; + +import static java.nio.charset.StandardCharsets.ISO_8859_1; /** */ @@ -536,7 +583,8 @@ URL url = new URL(new File(userHome).toURI().toURL(), ".gconf/apps/metacity/general/%25gconf.xml"); // Pending: verify character encoding spec for gconf - Reader reader = new InputStreamReader(url.openStream(), "ISO-8859-1"); + Reader reader = new InputStreamReader(url.openStream(), + ISO_8859_1); char[] buf = new char[1024]; StringBuilder sb = new StringBuilder(); int n; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java 2025-01-04 20:25:18.000000000 +0000 @@ -47,6 +47,8 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.nio.charset.StandardCharsets.US_ASCII; + /** * A DLS Level 1 and Level 2 soundbank reader (from files/url/streams). * @@ -1147,7 +1149,7 @@ return; RIFFWriter chunk = writer.writeChunk(name); chunk.writeString(value); - int len = value.getBytes("ascii").length; + int len = value.getBytes(US_ASCII).length; chunk.write(0); len++; if (len % 2 != 0) diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -29,6 +29,8 @@ import java.io.IOException; import java.io.InputStream; +import static java.nio.charset.StandardCharsets.US_ASCII; + /** * Resource Interchange File Format (RIFF) stream decoder. * @@ -76,14 +78,14 @@ byte[] fourcc = new byte[4]; fourcc[0] = (byte) b; readFully(fourcc, 1, 3); - this.fourcc = new String(fourcc, "ascii"); + this.fourcc = new String(fourcc, US_ASCII); ckSize = readUnsignedInt(); avail = ckSize; if (getFormat().equals("RIFF") || getFormat().equals("LIST")) { byte[] format = new byte[4]; readFully(format); - this.riff_type = new String(format, "ascii"); + this.riff_type = new String(format, US_ASCII); } } @@ -227,10 +229,10 @@ readFully(buff); for (int i = 0; i < buff.length; i++) { if (buff[i] == 0) { - return new String(buff, 0, i, "ascii"); + return new String(buff, 0, i, US_ASCII); } } - return new String(buff, "ascii"); + return new String(buff, US_ASCII); } // Read 8 bit signed integer from stream diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,8 @@ import java.io.OutputStream; import java.io.RandomAccessFile; +import static java.nio.charset.StandardCharsets.US_ASCII; + /** * Resource Interchange File Format (RIFF) stream encoder. * @@ -208,11 +210,11 @@ raf.write(0); if (chunktype == 0) - raf.write("RIFF".getBytes("ascii")); + raf.write("RIFF".getBytes(US_ASCII)); else if (chunktype == 1) - raf.write("LIST".getBytes("ascii")); + raf.write("LIST".getBytes(US_ASCII)); else - raf.write((format + " ").substring(0, 4).getBytes("ascii")); + raf.write((format + " ").substring(0, 4).getBytes(US_ASCII)); chunksizepointer = raf.getPointer(); this.chunktype = 2; @@ -220,8 +222,7 @@ this.chunktype = chunktype; startpointer = raf.getPointer(); if (chunktype != 2) - raf.write((format + " ").substring(0, 4).getBytes("ascii")); - + raf.write((format + " ").substring(0, 4).getBytes(US_ASCII)); } public void seek(long pos) throws IOException { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,8 @@ import javax.sound.midi.Soundbank; import javax.sound.midi.SoundbankResource; +import static java.nio.charset.StandardCharsets.US_ASCII; + /** * A SoundFont 2.04 soundbank reader. * @@ -539,7 +541,7 @@ return; RIFFWriter chunk = writer.writeChunk(name); chunk.writeString(value); - int len = value.getBytes("ascii").length; + int len = value.getBytes(US_ASCII).length; chunk.write(0); len++; if (len % 2 != 0) diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java 2025-01-04 20:25:18.000000000 +0000 @@ -124,102 +124,126 @@ private void processSystemExclusiveMessage(byte[] data) { synchronized (synth.control_mutex) { activity(); - + if (data.length < 3 || (data[1] & 0xFF) != 0x7E && (data[1] & 0xFF) != 0x7F ) { + // Not enough data to determine SysEx type or SysEx type is not supported + return; + } // Universal Non-Real-Time SysEx if ((data[1] & 0xFF) == 0x7E) { int deviceID = data[2] & 0xFF; if (deviceID == 0x7F || deviceID == synth.getDeviceID()) { + if (data.length < 4) { + return; + } int subid1 = data[3] & 0xFF; int subid2; switch (subid1) { - case 0x08: // MIDI Tuning Standard - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // BULK TUNING DUMP - { - // http://www.midi.org/about-midi/tuning.shtml - SoftTuning tuning = synth.getTuning(new Patch(0, - data[5] & 0xFF)); - tuning.load(data); - break; - } - case 0x04: // KEY-BASED TUNING DUMP - case 0x05: // SCALE/OCTAVE TUNING DUMP, 1 byte format - case 0x06: // SCALE/OCTAVE TUNING DUMP, 2 byte format - case 0x07: // SINGLE NOTE TUNING CHANGE (NON REAL-TIME) + case 0x08: // MIDI Tuning Standard + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // BULK TUNING DUMP + { + if (data.length < 6) { + break; + } + // http://www.midi.org/about-midi/tuning.shtml + SoftTuning tuning = synth.getTuning(new Patch(0, + data[5] & 0xFF)); + tuning.load(data); + break; + } + case 0x04: // KEY-BASED TUNING DUMP + case 0x05: // SCALE/OCTAVE TUNING DUMP, 1 byte format + case 0x06: // SCALE/OCTAVE TUNING DUMP, 2 byte format + case 0x07: // SINGLE NOTE TUNING CHANGE (NON REAL-TIME) // (BANK) - { - // http://www.midi.org/about-midi/tuning_extens.shtml - SoftTuning tuning = synth.getTuning(new Patch( - data[5] & 0xFF, data[6] & 0xFF)); - tuning.load(data); - break; - } - case 0x08: // scale/octave tuning 1-byte form (Non + { + if (data.length < 7) { + break; + } + // http://www.midi.org/about-midi/tuning_extens.shtml + SoftTuning tuning = synth.getTuning(new Patch( + data[5] & 0xFF, data[6] & 0xFF)); + tuning.load(data); // Check inside! + break; + } + case 0x08: // scale/octave tuning 1-byte form (Non // Real-Time) - case 0x09: // scale/octave tuning 2-byte form (Non + case 0x09: // scale/octave tuning 2-byte form (Non // Real-Time) - { - // http://www.midi.org/about-midi/tuning-scale.shtml - SoftTuning tuning = new SoftTuning(data); - int channelmask = (data[5] & 0xFF) * 16384 - + (data[6] & 0xFF) * 128 + (data[7] & 0xFF); - SoftChannel[] channels = synth.channels; - for (int i = 0; i < channels.length; i++) - if ((channelmask & (1 << i)) != 0) - channels[i].tuning = tuning; - break; - } - default: - break; - } - break; - case 0x09: // General Midi Message - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // General Midi 1 On - synth.setGeneralMidiMode(1); - reset(); - break; - case 0x02: // General Midi Off - synth.setGeneralMidiMode(0); - reset(); - break; - case 0x03: // General MidI Level 2 On - synth.setGeneralMidiMode(2); - reset(); - break; - default: - break; - } - break; - case 0x0A: // DLS Message - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // DLS On - if (synth.getGeneralMidiMode() == 0) - synth.setGeneralMidiMode(1); - synth.voice_allocation_mode = 1; - reset(); - break; - case 0x02: // DLS Off - synth.setGeneralMidiMode(0); - synth.voice_allocation_mode = 0; - reset(); + { + if (data.length < 8) { + break; + } + // http://www.midi.org/about-midi/tuning-scale.shtml + SoftTuning tuning = new SoftTuning(data); + int channelmask = (data[5] & 0xFF) * 16384 + + (data[6] & 0xFF) * 128 + (data[7] & 0xFF); + SoftChannel[] channels = synth.channels; + for (int i = 0; i < channels.length; i++) + if ((channelmask & (1 << i)) != 0) + channels[i].tuning = tuning; + break; + } + default: + break; + } break; - case 0x03: // DLS Static Voice Allocation Off - synth.voice_allocation_mode = 0; + case 0x09: // General Midi Message + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // General Midi 1 On + synth.setGeneralMidiMode(1); + reset(); + break; + case 0x02: // General Midi Off + synth.setGeneralMidiMode(0); + reset(); + break; + case 0x03: // General MidI Level 2 On + synth.setGeneralMidiMode(2); + reset(); + break; + default: + break; + } break; - case 0x04: // DLS Static Voice Allocation On - synth.voice_allocation_mode = 1; + case 0x0A: // DLS Message + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // DLS On + if (synth.getGeneralMidiMode() == 0) + synth.setGeneralMidiMode(1); + synth.voice_allocation_mode = 1; + reset(); + break; + case 0x02: // DLS Off + synth.setGeneralMidiMode(0); + synth.voice_allocation_mode = 0; + reset(); + break; + case 0x03: // DLS Static Voice Allocation Off + synth.voice_allocation_mode = 0; + break; + case 0x04: // DLS Static Voice Allocation On + synth.voice_allocation_mode = 1; + break; + default: + break; + } break; + default: break; - } - break; - - default: - break; } } } @@ -228,197 +252,240 @@ if ((data[1] & 0xFF) == 0x7F) { int deviceID = data[2] & 0xFF; if (deviceID == 0x7F || deviceID == synth.getDeviceID()) { + if (data.length < 4) { + return; + } int subid1 = data[3] & 0xFF; int subid2; switch (subid1) { - case 0x04: // Device Control - - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // Master Volume - case 0x02: // Master Balane - case 0x03: // Master fine tuning - case 0x04: // Master coarse tuning - int val = (data[5] & 0x7F) - + ((data[6] & 0x7F) * 128); - if (subid2 == 0x01) - setVolume(val); - else if (subid2 == 0x02) - setBalance(val); - else if (subid2 == 0x03) - setFineTuning(val); - else if (subid2 == 0x04) - setCoarseTuning(val); - break; - case 0x05: // Global Parameter Control - int ix = 5; - int slotPathLen = (data[ix++] & 0xFF); - int paramWidth = (data[ix++] & 0xFF); - int valueWidth = (data[ix++] & 0xFF); - int[] slotPath = new int[slotPathLen]; - for (int i = 0; i < slotPathLen; i++) { - int msb = (data[ix++] & 0xFF); - int lsb = (data[ix++] & 0xFF); - slotPath[i] = msb * 128 + lsb; - } - int paramCount = (data.length - 1 - ix) - / (paramWidth + valueWidth); - long[] params = new long[paramCount]; - long[] values = new long[paramCount]; - for (int i = 0; i < paramCount; i++) { - values[i] = 0; - for (int j = 0; j < paramWidth; j++) - params[i] = params[i] * 128 - + (data[ix++] & 0xFF); - for (int j = 0; j < valueWidth; j++) - values[i] = values[i] * 128 - + (data[ix++] & 0xFF); + case 0x04: // Device Control + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // Master Volume + case 0x02: // Master Balane + case 0x03: // Master fine tuning + case 0x04: // Master coarse tuning + if (data.length < 7) { + break; + } + int val = (data[5] & 0x7F) + + ((data[6] & 0x7F) * 128); + if (subid2 == 0x01) + setVolume(val); + else if (subid2 == 0x02) + setBalance(val); + else if (subid2 == 0x03) + setFineTuning(val); + else if (subid2 == 0x04) + setCoarseTuning(val); + break; + case 0x05: // Global Parameter Control + if (data.length < 6) { + break; + } + int ix = 5; + int slotPathLen = (data[ix++] & 0xFF); + if (data.length < slotPathLen * 2 + 8) { + break; + } + int paramWidth = (data[ix++] & 0xFF); + int valueWidth = (data[ix++] & 0xFF); + int[] slotPath = new int[slotPathLen]; + for (int i = 0; i < slotPathLen; i++) { + int msb = (data[ix++] & 0xFF); + int lsb = (data[ix++] & 0xFF); + slotPath[i] = msb * 128 + lsb; + } + int paramCount = (data.length - 1 - ix) + / (paramWidth + valueWidth); + if (paramCount < 1) { + break; + } + long[] params = new long[paramCount]; + long[] values = new long[paramCount]; + for (int i = 0; i < paramCount; i++) { + values[i] = 0; + for (int j = 0; j < paramWidth; j++) + params[i] = params[i] * 128 + + (data[ix++] & 0xFF); + for (int j = 0; j < valueWidth; j++) + values[i] = values[i] * 128 + + (data[ix++] & 0xFF); + } + globalParameterControlChange(slotPath, params, values); + break; + default: + break; } - globalParameterControlChange(slotPath, params, values); break; - default: - break; - } - break; - case 0x08: // MIDI Tuning Standard - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x02: // SINGLE NOTE TUNING CHANGE (REAL-TIME) - { - // http://www.midi.org/about-midi/tuning.shtml - SoftTuning tuning = synth.getTuning(new Patch(0, - data[5] & 0xFF)); - tuning.load(data); - SoftVoice[] voices = synth.getVoices(); - for (int i = 0; i < voices.length; i++) - if (voices[i].active) - if (voices[i].tuning == tuning) - voices[i].updateTuning(tuning); - break; - } - case 0x07: // SINGLE NOTE TUNING CHANGE (REAL-TIME) + case 0x08: // MIDI Tuning Standard + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x02: // SINGLE NOTE TUNING CHANGE (REAL-TIME) + { + // http://www.midi.org/about-midi/tuning.shtml + if (data.length < 6) { + break; + } + SoftTuning tuning = synth.getTuning(new Patch(0, + data[5] & 0xFF)); + tuning.load(data); + SoftVoice[] voices = synth.getVoices(); + for (int i = 0; i < voices.length; i++) + if (voices[i].active) + if (voices[i].tuning == tuning) + voices[i].updateTuning(tuning); + break; + } + case 0x07: // SINGLE NOTE TUNING CHANGE (REAL-TIME) // (BANK) - { - // http://www.midi.org/about-midi/tuning_extens.shtml - SoftTuning tuning = synth.getTuning(new Patch( - data[5] & 0xFF, data[6] & 0xFF)); - tuning.load(data); - SoftVoice[] voices = synth.getVoices(); - for (int i = 0; i < voices.length; i++) - if (voices[i].active) - if (voices[i].tuning == tuning) - voices[i].updateTuning(tuning); - break; - } - case 0x08: // scale/octave tuning 1-byte form + { + // http://www.midi.org/about-midi/tuning_extens.shtml + if (data.length < 7) { + break; + } + SoftTuning tuning = synth.getTuning(new Patch( + data[5] & 0xFF, data[6] & 0xFF)); + tuning.load(data); + SoftVoice[] voices = synth.getVoices(); + for (int i = 0; i < voices.length; i++) + if (voices[i].active) + if (voices[i].tuning == tuning) + voices[i].updateTuning(tuning); + break; + } + case 0x08: // scale/octave tuning 1-byte form //(Real-Time) - case 0x09: // scale/octave tuning 2-byte form + case 0x09: // scale/octave tuning 2-byte form // (Real-Time) - { - // http://www.midi.org/about-midi/tuning-scale.shtml - SoftTuning tuning = new SoftTuning(data); - int channelmask = (data[5] & 0xFF) * 16384 - + (data[6] & 0xFF) * 128 + (data[7] & 0xFF); - SoftChannel[] channels = synth.channels; - for (int i = 0; i < channels.length; i++) - if ((channelmask & (1 << i)) != 0) - channels[i].tuning = tuning; - SoftVoice[] voices = synth.getVoices(); - for (int i = 0; i < voices.length; i++) - if (voices[i].active) - if ((channelmask & (1 << (voices[i].channel))) != 0) - voices[i].updateTuning(tuning); - break; - } - default: - break; - } - break; - case 0x09: // Control Destination Settings - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // Channel Pressure - { - int[] destinations = new int[(data.length - 7) / 2]; - int[] ranges = new int[(data.length - 7) / 2]; - int ix = 0; - for (int j = 6; j < data.length - 1; j += 2) { - destinations[ix] = data[j] & 0xFF; - ranges[ix] = data[j + 1] & 0xFF; - ix++; - } - int channel = data[5] & 0xFF; - SoftChannel softchannel = synth.channels[channel]; - softchannel.mapChannelPressureToDestination( - destinations, ranges); - break; - } - case 0x02: // Poly Pressure - { - int[] destinations = new int[(data.length - 7) / 2]; - int[] ranges = new int[(data.length - 7) / 2]; - int ix = 0; - for (int j = 6; j < data.length - 1; j += 2) { - destinations[ix] = data[j] & 0xFF; - ranges[ix] = data[j + 1] & 0xFF; - ix++; - } - int channel = data[5] & 0xFF; - SoftChannel softchannel = synth.channels[channel]; - softchannel.mapPolyPressureToDestination( - destinations, ranges); - break; - } - case 0x03: // Control Change - { - int[] destinations = new int[(data.length - 7) / 2]; - int[] ranges = new int[(data.length - 7) / 2]; - int ix = 0; - for (int j = 7; j < data.length - 1; j += 2) { - destinations[ix] = data[j] & 0xFF; - ranges[ix] = data[j + 1] & 0xFF; - ix++; - } - int channel = data[5] & 0xFF; - SoftChannel softchannel = synth.channels[channel]; - int control = data[6] & 0xFF; - softchannel.mapControlToDestination(control, - destinations, ranges); + { + // http://www.midi.org/about-midi/tuning-scale.shtml + if (data.length < 8) { + break; + } + SoftTuning tuning = new SoftTuning(data); + int channelmask = (data[5] & 0xFF) * 16384 + + (data[6] & 0xFF) * 128 + (data[7] & 0xFF); + SoftChannel[] channels = synth.channels; + for (int i = 0; i < channels.length; i++) + if ((channelmask & (1 << i)) != 0) + channels[i].tuning = tuning; + SoftVoice[] voices = synth.getVoices(); + for (int i = 0; i < voices.length; i++) + if (voices[i].active) + if ((channelmask & (1 << (voices[i].channel))) != 0) + voices[i].updateTuning(tuning); + break; + } + default: + break; + } break; - } - default: + case 0x09: // Control Destination Settings + if (data.length < 5) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // Channel Pressure + { + if (data.length < 8) { + break; + } + int[] destinations = new int[(data.length - 6) / 2]; + int[] ranges = new int[(data.length - 6) / 2]; + int ix = 0; + for (int j = 6; j < data.length - 1; j += 2) { + destinations[ix] = data[j] & 0xFF; + ranges[ix] = data[j + 1] & 0xFF; + ix++; + } + int channel = data[5] & 0xFF; + SoftChannel softchannel = synth.channels[channel]; + softchannel.mapChannelPressureToDestination( + destinations, ranges); + break; + } + case 0x02: // Poly Pressure + { + if (data.length < 8) { + break; + } + int[] destinations = new int[(data.length - 6) / 2]; + int[] ranges = new int[(data.length - 6) / 2]; + int ix = 0; + for (int j = 6; j < data.length - 1; j += 2) { + destinations[ix] = data[j] & 0xFF; + ranges[ix] = data[j + 1] & 0xFF; + ix++; + } + int channel = data[5] & 0xFF; + SoftChannel softchannel = synth.channels[channel]; + softchannel.mapPolyPressureToDestination( + destinations, ranges); + break; + } + case 0x03: // Control Change + { + if (data.length < 8) { + break; + } + int[] destinations = new int[(data.length - 7) / 2]; + int[] ranges = new int[(data.length - 7) / 2]; + int ix = 0; + for (int j = 7; j < data.length - 1; j += 2) { + destinations[ix] = data[j] & 0xFF; + ranges[ix] = data[j + 1] & 0xFF; + ix++; + } + int channel = data[5] & 0xFF; + SoftChannel softchannel = synth.channels[channel]; + int control = data[6] & 0xFF; + softchannel.mapControlToDestination(control, + destinations, ranges); + break; + } + default: + break; + } break; - } - break; - case 0x0A: // Key Based Instrument Control - { - subid2 = data[4] & 0xFF; - switch (subid2) { - case 0x01: // Basic Message - int channel = data[5] & 0xFF; - int keynumber = data[6] & 0xFF; - SoftChannel softchannel = synth.channels[channel]; - for (int j = 7; j < data.length - 1; j += 2) { - int controlnumber = data[j] & 0xFF; - int controlvalue = data[j + 1] & 0xFF; - softchannel.controlChangePerNote(keynumber, - controlnumber, controlvalue); + case 0x0A: // Key Based Instrument Control + { + if (data.length < 8 || (data[4] & 0xFF) != 0x01) { + break; + } + subid2 = data[4] & 0xFF; + switch (subid2) { + case 0x01: // Basic Message + int channel = data[5] & 0xFF; + int keynumber = data[6] & 0xFF; + SoftChannel softchannel = synth.channels[channel]; + for (int j = 7; j < data.length - 1; j += 2) { + int controlnumber = data[j] & 0xFF; + int controlvalue = data[j + 1] & 0xFF; + softchannel.controlChangePerNote(keynumber, + controlnumber, controlvalue); + } + break; + default: + break; } break; + } default: break; - } - break; - } - default: - break; } } } - } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java 2025-01-04 20:25:18.000000000 +0000 @@ -289,12 +289,11 @@ c.current_instrument = null; c.current_director = null; } - for (Instrument instrument : instruments) { + for (ModelInstrument instrument : instruments) { String pat = patchToString(instrument.getPatch()); - SoftInstrument softins - = new SoftInstrument((ModelInstrument) instrument); + SoftInstrument softins = new SoftInstrument(instrument); inslist.put(pat, softins); - loadedlist.put(pat, (ModelInstrument) instrument); + loadedlist.put(pat, instrument); } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftTuning.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftTuning.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/com/sun/media/sound/SoftTuning.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/com/sun/media/sound/SoftTuning.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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,11 +25,12 @@ package com.sun.media.sound; -import java.io.UnsupportedEncodingException; import java.util.Arrays; import javax.sound.midi.Patch; +import static java.nio.charset.StandardCharsets.US_ASCII; + /** * A tuning program container, for use with MIDI Tuning. * See: http://www.midi.org @@ -88,10 +89,21 @@ */ public void load(byte[] data) { // Universal Non-Real-Time / Real-Time SysEx + if (data.length < 2) { + return; + } + if ((data[1] & 0xFF) == 0x7E || (data[1] & 0xFF) == 0x7F) { + if (data.length < 4) { + return; + } + int subid1 = data[3] & 0xFF; switch (subid1) { case 0x08: // MIDI Tuning Standard + if (data.length < 5) { + break; + } int subid2 = data[4] & 0xFF; switch (subid2) { case 0x01: // BULK TUNING DUMP (NON-REAL-TIME) @@ -99,12 +111,11 @@ // http://www.midi.org/about-midi/tuning.shtml //if (!checksumOK2(data)) // break; - try { - name = new String(data, 6, 16, "ascii"); - } catch (UnsupportedEncodingException e) { - name = null; - } int r = 22; + if (data.length < 128 * 3 + r) { + break; + } + name = new String(data, 6, 16, US_ASCII); for (int i = 0; i < 128; i++) { int xx = data[r++] & 0xFF; int yy = data[r++] & 0xFF; @@ -118,8 +129,14 @@ case 0x02: // SINGLE NOTE TUNING CHANGE (REAL-TIME) { // http://www.midi.org/about-midi/tuning.shtml + if (data.length < 7) { + break; + } int ll = data[6] & 0xFF; int r = 7; + if (data.length < ll * 4 + r) { + break; + } for (int i = 0; i < ll; i++) { int kk = data[r++] & 0xFF; int xx = data[r++] & 0xFF; @@ -135,11 +152,10 @@ // http://www.midi.org/about-midi/tuning_extens.shtml if (!checksumOK(data)) break; - try { - name = new String(data, 7, 16, "ascii"); - } catch (UnsupportedEncodingException e) { - name = null; + if (data.length < 407) { + break; } + name = new String(data, 7, 16, US_ASCII); int r = 23; for (int i = 0; i < 128; i++) { int xx = data[r++] & 0xFF; @@ -156,11 +172,10 @@ // http://www.midi.org/about-midi/tuning_extens.shtml if (!checksumOK(data)) break; - try { - name = new String(data, 7, 16, "ascii"); - } catch (UnsupportedEncodingException e) { - name = null; + if (data.length < 35) { + break; } + name = new String(data, 7, 16, US_ASCII); int[] octave_tuning = new int[12]; for (int i = 0; i < 12; i++) octave_tuning[i] = (data[i + 23] & 0xFF) - 64; @@ -174,11 +189,10 @@ // http://www.midi.org/about-midi/tuning_extens.shtml if (!checksumOK(data)) break; - try { - name = new String(data, 7, 16, "ascii"); - } catch (UnsupportedEncodingException e) { - name = null; + if (data.length < 47) { + break; } + name = new String(data, 7, 16, US_ASCII); double[] octave_tuning = new double[12]; for (int i = 0; i < 12; i++) { int v = (data[i * 2 + 23] & 0xFF) * 128 @@ -192,7 +206,13 @@ case 0x07: // SINGLE NOTE TUNING CHANGE (NON // REAL-TIME/REAL-TIME) (BANK) // http://www.midi.org/about-midi/tuning_extens.shtml + if (data.length < 8) { + break; + } int ll = data[7] & 0xFF; + if (data.length < ll * 4 + 8) { + break; + } int r = 8; for (int i = 0; i < ll; i++) { int kk = data[r++] & 0xFF; @@ -208,6 +228,9 @@ // Real-Time/REAL-TIME) { // http://www.midi.org/about-midi/tuning-scale.shtml + if (data.length < 20) { + break; + } int[] octave_tuning = new int[12]; for (int i = 0; i < 12; i++) octave_tuning[i] = (data[i + 8] & 0xFF) - 64; @@ -219,6 +242,9 @@ // Real-Time/REAL-TIME) { // http://www.midi.org/about-midi/tuning-scale.shtml + if (data.length < 32) { + break; + } double[] octave_tuning = new double[12]; for (int i = 0; i < 12; i++) { int v = (data[i * 2 + 8] & 0xFF) * 128 diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023, 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,15 +25,15 @@ package javax.swing; -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.border.*; - -import java.awt.Component; import java.awt.Color; +import java.awt.Component; import java.awt.Rectangle; - import java.io.Serializable; + +import javax.swing.border.Border; +import javax.swing.border.EmptyBorder; +import javax.swing.plaf.synth.SynthListUI; + import sun.swing.DefaultLookup; import sun.swing.SwingUtilities2; @@ -157,7 +157,11 @@ setText((value == null) ? "" : value.toString()); } - setEnabled(list.isEnabled()); + if (list.getName() == null || !list.getName().equals("ComboBox.list") + || !(list.getUI() instanceof SynthListUI)) { + setEnabled(list.isEnabled()); + } + setFont(list.getFont()); Border border = null; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java 2025-01-04 20:25:18.000000000 +0000 @@ -868,11 +868,11 @@ return new DefaultFormatterFactory(new DateFormatter()); } if (type instanceof Number) { - AbstractFormatter displayFormatter = new NumberFormatter(); - ((NumberFormatter)displayFormatter).setValueClass(type.getClass()); - AbstractFormatter editFormatter = new NumberFormatter( + NumberFormatter displayFormatter = new NumberFormatter(); + displayFormatter.setValueClass(type.getClass()); + NumberFormatter editFormatter = new NumberFormatter( new DecimalFormat("#.#")); - ((NumberFormatter)editFormatter).setValueClass(type.getClass()); + editFormatter.setValueClass(type.getClass()); return new DefaultFormatterFactory(displayFormatter, displayFormatter,editFormatter); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JRootPane.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JRootPane.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JRootPane.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JRootPane.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,18 +24,13 @@ */ package javax.swing; -import java.applet.Applet; import java.awt.*; -import java.awt.event.*; import java.beans.*; import java.security.AccessController; import javax.accessibility.*; import javax.swing.plaf.RootPaneUI; -import java.util.Vector; import java.io.Serializable; -import javax.swing.border.*; -import sun.awt.AWTAccessor; import sun.security.action.GetBooleanAction; @@ -511,10 +506,10 @@ * @return the default glassPane */ protected Component createGlassPane() { - JComponent c = new JPanel(); + JPanel c = new JPanel(); c.setName(this.getName()+".glassPane"); c.setVisible(false); - ((JPanel)c).setOpaque(false); + c.setOpaque(false); return c; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JTree.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JTree.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/JTree.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/JTree.java 2025-01-04 20:25:18.000000000 +0000 @@ -2033,7 +2033,7 @@ Enumeration toggledPaths = expandedState.keys(); Vector elements = null; TreePath path; - Object value; + Boolean value; if(toggledPaths != null) { while(toggledPaths.hasMoreElements()) { @@ -2042,8 +2042,7 @@ // Add the path if it is expanded, a descendant of parent, // and it is visible (all parents expanded). This is rather // expensive! - if(path != parent && value != null && - ((Boolean)value).booleanValue() && + if (path != parent && value != null && value && parent.isDescendant(path) && isVisible(path)) { if (elements == null) { elements = new Vector(); @@ -2081,11 +2080,11 @@ if(path == null) return false; - Object value; + Boolean value; do{ value = expandedState.get(path); - if(value == null || !((Boolean)value).booleanValue()) + if (value == null || !value) return false; } while( (path=path.getParentPath())!=null ); @@ -2109,7 +2108,7 @@ if(path != null) { Boolean value = expandedState.get(path); - return (value != null && value.booleanValue()); + return (value != null && value); } } return false; @@ -3729,9 +3728,9 @@ } if(!state) { // collapse last path. - Object cValue = expandedState.get(path); + Boolean cValue = expandedState.get(path); - if(cValue != null && ((Boolean)cValue).booleanValue()) { + if (cValue != null && cValue) { try { fireTreeWillCollapse(path); } @@ -3753,9 +3752,9 @@ } else { // Expand last path. - Object cValue = expandedState.get(path); + Boolean cValue = expandedState.get(path); - if(cValue == null || !((Boolean)cValue).booleanValue()) { + if (cValue == null || !cValue) { try { fireTreeWillExpand(path); } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -921,7 +921,7 @@ if (e.getSource() == list) { return; } - if (!SwingUtilities.isLeftMouseButton(e) || !comboBox.isEnabled()) + if (!SwingUtilities.isLeftMouseButton(e) || !comboBox.isEnabled() || !comboBox.isShowing()) return; if ( comboBox.isEditable() ) { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import javax.swing.ComboBoxEditor; import javax.swing.DefaultButtonModel; +import javax.swing.DefaultListCellRenderer; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JComboBox; @@ -108,6 +109,8 @@ */ private EditorFocusHandler editorFocusHandler; + private DlcrEnabledHandler dlcrEnabledHandler; + /** * If true, then the cell renderer will be forced to be non-opaque when * used for rendering the selected item in the combo box (not in the list), @@ -187,6 +190,7 @@ comboBox.addPropertyChangeListener(this); comboBox.addMouseListener(buttonHandler); editorFocusHandler = new EditorFocusHandler(comboBox); + dlcrEnabledHandler = new DlcrEnabledHandler(comboBox); super.installListeners(); } @@ -219,6 +223,7 @@ @Override protected void uninstallListeners() { editorFocusHandler.unregister(); + dlcrEnabledHandler.unregister(); comboBox.removePropertyChangeListener(this); comboBox.removeMouseListener(buttonHandler); buttonHandler.pressed = false; @@ -793,5 +798,37 @@ } } } + } + + /** + * Handler for updating combobox enabled status when renderer enabled + * status changes + */ + private static class DlcrEnabledHandler implements PropertyChangeListener { + private JComboBox comboBox; + + private DlcrEnabledHandler(JComboBox comboBox) { + this.comboBox = comboBox; + comboBox.addPropertyChangeListener("enabled",this); + } + + public void unregister() { + comboBox.removePropertyChangeListener("enabled", this); + } + + /** + * Called when the combos enabled status changes + * + * @param evt A PropertyChangeEvent object describing the event source + * and the property that has changed. + */ + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getPropertyName().equals("enabled")) { + if (comboBox.getRenderer() instanceof DefaultListCellRenderer) { + ((DefaultListCellRenderer) comboBox.getRenderer()) + .setEnabled((boolean) evt.getNewValue()); + } + } + } } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -1024,10 +1024,7 @@ painter, direction); - for (Object infoObject: painters) { - ParsedSynthStyle.PainterInfo info; - info = (ParsedSynthStyle.PainterInfo) infoObject; - + for (ParsedSynthStyle.PainterInfo info: painters) { if (painterInfo.equalsPainter(info)) { info.addPainter(painter); return; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java 2025-01-04 20:25:18.000000000 +0000 @@ -317,14 +317,12 @@ */ public AccessibleStateSet getAccessibleStateSet() { AccessibleStateSet states = new AccessibleStateSet(); - Component comp = getTextComponent(); + JTextComponent comp = getTextComponent(); if (comp.isEnabled()) { states.add(AccessibleState.ENABLED); } - if (comp instanceof JTextComponent && - ((JTextComponent)comp).isEditable()) { - + if (comp.isEditable()) { states.add(AccessibleState.EDITABLE); states.add(AccessibleState.FOCUSABLE); } @@ -742,11 +740,9 @@ * @see AccessibleStateSet */ public boolean isFocusTraversable() { - Component comp = getTextComponent(); - if (comp instanceof JTextComponent) { - if (((JTextComponent)comp).isEditable()) { - return true; - } + JTextComponent comp = getTextComponent(); + if (comp != null && comp.isEditable()) { + return true; } return false; } @@ -763,8 +759,8 @@ return; } - Component comp = getTextComponent(); - if (comp instanceof JTextComponent) { + JTextComponent comp = getTextComponent(); + if (comp != null) { comp.requestFocusInWindow(); @@ -772,7 +768,7 @@ if (elementInfo.validateIfNecessary()) { // set the caret position to the start of this component Element elem = elementInfo.getElement(); - ((JTextComponent)comp).setCaretPosition(elem.getStartOffset()); + comp.setCaretPosition(elem.getStartOffset()); // fire a AccessibleState.FOCUSED property change event AccessibleContext ac = editor.getAccessibleContext(); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java 2025-01-04 20:25:18.000000000 +0000 @@ -4225,7 +4225,7 @@ try { if (offset == 0 || !getText(offset - 1, 1).equals("\n")) { // Need to insert a newline. - AttributeSet newAttrs = null; + SimpleAttributeSet newAttrs = null; boolean joinP = true; if (offset != 0) { @@ -4259,9 +4259,8 @@ // sure and set the name (otherwise it will be // inherited). newAttrs = new SimpleAttributeSet(); - ((SimpleAttributeSet)newAttrs).addAttribute - (StyleConstants.NameAttribute, - HTML.Tag.CONTENT); + newAttrs.addAttribute(StyleConstants.NameAttribute, + HTML.Tag.CONTENT); } ElementSpec es = new ElementSpec(newAttrs, ElementSpec.ContentType, NEWLINE, 0, diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java 2025-01-04 20:25:18.000000000 +0000 @@ -22,27 +22,82 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package javax.swing.text.html; -import sun.awt.AppContext; +package javax.swing.text.html; -import java.awt.*; -import java.awt.event.*; -import java.io.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Shape; +import java.awt.event.ActionEvent; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.Serializable; +import java.io.StringReader; +import java.io.Writer; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; import java.net.MalformedURLException; import java.net.URL; -import javax.swing.text.*; -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.plaf.TextUI; -import java.util.*; -import javax.accessibility.*; -import java.lang.ref.*; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.Enumeration; + +import javax.accessibility.Accessible; +import javax.accessibility.AccessibleAction; +import javax.accessibility.AccessibleContext; +import javax.swing.Action; +import javax.swing.JEditorPane; +import javax.swing.JViewport; +import javax.swing.SizeRequirements; +import javax.swing.SwingUtilities; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.event.HyperlinkEvent; +import javax.swing.plaf.TextUI; +import javax.swing.text.AbstractDocument; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.BoxView; +import javax.swing.text.ComponentView; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Document; +import javax.swing.text.EditorKit; +import javax.swing.text.Element; +import javax.swing.text.ElementIterator; +import javax.swing.text.Highlighter; +import javax.swing.text.IconView; +import javax.swing.text.JTextComponent; +import javax.swing.text.LabelView; +import javax.swing.text.MutableAttributeSet; +import javax.swing.text.Position; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyledDocument; +import javax.swing.text.StyledEditorKit; +import javax.swing.text.TextAction; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; import javax.swing.text.html.parser.ParserDelegator; + +import sun.awt.AppContext; import sun.swing.SwingAccessor; +import static java.nio.charset.StandardCharsets.ISO_8859_1; + /** * The Swing JEditorPane text component supports different kinds * of content via a plug-in mechanism called an EditorKit. Because @@ -404,7 +459,7 @@ try { InputStream is = HTMLEditorKit.getResourceAsStream(DEFAULT_CSS); Reader r = new BufferedReader( - new InputStreamReader(is, "ISO-8859-1")); + new InputStreamReader(is, ISO_8859_1)); defaultStyles.loadRules(r, null); r.close(); } catch (Throwable e) { @@ -793,13 +848,12 @@ Rectangle bounds; TextUI ui = html.getUI(); try { - Shape lBounds = ui.modelToView(html, offset, + Rectangle lBounds = ui.modelToView(html, offset, Position.Bias.Forward); - Shape rBounds = ui.modelToView(html, offset + 1, + Rectangle rBounds = ui.modelToView(html, offset + 1, Position.Bias.Backward); - bounds = lBounds.getBounds(); - bounds.add((rBounds instanceof Rectangle) ? - (Rectangle)rBounds : rBounds.getBounds()); + bounds = lBounds; + bounds.add(rBounds); } catch (BadLocationException ble) { bounds = null; } @@ -830,18 +884,14 @@ if (e != null && offset > 0 && e.getStartOffset() == offset) { try { TextUI ui = editor.getUI(); - Shape s1 = ui.modelToView(editor, offset, - Position.Bias.Forward); - if (s1 == null) { + Rectangle r1 = ui.modelToView(editor, offset, + Position.Bias.Forward); + if (r1 == null) { return false; } - Rectangle r1 = (s1 instanceof Rectangle) ? (Rectangle)s1 : - s1.getBounds(); - Shape s2 = ui.modelToView(editor, e.getEndOffset(), - Position.Bias.Backward); - if (s2 != null) { - Rectangle r2 = (s2 instanceof Rectangle) ? (Rectangle)s2 : - s2.getBounds(); + Rectangle r2 = ui.modelToView(editor, e.getEndOffset(), + Position.Bias.Backward); + if (r2 != null) { r1.add(r2); } return r1.contains(x, y); @@ -1466,9 +1516,9 @@ //if parent == null unregister component listener if (parent == null) { if (cachedViewPort != null) { - Object cachedObject; + JViewport cachedObject; if ((cachedObject = cachedViewPort.get()) != null) { - ((JComponent)cachedObject).removeComponentListener(this); + cachedObject.removeComponentListener(this); } cachedViewPort = null; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/default.css openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/default.css --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/html/default.css 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/html/default.css 2025-01-04 20:25:18.000000000 +0000 @@ -102,7 +102,7 @@ margin-bottom: 0} dd p {margin-left: 0; - margin-rigth: 0; + margin-right: 0; margin-top: 0; margin-bottom: 0} diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java 2025-01-04 20:25:18.000000000 +0000 @@ -27,7 +27,6 @@ import java.lang.*; import java.util.*; import java.awt.Color; -import java.awt.Font; import java.io.OutputStream; import java.io.IOException; @@ -516,13 +515,13 @@ { if (emitStyleChanges) { Object oldStyle = current.getAttribute("sectionStyle"); - Object newStyle = findStyleNumber(newAttributes, Constants.STSection); + Integer newStyle = findStyleNumber(newAttributes, Constants.STSection); if (oldStyle != newStyle) { if (oldStyle != null) { resetSectionAttributes(current); } if (newStyle != null) { - writeControlWord("ds", ((Integer)newStyle).intValue()); + writeControlWord("ds", newStyle); current.addAttribute("sectionStyle", newStyle); } else { current.removeAttribute("sectionStyle"); @@ -555,8 +554,8 @@ boolean emitStyleChanges) throws IOException { - Object parm; - Object oldStyle, newStyle; + Object oldStyle; + Integer newStyle; /* The only way to get rid of tabs or styles is with the \pard keyword, emitted by resetParagraphAttributes(). Ideally we should avoid @@ -588,7 +587,7 @@ } if (oldStyle != newStyle && newStyle != null) { - writeControlWord("s", ((Integer)newStyle).intValue()); + writeControlWord("s", newStyle); current.addAttribute("paragraphStyle", newStyle); } @@ -707,14 +706,14 @@ if (updateStyleChanges) { Object oldStyle = current.getAttribute("characterStyle"); - Object newStyle = findStyleNumber(newAttributes, + Integer newStyle = findStyleNumber(newAttributes, Constants.STCharacter); if (oldStyle != newStyle) { if (oldStyle != null) { resetCharacterAttributes(current); } if (newStyle != null) { - writeControlWord("cs", ((Integer)newStyle).intValue()); + writeControlWord("cs", newStyle.intValue()); current.addAttribute("characterStyle", newStyle); } else { current.removeAttribute("characterStyle"); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java 2025-01-04 20:25:18.000000000 +0000 @@ -22,12 +22,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.swing.text.rtf; -import java.lang.*; -import java.util.*; -import java.io.*; import java.awt.Color; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.StreamTokenizer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -35,7 +39,24 @@ import java.nio.charset.CodingErrorAction; import java.security.AccessController; import java.security.PrivilegedAction; -import javax.swing.text.*; +import java.util.Dictionary; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Map; +import java.util.Set; +import java.util.Vector; + +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.MutableAttributeSet; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; +import javax.swing.text.StyledDocument; +import javax.swing.text.TabStop; import static java.nio.charset.StandardCharsets.ISO_8859_1; @@ -648,7 +669,7 @@ char[] values = new char[256]; int i; StreamTokenizer in = new StreamTokenizer(new BufferedReader( - new InputStreamReader(strm, "ISO-8859-1"))); + new InputStreamReader(strm, ISO_8859_1))); in.eolIsSignificant(false); in.commentChar('#'); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/FontDescriptor.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/FontDescriptor.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/FontDescriptor.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/FontDescriptor.java 2025-01-04 20:25:18.000000000 +0000 @@ -22,14 +22,17 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package sun.awt; import java.io.ByteArrayOutputStream; -import java.io.OutputStreamWriter; import java.io.IOException; +import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; -import java.nio.charset.StandardCharsets; + +import static java.nio.charset.StandardCharsets.UTF_16BE; +import static java.nio.charset.StandardCharsets.UTF_16LE; public class FontDescriptor implements Cloneable { @@ -109,9 +112,8 @@ public boolean useUnicode() { if (useUnicode && unicodeEncoder == null) { try { - this.unicodeEncoder = isLE? - StandardCharsets.UTF_16LE.newEncoder(): - StandardCharsets.UTF_16BE.newEncoder(); + this.unicodeEncoder = isLE ? UTF_16LE.newEncoder(): + UTF_16BE.newEncoder(); } catch (IllegalArgumentException x) {} } return useUnicode; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/SunToolkit.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/SunToolkit.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/SunToolkit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/SunToolkit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1805,8 +1805,8 @@ if (useSystemAAFontSettings()) { Toolkit tk = Toolkit.getDefaultToolkit(); if (tk instanceof SunToolkit) { - Object map = ((SunToolkit)tk).getDesktopAAHints(); - return (RenderingHints)map; + RenderingHints map = ((SunToolkit)tk).getDesktopAAHints(); + return map; } else { /* Headless Toolkit */ return null; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java 2025-01-04 20:25:18.000000000 +0000 @@ -29,77 +29,78 @@ import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; - import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.FlavorMap; import java.awt.datatransfer.FlavorTable; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; - +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.WritableRaster; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FilePermission; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Reader; import java.io.SequenceInputStream; import java.io.StringReader; - +import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; import java.net.URI; import java.net.URISyntaxException; - import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.IllegalCharsetNameException; -import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Modifier; - import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.ProtectionDomain; - -import java.util.*; - -import sun.datatransfer.DataFlavorUtil; - -import sun.awt.AppContext; -import sun.awt.ComponentFactory; -import sun.awt.SunToolkit; - -import java.awt.image.BufferedImage; -import java.awt.image.ImageObserver; -import java.awt.image.RenderedImage; -import java.awt.image.WritableRaster; -import java.awt.image.ColorModel; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.Stack; +import java.util.TreeMap; +import java.util.stream.Stream; import javax.imageio.ImageIO; -import javax.imageio.ImageReader; import javax.imageio.ImageReadParam; -import javax.imageio.ImageWriter; +import javax.imageio.ImageReader; import javax.imageio.ImageTypeSpecifier; - +import javax.imageio.ImageWriter; import javax.imageio.spi.ImageWriterSpi; - import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.ImageOutputStream; +import sun.awt.AppContext; +import sun.awt.ComponentFactory; +import sun.awt.SunToolkit; import sun.awt.image.ImageRepresentation; import sun.awt.image.ToolkitImage; +import sun.datatransfer.DataFlavorUtil; -import java.io.FilePermission; -import java.util.stream.Stream; - +import static java.nio.charset.StandardCharsets.UTF_8; /** * Provides a set of functions to be shared among the DataFlavor class and @@ -550,7 +551,7 @@ try { byte[] charsetNameBytes = (byte[])localeTransferable .getTransferData(javaTextEncodingFlavor); - charset = new String(charsetNameBytes, StandardCharsets.UTF_8); + charset = new String(charsetNameBytes, UTF_8); } catch (UnsupportedFlavorException cannotHappen) { } } else { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/font/Type1Font.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/font/Type1Font.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/font/Type1Font.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/font/Type1Font.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,23 +25,23 @@ package sun.font; -import java.lang.ref.WeakReference; import java.awt.FontFormatException; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; -import java.io.UnsupportedEncodingException; import java.lang.ref.WeakReference; +import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.nio.BufferUnderflowException; import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; +import java.util.HashMap; +import java.util.HashSet; + import sun.java2d.Disposer; import sun.java2d.DisposerRecord; -import java.util.HashSet; -import java.util.HashMap; -import java.awt.Font; + +import static java.nio.charset.StandardCharsets.US_ASCII; /* * Adobe Technical Note 5040 details the format of PFB files. @@ -609,11 +609,7 @@ byte[] nameBytes = new byte[pos2-pos1-1]; bb.position(pos1); bb.get(nameBytes); - try { - return new String(nameBytes, "US-ASCII"); - } catch (UnsupportedEncodingException e) { - return new String(nameBytes); - } + return new String(nameBytes, US_ASCII); } private String getString(ByteBuffer bb) { @@ -623,11 +619,7 @@ byte[] nameBytes = new byte[pos2-pos1-1]; bb.position(pos1); bb.get(nameBytes); - try { - return new String(nameBytes, "US-ASCII"); - } catch (UnsupportedEncodingException e) { - return new String(nameBytes); - } + return new String(nameBytes, US_ASCII); } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/java2d/Disposer.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/java2d/Disposer.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/java2d/Disposer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/java2d/Disposer.java 2025-01-04 20:25:18.000000000 +0000 @@ -142,8 +142,8 @@ public void run() { while (true) { try { - Object obj = queue.remove(); - ((Reference)obj).clear(); + Reference obj = queue.remove(); + obj.clear(); DisposerRecord rec = records.remove(obj); rec.dispose(); obj = null; @@ -200,7 +200,7 @@ if (pollingQueue) { return; } - Object obj; + Reference obj; pollingQueue = true; int freed = 0; int deferred = 0; @@ -208,7 +208,7 @@ while ( freed < 10000 && deferred < 100 && (obj = queue.poll()) != null ) { freed++; - ((Reference)obj).clear(); + obj.clear(); DisposerRecord rec = records.remove(obj); if (rec instanceof PollDisposable) { rec.dispose(); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/print/PageableDoc.java openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/print/PageableDoc.java --- openjdk-17-17.0.13+11/src/java.desktop/share/classes/sun/print/PageableDoc.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/classes/sun/print/PageableDoc.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,10 @@ package sun.print; +import java.awt.print.Pageable; import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.io.UnsupportedEncodingException; - -import java.awt.print.Pageable; import javax.print.Doc; import javax.print.DocFlavor; @@ -57,9 +55,7 @@ return pageable; } - public Reader getReaderForText() - throws UnsupportedEncodingException, IOException { - + public Reader getReaderForText() throws IOException { return null; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/native/libawt/java2d/SurfaceData.h openjdk-17-17.0.14+7/src/java.desktop/share/native/libawt/java2d/SurfaceData.h --- openjdk-17-17.0.13+11/src/java.desktop/share/native/libawt/java2d/SurfaceData.h 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/native/libawt/java2d/SurfaceData.h 2025-01-04 20:25:18.000000000 +0000 @@ -60,7 +60,7 @@ #define UNSAFE_TO_SUB(a, b) \ (((b >= 0) && (a < 0) && (a < (INT_MIN + b))) || \ - ((b < 0) && (a >= 0) && (-b > (INT_MAX - a)))) \ + ((b < 0) && (a >= 0) && (a > (INT_MAX + b)))) \ /* * The SurfaceDataRasInfo structure is used to pass in and return various diff -Nru openjdk-17-17.0.13+11/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c openjdk-17-17.0.14+7/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c --- openjdk-17-17.0.13+11/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -666,8 +666,6 @@ static void imageio_dispose(j_common_ptr info) { if (info != NULL) { - free(info->err); - info->err = NULL; if (info->is_decompressor) { j_decompress_ptr dinfo = (j_decompress_ptr) info; free(dinfo->src); @@ -678,6 +676,8 @@ cinfo->dest = NULL; } jpeg_destroy(info); + free(info->err); + info->err = NULL; free(info); } } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,9 +58,13 @@ * @since 1.5 */ -import jdk.internal.misc.Unsafe; import java.util.HashMap; +import jdk.internal.misc.Unsafe; + +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; + public final class XAtom { // Order of lock: XAWTLock -> XAtom.class @@ -308,12 +312,7 @@ throw new IllegalStateException("Atom should be initialized"); } checkWindow(window); - byte[] bdata = null; - try { - bdata = str.getBytes("UTF-8"); - } catch (java.io.UnsupportedEncodingException uee) { - uee.printStackTrace(); - } + byte[] bdata = str.getBytes(UTF_8); if (bdata != null) { setAtomData(window, XA_UTF8_STRING.atom, bdata); } @@ -327,12 +326,7 @@ throw new IllegalStateException("Atom should be initialized"); } checkWindow(window); - byte[] bdata = null; - try { - bdata = str.getBytes("ISO-8859-1"); - } catch (java.io.UnsupportedEncodingException uee) { - uee.printStackTrace(); - } + byte[] bdata = str.getBytes(ISO_8859_1); if (bdata != null) { setAtomData(window, XA_STRING, bdata); } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,14 +23,17 @@ * questions. */ - package sun.awt.X11; import java.awt.Frame; +import java.nio.charset.Charset; import sun.awt.IconInfo; import sun.util.logging.PlatformLogger; +import static java.nio.charset.StandardCharsets.US_ASCII; +import static java.nio.charset.StandardCharsets.UTF_8; + final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XNETProtocol"); @@ -382,22 +385,18 @@ * mandates UTF8_STRING for _NET_WM_NAME but at least sawfish-1.0 * still uses STRING. (mmm, moving targets...). */ - String charSet = "UTF8"; + Charset charSet = UTF_8; byte[] net_wm_name = XA_NET_WM_NAME.getByteArrayProperty(NetWindow, XA_UTF8_STRING.getAtom()); if (net_wm_name == null) { net_wm_name = XA_NET_WM_NAME.getByteArrayProperty(NetWindow, XAtom.XA_STRING); - charSet = "ASCII"; + charSet = US_ASCII; } if (net_wm_name == null) { return null; } - try { - net_wm_name_cache = new String(net_wm_name, charSet); - return net_wm_name_cache; - } catch (java.io.UnsupportedEncodingException uex) { - return null; - } + net_wm_name_cache = new String(net_wm_name, charSet); + return net_wm_name_cache; } /** diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2025-01-04 20:25:18.000000000 +0000 @@ -47,7 +47,6 @@ import java.awt.event.WindowEvent; import java.awt.peer.ComponentPeer; import java.awt.peer.WindowPeer; -import java.io.UnsupportedEncodingException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; @@ -67,6 +66,8 @@ import sun.java2d.pipe.Region; import sun.util.logging.PlatformLogger; +import static java.nio.charset.StandardCharsets.UTF_8; + class XWindowPeer extends XPanelPeer implements WindowPeer, DisplayChangedListener { @@ -772,6 +773,7 @@ // TODO this should be the default for every case. switch (runningWM) { case XWM.CDE_WM: + case XWM.KDE2_WM: case XWM.MOTIF_WM: case XWM.METACITY_WM: case XWM.MUTTER_WM: @@ -1358,12 +1360,7 @@ } messageBuilder.append('"'); messageBuilder.append('\0'); - final byte[] message; - try { - message = messageBuilder.toString().getBytes("UTF-8"); - } catch (UnsupportedEncodingException cannotHappen) { - return; - } + final byte[] message = messageBuilder.toString().getBytes(UTF_8); XClientMessageEvent req = null; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/XSettings.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/XSettings.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/XSettings.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/XSettings.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,10 @@ package sun.awt; import java.awt.Color; - -import java.io.UnsupportedEncodingException; - import java.util.HashMap; import java.util.Map; +import static java.nio.charset.StandardCharsets.UTF_8; /** * Per-screen XSETTINGS. @@ -198,12 +196,7 @@ { needBytes(len); - String str = null; - try { - str = new String(data, idx, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - // XXX: cannot happen, "UTF-8" is always supported - } + String str = new String(data, idx, len, UTF_8); idx = (idx + len + 3) & ~0x3; return str; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java 2025-01-04 20:25:18.000000000 +0000 @@ -60,35 +60,33 @@ * The restore token allows the ScreenCast session to be restored * with previously granted screen access permissions. */ -@SuppressWarnings("removal") final class TokenStorage { private TokenStorage() {} private static final String REL_NAME = + ".java/robot/screencast-tokens.properties"; + private static final String REL_NAME_SECONDARY = ".awt/robot/screencast-tokens.properties"; private static final Properties PROPS = new Properties(); private static final Path PROPS_PATH; private static final Path PROP_FILENAME; + @SuppressWarnings("removal") private static void doPrivilegedRunnable(Runnable runnable) { - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Void run() { - runnable.run(); - return null; - } + AccessController.doPrivileged((PrivilegedAction) () -> { + runnable.run(); + return null; }); } static { - PROPS_PATH = AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Path run() { - return setupPath(); - } - }); + @SuppressWarnings("removal") + Path propsPath = AccessController + .doPrivileged((PrivilegedAction) () -> setupPath()); + + PROPS_PATH = propsPath; if (PROPS_PATH != null) { PROP_FILENAME = PROPS_PATH.getFileName(); @@ -110,25 +108,32 @@ } Path path = Path.of(userHome, REL_NAME); + Path secondaryPath = Path.of(userHome, REL_NAME_SECONDARY); + + boolean copyFromSecondary = !Files.isWritable(path) + && Files.isWritable(secondaryPath); + Path workdir = path.getParent(); - if (!Files.exists(workdir)) { - try { - Files.createDirectories(workdir); - } catch (Exception e) { - if (SCREENCAST_DEBUG) { - System.err.printf("Token storage: cannot create" + - " directory %s %s\n", workdir, e); + if (!Files.isWritable(path)) { + if (!Files.exists(workdir)) { + try { + Files.createDirectories(workdir); + } catch (Exception e) { + if (SCREENCAST_DEBUG) { + System.err.printf("Token storage: cannot create" + + " directory %s %s\n", workdir, e); + } + return null; } - return null; } - } - if (!Files.isWritable(workdir)) { - if (SCREENCAST_DEBUG) { - System.err.printf("Token storage: %s is not writable\n", workdir); + if (!Files.isWritable(workdir)) { + if (SCREENCAST_DEBUG) { + System.err.printf("Token storage: %s is not writable\n", workdir); + } + return null; } - return null; } try { @@ -145,7 +150,17 @@ } } - if (Files.exists(path)) { + if (copyFromSecondary) { + if (SCREENCAST_DEBUG) { + System.out.println("Token storage: copying from the secondary location " + + secondaryPath); + } + synchronized (PROPS) { + if (readTokens(secondaryPath)) { + store(path, "copy from the secondary location"); + } + } + } else if (Files.exists(path)) { if (!setFilePermission(path)) { return null; } @@ -302,7 +317,7 @@ } if (changed) { - doPrivilegedRunnable(() -> store("save tokens")); + doPrivilegedRunnable(() -> store(PROPS_PATH, "save tokens")); } } } @@ -315,7 +330,7 @@ PROPS.clear(); PROPS.load(reader); } - } catch (IOException e) { + } catch (IOException | IllegalArgumentException e) { if (SCREENCAST_DEBUG) { System.err.printf(""" Token storage: failed to load property file %s @@ -410,7 +425,7 @@ } private static void removeMalformedRecords(Set malformedRecords) { - if (!isWritable() + if (!isWritable(PROPS_PATH) || malformedRecords == null || malformedRecords.isEmpty()) { return; @@ -424,17 +439,17 @@ } } - store("remove malformed records"); + store(PROPS_PATH, "remove malformed records"); } } - private static void store(String failMsg) { - if (!isWritable()) { + private static void store(Path path, String failMsg) { + if (!isWritable(path)) { return; } synchronized (PROPS) { - try (BufferedWriter writer = Files.newBufferedWriter(PROPS_PATH)) { + try (BufferedWriter writer = Files.newBufferedWriter(path)) { PROPS.store(writer, null); } catch (IOException e) { if (SCREENCAST_DEBUG) { @@ -445,13 +460,13 @@ } } - private static boolean isWritable() { - if (PROPS_PATH == null - || (Files.exists(PROPS_PATH) && !Files.isWritable(PROPS_PATH))) { + private static boolean isWritable(Path path) { + if (path == null + || (Files.exists(path) && !Files.isWritable(path))) { if (SCREENCAST_DEBUG) { System.err.printf( - "Token storage: %s is not writable\n", PROPS_PATH); + "Token storage: %s is not writable\n", path); } return false; } else { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java 2025-01-04 20:25:18.000000000 +0000 @@ -32,23 +32,24 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; import java.util.Properties; import java.util.Scanner; + import sun.awt.FcFontManager; import sun.awt.FontConfiguration; import sun.awt.FontDescriptor; import sun.awt.SunToolkit; -import sun.font.CompositeFontDescriptor; -import sun.font.FontConfigManager.FontConfigInfo; import sun.font.FontConfigManager.FcCompFont; import sun.font.FontConfigManager.FontConfigFont; +import sun.font.FontConfigManager.FontConfigInfo; import sun.util.logging.PlatformLogger; +import static java.nio.charset.StandardCharsets.ISO_8859_1; + public class FcFontConfiguration extends FontConfiguration { /** Version of the cache file format understood by this code. @@ -178,7 +179,7 @@ String[] componentFaceNames = cfi[idx].getComponentFaceNames(); FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length]; for (int i = 0; i < componentFaceNames.length; i++) { - ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.ISO_8859_1.newEncoder(), new int[0]); + ret[i] = new FontDescriptor(componentFaceNames[i], ISO_8859_1.newEncoder(), new int[0]); } return ret; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/font/NativeFont.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/NativeFont.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/font/NativeFont.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/font/NativeFont.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,10 @@ import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; -import java.io.UnsupportedEncodingException; -import java.lang.ref.WeakReference; import java.util.Locale; +import static java.nio.charset.StandardCharsets.UTF_8; + /* * Ideally there would be no native fonts used, and this class would be * unneeded and removed. Presently it is still needed until such time @@ -213,23 +213,11 @@ pos = sb.indexOf("-0-", pos); }; String xlfd = sb.toString(); - byte[] bytes = null; - try { - bytes = xlfd.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = xlfd.getBytes(); - } - return haveBitmapFonts(bytes); + return haveBitmapFonts(xlfd.getBytes(UTF_8)); } public static boolean fontExists(String xlfd) { - byte[] bytes = null; - try { - bytes = xlfd.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = xlfd.getBytes(); - } - return fontExists(bytes); + return fontExists(xlfd.getBytes(UTF_8)); } private static native boolean haveBitmapFonts(byte[] xlfd); @@ -380,13 +368,7 @@ } String xlfd = sb.toString(); - byte[] bytes = null; - try { - bytes = xlfd.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = xlfd.getBytes(); - } - return bytes; + return xlfd.getBytes(UTF_8); } public String toString() { diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/print/AttributeClass.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/AttributeClass.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/print/AttributeClass.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/AttributeClass.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,10 +22,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package sun.print; -import java.util.Objects; import java.io.ByteArrayInputStream; +import java.util.Objects; + +import static java.nio.charset.StandardCharsets.UTF_8; public class AttributeClass { private String myName; @@ -187,10 +190,7 @@ byte[] strBytes = new byte[valLength]; bufStream.read(strBytes, 0, valLength); - try { - strVal = new String(strBytes, "UTF-8"); - } catch (java.io.UnsupportedEncodingException uee) { - } + strVal = new String(strBytes, UTF_8); } return strVal; } @@ -219,10 +219,7 @@ int valLength = bufStream.read(); byte[] bufBytes = new byte[valLength]; bufStream.read(bufBytes, 0, valLength); - try { - valueArray[i] = new String(bufBytes, "UTF-8"); - } catch (java.io.UnsupportedEncodingException uee) { - } + valueArray[i] = new String(bufBytes, UTF_8); } return valueArray; } diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/print/IPPPrintService.java openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/IPPPrintService.java --- openjdk-17-17.0.13+11/src/java.desktop/unix/classes/sun/print/IPPPrintService.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/classes/sun/print/IPPPrintService.java 2025-01-04 20:25:18.000000000 +0000 @@ -27,42 +27,82 @@ import java.awt.GraphicsEnvironment; import java.awt.Toolkit; -import javax.print.attribute.*; -import javax.print.attribute.standard.*; -import javax.print.DocFlavor; -import javax.print.DocPrintJob; -import javax.print.PrintService; -import javax.print.ServiceUIFactory; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Locale; -import java.util.Date; -import java.util.Arrays; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import javax.print.event.PrintServiceAttributeListener; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLConnection; -import java.net.HttpURLConnection; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; import java.io.File; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.io.DataInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.nio.charset.Charset; - -import java.util.Iterator; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; +import java.util.Locale; import java.util.Map; +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintService; +import javax.print.ServiceUIFactory; +import javax.print.attribute.Attribute; +import javax.print.attribute.AttributeSet; +import javax.print.attribute.AttributeSetUtilities; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.HashAttributeSet; +import javax.print.attribute.HashPrintServiceAttributeSet; +import javax.print.attribute.PrintRequestAttribute; +import javax.print.attribute.PrintServiceAttribute; +import javax.print.attribute.PrintServiceAttributeSet; +import javax.print.attribute.Size2DSyntax; +import javax.print.attribute.standard.Chromaticity; +import javax.print.attribute.standard.ColorSupported; +import javax.print.attribute.standard.Copies; +import javax.print.attribute.standard.CopiesSupported; +import javax.print.attribute.standard.Destination; +import javax.print.attribute.standard.DialogOwner; +import javax.print.attribute.standard.DialogTypeSelection; +import javax.print.attribute.standard.Fidelity; +import javax.print.attribute.standard.Finishings; +import javax.print.attribute.standard.JobName; +import javax.print.attribute.standard.JobSheets; +import javax.print.attribute.standard.Media; +import javax.print.attribute.standard.MediaPrintableArea; +import javax.print.attribute.standard.MediaSize; +import javax.print.attribute.standard.MediaSizeName; +import javax.print.attribute.standard.MediaTray; +import javax.print.attribute.standard.NumberUp; +import javax.print.attribute.standard.OrientationRequested; +import javax.print.attribute.standard.PDLOverrideSupported; +import javax.print.attribute.standard.PageRanges; +import javax.print.attribute.standard.PagesPerMinute; +import javax.print.attribute.standard.PagesPerMinuteColor; +import javax.print.attribute.standard.PrinterInfo; +import javax.print.attribute.standard.PrinterIsAcceptingJobs; +import javax.print.attribute.standard.PrinterLocation; +import javax.print.attribute.standard.PrinterMakeAndModel; +import javax.print.attribute.standard.PrinterMessageFromOperator; +import javax.print.attribute.standard.PrinterMoreInfo; +import javax.print.attribute.standard.PrinterMoreInfoManufacturer; +import javax.print.attribute.standard.PrinterName; +import javax.print.attribute.standard.PrinterResolution; +import javax.print.attribute.standard.PrinterState; +import javax.print.attribute.standard.PrinterStateReasons; +import javax.print.attribute.standard.PrinterURI; +import javax.print.attribute.standard.QueuedJobCount; +import javax.print.attribute.standard.RequestingUserName; +import javax.print.attribute.standard.SheetCollate; +import javax.print.attribute.standard.Sides; +import javax.print.event.PrintServiceAttributeListener; + +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; public class IPPPrintService implements PrintService, SunPrinterJobService { @@ -325,11 +365,7 @@ if ((name == null) || (url == null)){ throw new IllegalArgumentException("null uri or printer name"); } - try { - printer = java.net.URLDecoder.decode(name, "UTF-8"); - } catch (java.io.UnsupportedEncodingException e) { - printer = name; - } + printer = java.net.URLDecoder.decode(name, UTF_8); supportedDocFlavors = null; supportedCats = null; mediaSizeNames = null; @@ -359,11 +395,7 @@ if ((name == null) || (uriStr == null)){ throw new IllegalArgumentException("null uri or printer name"); } - try { - printer = java.net.URLDecoder.decode(name, "UTF-8"); - } catch (java.io.UnsupportedEncodingException e) { - printer = name; - } + printer = java.net.URLDecoder.decode(name, UTF_8); supportedDocFlavors = null; supportedCats = null; mediaSizeNames = null; @@ -1735,9 +1767,8 @@ InputStream is = urlConnection.getInputStream(); if (is != null) { - BufferedReader d = - new BufferedReader(new InputStreamReader(is, - Charset.forName("ISO-8859-1"))); + BufferedReader d = new BufferedReader( + new InputStreamReader(is, ISO_8859_1)); String lineStr; while ((lineStr = d.readLine()) != null) { if (lineStr.startsWith("*cupsFilter:")) { @@ -1829,13 +1860,7 @@ public static boolean writeIPPRequest(OutputStream os, String operCode, AttributeClass[] attCl) { - OutputStreamWriter osw; - try { - osw = new OutputStreamWriter(os, "UTF-8"); - } catch (java.io.UnsupportedEncodingException exc) { - debug_println(debugPrefix+"writeIPPRequest, UTF-8 not supported? Exception: "+exc); - return false; - } + OutputStreamWriter osw = new OutputStreamWriter(os, UTF_8); debug_println(debugPrefix+"writeIPPRequest, op code= "+operCode); char[] opCode = new char[2]; opCode[0] = (char)Byte.parseByte(operCode.substring(0,2), 16); diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h --- openjdk-17-17.0.13+11/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -55,13 +55,11 @@ } GParamFlags; /* We define all structure pointers to be void* */ -typedef void GMainContext; typedef void GVfs; typedef void GdkColormap; typedef void GdkDrawable; typedef void GdkGC; -typedef void GdkPixbuf; typedef void GdkPixmap; typedef void GtkFixed; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h --- openjdk-17-17.0.13+11/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -180,8 +180,6 @@ } cairo_status_t; /* We define all structure pointers to be void* */ -typedef void GdkPixbuf; -typedef void GMainContext; typedef void GVfs; typedef void GdkColormap; diff -Nru openjdk-17-17.0.13+11/src/java.desktop/windows/classes/sun/awt/windows/WDataTransferer.java openjdk-17-17.0.14+7/src/java.desktop/windows/classes/sun/awt/windows/WDataTransferer.java --- openjdk-17-17.0.13+11/src/java.desktop/windows/classes/sun/awt/windows/WDataTransferer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.desktop/windows/classes/sun/awt/windows/WDataTransferer.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,19 +25,15 @@ package sun.awt.windows; -import java.awt.Image; import java.awt.Graphics2D; +import java.awt.Image; import java.awt.Transparency; - import java.awt.color.ColorSpace; - import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.FlavorTable; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; - import java.awt.geom.AffineTransform; - import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.ComponentColorModel; @@ -48,18 +44,16 @@ import java.awt.image.ImageObserver; import java.awt.image.Raster; import java.awt.image.WritableRaster; - import java.io.BufferedInputStream; import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.io.File; - import java.net.URL; - import java.nio.charset.Charset; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -69,13 +63,11 @@ import sun.awt.Mutex; import sun.awt.datatransfer.DataTransferer; import sun.awt.datatransfer.ToolkitThreadBlockedHandler; - import sun.awt.image.ImageRepresentation; import sun.awt.image.ToolkitImage; -import java.util.ArrayList; - -import java.io.ByteArrayOutputStream; +import static java.nio.charset.StandardCharsets.UTF_16LE; +import static java.nio.charset.StandardCharsets.UTF_8; /** * Platform-specific support for the data transfer subsystem. @@ -249,7 +241,7 @@ if (bytes == null || !DataFlavor.javaFileListFlavor.equals(flavor)) { throw new IOException("data translation failed"); } - String st = new String(bytes, 0, bytes.length, "UTF-16LE"); + String st = new String(bytes, 0, bytes.length, UTF_16LE); String[] filenames = st.split("\0"); if( 0 == filenames.length ){ return null; @@ -275,7 +267,7 @@ { try { charset = new String((byte[])localeTransferable. - getTransferData(javaTextEncodingFlavor), "UTF-8"); + getTransferData(javaTextEncodingFlavor), UTF_8); } catch (UnsupportedFlavorException cannotHappen) { } } @@ -548,8 +540,6 @@ * on encode: static convertToHTMLFormat is responsible for HTML clipboard header creation */ class HTMLCodec extends InputStream { - //static section - public static final String ENCODING = "UTF-8"; public static final String VERSION = "Version:"; public static final String START_HTML = "StartHTML:"; @@ -671,13 +661,8 @@ //HTML header.append(htmlPrefix); - byte[] headerBytes = null, trailerBytes = null; - - try { - headerBytes = header.toString().getBytes(ENCODING); - trailerBytes = htmlSuffix.getBytes(ENCODING); - } catch (UnsupportedEncodingException cannotHappen) { - } + byte[] headerBytes = header.toString().getBytes(UTF_8); + byte[] trailerBytes = htmlSuffix.getBytes(UTF_8); byte[] retval = new byte[headerBytes.length + bytes.length + trailerBytes.length]; @@ -786,7 +771,7 @@ BufferedReader bufferedReader = new BufferedReader( new InputStreamReader( bufferedStream, - ENCODING + UTF_8 ), CHAR_BUFFER_LEN ); diff -Nru openjdk-17-17.0.13+11/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java openjdk-17-17.0.14+7/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java --- openjdk-17-17.0.13+11/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -78,7 +78,7 @@ byte[] inBuf = new byte[1]; int count = read(inBuf, 0, 1); if (count > 0) { - return inBuf[0]; + return inBuf[0] & 0xff; } else { return -1; } diff -Nru openjdk-17-17.0.13+11/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java openjdk-17-17.0.14+7/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java --- openjdk-17-17.0.13+11/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java 2025-01-04 20:25:18.000000000 +0000 @@ -143,25 +143,6 @@ } /** - * If the type is not accessible from current context, try to figure out the - * sharpest accessible supertype. - * - * @param originalType type to sharpen - * @return sharped type - */ - Type sharpestAccessible(Type originalType) { - if (originalType.hasTag(ARRAY)) { - return types.makeArrayType(sharpestAccessible(types.elemtype(originalType))); - } - - Type type = originalType; - while (!rs.isAccessible(gen.getAttrEnv(), type.asElement())) { - type = types.supertype(type); - } - return type; - } - - /** * "Legacy" bytecode flavor: emit the StringBuilder.append chains for string * concatenation. */ @@ -305,6 +286,14 @@ return splits.toList(); } + + /** + * Returns true if the argument should be converted to a string eagerly, to preserve + * possible side-effects. + */ + protected boolean shouldConvertToStringEagerly(Type argType) { + return !types.unboxedTypeOrType(argType).isPrimitive() && argType.tsym != syms.stringType.tsym; + } } /** @@ -333,14 +322,18 @@ for (JCTree arg : t) { Object constVal = arg.type.constValue(); if ("".equals(constVal)) continue; - if (arg.type == syms.botType) { - dynamicArgs.add(types.boxedClass(syms.voidType).type); - } else { - dynamicArgs.add(sharpestAccessible(arg.type)); + Type argType = arg.type; + if (argType == syms.botType) { + argType = types.boxedClass(syms.voidType).type; } if (!first || generateFirstArg) { gen.genExpr(arg, arg.type).load(); } + if (shouldConvertToStringEagerly(argType)) { + gen.callMethod(pos, syms.stringType, names.valueOf, List.of(syms.objectType), true); + argType = syms.stringType; + } + dynamicArgs.add(argType); first = false; } doCall(type, pos, dynamicArgs.toList()); @@ -439,10 +432,15 @@ } else { // Ordinary arguments come through the dynamic arguments. recipe.append(TAG_ARG); - dynamicArgs.add(sharpestAccessible(arg.type)); + Type argType = arg.type; if (!first || generateFirstArg) { gen.genExpr(arg, arg.type).load(); } + if (shouldConvertToStringEagerly(argType)) { + gen.callMethod(pos, syms.stringType, names.valueOf, List.of(syms.objectType), true); + argType = syms.stringType; + } + dynamicArgs.add(argType); first = false; } } diff -Nru openjdk-17-17.0.13+11/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java openjdk-17-17.0.14+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java --- openjdk-17-17.0.13+11/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java 2025-01-04 20:25:18.000000000 +0000 @@ -317,8 +317,9 @@ //------------------------------------------------------------------------------ // frame::adjust_unextended_sp private void adjustUnextendedSP() { - raw_unextendedSP = getFP(); + // Nothing to do. senderForInterpreterFrame finds the correct unextendedSP. } + private Frame senderForInterpreterFrame(PPC64RegisterMap map) { if (DEBUG) { System.out.println("senderForInterpreterFrame"); diff -Nru openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java --- openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -212,6 +212,13 @@ } }, + // Extract options + new Option(false, OptionType.EXTRACT, "--keep-old-files", "-k") { + void process(Main jartool, String opt, String arg) { + jartool.kflag = true; + } + }, + // Hidden options new Option(false, OptionType.OTHER, "-P") { void process(Main jartool, String opt, String arg) { @@ -254,6 +261,7 @@ CREATE("create"), CREATE_UPDATE("create.update"), CREATE_UPDATE_INDEX("create.update.index"), + EXTRACT("extract"), OTHER("other"); /** Resource lookup section prefix. */ diff -Nru openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/Main.java openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/Main.java --- openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2025-01-04 20:25:18.000000000 +0000 @@ -155,8 +155,9 @@ * nflag: Perform jar normalization at the end * pflag: preserve/don't strip leading slash and .. component from file name * dflag: print module descriptor + * kflag: keep existing file */ - boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag, pflag, dflag, validate; + boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag, pflag, dflag, kflag, validate; boolean suppressDeprecateMsg = false; @@ -581,6 +582,9 @@ case '0': flag0 = true; break; + case 'k': + kflag = true; + break; case 'i': if (cflag || uflag || xflag || tflag) { usageError(getMsg("error.multiple.main.operations")); @@ -611,6 +615,9 @@ usageError(getMsg("error.bad.option")); return false; } + if (kflag && !xflag) { + warn(formatMsg("warn.option.is.ignored", "--keep-old-files/-k/k")); + } /* parse file arguments */ int n = args.length - count; @@ -1451,6 +1458,12 @@ output(formatMsg("out.create", name)); } } else { + if (f.exists() && kflag) { + if (vflag) { + output(formatMsg("out.kept", name)); + } + return rc; + } if (f.getParent() != null) { File d = new File(f.getParent()); if (!d.exists() && !d.mkdirs() || !d.isDirectory()) { diff -Nru openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties --- openjdk-17-17.0.13+11/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties 2025-01-04 20:25:18.000000000 +0000 @@ -137,6 +137,8 @@ unexpected versioned entry {0} warn.flag.is.deprecated=\ Warning: The {0} option is deprecated, and is planned for removal in a future JDK release\n +warn.option.is.ignored=\ + Warning: The {0} option is not valid with current usage, will be ignored. out.added.manifest=\ added manifest out.added.module-info=\ @@ -159,6 +161,8 @@ \ \ created: {0} out.extracted=\ extracted: {0} +out.kept=\ + \ \ skipped: {0} exists out.inflated=\ \ inflated: {0} out.size=\ @@ -236,7 +240,10 @@ main.help.opt.main.update=\ \ -u, --update Update an existing jar archive main.help.opt.main.extract=\ -\ -x, --extract Extract named (or all) files from the archive +\ -x, --extract Extract named (or all) files from the archive.\n\ +\ If a file with the same name appears more than once in\n\ +\ the archive, each copy will be extracted, with later copies\n\ +\ overwriting (replacing) earlier copies unless -k is specified. main.help.opt.main.describe-module=\ \ -d, --describe-module Print the module descriptor, or automatic module name main.help.opt.main.validate=\ @@ -298,6 +305,15 @@ \ --date=TIMESTAMP The timestamp in ISO-8601 extended offset date-time with\n\ \ optional time-zone format, to use for the timestamps of\n\ \ entries, e.g. "2022-02-12T12:30:00-05:00" +main.help.opt.extract=\ +\ Operation modifiers valid only in extract mode:\n +main.help.opt.extract.keep-old-files=\ +\ -k, --keep-old-files Do not overwrite existing files.\n\ +\ If a Jar file entry with the same name exists in the target\n\ +\ directory, the existing file will not be overwritten.\n\ +\ As a result, if a file appears more than once in an\n\ +\ archive, later copies will not overwrite earlier copies.\n\ +\ Also note that some file system can be case insensitive. main.help.opt.other=\ \ Other options:\n main.help.opt.other.help=\ diff -Nru openjdk-17-17.0.13+11/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java openjdk-17-17.0.14+7/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java --- openjdk-17-17.0.13+11/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -124,8 +124,9 @@ byte b[] = connection.readPacket(); if (b.length == 0) { done = true; + } else { + p = Packet.fromByteArray(b); } - p = Packet.fromByteArray(b); } catch (IOException e) { done = true; } diff -Nru openjdk-17-17.0.13+11/src/jdk.jdwp.agent/share/native/libjdwp/util.c openjdk-17-17.0.14+7/src/jdk.jdwp.agent/share/native/libjdwp/util.c --- openjdk-17-17.0.13+11/src/jdk.jdwp.agent/share/native/libjdwp/util.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jdwp.agent/share/native/libjdwp/util.c 2025-01-04 20:25:18.000000000 +0000 @@ -277,12 +277,12 @@ localAgentProperties = JNI_FUNC_PTR(env,CallStaticObjectMethod) (env, localVMSupportClass, getAgentProperties); - saveGlobalRef(env, localAgentProperties, &(gdata->agent_properties)); if (JNI_FUNC_PTR(env,ExceptionOccurred)(env)) { JNI_FUNC_PTR(env,ExceptionClear)(env); EXIT_ERROR(AGENT_ERROR_INTERNAL, "Exception occurred calling VMSupport.getAgentProperties"); } + saveGlobalRef(env, localAgentProperties, &(gdata->agent_properties)); } } END_WITH_LOCAL_REFS(env); diff -Nru openjdk-17-17.0.13+11/src/jdk.jfr/share/conf/jfr/default.jfc openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/default.jfc --- openjdk-17-17.0.13+11/src/jdk.jfr/share/conf/jfr/default.jfc 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/default.jfc 2025-01-04 20:25:18.000000000 +0000 @@ -777,6 +777,7 @@ true + true 0 ms diff -Nru openjdk-17-17.0.13+11/src/jdk.jfr/share/conf/jfr/profile.jfc openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/profile.jfc --- openjdk-17-17.0.13+11/src/jdk.jfr/share/conf/jfr/profile.jfc 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jfr/share/conf/jfr/profile.jfc 2025-01-04 20:25:18.000000000 +0000 @@ -777,6 +777,7 @@ true + true 0 ms diff -Nru openjdk-17-17.0.13+11/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java openjdk-17-17.0.14+7/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java --- openjdk-17-17.0.13+11/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -1696,6 +1696,9 @@ ResourcePoolBuilder out) { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES); + // sort the map of module name to the class name of the generated SystemModules class + List> systemModulesMap = map.entrySet() + .stream().sorted(Map.Entry.comparingByKey()).toList(); cw.visit(Opcodes.V1_8, ACC_FINAL+ACC_SUPER, SYSTEM_MODULES_MAP_CLASS, @@ -1762,10 +1765,10 @@ mv.visitTypeInsn(ANEWARRAY, "java/lang/String"); int index = 0; - for (String moduleName : sorted(map.keySet())) { + for (Map.Entry entry : systemModulesMap) { mv.visitInsn(DUP); // arrayref pushInt(mv, index); - mv.visitLdcInsn(moduleName); + mv.visitLdcInsn(entry.getKey()); mv.visitInsn(AASTORE); index++; } @@ -1785,10 +1788,10 @@ mv.visitTypeInsn(ANEWARRAY, "java/lang/String"); index = 0; - for (String className : sorted(map.values())) { + for (Map.Entry entry : systemModulesMap) { mv.visitInsn(DUP); // arrayref pushInt(mv, index); - mv.visitLdcInsn(className.replace('/', '.')); + mv.visitLdcInsn(entry.getValue().replace('/', '.')); mv.visitInsn(AASTORE); index++; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/ProblemList-zgc.txt openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList-zgc.txt --- openjdk-17-17.0.13+11/test/hotspot/jtreg/ProblemList-zgc.txt 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList-zgc.txt 2025-01-04 20:25:18.000000000 +0000 @@ -32,6 +32,7 @@ resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8220624 generic-all serviceability/sa/CDSJMapClstats.java 8220624 generic-all serviceability/sa/ClhsdbJhisto.java 8220624 generic-all +serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 8276539 generic-all serviceability/sa/ClhsdbCDSCore.java 8268722 macosx-x64 serviceability/sa/ClhsdbFindPC.java#id1 8268722 macosx-x64 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/ProblemList.txt openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList.txt --- openjdk-17-17.0.13+11/test/hotspot/jtreg/ProblemList.txt 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/ProblemList.txt 2025-01-04 20:25:18.000000000 +0000 @@ -50,13 +50,13 @@ compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x compiler/rtm/locking/TestRTMAbortRatio.java 8183263 generic-x64,generic-i586 -compiler/rtm/locking/TestRTMAbortThreshold.java 8183263 generic-x64,generic-i586 +compiler/rtm/locking/TestRTMAbortThreshold.java 8183263,8313877 generic-x64,generic-i586,generic-ppc64le compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java 8183263 generic-x64,generic-i586 compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java 8183263 generic-x64,generic-i586 compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java 8183263 generic-x64,generic-i586 compiler/rtm/locking/TestRTMLockingCalculationDelay.java 8183263 generic-x64,generic-i586 compiler/rtm/locking/TestRTMLockingThreshold.java 8183263 generic-x64,generic-i586 -compiler/rtm/locking/TestRTMSpinLoopCount.java 8183263 generic-x64,generic-i586 +compiler/rtm/locking/TestRTMSpinLoopCount.java 8183263,8313877 generic-x64,generic-i586,generic-ppc64le compiler/rtm/locking/TestUseRTMDeopt.java 8183263 generic-x64,generic-i586 compiler/rtm/locking/TestUseRTMXendForLockBusy.java 8183263 generic-x64,generic-i586 compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java 8183263 generic-x64,generic-i586 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/TEST.groups openjdk-17-17.0.14+7/test/hotspot/jtreg/TEST.groups --- openjdk-17-17.0.13+11/test/hotspot/jtreg/TEST.groups 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/TEST.groups 2025-01-04 20:25:18.000000000 +0000 @@ -397,7 +397,8 @@ -runtime/Unsafe/RangeCheck.java \ sanity/ \ -:tier1_runtime_appcds_exclude \ - -runtime/signal + -runtime/signal \ + -runtime/stack hotspot_cds = \ runtime/cds/ \ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,14 +42,14 @@ * jcstress tests wrapper */ @Artifact(organization = "org.openjdk.jcstress", name = "jcstress-tests-all", - revision = "0.16", extension = "jar", unpack = false) + revision = JcstressRunner.VERSION, extension = "jar", unpack = false) public class JcstressRunner { + public static final String VERSION = "0.17-SNAPSHOT-20240328"; public static final String MAIN_CLASS = "org.openjdk.jcstress.Main"; - // Allow to configure jcstress mode parameter. - // Test mode preset: sanity, quick, default, tough, stress. - public static final String MODE_PROPERTY = "jcstress.mode"; + public static final String TIME_BUDGET_PROPERTY = "jcstress.time_budget"; + public static String timeBudget = "6m"; public static Path pathToArtifact() { Map artifacts; @@ -59,7 +59,7 @@ throw new Error("TESTBUG: Can not resolve artifacts for " + JcstressRunner.class.getName(), e); } - return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.16") + return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-" + VERSION) .toAbsolutePath(); } @@ -69,7 +69,7 @@ } Path out = Paths.get("jcstress.out").toAbsolutePath(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(getCmd(args)) + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(getCmd(args)) .redirectErrorStream(true) .redirectOutput(out.toFile()); OutputAnalyzer oa = ProcessTools.executeProcess(pb); @@ -109,21 +109,17 @@ extraFlags.add("--jvmArgs"); extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir")); - // The "default" preset might take days for some tests - // so use quick testing by default. - String mode = "quick"; for (String jvmArg : Utils.getTestJavaOpts()) { - if(jvmArg.startsWith("-D" + MODE_PROPERTY)) { - String[] pair = jvmArg.split("=", 2); - mode = pair[1]; - continue; + if (jvmArg.startsWith("-D" + TIME_BUDGET_PROPERTY)) { + timeBudget = jvmArg.split("=", 2)[1]; + } else { + extraFlags.add("--jvmArgs"); + extraFlags.add(jvmArg); } - extraFlags.add("--jvmArgs"); - extraFlags.add(jvmArg); } - extraFlags.add("-m"); - extraFlags.add(mode); + extraFlags.add("-tb"); + extraFlags.add(timeBudget); extraFlags.add("-sc"); extraFlags.add("false"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/jcstress/TestGenerator.java openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/TestGenerator.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/jcstress/TestGenerator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/jcstress/TestGenerator.java 2025-01-04 20:25:18.000000000 +0000 @@ -110,7 +110,7 @@ Path output; try { output = Files.createTempFile("jcstress", ".out"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-jar", path.toAbsolutePath().toString(), "-l"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/scimark/Scimark.java openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/scimark/Scimark.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/applications/scimark/Scimark.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/applications/scimark/Scimark.java 2025-01-04 20:25:18.000000000 +0000 @@ -49,7 +49,7 @@ System.setProperty("test.noclasspath", "true"); - OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm( + OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJavaProcessBuilder( "-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(), "jnt.scimark2.commandline", "-large") .start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -190,7 +190,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); try { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -338,7 +338,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); try { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -51,7 +51,7 @@ CheckC2OptoAssembly.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java 2025-01-04 20:25:18.000000000 +0000 @@ -173,7 +173,7 @@ for (String className : classNames) { // Start a new job { - ProcessBuilder pb = ProcessTools.createTestJvm(mix(c, "-Xmx256m", className)); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(mix(c, "-Xmx256m", className)); Process p = pb.start(); OutputAnalyzer oa = new OutputAnalyzer(p); forks.add(new Fork(p, oa)); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -65,14 +65,14 @@ } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -65,14 +65,14 @@ } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -134,7 +134,7 @@ cmdline.add("compiler.blackhole.BlackholeIntrinsicTest"); cmdline.add(test); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.stderrShouldBeEmpty(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -64,14 +64,14 @@ } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -64,14 +64,14 @@ } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -64,14 +64,14 @@ } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ test_constant_array.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); String output = new OutputAnalyzer(pb.start()).getOutput(); // should have 2 "can be fully eliminated" System.out.println(output); @@ -74,7 +74,7 @@ test_multi_constant_array.class.getName() }; - pb = ProcessTools.createJavaProcessBuilder(procArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); output = new OutputAnalyzer(pb.start()).getOutput(); // should have 1 "can be fully eliminated" System.out.println(output); @@ -94,7 +94,7 @@ test_multi_new_array.class.getName() }; - pb = ProcessTools.createJavaProcessBuilder(procArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); output = new OutputAnalyzer(pb.start()).getOutput(); // should have 2 "can be fully eliminated" System.out.println(output); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,8 +26,8 @@ * @bug 8251093 * @summary Sanity check the flag TraceLinearScanLevel with the highest level in a silent HelloWorld program. * - * @requires vm.debug == true & vm.compiler1.enabled - * @run main/othervm -XX:TraceLinearScanLevel=4 compiler.c1.TestTraceLinearScanLevel + * @requires vm.debug == true & vm.compiler1.enabled & vm.compMode != "Xcomp" + * @run main/othervm -Xbatch -XX:TraceLinearScanLevel=4 compiler.c1.TestTraceLinearScanLevel */ package compiler.c1; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/Test7068051.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/Test7068051.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/Test7068051.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/Test7068051.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, 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 @@ -36,6 +36,7 @@ import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.IOException; import java.io.InputStream; @@ -133,11 +134,10 @@ for (String p : params) { jar.addToolArg(p); } - ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); try { - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = ProcessTools.executeProcess(jar.getCommand()); output.shouldHaveExitValue(0); - } catch (IOException ex) { + } catch (Exception ex) { throw new AssertionError("TESTBUG: jar failed.", ex); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/TestBit.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/TestBit.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/TestBit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/TestBit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ "-XX:CompileCommand=compileonly," + className + "::tst*", className, testName}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String expectedTestBitInstruction = diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java 2025-01-04 20:25:18.000000000 +0000 @@ -94,7 +94,7 @@ "-XX:CompileCommand=option," + className + "::main,bool,PrintAssembly,true", className}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); List lines = output.asLines(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,27 +1,27 @@ /* -* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. -* Copyright (c) 2020, Arm Limited. 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. -* -*/ + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Arm Limited. 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 @@ -79,7 +79,7 @@ Collections.addAll(vmopts, "-Dtest.jdk=" + testjdkPath); Collections.addAll(vmopts, args); Collections.addAll(vmopts, TestSVEWithJNI.class.getName(), mode); - return ProcessTools.createJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()])); + return ProcessTools.createLimitedTestJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()])); } public static void main(String [] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,7 +132,7 @@ public void runtest(String classname, String testType, boolean useCompressedOops, String[] procArgs) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.stderrShouldBeEmptyIgnoreVMWarnings(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/calls/TestManyArgs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/TestManyArgs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/calls/TestManyArgs.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/TestManyArgs.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary Pass values on stack. + * @requires os.arch == "riscv64" + * @run main/native compiler.calls.TestManyArgs + */ + +package compiler.calls; + +public class TestManyArgs { + static { + System.loadLibrary("TestManyArgs"); + } + + native static void scramblestack(); + + native static int checkargs(int arg0, short arg1, byte arg2, + int arg3, short arg4, byte arg5, + int arg6, short arg7, byte arg8, + int arg9, short arg10, byte arg11); + + static int compiledbridge(int arg0, short arg1, byte arg2, + int arg3, short arg4, byte arg5, + int arg6, short arg7, byte arg8, + int arg9, short arg10, byte arg11) { + return checkargs(arg0, arg1, arg2, arg3, arg4, arg5, + arg6, arg7, arg8, arg9, arg10, arg11); + } + + static public void main(String[] args) { + scramblestack(); + for (int i = 0; i < 20000; i++) { + int res = compiledbridge((int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf); + if (res != 0) { + throw new RuntimeException("Test failed"); + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "jni.h" + +#ifdef riscv64 +/* RV64 ABI pass all integers as 64-bit, in registers or on stack + * As compiler may choose to load smaller width than 64-bit if passed on stack, + * this test may not find any bugs. + * Therefore we trick the compiler todo 64-bit loads, + * by saying these args are jlongs. + */ +JNIEXPORT jint JNICALL Java_compiler_calls_TestManyArgs_checkargs(JNIEnv* env, jclass jclazz, + jlong arg0, jlong arg1, jlong arg2, + jlong arg3, jlong arg4, jlong arg5, + jlong arg6, jlong arg7, jlong arg8, + jlong arg9, jlong arg10, jlong arg11) +#else +JNIEXPORT jint JNICALL Java_compiler_calls_TestManyArgs_checkargs(JNIEnv* env, jclass jclazz, + jint arg0, jshort arg1, jbyte arg2, + jint arg3, jshort arg4, jbyte arg5, + jint arg6, jshort arg7, jbyte arg8, + jint arg9, jshort arg10, jbyte arg11) +#endif +{ + if (arg0 != 0xf) return 1; + if (arg1 != 0xf) return 1; + if (arg2 != 0xf) return 1; + if (arg3 != 0xf) return 1; + if (arg4 != 0xf) return 1; + if (arg5 != 0xf) return 1; + if (arg6 != 0xf) return 1; + if (arg7 != 0xf) return 1; + if (arg8 != 0xf) return 1; + if (arg9 != 0xf) return 1; + if (arg10 != 0xf) return 1; + if (arg11 != 0xf) return 1; + return 0; +} + +JNIEXPORT +void JNICALL Java_compiler_calls_TestManyArgs_scramblestack(JNIEnv* env, jclass jclazz) +{ + volatile char stack[12*8]; + for (unsigned int i = 0; i < sizeof(stack); i++) { + stack[i] = (char)0xff; + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -164,11 +164,11 @@ options.add("'" + TestMain.class.getName() + "'"); crashOut = ProcessTools.executeProcess( CoreUtils.addCoreUlimitCommand( - ProcessTools.createTestJvm(options.toArray(new String[0])))); + ProcessTools.createTestJavaProcessBuilder(options.toArray(new String[0])))); } else { options.add("-XX:CompileOnly=" + TestMain.class.getName() + "::" + getTestMethod()); options.add(TestMain.class.getName()); - crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); + crashOut = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options)); } crashOutputString = crashOut.getOutput(); Asserts.assertNotEquals(crashOut.getExitValue(), 0, "Crash JVM exits gracefully"); @@ -271,7 +271,7 @@ private String[] getTestJvmCommandlineWithPrefix(String prefix, String... args) { try { - String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm(args)); + String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder(args)); return new String[]{"sh", "-c", prefix + (Platform.isWindows() ? cmd.replace('\\', '/').replace(";", "\\;").replace("|", "\\|") : cmd)}; } catch(Throwable t) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -79,7 +79,7 @@ options.add("-XX:CompileCommand=compileonly," + getTestClass() + "::" + getTestMethod()); options.add("-Xbatch"); options.add(getTestClass()); - oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); + oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options)); Asserts.assertEquals(oa.getExitValue(), 0, "Crash JVM exits gracefully"); replayFiles = Files.list(Paths.get(".")) .map(Path::toFile) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/SABase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/SABase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/ciReplay/SABase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/ciReplay/SABase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -71,7 +71,7 @@ } ProcessBuilder pb; try { - pb = ProcessTools.createTestJvm("--add-modules", "jdk.hotspot.agent", + pb = ProcessTools.createTestJavaProcessBuilder("--add-modules", "jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "sun.jvm.hotspot.CLHSDB", JDKToolFinder.getTestJDKTool("java"), TEST_CORE_FILE_NAME); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -67,9 +67,9 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createTestJvm("-XX:+PrintCodeCache", - "-XX:+Verbose", - "-version"); + pb = ProcessTools.createTestJavaProcessBuilder("-XX:+PrintCodeCache", + "-XX:+Verbose", + "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); out.stdoutShouldMatch(VERBOSE_REGEXP); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,7 @@ final boolean largePages = WHITE_BOX.getBooleanVMFlag("UseLargePages"); final long largePageSize = WHITE_BOX.getVMLargePageSize(); if (largePages && (largePageSize == 1024 * 1024 * 1024)) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseLargePages", "-XX:+SegmentedCodeCache", "-XX:InitialCodeCacheSize=2g", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,8 +42,8 @@ ProcessBuilder pb1, pb2; OutputAnalyzer out1, out2; - pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); - pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); + pb1 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); + pb2 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); out1 = new OutputAnalyzer(pb1.start()); out2 = new OutputAnalyzer(pb2.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,80 +89,80 @@ ProcessBuilder pb; // Disabled with ReservedCodeCacheSize < 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, false); // Disabled without TieredCompilation - pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-TieredCompilation", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, false); // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=240m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=240m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=400m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=400m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // Always enabled if SegmentedCodeCache is set - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:-TieredCompilation", - "-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:-TieredCompilation", + "-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // The profiled and non-profiled code heaps should not be available in // interpreter-only mode - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-Xint", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-Xint", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED); // If we stop compilation at CompLevel_none or CompLevel_simple we // don't need a profiled code heap. - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=0", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=0", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=1", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=1", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); // Fails with too small non-nmethod code heap size - pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K", + "-version"); failsWith(pb, "Invalid NonNMethodCodeHeapSize"); // Fails if code heap sizes do not add up - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=10M", - "-XX:NonNMethodCodeHeapSize=5M", - "-XX:ProfiledCodeHeapSize=5M", - "-XX:NonProfiledCodeHeapSize=5M", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=10M", + "-XX:NonNMethodCodeHeapSize=5M", + "-XX:ProfiledCodeHeapSize=5M", + "-XX:NonProfiledCodeHeapSize=5M", + "-version"); failsWith(pb, "Invalid code heap sizes"); // Fails if not enough space for VM internal code long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace"); // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3) long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace; - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=" + minSize, - "-XX:InitialCodeCacheSize=100K", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=" + minSize, + "-XX:InitialCodeCacheSize=100K", + "-version"); failsWith(pb, "Not enough space in non-nmethod code heap to run VM"); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldContain("Invalid ReservedCodeCacheSize="); out.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -63,11 +63,11 @@ } public static void runTest() throws Throwable { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); // Ignore adapter creation failures - if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache for adapters")) { + if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache")) { oa.reportDiagnosticSummary(); throw new RuntimeException("VM finished with exit code " + oa.getExitValue()); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024, 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 8337066 + * @summary Test that MergeMem is skipped when looking for stores + * @compile -encoding UTF-8 TestAntiDependencyForPinnedLoads.java + * @run main/othervm -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,java.lang.StringUTF16::reverse + * compiler.controldependency.TestAntiDependencyForPinnedLoads + */ + +package compiler.controldependency; + +public class TestAntiDependencyForPinnedLoads { + public static void main(String[] args) { + for(int i = 0; i < 50_000; i++) { + String str = "YYYY年MM月DD日"; + StringBuffer strBuffer = new StringBuffer(str); + String revStr = strBuffer.reverse().toString(); + if (!revStr.equals("日DD月MM年YYYY")) throw new InternalError("FAIL"); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ "-Xcomp", "-XX:-TieredCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:CompileOnly=" + className + "::sum", "-XX:+" + stressOpt, "-XX:+LogCompilation", "-XX:LogFile=" + log, className, "10"}; - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(procArgs).start()) + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder(procArgs).start()) .shouldHaveExitValue(0); new OutputAnalyzer(Paths.get(log)) .shouldContain("stress_test seed"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestStressCM.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressCM.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestStressCM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressCM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -48,7 +48,7 @@ "-XX:CompileOnly=" + className + "::sum", "-XX:+TraceOptoPipelining", "-XX:+" + stressOpt, "-XX:StressSeed=" + stressSeed, className, "10"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); // Extract the trace of our method (the last one after those of all diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -48,7 +48,7 @@ "-XX:CompileOnly=" + className + "::sum", "-XX:+" + traceOption, "-XX:+" + stressOption, "-XX:StressSeed=" + stressSeed, className, "10"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); return out.getStdout(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+VerifyAdapterSharing", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2021, 2024, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ "-XX:+PrintEliminateAllocations", Test.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0) .stdoutShouldContain("++++ Eliminated: "); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class InlineAccessors { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/PrintInlining.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/PrintInlining.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/PrintInlining.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/PrintInlining.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class PrintInlining { static void test(String option) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:-UseOnStackReplacement", "-XX:CompileCommand=dontinline,*::bar", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class ResolvedClassTest { /* ======================================================================== */ static void testStatic() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStatic.class.getName() + "::test", @@ -78,7 +78,7 @@ /* ======================================================================== */ static void testStaticInit() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStaticInit.class.getName() + "::test", @@ -115,7 +115,7 @@ /* ======================================================================== */ static void testIndy() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestIndy.class.getName() + "::test", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java 2025-01-04 20:25:18.000000000 +0000 @@ -28,6 +28,10 @@ * @summary Verify UseSHA3Intrinsics option processing on supported CPU. * @library /test/lib / * @requires vm.flagless + * @requires os.arch == "aarch64" & os.family == "mac" + * @comment sha3 is only implemented on AArch64 for now. + * UseSHA3Intrinsics is only auto-enabled on Apple silicon, because it + * may introduce performance regression on others. See JDK-8297092. * * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java 2025-01-04 20:25:18.000000000 +0000 @@ -61,7 +61,7 @@ argsList.add(test.getName()); argsList.add(Integer.toString(ITERATIONS)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(argsList); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(argsList); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ public class MHInlineTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/Agent.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/Agent.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/Agent.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/Agent.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.PrintStream; @@ -51,8 +52,7 @@ System.out.println("Running jar " + Arrays.toString(jar.getCommand())); - ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = ProcessTools.executeProcess(jar.getCommand()); output.shouldHaveExitValue(0); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -43,7 +43,7 @@ public class PollutedTrapCounts { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:-TieredCompilation", "-Xbatch", "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java 2025-01-04 20:25:18.000000000 +0000 @@ -73,7 +73,7 @@ } static void test(String explicitFlag, Expectation... expectations) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCIProduct", "-XX:-UnlockExperimentalVMOptions", explicitFlag, "-XX:+PrintFlagsFinal", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class TestInvalidJVMCIOption { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EagerJVMCI", "-XX:+UseJVMCICompiler", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ } static void test(String enableFlag) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", enableFlag, "-Djvmci.Compiler=null", "-XX:+JVMCIPrintProperties"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+PrintFlagsFinal", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -146,7 +146,7 @@ } private void start() { - ProcessBuilder process = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); try { // Calls 'main' of TestVM to run all specified tests with commands 'cmds'. // Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public static void main(String args[]) throws Exception { if (args.length == 0) { // Spawn new VM instance to execute test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:-BytecodeVerificationRemote", "-XX:-BytecodeVerificationLocal", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopopts/InfiniteLoopBadControlNeverBranch.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopopts/InfiniteLoopBadControlNeverBranch.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopopts/InfiniteLoopBadControlNeverBranch.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopopts/InfiniteLoopBadControlNeverBranch.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024, 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 8335709 + * @summary C2: assert(!loop->is_member(get_loop(useblock))) failed: must be outside loop + * @library /test/lib + * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,InfiniteLoopBadControlNeverBranch::* InfiniteLoopBadControlNeverBranch + * + */ + + +import jdk.test.lib.Utils; + +public class InfiniteLoopBadControlNeverBranch { + static int b; + static short c; + + public static void main(String[] args) throws InterruptedException { + Thread thread = new Thread(() -> test()); + thread.setDaemon(true); + thread.start(); + Thread.sleep(Utils.adjustTimeout(4000)); + } + + static void test() { + int i = 0; + while (true) { + if (i > 1) { + b = 0; + } + c = (short) (b * 7); + i++; + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public class CheckLoopStripMiningIterShortLoop { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java 2025-01-04 20:25:18.000000000 +0000 @@ -83,7 +83,7 @@ System.arraycopy(args, 0, cmds, 1, args.length); cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,7 @@ public static void main(String[] args) throws Exception { // Test C2 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java 2025-01-04 20:25:18.000000000 +0000 @@ -71,7 +71,7 @@ command.add("-XX:CompileCommand=compileonly," + Launcher.class.getName() + "::" + "test"); command.add(Launcher.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -87,9 +87,9 @@ final String cpuModel = cpuFeatures.get(0); if (isCPUModelNeoverseN1(cpuModel)) { - checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"), + checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"), "isb", "1"); - checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), + checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), "isb", "2"); } else { System.out.println("Skip because no defaults for CPU model: " + cpuModel); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { // Test C1 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java 2025-01-04 20:25:18.000000000 +0000 @@ -54,7 +54,7 @@ command.add(Launcher.class.getName()); // Test C2 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -251,7 +251,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { @@ -266,7 +266,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); out.shouldContain("CompileCommand: An error occurred during parsing"); @@ -277,7 +277,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -56,7 +56,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java 2025-01-04 20:25:18.000000000 +0000 @@ -82,7 +82,7 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.IOException; @@ -60,11 +61,10 @@ .addToolArg(Agent.AGENT_JAR) .addToolArg(Agent.class.getName().replace('.', File.separatorChar) + ".class"); - ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); try { - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = ProcessTools.executeProcess(jar.getCommand()); output.shouldHaveExitValue(0); - } catch (IOException ex) { + } catch (Exception ex) { throw new Error("TESTBUG: jar failed.", ex); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -44,6 +44,7 @@ import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.IOException; @@ -63,11 +64,10 @@ .addToolArg(Agent.AGENT_JAR) .addToolArg(Agent.class.getName().replace('.', File.separatorChar) + ".class"); - ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); try { - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = ProcessTools.executeProcess(jar.getCommand()); output.shouldHaveExitValue(0); - } catch (IOException ex) { + } catch (Exception ex) { throw new Error("TESTBUG: jar failed.", ex); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ public static void main(String args[]) { OutputAnalyzer oa; try { - oa = ProcessTools.executeProcess(ProcessTools.createTestJvm( + oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder( Test8015436.class.getName())); } catch (Exception ex) { throw new Error("TESTBUG: exception while running child process: " + ex, ex); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class NumCompilerThreadsCheck { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CICompilerCount=-1"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); String expectedOutput = "outside the allowed range"; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,10 +44,10 @@ public class SmallCodeCacheStartup { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", - "-XX:CICompilerCount=64", - "-Xcomp", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", + "-XX:CICompilerCount=64", + "-Xcomp", + "-version"); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); try { analyzer.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/StartupOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/StartupOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/startup/StartupOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/startup/StartupOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -43,12 +43,12 @@ ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldNotContain("no space to run compilers"); out.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version"); out = new OutputAnalyzer(pb.start()); // The VM should not crash but may return an error message because we don't have enough space for adapters int exitCode = out.getExitValue(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ public static OutputAnalyzer executeRTMTest(CompilableTest test, String... options) throws Exception { ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder( + = ProcessTools.createLimitedTestJavaProcessBuilder( RTMTestBase.prepareTestOptions(test, options)); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); @@ -83,7 +83,7 @@ public static OutputAnalyzer executeRTMTest(String logFileName, CompilableTest test, String... options) throws Exception { ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder( + = ProcessTools.createLimitedTestJavaProcessBuilder( RTMTestBase.prepareTestOptions(logFileName, test, options)); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/types/correctness/OffTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/types/correctness/OffTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/types/correctness/OffTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/types/correctness/OffTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -86,7 +86,7 @@ OPTIONS[TYPE_PROFILE_INDEX] = typeProfileLevel; OPTIONS[USE_TYPE_SPECULATION_INDEX] = useTypeSpeculation; OPTIONS[PROFILING_TYPE_INDEX] = type.name(); - ProcessBuilder processBuilder = ProcessTools.createTestJvm(OPTIONS); + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(OPTIONS); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); outputAnalyzer.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -224,11 +224,11 @@ ProcessBuilder pb; OutputAnalyzer out; try { - pb = ProcessTools.createJavaProcessBuilder("-XX:-BackgroundCompilation", - "-XX:+TraceNewVectors", - "compiler.vectorization.TestBufferVectorization", - testName, - "run"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-BackgroundCompilation", + "-XX:+TraceNewVectors", + "compiler.vectorization.TestBufferVectorization", + testName, + "run"); out = new OutputAnalyzer(pb.start()); } catch (Exception e) { throw new RuntimeException(" Exception launching Java process: " + e); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/containers/cgroup/PlainRead.java openjdk-17-17.0.14+7/test/hotspot/jtreg/containers/cgroup/PlainRead.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/containers/cgroup/PlainRead.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/containers/cgroup/PlainRead.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -67,7 +67,7 @@ public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+container=trace", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+container=trace", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (wb.isContainerized()) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAgeOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAgeOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAgeOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAgeOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -66,7 +66,7 @@ } public static void runTest(String gcArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAt.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAt.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAt.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAt.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -36,7 +36,7 @@ public class TestAllocateHeapAt { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:AllocateHeapAt=" + System.getProperty("test.dir", "."), "-Xlog:gc+heap=info", "-Xmx32m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ f = new File(test_dir, UUID.randomUUID().toString()); } while(f.exists()); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:AllocateHeapAt=" + f.getName(), "-Xlog:gc+heap=info", "-Xmx32m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ "-Xlog:gc+heap=info", "-version"}); - ProcessBuilder pb = ProcessTools.createTestJvm(flags); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestCardTablePageCommits.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestCardTablePageCommits.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestCardTablePageCommits.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestCardTablePageCommits.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ // because of 8kB pages, assume 4 KB pages for all other CPUs. String Xmx = "-Xmx4m"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( Xmx, "-XX:NativeMemoryTracking=detail", "-XX:+UseParallelGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestNumWorkerOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestNumWorkerOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestNumWorkerOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestNumWorkerOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ } public static void runTest(String gcArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestObjectAlignment.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestObjectAlignment.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestObjectAlignment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestObjectAlignment.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,36 +26,29 @@ /** * @test TestObjectAlignment * @bug 8021823 + * @requires vm.bits == "64" * @summary G1: Concurrent marking crashes with -XX:ObjectAlignmentInBytes>=32 in 64bit VMs * @library /test/lib * @modules java.base/jdk.internal.misc - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=64 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=128 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=64 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=128 - * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=8 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=16 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=32 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=64 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=128 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=256 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=8 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=16 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=32 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=64 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=128 + * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=256 */ public class TestObjectAlignment { public static byte[] garbage; - private static boolean runsOn32bit() { - return System.getProperty("sun.arch.data.model").equals("32"); - } - public static void main(String[] args) throws Exception { - if (runsOn32bit()) { - // 32 bit VMs do not allow setting ObjectAlignmentInBytes, so there is nothing to test. We still get called. - return; - } for (int i = 0; i < 10; i++) { garbage = new byte[1000]; System.gc(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestSmallHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestSmallHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestSmallHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestSmallHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception { long minMaxHeap = 4 * 1024 * 1024; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( gc, "-Xmx" + minMaxHeap, "-XX:+PrintFlagsFinal", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public class TestVerifyDuringStartup { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-UseTLAB", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyDuringStartup", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifySilently.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySilently.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifySilently.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySilently.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ "-XX:+VerifyAfterGC", (verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"), TestVerifySilentlyRunSystemGC.class.getName()}); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifySubSet.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySubSet.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/TestVerifySubSet.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/TestVerifySubSet.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,7 +55,7 @@ "-Xlog:gc+verify=debug", "-XX:VerifySubSet="+subset, TestVerifySubSetRunSystemGC.class.getName()}); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/GCArguments.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/GCArguments.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/GCArguments.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/GCArguments.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -66,19 +66,19 @@ return augmented.toArray(new String[augmented.size()]); } - static public ProcessBuilder createJavaProcessBuilder(List arguments) { - return createJavaProcessBuilder(arguments.toArray(String[]::new)); + static public ProcessBuilder createLimitedTestJavaProcessBuilder(List arguments) { + return createLimitedTestJavaProcessBuilder(arguments.toArray(String[]::new)); } - static public ProcessBuilder createJavaProcessBuilder(String... arguments) { - return ProcessTools.createJavaProcessBuilder(withDefaults(arguments)); + static public ProcessBuilder createLimitedTestJavaProcessBuilder(String... arguments) { + return ProcessTools.createLimitedTestJavaProcessBuilder(withDefaults(arguments)); } - static public ProcessBuilder createTestJvm(List arguments) { - return createTestJvm(arguments.toArray(String[]::new)); + static public ProcessBuilder createTestJavaProcessBuilder(List arguments) { + return createTestJavaProcessBuilder(arguments.toArray(String[]::new)); } - static public ProcessBuilder createTestJvm(String... arguments) { - return ProcessTools.createTestJvm(withDefaults(arguments)); + static public ProcessBuilder createTestJavaProcessBuilder(String... arguments) { + return ProcessTools.createTestJavaProcessBuilder(withDefaults(arguments)); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -65,7 +65,7 @@ " *bool +UseParallelGC *= *true +\\{product\\} *\\{command line\\}"; private static void testFlag() throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( option, heapSizeOption, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java 2025-01-04 20:25:18.000000000 +0000 @@ -51,7 +51,7 @@ private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *"; public static void testDefaultValue() throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -77,7 +77,7 @@ public static void testSetValue() throws Exception { long flagValue = 2048; - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +35,7 @@ * @library / * @modules java.base/jdk.internal.misc * java.management + * @requires vm.opt.CompressedClassSpaceSize == null & vm.opt.UseCompressedClassPointers == null * @run driver gc.arguments.TestCompressedClassFlags */ public class TestCompressedClassFlags { @@ -50,7 +51,7 @@ } private static OutputAnalyzer runJava(String ... args) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -40,13 +40,13 @@ public class TestDisableDefaultGC { public static void main(String[] args) throws Exception { // Start VM, disabling all possible default GCs - ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC", - "-XX:-UseParallelGC", - "-XX:-UseG1GC", - "-XX:-UseZGC", - "-XX:+UnlockExperimentalVMOptions", - "-XX:-UseShenandoahGC", - "-version"); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:-UseSerialGC", + "-XX:-UseParallelGC", + "-XX:-UseG1GC", + "-XX:-UseZGC", + "-XX:+UnlockExperimentalVMOptions", + "-XX:-UseShenandoahGC", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("Garbage collector not selected"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +25,7 @@ /* * @test TestG1ConcMarkStepDurationMillis - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1ConcMarkStepDurationMillis == null * @summary Tests argument processing for double type flag, G1ConcMarkStepDurationMillis * @library /test/lib * @library / @@ -78,7 +78,7 @@ Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:G1ConcMarkStepDurationMillis="+expectedValue, "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(expectedResult == PASS ? 0 : 1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 TestG1ConcRefinementThreads * @bug 8047976 - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1ConcRefinementThreads == null * @summary Tests argument processing for G1ConcRefinementThreads * @library /test/lib * @library / @@ -69,7 +69,7 @@ } Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 TestG1HeapRegionSize * @bug 8021879 - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1HeapRegionSize == null * @summary Verify that the flag G1HeapRegionSize is updated properly * @modules java.base/jdk.internal.misc * @modules java.management/sun.management @@ -52,7 +52,7 @@ flagList.add("-XX:+PrintFlagsFinal"); flagList.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flagList); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flagList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(exitValue); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -63,7 +63,7 @@ }; private static void check(String flag, boolean is_valid) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm("-XX:+UseG1GC", flag, "-version"); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:+UseG1GC", flag, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (is_valid) { output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java 2025-01-04 20:25:18.000000000 +0000 @@ -48,7 +48,7 @@ } private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-Xminf" + min, "-Xmaxf" + max, "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 TestInitialTenuringThreshold * @bug 8014765 - * @requires vm.gc.Parallel + * @requires vm.gc.Parallel & vm.opt.InitialTenuringThreshold == null & vm.opt.MaxTenuringThreshold == null * @summary Tests argument processing for initial tenuring threshold * @library /test/lib * @library / @@ -41,7 +41,7 @@ public class TestInitialTenuringThreshold { public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-XX:+UseParallelGC", "-XX:InitialTenuringThreshold=" + String.valueOf(initial), "-XX:MaxTenuringThreshold=" + String.valueOf(max), @@ -58,8 +58,9 @@ public static void main(String args[]) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( // some value below the default value of InitialTenuringThreshold of 7 + "-XX:+UseParallelGC", "-XX:MaxTenuringThreshold=1", "-version" ); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java 2025-01-04 20:25:18.000000000 +0000 @@ -115,7 +115,7 @@ } private static void getNewOldSize(String gcflag, long[] values) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm(gcflag, + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(gcflag, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -208,7 +208,7 @@ finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = GCArguments.createTestJvm(finalargs.toArray(String[]::new)); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(finalargs.toArray(String[]::new)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -308,7 +308,7 @@ } private static void expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm(flags); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); shouldContainOrNot(output, hasWarning, "Warning"); shouldContainOrNot(output, hasError, "Error"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,7 +98,7 @@ Boolean.toString(shrinkHeapInSteps) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } @@ -123,7 +123,7 @@ "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-version" ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(1); analyzer.shouldContain("Error: Could not create the Java Virtual Machine."); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -95,7 +95,7 @@ finalargs.add("-XX:+PrintFlagsFinal"); finalargs.add("-version"); - ProcessBuilder pb = GCArguments.createTestJvm(finalargs); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -61,7 +61,7 @@ args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); @@ -84,7 +84,7 @@ args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -102,7 +102,7 @@ Boolean.toString(useAdaptiveSizePolicy) ); vmOptions.removeIf((String p) -> p.isEmpty()); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -82,7 +82,7 @@ Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); System.out.println(analyzer.getOutput()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -166,7 +166,7 @@ Long.toString(maxHeapSize) ); vmOptions.removeIf(String::isEmpty); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -65,13 +65,13 @@ } static void runNewSizeThreadIncreaseTest(String expectedValue, boolean isNewsizeChanged) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder("-XX:+UseSerialGC", - "-Xms96M", - "-Xmx128M", - "-XX:NewRatio=2", - "-Xlog:gc+heap+ergo=debug", - "-XX:NewSizeThreadIncrease="+expectedValue, - GCTest.class.getName()); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder("-XX:+UseSerialGC", + "-Xms96M", + "-Xmx128M", + "-XX:NewRatio=2", + "-Xlog:gc+heap+ergo=debug", + "-XX:NewSizeThreadIncrease="+expectedValue, + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -161,7 +161,7 @@ } Collections.addAll(vmOpts, "-XX:+UseParallelGC", "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldFail) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -56,7 +56,7 @@ private static final String printFlagsFinalPattern = " *uint *" + flagName + " *:?= *(\\d+) *\\{product\\} *"; public static void testDefaultValue() throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -94,7 +94,7 @@ for (String gc : supportedGC) { // Make sure the VM does not allow ParallelGCThreads set to 0 - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+Use" + gc + "GC", "-XX:ParallelGCThreads=0", "-XX:+PrintFlagsFinal", @@ -127,7 +127,7 @@ } public static long getParallelGCThreadCount(String... flags) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flags); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ result.addAll(Arrays.asList(args)); result.add("-XX:+PrintFlagsFinal"); result.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(result); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(result); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ public static void testDefaultGC(boolean actAsServer) throws Exception { // Start VM without specifying GC - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:" + (actAsServer ? "+" : "-") + "AlwaysActAsServerClassMachine", "-XX:" + (actAsServer ? "-" : "+") + "NeverActAsServerClassMachine", "-XX:+PrintFlagsFinal", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ long initHeap = heapAlignment; long maxHeap = heapAlignment * 2; - ProcessBuilder pb_enabled = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb_enabled = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseParallelGC", "-Xms" + String.valueOf(initHeap), "-Xmx" + String.valueOf(maxHeap), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -87,7 +87,7 @@ Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -116,7 +116,7 @@ vmOptions.add("-XX:TargetSurvivorRatio=" + ratio); vmOptions.add("-version"); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(1); @@ -151,7 +151,7 @@ Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseDynamicNumberOfGcThreads", "-version" ); @@ -50,7 +50,7 @@ throw new RuntimeException("Not expected to get exit value 0"); } - pb = GCArguments.createJavaProcessBuilder( + pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:MaxiumHeapSize=500m", "-version" ); @@ -61,7 +61,7 @@ } // The last JAVA process should run successfully for the purpose of sanity check - pb = GCArguments.createJavaProcessBuilder( + pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseDynamicNumberOfGCThreads", "-version" ); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -93,7 +93,7 @@ finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; @@ -157,7 +157,7 @@ } private static String expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flags); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(errorcode); return output.getStdout(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public class TestUseNUMAInterleaving { public static void main(String[] args) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-XX:+UseNUMA", "-XX:+PrintFlagsFinal", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -86,7 +86,7 @@ (verifyAfterGC ? "-XX:+VerifyAfterGC" : "-XX:-VerifyAfterGC"), GarbageProducer.class.getName() }); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ private static long YoungGenSize = 32 * 1024 * 1024; private static OutputAnalyzer run(boolean enableUnloading) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestAlignment.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestAlignment.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestAlignment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestAlignment.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,15 +36,22 @@ * @run main/othervm -Xmx64m -XX:-UseTLAB * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * gc.epsilon.TestAlignment - * + */ + +/** + * @test TestAlignment + * @requires vm.gc.Epsilon + * @requires vm.bits == "64" + * @summary Check Epsilon TLAB options with unusual object alignment + * @bug 8212177 * @run main/othervm -Xmx64m -XX:+UseTLAB * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestAlignment * * @run main/othervm -Xmx64m -XX:-UseTLAB * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestAlignment */ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,14 +37,14 @@ public class TestDieDefault { public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.shouldHaveExitValue(0); } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldContain("OutOfMemoryError"); if (out.getExitValue() == 0) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,14 +38,14 @@ public class TestDieWithHeapDump { public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.shouldHaveExitValue(0); } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); Process p = pb.start(); OutputAnalyzer out = new OutputAnalyzer(p); out.shouldContain("OutOfMemoryError"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java 2025-01-04 20:25:18.000000000 +0000 @@ -39,7 +39,7 @@ static String ON_ERR_MSG = "Epsilon error handler message"; public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.stdoutShouldNotMatch("^" + ON_ERR_MSG); @@ -47,7 +47,7 @@ } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldContain("OutOfMemoryError"); if (out.getExitValue() == 0) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java 2025-01-04 20:25:18.000000000 +0000 @@ -48,29 +48,36 @@ * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * -XX:EpsilonMaxTLABSize=12345 * gc.epsilon.TestMaxTLAB - * + */ + +/** + * @test TestMaxTLAB + * @requires vm.gc.Epsilon + * @requires vm.bits == "64" + * @summary Check EpsilonMaxTLAB options + * @bug 8212177 * @run main/othervm -Xmx64m * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * -XX:EpsilonMaxTLABSize=1 - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestMaxTLAB * * @run main/othervm -Xmx64m * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * -XX:EpsilonMaxTLABSize=1K - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestMaxTLAB * * @run main/othervm -Xmx64m * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * -XX:EpsilonMaxTLABSize=1M - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestMaxTLAB * * @run main/othervm -Xmx64m * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * -XX:EpsilonMaxTLABSize=12345 - * -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 + * -XX:ObjectAlignmentInBytes=16 * gc.epsilon.TestMaxTLAB */ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,7 +73,7 @@ String[] baseArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; // Base test with gc and +UseDynamicNumberOfGCThreads: - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder(baseArgs); verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); // Turn on parallel reference processing @@ -81,7 +81,7 @@ String[] parRefArgs = new String[baseArgs.length + parRefProcArg.length]; System.arraycopy(parRefProcArg, 0, parRefArgs, 0, parRefProcArg.length); System.arraycopy(baseArgs, 0, parRefArgs, parRefProcArg.length, baseArgs.length); - pb_enabled = ProcessTools.createJavaProcessBuilder(parRefArgs); + pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder(parRefArgs); verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -70,7 +70,7 @@ private static void testInitialGCThreadLogging(String gcFlag, String threadName) throws Exception { // Base test with gc and +UseDynamicNumberOfGCThreads: - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/Test2GbHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/Test2GbHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/Test2GbHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/Test2GbHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ testArguments.add("-Xmx2g"); testArguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -80,7 +80,7 @@ public class TestEagerReclaimHumongousRegions { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java 2025-01-04 20:25:18.000000000 +0000 @@ -30,6 +30,7 @@ * mark bitmaps at reclaim. * @key randomness * @requires vm.gc.G1 + * @requires vm.debug * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -118,7 +119,7 @@ public class TestEagerReclaimHumongousRegionsClearMarkBits { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", @@ -129,7 +130,6 @@ "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyAfterGC", "-XX:ConcGCThreads=1", // Want to make marking as slow as possible. - "-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only. "-XX:+G1VerifyBitmaps", TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ } public static void runTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -92,7 +92,7 @@ public class TestEagerReclaimHumongousRegionsWithRefs { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java 2025-01-04 20:25:18.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ +package gc.g1; + /* * @test TestG1SkipCompaction * @summary Test for JDK-8262068 Improve G1 Full GC by skipping compaction @@ -29,7 +31,7 @@ * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @run main/othervm -Xms256m -Xmx256m TestG1SkipCompaction + * @run main/othervm -Xms256m -Xmx256m gc.g1.TestG1SkipCompaction */ import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -52,7 +54,7 @@ "-XX:G1HeapRegionSize=1m", GCTest.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,14 +41,14 @@ public class TestG1TraceEagerReclaimHumongousObjects { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xms128M", - "-Xmx128M", - "-Xmn16M", - "-XX:G1HeapRegionSize=1M", - "-Xlog:gc+phases=trace,gc+humongous=trace", - "-XX:+UnlockExperimentalVMOptions", - GCWithHumongousObjectTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xms128M", + "-Xmx128M", + "-Xmn16M", + "-XX:G1HeapRegionSize=1M", + "-Xlog:gc+phases=trace,gc+humongous=trace", + "-XX:+UnlockExperimentalVMOptions", + GCWithHumongousObjectTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -185,26 +185,26 @@ private void testNormalLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.OFF); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+phases=debug", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+phases=debug", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.DEBUG); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+phases=trace", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+phases=trace", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.TRACE); @@ -220,10 +220,10 @@ }; private void testConcurrentRefinementLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+refine+stats=debug", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+refine+stats=debug", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, concRefineMessages, Level.DEBUG); } @@ -235,29 +235,29 @@ }; private void testWithEvacuationFailureLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx32M", - "-Xmn16M", - "-XX:+G1EvacuationFailureALot", - "-XX:G1EvacuationFailureALotCount=100", - "-XX:G1EvacuationFailureALotInterval=1", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:-G1UsePreventiveGC", - "-Xlog:gc+phases=debug", - GCTestWithEvacuationFailure.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx32M", + "-Xmn16M", + "-XX:+G1EvacuationFailureALot", + "-XX:G1EvacuationFailureALotCount=100", + "-XX:G1EvacuationFailureALotInterval=1", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:-G1UsePreventiveGC", + "-Xlog:gc+phases=debug", + GCTestWithEvacuationFailure.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx32M", - "-Xmn16M", - "-Xms32M", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:-G1UsePreventiveGC", - "-Xlog:gc+phases=trace", - GCTestWithEvacuationFailure.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx32M", + "-Xmn16M", + "-Xms32M", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:-G1UsePreventiveGC", + "-Xlog:gc+phases=trace", + GCTestWithEvacuationFailure.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, exhFailureMessages, Level.TRACE); @@ -265,13 +265,13 @@ } private void testWithConcurrentStart() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xbootclasspath/a:.", - "-Xlog:gc*=debug", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - GCTestWithConcurrentStart.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xbootclasspath/a:.", + "-Xlog:gc*=debug", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + GCTestWithConcurrentStart.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Clear Claimed Marks"); @@ -279,13 +279,13 @@ } private void testExpandHeap() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xbootclasspath/a:.", - "-Xlog:gc+ergo+heap=debug", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xbootclasspath/a:.", + "-Xlog:gc+ergo+heap=debug", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Expand the heap. requested expansion amount: "); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ private static final int initiatingHeapOccupancyPercent = 50; // % public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -47,7 +47,7 @@ private static final int heapRegionSize = 1; // MB public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,7 +106,7 @@ finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -56,7 +56,7 @@ private static final int YoungSize = HeapSize / 8; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UseG1GC", "-Xms" + HeapSize + "m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,17 +33,21 @@ * @requires vm.opt.LargePageSizeInBytes == null * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages gc.g1.TestLargePageUseForAuxMemory + * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseLargePages gc.g1.TestLargePageUseForAuxMemory */ +import java.util.ArrayList; +import java.util.List; import java.lang.Math; +import java.util.Collections; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Asserts; import jdk.test.lib.Platform; -import jtreg.SkippedException; import jdk.test.whitebox.WhiteBox; +import jtreg.SkippedException; + public class TestLargePageUseForAuxMemory { static final long HEAP_REGION_SIZE = 1 * 1024 * 1024; static long largePageSize; @@ -106,19 +110,22 @@ checkSize(output, expectedPageSize, "Next Bitmap: .*page_size=([^ ]+)"); } + static List getOpts(long heapsize, boolean largePageEnabled) { + return List.of("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE, + "-Xmx" + heapsize, + "-Xlog:pagesize,gc+init,gc+heap+coops=debug", + "-XX:" + (largePageEnabled ? "+" : "-") + "UseLargePages", + "-version"); + } + static void testVM(String what, long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception { System.out.println(what + " heapsize " + heapsize + " card table should use large pages " + cardsShouldUseLargePages + " " + "bitmaps should use large pages " + bitmapShouldUseLargePages); ProcessBuilder pb; + // Test with large page enabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE, - "-Xmx" + heapsize, - "-Xlog:pagesize,gc+init,gc+heap+coops=debug", - "-XX:+UseLargePages", - "-XX:+IgnoreUnrecognizedVMOptions", // there is no ObjectAlignmentInBytes in 32 bit builds - "-XX:ObjectAlignmentInBytes=8", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(getOpts(heapsize, true)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // Only expect large page size if large pages are enabled. @@ -132,14 +139,7 @@ output.shouldHaveExitValue(0); // Test with large page disabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE, - "-Xmx" + heapsize, - "-Xlog:pagesize", - "-XX:-UseLargePages", - "-XX:+IgnoreUnrecognizedVMOptions", // there is no ObjectAlignmentInBytes in 32 bit builds - "-XX:ObjectAlignmentInBytes=8", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(getOpts(heapsize, false)); output = new OutputAnalyzer(pb.start()); checkSmallTables(output, smallPageSize); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages gc.g1.TestLargePageUseForHeap + -XX:+UseLargePages gc.g1.TestLargePageUseForHeap */ import jdk.test.lib.process.OutputAnalyzer; @@ -87,12 +87,12 @@ static void testVM(long regionSize) throws Exception { ProcessBuilder pb; // Test with large page enabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + regionSize, - "-Xmx128m", - "-Xlog:gc+init,pagesize,gc+heap+coops=debug", - "-XX:+UseLargePages", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + regionSize, + "-Xmx128m", + "-Xlog:gc+init,pagesize,gc+heap+coops=debug", + "-XX:+UseLargePages", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); boolean largePageEnabled = checkLargePageEnabled(output); @@ -100,12 +100,12 @@ output.shouldHaveExitValue(0); // Test with large page disabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + regionSize, - "-Xmx128m", - "-Xlog:gc+init,pagesize,gc+heap+coops=debug", - "-XX:-UseLargePages", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + regionSize, + "-Xmx128m", + "-Xlog:gc+init,pagesize,gc+heap+coops=debug", + "-XX:-UseLargePages", + "-version"); output = new OutputAnalyzer(pb.start()); checkHeap(output, smallPageSize); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ Collections.addAll(testArguments, extraArgs); testArguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -109,7 +109,7 @@ basicOpts.add(GCTest.class.getName()); - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(basicOpts); + ProcessBuilder procBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(basicOpts); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPLABOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPLABOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +59,7 @@ GCTest.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -62,7 +62,7 @@ testArguments.add("-XX:OldPLABSize=" + plabSize); testArguments.add(GCTest.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldSucceed) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,22 +40,22 @@ public class TestPeriodicLogMessages { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1PeriodicGCInterval=0", - "-Xlog:gc+init,gc+periodic=debug", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1PeriodicGCInterval=0", + "-Xlog:gc+init,gc+periodic=debug", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Periodic GC: Disabled"); output.shouldNotContain("Checking for periodic GC"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1PeriodicGCInterval=100", - "-Xlog:gc+init,gc+periodic=debug", - "-Xmx10M", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1PeriodicGCInterval=100", + "-Xlog:gc+init,gc+periodic=debug", + "-Xmx10M", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); output.shouldContain("Periodic GC: Enabled"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -69,7 +69,7 @@ finalargs.add(RunAndWaitForMarking.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,12 +44,12 @@ public class TestRemsetLoggingThreads { private static void runTest(int refinementThreads, int workerThreads) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:+UnlockDiagnosticVMOptions", - "-Xlog:gc+remset+exit=trace", - "-XX:G1ConcRefinementThreads=" + refinementThreads, - "-XX:ParallelGCThreads=" + workerThreads, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:+UnlockDiagnosticVMOptions", + "-Xlog:gc+remset+exit=trace", + "-XX:G1ConcRefinementThreads=" + refinementThreads, + "-XX:ParallelGCThreads=" + workerThreads, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ finalargs.add(VerifySummaryOutput.class.getName()); finalargs.add(String.valueOf(numGCs)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +59,7 @@ } dump_args.addAll(Arrays.asList(new String[] { "-Xshare:dump", "-Xlog:cds" })); - pb = ProcessTools.createJavaProcessBuilder(dump_args); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(dump_args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); @@ -72,7 +72,7 @@ } load_args.addAll(Arrays.asList(new String[] { "-Xshare:on", "-version" })); - pb = ProcessTools.createJavaProcessBuilder(load_args.toArray(new String[0])); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(load_args.toArray(new String[0])); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +101,7 @@ } private void performTest(List opts) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm(opts); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(opts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -61,7 +61,7 @@ private static final int REGION_SIZE = 1 * 1024 * 1024; public static void main(String[] args) throws Exception, Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:InitialHeapSize=" + INITIAL_HEAP_SIZE, "-Xmn" + MINIMAL_YOUNG_SIZE, "-Xmx" + MAXIMUM_HEAP_SIZE, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,16 +40,16 @@ public class TestSkipRebuildRemsetPhase { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:.", - "-XX:+UseG1GC", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - "-XX:G1MixedGCLiveThresholdPercent=20", - "-Xlog:gc+marking=debug,gc+phases=debug,gc+remset+tracking=trace", - "-Xms10M", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:.", + "-XX:+UseG1GC", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "-XX:G1MixedGCLiveThresholdPercent=20", + "-Xlog:gc+marking=debug,gc+phases=debug,gc+remset+tracking=trace", + "-Xms10M", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Skipping Remembered Set Rebuild."); output.shouldContain("No Remembered Sets to update after rebuild"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -153,7 +153,7 @@ basicOpts.add(TriggerGCs.class.getName()); - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(basicOpts); + ProcessBuilder procBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(basicOpts); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,7 +90,7 @@ Collections.addAll(testOpts, extraFlags); testOpts.add(RunMixedGC.class.getName()); System.out.println(testOpts); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testOpts); return new OutputAnalyzer(pb.start()); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ * questions. */ -package gc.g1; +package gc.g1.numa; /** * @test TestG1NUMATouchRegions @@ -33,7 +33,9 @@ * java.management * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run main/othervm -XX:+UseG1GC -Xbootclasspath/a:. -XX:+UseNUMA -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.g1.TestG1NUMATouchRegions + * @run main/othervm -XX:+UseG1GC -Xbootclasspath/a:. -XX:+UseNUMA + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * gc.g1.numa.TestG1NUMATouchRegions */ import java.util.LinkedList; @@ -179,7 +181,7 @@ return; } - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:pagesize,gc+heap+region=trace", "-XX:+UseG1GC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class TestDeprecatedPrintFlags { public static void testPrintGC() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGC", DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGC", DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGC is deprecated. Will use -Xlog:gc instead."); output.shouldNotContain("PrintGCDetails"); @@ -52,7 +52,7 @@ } public static void testPrintGCDetails() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGCDetails", DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); output.shouldNotContain("PrintGC is deprecated"); @@ -63,7 +63,7 @@ public static void testXloggc() throws Exception { String fileName = "gc-test.log"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xloggc:" + fileName, DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xloggc:" + fileName, DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); output.shouldNotContain("PrintGCDetails"); @@ -80,7 +80,7 @@ public static void testXloggcWithPrintGCDetails() throws Exception { String fileName = "gc-test.log"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-Xloggc:" + fileName, DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGCDetails", "-Xloggc:" + fileName, DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestGCId.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestGCId.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestGCId.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestGCId.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -74,7 +74,7 @@ private static void testGCId(String gcFlag) throws Exception { ProcessBuilder pb_default = - ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); verifyContainsGCIDs(new OutputAnalyzer(pb_default.start())); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -95,7 +95,7 @@ String testSrc= "-Dtest.src=" + System.getProperty("test.src", "."); ProcessBuilder pb = - ProcessTools.createTestJvm( + ProcessTools.createTestJavaProcessBuilder( "-Xlog:gc*", "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestPrintReferences.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestPrintReferences.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/logging/TestPrintReferences.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/logging/TestPrintReferences.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -68,10 +68,10 @@ } public static void testRefs() throws Exception { - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref+phases=debug", - "-XX:+UseG1GC", - "-Xmx32M", - GCTest.class.getName()); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:gc+ref+phases=debug", + "-XX:+UseG1GC", + "-Xmx32M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); checkRefsLogFormat(output); @@ -94,13 +94,13 @@ } public static void testPhases(boolean parallelRefProcEnabled) throws Exception { - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder("-Xlog:gc+phases+ref=debug", - "-XX:+UseG1GC", - "-Xmx32M", - "-XX:" + (parallelRefProcEnabled ? "+" : "-") + "ParallelRefProcEnabled", - "-XX:-UseDynamicNumberOfGCThreads", - "-XX:ParallelGCThreads=2", - GCTest.class.getName()); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:gc+phases+ref=debug", + "-XX:+UseG1GC", + "-Xmx32M", + "-XX:" + (parallelRefProcEnabled ? "+" : "-") + "ParallelRefProcEnabled", + "-XX:-UseDynamicNumberOfGCThreads", + "-XX:ParallelGCThreads=2", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); checkLogFormat(output, parallelRefProcEnabled); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,11 +37,12 @@ * @library / * @modules java.base/jdk.internal.misc * java.management - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops gc.metaspace.TestMetaspaceMemoryPool - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m gc.metaspace.TestMetaspaceMemoryPool - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers gc.metaspace.TestMetaspaceMemoryPool - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m gc.metaspace.TestMetaspaceMemoryPool + * @run main/othervm -XX:-UseCompressedOops gc.metaspace.TestMetaspaceMemoryPool + * @run main/othervm -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m gc.metaspace.TestMetaspaceMemoryPool + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers gc.metaspace.TestMetaspaceMemoryPool + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m gc.metaspace.TestMetaspaceMemoryPool */ + public class TestMetaspaceMemoryPool { public static void main(String[] args) { verifyThatMetaspaceMemoryManagerExists(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022, 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 @@ -37,9 +37,10 @@ import gc.testlibrary.PerfCounter; import gc.testlibrary.PerfCounters; -/* @test TestMetaspacePerfCountersSerial +/* @test id=Serial-64 * @bug 8014659 * @requires vm.gc.Serial + * @requires vm.bits == "64" * @library /test/lib / * @summary Tests that performance counters for metaspace and compressed class * space exists and works. @@ -47,13 +48,14 @@ * java.compiler * java.management/sun.management * jdk.internal.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters */ -/* @test TestMetaspacePerfCountersParallel +/* @test id=Parallel-64 * @bug 8014659 * @requires vm.gc.Parallel + * @requires vm.bits == "64" * @library /test/lib / * @summary Tests that performance counters for metaspace and compressed class * space exists and works. @@ -61,13 +63,14 @@ * java.compiler * java.management/sun.management * jdk.internal.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters */ -/* @test TestMetaspacePerfCountersG1 +/* @test id=G1-64 * @bug 8014659 * @requires vm.gc.G1 + * @requires vm.bits == "64" * @library /test/lib / * @summary Tests that performance counters for metaspace and compressed class * space exists and works. @@ -75,13 +78,14 @@ * java.compiler * java.management/sun.management * jdk.internal.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters */ -/* @test TestMetaspacePerfCountersShenandoah +/* @test id=Shenandoah-64 * @bug 8014659 * @requires vm.gc.Shenandoah + * @requires vm.bits == "64" * @library /test/lib / * @summary Tests that performance counters for metaspace and compressed class * space exists and works. @@ -89,9 +93,96 @@ * java.compiler * java.management/sun.management * jdk.internal.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters */ + +/* @test id=Epsilon-64 + * @bug 8014659 + * @requires vm.gc.Epsilon + * @requires vm.bits == "64" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseEpsilonGC gc.metaspace.TestMetaspacePerfCounters + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseEpsilonGC gc.metaspace.TestMetaspacePerfCounters + */ + +/* @test id=Serial-32 + * @bug 8014659 + * @requires vm.gc.Serial + * @requires vm.bits == "32" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters + */ + +/* @test id=Parallel-32 + * @bug 8014659 + * @requires vm.gc.Parallel + * @requires vm.bits == "32" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters + */ + +/* @test id=G1-32 + * @bug 8014659 + * @requires vm.gc.G1 + * @requires vm.bits == "32" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters + */ + +/* @test id=Shenandoah-32 + * @bug 8014659 + * @requires vm.gc.Shenandoah + * @requires vm.bits == "32" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UsePerfData -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters + */ + + +/* @test id=Epsilon-32 + * @bug 8014659 + * @requires vm.gc.Epsilon + * @requires vm.bits == "32" + * @library /test/lib / + * @summary Tests that performance counters for metaspace and compressed class + * space exists and works. + * @modules java.base/jdk.internal.misc + * java.compiler + * java.management/sun.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.metaspace.TestMetaspacePerfCounters + */ + public class TestMetaspacePerfCounters { public static Class fooClass = null; private static final String[] counterNames = {"minCapacity", "maxCapacity", "capacity", "used"}; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -84,7 +84,7 @@ } private static OutputAnalyzer run(long maxMetaspaceSize, long metaspaceSize) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MaxMetaspaceSize=" + maxMetaspaceSize, "-XX:MetaspaceSize=" + metaspaceSize, "-XX:-UseLargePages", // Prevent us from using 2GB large pages on solaris + sparc. diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java 2025-01-04 20:25:18.000000000 +0000 @@ -34,13 +34,27 @@ * @bug 8023476 * @library /test/lib / * @requires vm.gc.Serial + * @requires vm.bits == "64" * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace * report the same data. * @modules java.base/jdk.internal.misc * java.management * jdk.internal.jvmstat/sun.jvmstat.monitor - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools + * @run main/othervm -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools + */ + +/* @test TestPerfCountersAndMemoryPools + * @bug 8023476 + * @library /test/lib / + * @requires vm.gc.Serial + * @requires vm.bits == "32" + * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace + * report the same data. + * @modules java.base/jdk.internal.misc + * java.management + * jdk.internal.jvmstat/sun.jvmstat.monitor + * @run main/othervm -Xlog:class+load,class+unload=trace -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools */ public class TestPerfCountersAndMemoryPools { public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, Twitter, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -119,7 +119,7 @@ System.out.println(" " + a); } - final ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(jvmArgs); + final ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(jvmArgs); final OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class HeapChangeLogging { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", HeapFiller.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", HeapFiller.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String stdout = output.getStdout(); System.out.println(stdout); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java 2025-01-04 20:25:18.000000000 +0000 @@ -56,7 +56,7 @@ for (int c = 0; c < NUM_RUNS; c++) { Callable task = () -> { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xms128m", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xms128m", "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,7 @@ String[] cmds = Arrays.copyOf(args, args.length + 2); cmds[args.length] = TestObjItrWithHeapDump.class.getName(); cmds[args.length + 1] = "test"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -42,7 +42,7 @@ String[] cmds = Arrays.copyOf(args, args.length + 2); cmds[args.length] = TestPeriodicGC.class.getName(); cmds[args.length + 1] = "test"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,20 +41,54 @@ */ /* + * @test id=default-debug + * @summary Tests that we pass at least one jcstress-like test with all verification turned on + * @requires vm.gc.Shenandoah + * @requires vm.debug + * @modules java.base/jdk.internal.misc + * java.management + * + * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive + * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers + * TestVerifyJCStress + * + * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact + * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers + * TestVerifyJCStress + */ + +/* * @test id=default * @summary Tests that we pass at least one jcstress-like test with all verification turned on * @requires vm.gc.Shenandoah + * @requires !vm.debug * @modules java.base/jdk.internal.misc * java.management * * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive - * -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers + * -XX:+ShenandoahVerify * TestVerifyJCStress * * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact - * -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers + * -XX:+ShenandoahVerify + * TestVerifyJCStress + */ + +/* + * @test id=iu-debug + * @summary Tests that we pass at least one jcstress-like test with all verification turned on + * @requires vm.gc.Shenandoah + * @requires vm.debug + * @modules java.base/jdk.internal.misc + * java.management + * + * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu + * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers * TestVerifyJCStress */ @@ -62,20 +96,30 @@ * @test id=iu * @summary Tests that we pass at least one jcstress-like test with all verification turned on * @requires vm.gc.Shenandoah + * @requires !vm.debug * @modules java.base/jdk.internal.misc * java.management * * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu - * -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers + * -XX:+ShenandoahVerify * TestVerifyJCStress + */ + +/* + * @test id=iu-c1 + * @summary Tests that we pass at least one jcstress-like test with all verification turned on + * @requires vm.gc.Shenandoah + * @modules java.base/jdk.internal.misc + * java.management * * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu - * -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 + * -XX:+ShenandoahVerify -XX:TieredStopAtLevel=1 * TestVerifyJCStress */ + import java.util.*; import java.util.concurrent.*; import java.util.concurrent.locks.*; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/compiler/TestLoadBypassesNullCheck.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/compiler/TestLoadBypassesNullCheck.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/compiler/TestLoadBypassesNullCheck.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/compiler/TestLoadBypassesNullCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8342496 + * @summary C2/Shenandoah: SEGV in compiled code when running jcstress + * @requires vm.flavor == "server" + * @requires vm.gc.Shenandoah + * + * @run main/othervm -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:+UseShenandoahGC -XX:LoopMaxUnroll=0 + * -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM -XX:StressSeed=270847015 + * TestLoadBypassesNullCheck + * @run main/othervm -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:+UseShenandoahGC -XX:LoopMaxUnroll=0 + * -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM + * TestLoadBypassesNullCheck + * + */ + +public class TestLoadBypassesNullCheck { + private static A fieldA = new A(); + private static Object fieldO = new Object(); + private static volatile int volatileField; + + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + test1(); + } + fieldA = null; + try { + test1(); + } catch (NullPointerException npe) { + } + } + + private static boolean test1() { + for (int i = 0; i < 1000; i++) { + volatileField = 42; + A a = fieldA; + Object o = a.fieldO; + if (o == fieldO) { + return true; + } + } + return false; + } + + private static class A { + public Object fieldO; + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,7 +55,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -68,7 +68,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -63,7 +63,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java 2025-01-04 20:25:18.000000000 +0000 @@ -54,7 +54,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -67,7 +67,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -99,7 +99,7 @@ pbArgs.add(TestClassLoaderLeak.class.getName()); pbArgs.add("test"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(pbArgs.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(pbArgs.toArray(new String[0])); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java 2025-01-04 20:25:18.000000000 +0000 @@ -62,7 +62,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx32m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ private static void testHeuristics() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -57,7 +57,7 @@ output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -68,7 +68,7 @@ output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -83,7 +83,7 @@ private static void testRange(String option, int min, int max) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -94,7 +94,7 @@ output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -105,7 +105,7 @@ output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -116,7 +116,7 @@ output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java 2025-01-04 20:25:18.000000000 +0000 @@ -43,7 +43,7 @@ cmds[args.length] = "-Xmx128m"; cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("ClassUnloading"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -60,7 +60,7 @@ }; { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -77,7 +77,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -95,7 +95,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -113,7 +113,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -131,7 +131,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java 2025-01-04 20:25:18.000000000 +0000 @@ -60,7 +60,7 @@ }; for (String opt : opts) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java 2025-01-04 20:25:18.000000000 +0000 @@ -52,7 +52,7 @@ private static void testWith(String h, Mode mode) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -73,7 +73,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -94,7 +94,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,7 +38,7 @@ public class TestHumongousThresholdArgs { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -51,7 +51,7 @@ int[] invalid = new int[] {-100, -1, 0, 101, 1000}; for (int v : valid) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -62,7 +62,7 @@ } for (int v : invalid) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java 2025-01-04 20:25:18.000000000 +0000 @@ -44,7 +44,7 @@ cmds[args.length] = "-Xmx128m"; cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("UseCountedLoopSafepoints"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java 2025-01-04 20:25:18.000000000 +0000 @@ -51,7 +51,7 @@ private static void testWith(String h, Mode mode) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -72,7 +72,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -93,7 +93,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java 2025-01-04 20:25:18.000000000 +0000 @@ -45,7 +45,7 @@ private static void testInvalidRegionSizes() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx1g", @@ -55,7 +55,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms8m", "-Xmx1g", @@ -65,7 +65,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -77,7 +77,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -88,7 +88,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -100,7 +100,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -111,7 +111,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -122,7 +122,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -134,7 +134,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -145,7 +145,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -160,7 +160,7 @@ private static void testMinRegionSize() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -172,7 +172,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -184,7 +184,7 @@ output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -196,7 +196,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -211,7 +211,7 @@ private static void testMaxRegionSize() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -223,7 +223,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -29,7 +29,15 @@ * @library /test/lib * @run driver TestSelectiveBarrierFlags -Xint * @run driver TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:TieredStopAtLevel=1 - * @run driver TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers + */ + +/* @test + * @summary Test selective barrier enabling works, by aggressively compiling HelloWorld with combinations + * of barrier flags + * @requires vm.gc.Shenandoah + * @requires vm.debug + * @library /test/lib + * @run driver TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation -XX:+ShenandoahVerifyOptoBarriers */ import java.util.*; @@ -83,7 +91,7 @@ pool.submit(() -> { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(conf.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(conf.toArray(new String[0])); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } catch (Exception e) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,7 +38,7 @@ public class TestSoftMaxHeapSize { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", @@ -49,7 +49,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", @@ -60,7 +60,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java 2025-01-04 20:25:18.000000000 +0000 @@ -45,7 +45,7 @@ } private static void testWith(int conc, int par) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,7 +38,7 @@ public class TestThreadCountsOverride { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -53,7 +53,7 @@ } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java 2025-01-04 20:25:18.000000000 +0000 @@ -65,7 +65,7 @@ private static void shouldFailAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -83,7 +83,7 @@ private static void shouldPassAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,7 +55,7 @@ private static void shouldFailAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -73,7 +73,7 @@ private static void shouldPassAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestG1.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestG1.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestG1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestG1.java 2025-01-04 20:25:18.000000000 +0000 @@ -40,7 +40,7 @@ public class TestG1 { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,7 @@ public class TestParallelGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParallelGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseParallelGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -40,7 +40,7 @@ public class TestSerialGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseSerialGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseSerialGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java 2025-01-04 20:25:18.000000000 +0000 @@ -40,7 +40,7 @@ public class TestShenandoah { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -61,7 +61,7 @@ "-XX:+PrintNMTStatistics" )); baseargs.addAll(Arrays.asList(args)); baseargs.add(GCTest.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(baseargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(baseargs); verifySymbolMemoryUsageNotTooHigh(new OutputAnalyzer(pb.start())); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +101,7 @@ "-Dregionsize=" + regionSize, TestStressG1HumongousImpl.class.getName() ); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(options); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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,7 +59,7 @@ "-XX:+UseG1GC", StressUncommit.class.getName() ); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(options); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldMatch("Uncommit regions"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java 2025-01-04 20:25:18.000000000 +0000 @@ -277,7 +277,7 @@ args.addAll(Arrays.asList(defaultArgs)); args.addAll(Arrays.asList(extraArgs)); - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.err.println(output.getStderr()); System.out.println(output.getStdout()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/whitebox/TestWBGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/whitebox/TestWBGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/whitebox/TestWBGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/whitebox/TestWBGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -43,7 +43,7 @@ public class TestWBGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,7 @@ final String heapBackingFile = "Heap Backing File: " + directory; final String failedToCreateFile = "Failed to create file " + directory; - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-Xlog:gc*", "-Xms32M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestGarbageCollectorMXBean.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestGarbageCollectorMXBean.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestGarbageCollectorMXBean.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestGarbageCollectorMXBean.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,14 +21,16 @@ * questions. */ +package gc.z; + /** * @test TestGarbageCollectorMXBean * @requires vm.gc.Z * @summary Test ZGC garbage collector MXBean * @modules java.management * @requires vm.compMode != "Xcomp" - * @run main/othervm -XX:+UseZGC -Xms256M -Xmx512M -Xlog:gc TestGarbageCollectorMXBean 256 512 - * @run main/othervm -XX:+UseZGC -Xms512M -Xmx512M -Xlog:gc TestGarbageCollectorMXBean 512 512 + * @run main/othervm -XX:+UseZGC -Xms256M -Xmx512M -Xlog:gc gc.z.TestGarbageCollectorMXBean 256 512 + * @run main/othervm -XX:+UseZGC -Xms512M -Xmx512M -Xlog:gc gc.z.TestGarbageCollectorMXBean 512 512 */ import java.lang.management.ManagementFactory; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestMemoryMXBean.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryMXBean.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestMemoryMXBean.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryMXBean.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,13 +21,15 @@ * questions. */ +package gc.z; + /** * @test TestMemoryMXBean * @requires vm.gc.Z * @summary Test ZGC heap memory MXBean * @modules java.management - * @run main/othervm -XX:+UseZGC -Xms128M -Xmx256M -Xlog:gc* TestMemoryMXBean 128 256 - * @run main/othervm -XX:+UseZGC -Xms256M -Xmx256M -Xlog:gc* TestMemoryMXBean 256 256 + * @run main/othervm -XX:+UseZGC -Xms128M -Xmx256M -Xlog:gc* gc.z.TestMemoryMXBean 128 256 + * @run main/othervm -XX:+UseZGC -Xms256M -Xmx256M -Xlog:gc* gc.z.TestMemoryMXBean 256 256 */ import java.lang.management.ManagementFactory; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestMemoryManagerMXBean.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryManagerMXBean.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestMemoryManagerMXBean.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestMemoryManagerMXBean.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,12 +21,14 @@ * questions. */ +package gc.z; + /** * @test TestMemoryManagerMXBean * @requires vm.gc.Z * @summary Test ZGC memory manager MXBean * @modules java.management - * @run main/othervm -XX:+UseZGC -Xmx128M TestMemoryManagerMXBean + * @run main/othervm -XX:+UseZGC -Xmx128M gc.z.TestMemoryManagerMXBean */ import java.lang.management.ManagementFactory; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java 2025-01-04 20:25:18.000000000 +0000 @@ -68,7 +68,7 @@ } public static void main(String[] args) throws Exception { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-Xms128M", "-Xmx128M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestSmallHeap.java openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestSmallHeap.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/gc/z/TestSmallHeap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/gc/z/TestSmallHeap.java 2025-01-04 20:25:18.000000000 +0000 @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { for (var maxCapacity: args) { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-Xlog:gc,gc+init,gc+reloc,gc+heap", "-Xmx" + maxCapacity, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java openjdk-17-17.0.14+7/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -56,7 +56,7 @@ var jar = new ProcessBuilder(JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "GetObjectSizeOverflowAgent.class"); new OutputAnalyzer(jar.start()).shouldHaveExitValue(0); - ProcessBuilder pt = ProcessTools.createTestJvm("-Xmx4000m", "-javaagent:agent.jar", "GetObjectSizeOverflowAgent"); + ProcessBuilder pt = ProcessTools.createTestJavaProcessBuilder("-Xmx4000m", "-javaagent:agent.jar", "GetObjectSizeOverflowAgent"); OutputAnalyzer output = new OutputAnalyzer(pt.start()); output.stdoutShouldContain("GetObjectSizeOverflow passed"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ static final String OPTION="this_is_not_an_option"; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-showversion", "-XX:" + OPTION); new OutputAnalyzer(pb.start()) .shouldNotHaveExitValue(0) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,13 +21,14 @@ * questions. */ +import static java.lang.Character.isDigit; import static java.lang.Long.parseLong; import static java.lang.System.getProperty; import static java.nio.file.Files.readAllBytes; import static java.util.Arrays.stream; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; -import static jdk.test.lib.process.ProcessTools.createJavaProcessBuilder; +import static jdk.test.lib.process.ProcessTools.createLimitedTestJavaProcessBuilder; import static jdk.test.lib.Platform.isWindows; import jdk.test.lib.Utils; import jdk.test.lib.Platform; @@ -40,6 +41,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.Collection; +import java.util.concurrent.TimeUnit; import java.util.Optional; import java.util.stream.Stream; @@ -60,17 +62,18 @@ * * This test is performed in three steps. The first VM starts a second VM with * gc logging enabled. The second VM starts a third VM and redirects the third - * VMs output to the first VM, it then exits and hopefully closes its log file. + * VMs output to the first VM. The second VM then exits and hopefully closes + * its log file. * - * The third VM waits for the second to exit and close its log file. After that, - * the third VM tries to rename the log file of the second VM. If it succeeds in - * doing so it means that the third VM did not inherit the open log file - * (windows can not rename opened files easily) + * The third VM waits for the second to exit and close its log file. + * On Windows, the third VM tries to rename the log file of the second VM. + * If it succeeds in doing so it means that the third VM did not inherit + * the open log file (windows cannot rename opened files easily). + * On unix like systems, the third VM uses "lsof" for verification. * - * The third VM communicates the success to rename the file by printing "CLOSED - * FD". The first VM checks that the string was printed by the third VM. - * - * On unix like systems "lsof" is used. + * The third VM communicates success by printing "RETAINS FD". The first VM + * waits for the third VM to exit and checks that the string was printed by + * the third VM. */ public class TestInheritFD { @@ -80,9 +83,145 @@ public static final String EXIT = "VM RESULT => VM EXIT"; public static final String LOG_SUFFIX = ".strangelogsuffixthatcanbecheckedfor"; public static final String USER_DIR = System.getProperty("user.dir"); + public static final String LSOF_PID_PREFIX = " VM lsof pid="; + public static final String SECOND_VM_PID_PREFIX = "Second VM pid="; + public static final String THIRD_VM_PID_PREFIX = "Third VM pid="; + public static final String THIRD_VM_WAITING_PREFIX = "Third VM waiting for second VM pid="; + + public static float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0")); + public static long subProcessTimeout = (long)(15L * timeoutFactor); + + // Extract a pid from the specified String at the specified start offset. + private static long extractPidFromStringOffset(String str, int start) { + int end; + for (end = start; end < str.length(); end++) { + if (!isDigit(str.charAt(end))) { + break; + } + } + if (start == end) { // no digits at all + return -1; + } + return parseLong(str.substring(start, end)); + } + + // Wait for the sub-process pids identified in commFile to finish executing. + // Returns true if RETAINS_FD was found in the commFile and false otherwise. + private static boolean waitForSubPids(File commFile) throws Exception { + String out = ""; + int sleepCnt = 0; + long secondVMPID = -1; + long secondVMlsofPID = -1; + long thirdVMPID = -1; + long thirdVMlsofPID = -1; + // Only have to gather info until the doneWithPattern shows up in the output: + String doneWithPattern; + if (isWindows()) { + doneWithPattern = THIRD_VM_PID_PREFIX; + } else { + doneWithPattern = "Third" + LSOF_PID_PREFIX; + } + do { + out = new String(readAllBytes(commFile.toPath())); + if (secondVMPID == -1) { + int ind = out.indexOf(SECOND_VM_PID_PREFIX); + if (ind != -1) { + int startPid = ind + SECOND_VM_PID_PREFIX.length(); + secondVMPID = extractPidFromStringOffset(out, startPid); + System.out.println("secondVMPID=" + secondVMPID); + } + } + if (!isWindows() && secondVMlsofPID == -1) { + String prefix = "Second" + LSOF_PID_PREFIX; + int ind = out.indexOf(prefix); + if (ind != -1) { + int startPid = ind + prefix.length(); + secondVMlsofPID = extractPidFromStringOffset(out, startPid); + System.out.println("secondVMlsofPID=" + secondVMlsofPID); + } + } + if (thirdVMPID == -1) { + int ind = out.indexOf(THIRD_VM_PID_PREFIX); + if (ind != -1) { + int startPid = ind + THIRD_VM_PID_PREFIX.length(); + thirdVMPID = extractPidFromStringOffset(out, startPid); + System.out.println("thirdVMPID=" + thirdVMPID); + } + } + if (!isWindows() && thirdVMlsofPID == -1) { + String prefix = "Third" + LSOF_PID_PREFIX; + int ind = out.indexOf(prefix); + if (ind != -1) { + int startPid = ind + prefix.length(); + thirdVMlsofPID = extractPidFromStringOffset(out, startPid); + System.out.println("thirdVMlsofPID=" + thirdVMlsofPID); + } + } + Thread.sleep(100); + sleepCnt++; + } while (!out.contains(doneWithPattern) && !out.contains(EXIT)); + + System.out.println("Called Thread.sleep(100) " + sleepCnt + " times."); + + long subPids[] = new long[4]; // At most 4 pids to check. + String subNames[] = new String[4]; // At most 4 names for those pids. + int ind = 0; + if (!isWindows() && secondVMlsofPID != -1) { + // The second VM's lsof cmd should be the first non-windows sub-process to finish: + subPids[ind] = secondVMlsofPID; + subNames[ind] = "second VM lsof"; + ind++; + } + // The second VM should the second non-windows or first windows sub-process to finish: + subPids[ind] = secondVMPID; + subNames[ind] = "second VM"; + ind++; + if (!isWindows() && thirdVMlsofPID != -1) { + // The third VM's lsof cmd should be the third non-windows sub-process to finish: + subPids[ind] = thirdVMlsofPID; + subNames[ind] = "third VM lsof"; + ind++; + } + // The third VM should the last sub-process to finish: + subPids[ind] = thirdVMPID; + subNames[ind] = "third VM"; + ind++; + if (isWindows()) { + // No lsof pids on windows so we use fewer array slots. + // Make sure they are marked as not used. + for (; ind < subPids.length; ind++) { + subPids[ind] = -1; + } + } + + try { + for (ind = 0; ind < subPids.length; ind++) { + if (subPids[ind] == -1) { + continue; + } + System.out.print("subs[" + ind + "]={pid=" + subPids[ind] + ", name=" + subNames[ind] + "}"); + ProcessHandle.of(subPids[ind]).ifPresent(handle -> handle.onExit().orTimeout(subProcessTimeout, TimeUnit.SECONDS).join()); + System.out.println(" finished."); + } + } catch (Exception e) { + // Terminate the "subs" line from above: + System.out.println(" Exception was thrown while trying to join() subPids: " + e.toString()); + throw e; + } finally { + // Reread to get everything in the commFile: + out = new String(readAllBytes(commFile.toPath())); + System.out.println(""); + System.out.println(out); + System.out.println(""); + } + + return out.contains(RETAINS_FD); + } // first VM public static void main(String[] args) throws Exception { + System.out.println("subProcessTimeout=" + subProcessTimeout + " seconds."); + System.out.println("First VM starts."); String logPath = Utils.createTempFile("logging", LOG_SUFFIX).toFile().getName(); File commFile = Utils.createTempFile("communication", ".txt").toFile(); @@ -90,7 +229,7 @@ throw new SkippedException("Could not find lsof like command"); } - ProcessBuilder pb = createJavaProcessBuilder( + ProcessBuilder pb = createLimitedTestJavaProcessBuilder( "-Xlog:gc:\"" + logPath + "\"", "-Dtest.jdk=" + getProperty("test.jdk"), VMStartedWithLogging.class.getName(), @@ -99,25 +238,19 @@ pb.redirectOutput(commFile); // use temp file to communicate between processes pb.start(); - String out = ""; - do { - out = new String(readAllBytes(commFile.toPath())); - Thread.sleep(100); - System.out.println("SLEEP 100 millis"); - } while (!out.contains(EXIT)); - - System.out.println(out); - if (out.contains(RETAINS_FD)) { - System.out.println("Log file was not inherited by third VM"); + if (waitForSubPids(commFile)) { + System.out.println("Log file was not inherited by third VM."); } else { - throw new RuntimeException("could not match: " + RETAINS_FD); + throw new RuntimeException("Log file was leaked to the third VM."); } + System.out.println("First VM ends."); } static class VMStartedWithLogging { // second VM public static void main(String[] args) throws IOException, InterruptedException { - ProcessBuilder pb = createJavaProcessBuilder( + System.out.println(SECOND_VM_PID_PREFIX + ProcessHandle.current().pid()); + ProcessBuilder pb = createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + getProperty("test.jdk"), VMShouldNotInheritFileDescriptors.class.getName(), args[0], @@ -126,30 +259,43 @@ pb.start(); if (!isWindows()) { - System.out.println("(Second VM) Open file descriptors:\n" + outputContainingFilenames().stream().collect(joining("\n"))); + System.out.println("(Second VM) Open file descriptors:\n" + outputContainingFilenames("Second").stream().collect(joining("\n"))); + } + if (false) { // Enable to simulate a timeout in the second VM. + Thread.sleep(300 * 1000); } + System.out.println("Second VM ends."); } } static class VMShouldNotInheritFileDescriptors { // third VM public static void main(String[] args) throws InterruptedException { + System.out.println(THIRD_VM_PID_PREFIX + ProcessHandle.current().pid()); try { File logFile = new File(args[0]); long parentPid = parseLong(args[1]); fakeLeakyJVM(false); // for debugging of test case + System.out.println(THIRD_VM_WAITING_PREFIX + parentPid); + ProcessHandle.of(parentPid).ifPresent(handle -> handle.onExit().orTimeout(subProcessTimeout, TimeUnit.SECONDS).join()); + if (isWindows()) { - windows(logFile, parentPid); + windows(logFile); } else { - Collection output = outputContainingFilenames(); + Collection output = outputContainingFilenames("Third"); System.out.println("(Third VM) Open file descriptors:\n" + output.stream().collect(joining("\n"))); System.out.println(findOpenLogFile(output) ? LEAKS_FD : RETAINS_FD); } + if (false) { // Enable to simulate a timeout in the third VM. + Thread.sleep(300 * 1000); + } } catch (Exception e) { - System.out.println(e.toString()); + System.out.println("Exception was thrown: " + e.toString()); + throw e; } finally { System.out.println(EXIT); + System.out.println("Third VM ends."); } } } @@ -165,9 +311,11 @@ } } - static Stream run(String... args){ + static Stream runLsof(String whichVM, String... args){ try { - return new BufferedReader(new InputStreamReader(new ProcessBuilder(args).start().getInputStream())).lines(); + Process lsof = new ProcessBuilder(args).start(); + System.out.println(whichVM + LSOF_PID_PREFIX + lsof.pid()); + return new BufferedReader(new InputStreamReader(lsof.getInputStream())).lines(); } catch (IOException e) { throw new RuntimeException(e); } @@ -186,12 +334,12 @@ return lsofCommandCache; } - static Collection outputContainingFilenames() { + static Collection outputContainingFilenames(String whichVM) { long pid = ProcessHandle.current().pid(); String[] command = lsofCommand().orElseThrow(() -> new RuntimeException("lsof like command not found")); // Only search the directory in which the VM is running (user.dir property). System.out.println("using command: " + command[0] + " -a +d " + USER_DIR + " " + command[1] + " " + pid); - return run(command[0], "-a", "+d", USER_DIR, command[1], "" + pid).collect(toList()); + return runLsof(whichVM, command[0], "-a", "+d", USER_DIR, command[1], "" + pid).collect(toList()); } static boolean findOpenLogFile(Collection fileNames) { @@ -208,9 +356,7 @@ .isPresent(); } - static void windows(File f, long parentPid) throws InterruptedException { - System.out.println("waiting for pid: " + parentPid); - ProcessHandle.of(parentPid).ifPresent(handle -> handle.onExit().join()); + static void windows(File f) throws InterruptedException { System.out.println("trying to rename file to the same name: " + f); System.out.println(f.renameTo(f) ? RETAINS_FD : LEAKS_FD); // this parts communicates a closed file descriptor by printing "VM RESULT => RETAINS FD" } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,7 +51,7 @@ "--patch-module=java.base"), "mods/java.base"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Incompatible definition of java.lang.Object") .shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BadObjectClass/TestUnloadClassError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/TestUnloadClassError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BadObjectClass/TestUnloadClassError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BadObjectClass/TestUnloadClassError.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,9 @@ * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler - * @run main TestUnloadClassError + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestUnloadClassError */ import jdk.test.lib.compiler.InMemoryJavaCompiler; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class BootClassPathAppend { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintCompilation", "-Xcomp", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -107,7 +107,7 @@ }; cl.loadClass(classTestCName); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", classTestCName); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", classTestCName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String test_output = output.getOutput(); if (test_output == null) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public static void main(String args[]) throws Throwable { // Run Lamba class - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("TestPkg.Lambda"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("TestPkg.Lambda"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Exception in thread \"main\" java.lang.ExceptionInInitializerError"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class CDSCompressedKPtrs { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -50,7 +50,7 @@ output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public class XShareAuto { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-server", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./XShareAuto.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -55,7 +55,7 @@ }; for (String x : cases) { - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./XShareAuto.jsa", "-Xlog:cds", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class FormatCheckingTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("BadHelloWorld"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("BadHelloWorld"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Illegal class name"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -68,7 +68,7 @@ output.shouldHaveExitValue(0); // ======= execute the test - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", ".", "-XX:+UnlockDiagnosticVMOptions", "-XX:MallocMaxTestWords=" + mallocMaxTestWords, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -67,7 +67,7 @@ output.shouldHaveExitValue(0); // ======= execute the test - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", ".", "-XX:+UnlockDiagnosticVMOptions", "-XX:MallocMaxTestWords=" + mallocMaxTestWords, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,21 +54,21 @@ // Run the test. This should fail because --enable-preview is not specified. ClassFileInstaller.writeClassToDisk("PVTest", klassbuf, System.getProperty("test.classes")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("Preview features are not enabled"); oa.shouldHaveExitValue(1); // This should be successful because --enable-preview is specified. - pb = ProcessTools.createJavaProcessBuilder("--enable-preview", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("--enable-preview", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("Hi!"); oa.shouldHaveExitValue(0); // Test -Xlog:class+preview - pb = ProcessTools.createJavaProcessBuilder("--enable-preview", "-Xlog:class+preview", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("--enable-preview", "-Xlog:class+preview", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("[info][class,preview] Loading class PVTest that depends on preview features"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:exceptions=warning", "CheckedExceptions"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class UnsupportedClassFileVersion implements Opcodes { public static void main(String... args) throws Exception { writeClassFile(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "ClassFile"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "ClassFile"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("ClassFile has been compiled by a more recent version of the " + "Java Runtime (class file version 99.0), this version of " + diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,14 +36,14 @@ public class BooleanFlagWithInvalidValue { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings=8", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-PrintWarnings=8", "-version"); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ pw.println("aaa, aaa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-XX:CompileCommandFile=hs_comp.txt", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompileCommandFile=hs_comp.txt", "-version"); output = new OutputAnalyzer(pb.start()); // problems in CompileCommandFile are treated as warnings output.shouldHaveExitValue(0); @@ -60,7 +60,7 @@ pw.println("aa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("warning: .hotspot_compiler file is present but has been ignored. Run with -XX:CompileCommandFile=.hotspot_compiler to load the file."); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,7 @@ pw.close(); // start VM - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:Flags=.hotspotrc", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ pw.println("aaa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-XX:Flags=hs_flags.txt","-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:Flags=hs_flags.txt","-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Unrecognized VM option 'aaa'"); output.shouldHaveExitValue(1); @@ -57,7 +57,7 @@ pw.println("aa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("warning: .hotspotrc file is present but has been ignored. Run with -XX:Flags=.hotspotrc to load the file."); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,7 +36,7 @@ public class DoubleFlagWithIntegerValue { public static void testDoubleFlagWithValue(String value) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:SweeperThreshold=" + value, "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:SweeperThreshold=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Improperly specified VM option"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,7 +36,7 @@ public class FlagWithInvalidValue { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MaxRAMPercentage=v", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,7 +38,7 @@ public class IgnoreUnrecognizedVMOptions { private static void runJavaAndCheckExitValue(boolean shouldSucceed, String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldSucceed) { output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,14 +36,14 @@ public class NonBooleanFlagWithInvalidBooleanPrefix { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-MaxRAMPercentage=1", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMPercentage=1'"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+MaxRAMPercentage=1", "-version"); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java 2025-01-04 20:25:18.000000000 +0000 @@ -40,7 +40,7 @@ String flag = "DummyObsoleteTestFlag"; // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449) - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:" + flag + "PlusJunk", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -48,7 +48,7 @@ output.shouldHaveExitValue(1); // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989) - ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb2 = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+" + flag, "-version"); OutputAnalyzer output2 = new OutputAnalyzer(pb2.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,7 @@ OutputAnalyzer output; System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output"); - output = new OutputAnalyzer((ProcessTools.createJavaProcessBuilder( + output = new OutputAnalyzer((ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + System.getProperty("test.jdk"), "-XX:MinHeapFreeRatio=20", "-XX:MaxHeapFreeRatio=80", runJcmd.class.getName())).start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -417,7 +417,7 @@ runJava.add(optionValue); runJava.add(JVMStartup.class.getName()); - out = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(runJava).start()); + out = new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder(runJava).start()); exitCode = out.getExitValue(); String exitCodeString = null; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -469,7 +469,7 @@ runJava.add(PRINT_FLAGS_RANGES); runJava.add("-version"); - p = ProcessTools.createJavaProcessBuilder(runJava).start(); + p = ProcessTools.createLimitedTestJavaProcessBuilder(runJava).start(); result = getJVMOptions(new InputStreamReader(p.getInputStream()), withRanges, acceptOrigin); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class PrintTouchedMethods { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UnlockDiagnosticVMOptions", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", @@ -52,7 +52,7 @@ output.shouldContain("Error: VM option 'LogTouchedMethods' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions."); output.shouldContain("Error: Could not create the Java Virtual Machine."); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", @@ -78,7 +78,7 @@ output.shouldNotContain("TestLogTouchedMethods.methodB:()V"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xint", "-XX:+LogTouchedMethods", @@ -100,7 +100,7 @@ output.shouldNotContain("TestLogTouchedMethods.methodB:()V"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xint", "-XX:+LogTouchedMethods", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,13 +38,13 @@ public class TestHexArguments { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:SharedBaseAddress=0x1D000000", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Could not create the Java Virtual Machine"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:SharedBaseAddress=1D000000", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { OutputAnalyzer output; - output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder("-XX:" + VERY_LONG_OPTION, "-version").start()); + output = new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:" + VERY_LONG_OPTION, "-version").start()); output.shouldHaveExitValue(1); output.shouldContain(String.format("Unrecognized VM option '%s'", VERY_LONG_OPTION)); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -57,7 +57,7 @@ for (String option : options) { String testOption = option + "junk"; ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder(testOption, "-version"); + ProcessTools.createLimitedTestJavaProcessBuilder(testOption, "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Unrecognized option: " + testOption) .shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public class TestVMOptions { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:bogus", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsInitial"); @@ -45,7 +45,7 @@ output.shouldHaveExitValue(0); output.shouldContain("bool UseSerialGC"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-PrintVMOptions", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -54,7 +54,7 @@ File dir = new File(System.getProperty("test.src", ".")); File file = new File(dir, "flagfile.txt"); String s = file.getAbsolutePath(); - pb = ProcessTools.createJavaProcessBuilder("-XX:Flags="+s); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:Flags="+s); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("VM option '-IgnoreUnrecognizedVMOptions'"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public class TraceExceptionsTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:exceptions=info", "NoClassFound"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java 2025-01-04 20:25:18.000000000 +0000 @@ -43,7 +43,7 @@ "bogus_option", }; for (String option : badOptions) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:" + option, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -80,7 +80,7 @@ // command line by -XX:+UnlockDiagnosticVMOptions. static void testDeprecatedDiagnostic(String option, String value) throws Throwable { String XXoption = CommandLineOptionTest.prepareFlag(option, value); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, XXoption, "-version"); OutputAnalyzer output = new OutputAnalyzer(processBuilder.start()); // check for option deprecation message: @@ -93,7 +93,7 @@ // command line by -XX:+UnlockExperimentalVMOption. static void testDeprecatedExperimental(String option, String value) throws Throwable { String XXoption = CommandLineOptionTest.prepareFlag(option, value); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, XXoption, "-version"); OutputAnalyzer output = new OutputAnalyzer(processBuilder.start()); // check for option deprecation message: diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public class VMOptionWarning { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions."); @@ -47,17 +47,17 @@ return; } - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintInlining", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions."); - pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+VerifyStack", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM."); - pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CheckCompressedOops", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM."); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java 2025-01-04 20:25:18.000000000 +0000 @@ -247,7 +247,7 @@ runJava.add(PrintPropertyAndOptions.class.getName()); runJava.addAll(appParams); - pb = ProcessTools.createJavaProcessBuilder(runJava); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(runJava); VMParams.clear(); appParams.clear(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,7 +55,7 @@ // CDS off, small heap, ccs size default (1G) // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding. public static void smallHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedBaseAddress=8g", "-Xmx128m", @@ -72,7 +72,7 @@ // CDS off, small heap, ccs size explicitely set to 1G // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding. public static void smallHeapTestWith1G() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=1g", "-Xmx128m", @@ -90,7 +90,7 @@ // We expect the ccs to be mapped somewhere far beyond the heap, such that it is not possible // to use zero based encoding. public static void largeHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", "-Xmx30g", @@ -115,7 +115,7 @@ // for compressed oops. // We expect a zerobased ccs. public static void largeHeapAbove32GTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", "-Xmx31g", @@ -136,7 +136,7 @@ // Using large paged heap, metaspace uses small pages. public static void largePagesForHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx128m", "-XX:+UseLargePages", @@ -150,7 +150,7 @@ } public static void heapBaseMinAddressTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:HeapBaseMinAddress=1m", "-Xlog:gc+heap+coops=debug", "-version"); @@ -161,7 +161,7 @@ public static void sharingTest() throws Exception { // Test small heaps - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", @@ -177,7 +177,7 @@ output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", @@ -196,7 +196,7 @@ } public static void smallHeapTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -212,7 +212,7 @@ } public static void smallHeapTestWith1GNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -232,7 +232,7 @@ } public static void largeHeapTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -252,7 +252,7 @@ } public static void largePagesTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -266,7 +266,7 @@ } public static void heapBaseMinAddressTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:HeapBaseMinAddress=1m", @@ -279,7 +279,7 @@ public static void sharingTestNoCoop() throws Exception { // Test small heaps - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -297,7 +297,7 @@ output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,23 +42,23 @@ ProcessBuilder pb; OutputAnalyzer output; // Minimum size is 1MB - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=0", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=0", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("outside the allowed range") .shouldHaveExitValue(1); // Invalid size of -1 should be handled correctly - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Improperly specified VM option 'CompressedClassSpaceSize=-1'") .shouldHaveExitValue(1); // Maximum size is 3GB - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=4g", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=4g", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("outside the allowed range") .shouldHaveExitValue(1); @@ -67,28 +67,28 @@ // Make sure the minimum size is set correctly and printed // (Note: ccs size are rounded up to the next larger root chunk boundary (16m). // Note that this is **reserved** size and does not affect rss. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", - "-XX:CompressedClassSpaceSize=1m", - "-Xlog:gc+metaspace=trace", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=1m", + "-Xlog:gc+metaspace=trace", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldMatch("Compressed class space.*16777216") .shouldHaveExitValue(0); // Make sure the maximum size is set correctly and printed - pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", - "-XX:CompressedClassSpaceSize=3g", - "-Xlog:gc+metaspace=trace", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=3g", + "-Xlog:gc+metaspace=trace", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldMatch("Compressed class space.*3221225472") .shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:-UseCompressedClassPointers", - "-XX:CompressedClassSpaceSize=1m", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-UseCompressedClassPointers", + "-XX:CompressedClassSpaceSize=1m", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used") .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:ObjectAlignmentInBytes=" + alignment, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -74,8 +74,8 @@ } private static OutputAnalyzer testObjectAlignment(int alignment) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:ObjectAlignmentInBytes=" + alignment, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ObjectAlignmentInBytes=" + alignment, + "-version"); return new OutputAnalyzer(pb.start()); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -189,7 +189,7 @@ args.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -43,7 +43,7 @@ public class CleanProtectionDomain { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:protectiondomain+table=debug", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,7 +98,7 @@ } public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.security.policy==" + System.getProperty("test.src") + File.separator + "test.policy", "-Dtest.classes=" + System.getProperty("test.classes", "."), "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public static void main(String args[]) throws Throwable { System.out.println("Regression test for bug 8044738"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("EnclMethTest"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("EnclMethTest"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("java.lang.ClassFormatError: Wrong EnclosingMethod"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -45,7 +45,7 @@ // This test was adapted from SafeFetchInErrorHandlingTest.java. public class BadNativeStackInErrorHandlingTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:ErrorHandlerTest=14", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021, 2023, 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 8271003 + * @summary CLASSPATH env variable setting should not be truncated in a hs err log. + * @requires vm.flagless + * @requires vm.debug + * @library /test/lib + * @run driver ClassPathEnvVar + */ +import java.io.File; +import java.util.Map; + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +public class ClassPathEnvVar { + private static final String pathSep = File.pathSeparator; + private static final String sep = File.separator; + private static final String classPathEnv = "CLASSPATH"; + private static final String endPath = "end-path"; + + public static void main(String[] args) throws Exception { + OutputAnalyzer output = runCrasher().shouldContain("CreateCoredumpOnCrash turned off, no core file dumped") + .shouldNotHaveExitValue(0); + + checkErrorLog(output); + + } + private static OutputAnalyzer runCrasher() throws Exception { + ProcessBuilder pb = + ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-CreateCoredumpOnCrash", + "-XX:ErrorHandlerTest=14", + "-XX:+ErrorFileToStdout"); + + // Obtain the CLASSPATH setting and expand it to more than 2000 chars. + Map envMap = pb.environment(); + String cp = envMap.get(classPathEnv); + if (cp == null) { + cp = "this" + sep + "is" + sep + "dummy" + sep + "path"; + } + while (cp.length() < 2000) { + cp += pathSep + cp; + } + cp += pathSep + endPath; + envMap.put(classPathEnv, cp); + + return new OutputAnalyzer(pb.start()); + } + + private static void checkErrorLog(OutputAnalyzer output) throws Exception { + String classPathLine = output.firstMatch("CLASSPATH=.*"); + + if (classPathLine == null) { + throw new RuntimeException("CLASSPATH setting not found in hs err log."); + } + + // Check if the CLASSPATH line has been truncated. + if (!classPathLine.endsWith(endPath)) { + throw new RuntimeException("CLASSPATH was truncated in the hs err log."); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +59,7 @@ } public static OutputAnalyzer runTest(String option) throws Exception { return new OutputAnalyzer( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", option, Crasher.class.getName()) .start()); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -97,7 +97,7 @@ System.out.println("First crash..."); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=1", @@ -123,7 +123,7 @@ System.out.println("Second crash..."); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=2", // << now 2 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -48,7 +48,7 @@ public static void do_test(boolean redirectStdout, boolean redirectStderr) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=14", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java 2025-01-04 20:25:18.000000000 +0000 @@ -113,7 +113,7 @@ * expected to have a min number of MachCode sections. */ private static void run(boolean crashInJava) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", "-Xcomp", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -53,7 +53,7 @@ // Need to disable ShowRegistersOnAssert: that flag causes registers to be shown, which calls os::print_location, // which - as part of its checks - will iterate the threads list under a ThreadListHandle, changing the max nesting // counters and confusing this test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+EnableThreadSMRStatistics", "-Xmx100M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -47,7 +47,7 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Exception in thread"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ public class SafeFetchInErrorHandlingTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:ErrorHandlerTest=14", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,7 +55,7 @@ { System.out.println("Testing " + (suppress_assert ? "suppressed" : "normal") + " " + (do_assert ? "assert" : "guarantee") + " with " + (show_registers_on_assert ? "-XX:+ShowRegistersOnAssert" : "-XX:-ShowRegistersOnAssert") + "..."); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=" + (do_assert ? "1" : "2"), (suppress_assert ? "-XX:SuppressErrorAt=/vmError.cpp" : ""), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java 2025-01-04 20:25:18.000000000 +0000 @@ -53,7 +53,7 @@ } } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", "-XX:-CreateCoredumpOnCrash", "-Xmx128m", TestCrashOnOutOfMemoryError.class.getName(),"throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); int exitValue = output.getExitValue(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java 2025-01-04 20:25:18.000000000 +0000 @@ -49,7 +49,7 @@ } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+ExitOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+ExitOnOutOfMemoryError", "-Xmx128m", TestExitOnOutOfMemoryError.class.getName(), "throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java 2025-01-04 20:25:18.000000000 +0000 @@ -63,7 +63,7 @@ } static void test(int level) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpGzipLevel=" + level, "-Xmx128M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java 2025-01-04 20:25:18.000000000 +0000 @@ -75,7 +75,7 @@ static void test(String type) throws Exception { String heapdumpFilename = type + ".hprof"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=" + heapdumpFilename, // Note: When trying to provoke a metaspace OOM we may generate a lot of classes. In debug VMs this // can cause considerable wait times since: diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java 2025-01-04 20:25:18.000000000 +0000 @@ -54,7 +54,7 @@ String heapdumpPath = "dumps"; File dumpDirectory = new File(heapdumpPath); dumpDirectory.mkdir(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", "-Xmx64m", "-XX:HeapDumpPath=" + heapdumpPath, TestHeapDumpPath.class.getName(), "OOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java 2025-01-04 20:25:18.000000000 +0000 @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception { String msg = "Test Succeeded"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=14", // trigger potential SEGV "-XX:OnError=echo " + msg, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java 2025-01-04 20:25:18.000000000 +0000 @@ -47,12 +47,12 @@ // else this is the main test String msg1 = "Test1 Succeeded"; String msg2 = "Test2 Succeeded"; - ProcessBuilder pb_single = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_single = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:OnOutOfMemoryError=echo " + msg1, TestOnOutOfMemoryError.class.getName(), "throwOOME"); - ProcessBuilder pb_multiple = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_multiple = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:OnOutOfMemoryError=echo " + msg1, "-XX:OnOutOfMemoryError=echo " + msg2, TestOnOutOfMemoryError.class.getName(), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -53,7 +53,7 @@ // Need to disable ShowRegistersOnAssert: that flag causes registers to be shown, which calls os::print_location, // which - as part of its checks - will iterate the threads list under a ThreadListHandle, changing the max nesting // counters and confusing this test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+EnableThreadSMRStatistics", "-Xmx100M", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -107,7 +107,7 @@ arguments.add("-XX:OnError=echo hi"); } arguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); Map env = pb.environment(); env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public static void main(String args[]) throws Exception { if (args.length == 0) { // Spawn new VM instance to execute test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-TieredCompilation", "-XX:CompileCommand=dontinline,if_icmpleIsLastOpcode.m*", "-Xmx64m", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public static void runTest(String whichTests, String classFileVersion) throws Throwable { System.out.println("\nC1 invocation tests, Tests: " + whichTests + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", "-Xcomp", "-XX:TieredStopAtLevel=1", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", whichTests, "--classfile_version=" + classFileVersion); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -67,7 +67,7 @@ public static void runTest(String whichTests, String classFileVersion) throws Throwable { System.out.println("\nOld CHA invocation tests, Tests: " + whichTests + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", "-Xcomp", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UseVtableBasedCHA", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", whichTests, "--classfile_version=" + classFileVersion); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -73,7 +73,7 @@ public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokeinterface invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokeinterface.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokespecial invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokespecial.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokevirtual invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokevirtual.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 * @bug 8020675 * @summary make sure there is no fatal error if a class is loaded from an invalid jar file which is in the bootclasspath + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -41,7 +42,7 @@ public static void main(String args[]) throws Exception { String bootCP = "-Xbootclasspath/a:" + System.getProperty("test.src") + File.separator + "dummy.jar"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "TestForName"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ * @summary JVM should be able to handle full path (directory path plus * class name) or directory path longer than MAX_PATH specified * in -Xbootclasspath/a on windows. + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -69,7 +70,7 @@ CompilerUtils.compile(sourceDir, destDir); String bootCP = "-Xbootclasspath/a:" + destDir.toString(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -81,7 +82,7 @@ CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -96,7 +97,7 @@ // run with long bootclasspath to hello.jar bootCP = "-Xbootclasspath/a:" + helloJar; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -121,7 +122,7 @@ CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -138,7 +139,7 @@ Path jarPath = jarDir.resolve("hello.jar"); Files.copy(Paths.get(helloJar), jarPath); bootCP = "-Xbootclasspath/a:" + jarPath.toString(); - pb = ProcessTools.createJavaProcessBuilder(bootCP, "Hello"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Hello World") @@ -150,7 +151,7 @@ CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/TestResize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/TestResize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LoadClass/TestResize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LoadClass/TestResize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ * @bug 8184765 * @summary make sure the SystemDictionary gets resized when load factor is too high * @requires vm.debug + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -116,10 +117,10 @@ // that will allow us to calculate the table's load factor. // -Xlog:safepoint+cleanup will print out cleanup details at safepoint // that will allow us to detect if the system dictionary resized. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintSystemDictionaryAtExit", - "-Xlog:safepoint+cleanup", - "TriggerResize", - "50000"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintSystemDictionaryAtExit", + "-Xlog:safepoint+cleanup", + "TriggerResize", + "50000"); analyzeOutputOn(pb); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -37,12 +37,12 @@ public class LocalLongTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xint", - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "--add-opens", - "java.base/java.lang.invoke=ALL-UNNAMED", - "LocalLongHelper"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "--add-opens", + "java.base/java.lang.invoke=ALL-UNNAMED", + "LocalLongHelper"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); }; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,17 +41,17 @@ public static void main(String[] args) throws Exception { test(); // Test good LVT in this test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("DuplicateLVT"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("DuplicateLVT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("DuplicateLVTT"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("DuplicateLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("NotFoundLVTT"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("NotFoundLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry") .shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,7 @@ Path gcLogPath = createGcLogPath("gc." + gc + "." + doConcurrent); System.err.println("test(" + gc + ", " + doConcurrent + ")" + " " + dateFormat.format(new Date())); // Run this Leak class with logging - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:membername+table=trace,gc+verify=debug,gc:" + gcLogPath + ":time,utctime,uptime,pid,level,tags", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -81,7 +81,7 @@ test++; report("Test " + test + ": normal command-line flag"); - pb = ProcessTools.createJavaProcessBuilder(flag, main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(flag, main, max); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); @@ -96,7 +96,7 @@ for (String envVar : envVars) { report("Test " + test + ": " + envVar + " env-var"); - pb = ProcessTools.createJavaProcessBuilder(main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(main, max); pb.environment().put(envVar, flag); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -112,7 +112,7 @@ PrintWriter pw = new PrintWriter(rcFile); pw.println(flagRaw); pw.close(); - pb = ProcessTools.createJavaProcessBuilder(rcFileFlag, main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(rcFileFlag, main, max); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ public class MaxMetaspaceSizeTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:MaxMetaspaceSize=4K", "-XX:+UseCompressedClassPointers", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/CDS.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CDS.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/CDS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CDS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @requires vm.flavor == "minimal" + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver CDS @@ -37,17 +38,17 @@ public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:dump"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:dump"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:on"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:on"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:auto", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:auto", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @requires vm.flavor == "minimal" + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver CheckJNI @@ -35,7 +36,7 @@ public class CheckJNI { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xcheck:jni", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xcheck:jni", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Minimal VM warning: JNI CHECKING is not supported in this VM") .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 * @library /test/lib * @requires vm.flavor == "minimal" + * @requires vm.flagless * @modules java.base/jdk.internal.misc * java.instrument * @run driver Instrumentation @@ -36,7 +37,7 @@ public class Instrumentation { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-minimal", "-javaagent:redefineagent.jar", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Instrumentation agents are not supported in this VM") diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/JMX.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JMX.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/JMX.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JMX.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @requires vm.flavor == "minimal" + * @requires vm.flagless * @library /test/lib * @run main/othervm JMX */ @@ -37,12 +38,12 @@ public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:+ManagementServer", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:+ManagementServer", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("ManagementServer is not supported in this VM.") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Dcom.sun.management ", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Dcom.sun.management ", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("-Dcom.sun.management is not supported in this VM.") .shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @requires vm.flavor == "minimal" + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver JVMTI @@ -35,7 +36,7 @@ public class JVMTI { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-minimal", "-agentlib:jdwp=server=y,transport=dt_socket,address=5000,suspend=n", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/NMT.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/NMT.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/MinimalVM/NMT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/MinimalVM/NMT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @requires vm.flavor == "minimal" + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver NMT @@ -37,17 +38,17 @@ public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -272,7 +272,7 @@ opts.addAll(Arrays.asList(args)); opts.add("DeflationIntervalsTest$Test"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(opts); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/MonitorUnlinkBatchTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUnlinkBatchTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/MonitorUnlinkBatchTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUnlinkBatchTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -165,7 +165,7 @@ opts.addAll(Arrays.asList(args)); opts.add("MonitorUnlinkBatchTest$Test"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(opts); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); if (msg.isEmpty()) { oa.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ public static void main(String[] args) throws Exception { if (args.length == 0) { // Without args we invoke the test in a java sub-process: - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( // Test doesn't need much Java heap: "-Xmx100M", // AvgMonitorsPerThreadEstimate == 1 means we'll start with diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -87,14 +87,14 @@ public static void main(String[] args) throws Exception { generateTests(); for (int i = 0; i < fatalTests.length; i++) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(fatalTests[i]); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(fatalTests[i]); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldContain("fatal error: Synchronizing on object"); output.shouldNotContain("synchronization on value based class did not fail"); output.shouldNotHaveExitValue(0); } for (int i = 0; i < logTests.length; i++) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(logTests[i]); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(logTests[i]); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); checkOutput(output); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java 2025-01-04 20:25:18.000000000 +0000 @@ -103,7 +103,7 @@ // If modules in the system image have been archived in CDS, they will not be // created again at run time. Explicitly use an external module to make sure // we have a runtime-defined ModuleEntry - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:NativeMemoryTracking=detail", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ /* * @test * @summary Empty argument to NMT should result in an informative error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -36,7 +37,7 @@ public class CommandLineEmptyArgument { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:NativeMemoryTracking="); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NativeMemoryTracking="); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ /* * @test * @summary Invalid argument to NMT should result in an informative error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -36,7 +37,7 @@ public class CommandLineInvalidArgument { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:NativeMemoryTracking=apa"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NativeMemoryTracking=apa"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:NativeMemoryTracking=summary", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ /* * @test * @summary Turning off NMT should not result in an error + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -36,7 +37,7 @@ public class CommandLineTurnOffNMT { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:NativeMemoryTracking=off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ /* * @test * @summary Verify that jcmd correctly reports that NMT is not enabled + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -50,13 +51,13 @@ // First run without enabling NMT (not in debug, where NMT is by default on) if (!Platform.isDebugBuild()) { - pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } // Then run with explicitly disabling NMT, should not be any difference - pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 SAP SE. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -156,7 +156,7 @@ } vmArgs.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmArgs); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(vmArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (debug) { output.reportDiagnosticSummary(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,14 +38,14 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=detail", @@ -55,7 +55,7 @@ // Make sure memory reserved for Module processing is recorded. output_detail.shouldContain(" Module (reserved="); - ProcessBuilder pb1 = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb1 = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=summary", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ /* * @test * @summary Trying to enable PrintNMTStatistics should result in a warning + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -36,7 +37,7 @@ public class PrintNMTStatisticsWithNMTDisabled { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=off", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithClassUnload.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithClassUnload.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithClassUnload.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithClassUnload.java 2025-01-04 20:25:18.000000000 +0000 @@ -34,8 +34,10 @@ * PackagedNestHost.java * PackagedNestHost2.java * @compile PackagedNestHost2Member.jcod - * - * @run main/othervm -Xlog:class+unload=trace TestNestHostErrorWithClassUnload + + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xlog:class+unload=trace TestNestHostErrorWithClassUnload */ // Test setup: diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public class PerfMemDestroy { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PerfAllowAtExitRegistration", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PerfAllowAtExitRegistration", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ public class PrintStringTableStatsTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintStringTableStatistics", "--version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -254,7 +254,7 @@ // In order to dynamicaly determine if the platform supports the reserved // stack area, run with -XX:StackReservedPages=1 and see if we get the // expected warning message for platforms that don't support it. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:StackReservedPages=1", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:StackReservedPages=1", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("StackReservedPages=1 log: [" + output.getOutput() + "]"); if (output.getExitValue() != 0) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java 2025-01-04 20:25:18.000000000 +0000 @@ -63,7 +63,7 @@ } public static void testWith(int delay, boolean shouldPass) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+AbortVMOnVMOperationTimeout", "-XX:AbortVMOnVMOperationTimeoutDelay=" + delay, diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -40,7 +40,7 @@ public class TestAbortVMOnSafepointTimeout { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,13 +40,14 @@ ProcessBuilder pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_java_overflow"); pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH); - new OutputAnalyzer(pb.start()) - .shouldHaveExitValue(0); + OutputAnalyzer output = ProcessTools.executeProcess(pb); + output.shouldHaveExitValue(0); - pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow"); + pb = ProcessTools.createNativeTestProcessBuilder("invoke", + "test_java_overflow_initial"); pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH); - new OutputAnalyzer(pb.start()) - .shouldHaveExitValue(0); + output = ProcessTools.executeProcess(pb); + output.shouldHaveExitValue(0); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Stack guard pages should be installed correctly and removed when thread is detached for native threads + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @requires os.family == "linux" + * @compile DoOverflow.java + * @run main/native TestStackGuardPagesNative + */ +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + + +public class TestStackGuardPagesNative { + public static void main(String args[]) throws Exception { + + ProcessBuilder pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow"); + pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH); + OutputAnalyzer output = ProcessTools.executeProcess(pb); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow_initial"); + pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH); + output = ProcessTools.executeProcess(pb); + output.shouldHaveExitValue(0); + + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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 @@ -53,10 +53,11 @@ static jmp_buf context; -static int _last_si_code = -1; -static int _failures = 0; -static int _rec_count = 0; -static int _kp_rec_count = 0; +static volatile int _last_si_code = -1; +static volatile int _failures = 0; +static volatile int _rec_count = 0; // Number of allocations to hit stack guard page +static volatile int _kp_rec_count = 0; // Kept record of rec_count, for retrying +static int _peek_value = 0; // Used for accessing memory to cause SIGSEGV pid_t gettid() { return (pid_t) syscall(SYS_gettid); @@ -73,7 +74,7 @@ void set_signal_handler() { if (altstack == NULL) { // Dynamically allocated in case SIGSTKSZ is not constant - altstack = malloc(SIGSTKSZ); + altstack = (char*)malloc(SIGSTKSZ); if (altstack == NULL) { fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n"); exit(7); @@ -116,31 +117,37 @@ return jdk_args.javaStackSize; } -void *run_java_overflow (void *p) { +// Call DoOverflow::`method` on JVM +void call_method_on_jvm(const char* method) { JNIEnv *env; jclass class_id; jmethodID method_id; int res; - res = (*_jvm)->AttachCurrentThread(_jvm, (void**)&env, NULL); + res = (*_jvm)->AttachCurrentThread(_jvm, (void **)&env, NULL); if (res != JNI_OK) { fprintf(stderr, "Test ERROR. Can't attach to current thread\n"); exit(7); } - class_id = (*env)->FindClass (env, "DoOverflow"); + class_id = (*env)->FindClass(env, "DoOverflow"); if (class_id == NULL) { fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n"); exit(7); } - method_id = (*env)->GetStaticMethodID(env, class_id, "printIt", "()V"); + method_id = (*env)->GetStaticMethodID(env, class_id, method, "()V"); if (method_id == NULL) { - fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printIt\n"); + fprintf(stderr, "Test ERROR. Can't find method DoOverflow.%s\n", method); exit(7); } (*env)->CallStaticVoidMethod(env, class_id, method_id, NULL); +} + +void *run_java_overflow (void *p) { + volatile int res; + call_method_on_jvm("printIt"); res = (*_jvm)->DetachCurrentThread(_jvm); if (res != JNI_OK) { @@ -151,42 +158,22 @@ } void do_overflow(){ - int *p = alloca(sizeof(int)); + volatile int *p = NULL; if (_kp_rec_count == 0 || _rec_count < _kp_rec_count) { - _rec_count ++; - do_overflow(); + for(;;) { + _rec_count++; + p = (int*)alloca(128); + _peek_value = p[0]; // Peek + } } } void *run_native_overflow(void *p) { // Test that stack guard page is correctly set for initial and non initial thread // and correctly removed for the initial thread - JNIEnv *env; - jclass class_id; - jmethodID method_id; - int res; - + volatile int res; printf("run_native_overflow %ld\n", (long) gettid()); - - res = (*_jvm)->AttachCurrentThread(_jvm, (void **)&env, NULL); - if (res != JNI_OK) { - fprintf(stderr, "Test ERROR. Can't attach to current thread\n"); - exit(7); - } - - class_id = (*env)->FindClass (env, "DoOverflow"); - if (class_id == NULL) { - fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n"); - exit(7); - } - - method_id = (*env)->GetStaticMethodID (env, class_id, "printAlive", "()V"); - if (method_id == NULL) { - fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printAlive\n"); - exit(7); - } - - (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL); + call_method_on_jvm("printAlive"); // Initialize statics used in do_overflow _kp_rec_count = 0; @@ -240,7 +227,18 @@ void usage() { fprintf(stderr, "Usage: invoke test_java_overflow\n"); + fprintf(stderr, " invoke test_java_overflow_initial\n"); fprintf(stderr, " invoke test_native_overflow\n"); + fprintf(stderr, " invoke test_native_overflow_initial\n"); +} + +void init_thread_or_die(pthread_t *thr, pthread_attr_t *thread_attr) { + size_t stack_size = get_java_stacksize(); + if (pthread_attr_init(thread_attr) != 0 || + pthread_attr_setstacksize(thread_attr, stack_size) != 0) { + printf("Failed to set stacksize. Exiting test.\n"); + exit(0); + } } @@ -283,37 +281,53 @@ exit(7); } - size_t stack_size = get_java_stacksize(); pthread_t thr; pthread_attr_t thread_attr; - pthread_attr_init(&thread_attr); - pthread_attr_setstacksize(&thread_attr, stack_size); + if (argc < 2) { + fprintf(stderr, "No test selected"); + usage(); + exit(7); + } - if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) { + if (strcmp(argv[1], "test_java_overflow_initial") == 0) { printf("\nTesting JAVA_OVERFLOW\n"); + printf("Testing stack guard page behaviour for initial thread\n"); + run_java_overflow(NULL); + // This test crash on error + exit(0); + } + + if (strcmp(argv[1], "test_java_overflow") == 0) { + init_thread_or_die(&thr, &thread_attr); + printf("\nTesting JAVA_OVERFLOW\n"); printf("Testing stack guard page behaviour for other thread\n"); pthread_create(&thr, &thread_attr, run_java_overflow, NULL); pthread_join(thr, NULL); - printf("Testing stack guard page behaviour for initial thread\n"); - run_java_overflow(NULL); // This test crash on error exit(0); } - if (argc > 1 && strcmp(argv[1], "test_native_overflow") == 0) { + if (strcmp(argv[1], "test_native_overflow_initial") == 0) { printf("\nTesting NATIVE_OVERFLOW\n"); + printf("Testing stack guard page behaviour for initial thread\n"); + run_native_overflow(NULL); + + exit((_failures > 0) ? 1 : 0); + } + + if (strcmp(argv[1], "test_native_overflow") == 0) { + init_thread_or_die(&thr, &thread_attr); + printf("\nTesting NATIVE_OVERFLOW\n"); printf("Testing stack guard page behaviour for other thread\n"); + pthread_create(&thr, &thread_attr, run_native_overflow, NULL); pthread_join(thr, NULL); - printf("Testing stack guard page behaviour for initial thread\n"); - run_native_overflow(NULL); - exit((_failures > 0) ? 1 : 0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ public class LargeClassTest implements Opcodes { public static void main(String... args) throws Exception { writeClassFile(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "Large"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "Large"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2022, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -67,7 +67,7 @@ public static void main(String[] argv) throws Exception { String main = "TestBreakSignalThreadDump$TestProcess"; - ProcessBuilder pb = ProcessTools.createTestJvm("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, main); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, main); if (argv.length > 0 && argv[0].equals("load_libjsig")) { prepend_jsig_lib(pb.environment()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +101,7 @@ System.out.println("*** Testing " + stackOption + stackSize); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( stackOption + stackSize, // Uncomment the following to get log output // that shows actual thread creation sizes. @@ -144,7 +144,7 @@ static void checkMinStackAllowed(String stackOption, String optionMesg, String stackSize) throws Exception { System.out.println("*** Testing " + stackOption + stackSize); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( stackOption + stackSize, // Uncomment the following to get log output // that shows actual thread creation sizes. diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,11 +51,11 @@ public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stacktrace=info", - "-XX:MaxJavaStackTraceDepth=1024", - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "TestThrowable"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stacktrace=info", + "-XX:MaxJavaStackTraceDepth=1024", + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "TestThrowable"); analyzeOutputOn(pb); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -43,10 +43,10 @@ }; public static void main(String[] args) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx64m", - "-Xlog:exceptions=trace", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx64m", + "-Xlog:exceptions=trace", - "TestCatchThrowableOOM$OOM"); + "TestCatchThrowableOOM$OOM"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); for (String msg : expected) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -79,11 +79,11 @@ int[] depths = {0, 20, 1024}; for (int d : depths) { System.out.println("running test with -XX:MaxJavaStackTraceDepth=" + d); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stacktrace=info", - "-XX:MaxJavaStackTraceDepth=" + d, - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "TestMaxJavaStackTraceDepth"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stacktrace=info", + "-XX:MaxJavaStackTraceDepth=" + d, + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "TestMaxJavaStackTraceDepth"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (d == 0) { // Should get all the elements in stack trace diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class RangeCheck { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xmx128m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -61,14 +61,14 @@ throw new RuntimeException("File libjsig not found, path: " + libjsig); } - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", "-version"); Map env = pb.environment(); env.put(env_var, libjsig); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("libjsig is activated"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); env = pb.environment(); env.put(env_var, libjsig); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/DeterministicDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/DeterministicDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/DeterministicDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/DeterministicDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,7 +25,7 @@ * @test * @bug 8241071 * @summary The same JDK build should always generate the same archive file (no randomness). - * @requires vm.cds + * @requires vm.cds & vm.flagless * @library /test/lib * @run driver DeterministicDump */ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ } String msg = "OutOfMemoryError: Metaspace"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(processArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(processArgs); CDSTestUtils.executeAndLog(pb, "dump").shouldContain(msg).shouldHaveExitValue(1); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/SharedStrings.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/SharedStrings.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ // This also serves as a reference on how to use this feature, // hence the command lines are spelled out instead of using the // test utils methods. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", "-Xlog:cds,cds+hashtables", @@ -56,7 +56,7 @@ CDSTestUtils.checkDump(out, "Shared string table stats"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", // needed for access to white box test API diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java 2025-01-04 20:25:18.000000000 +0000 @@ -49,7 +49,7 @@ } } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", "-XX:-CreateCoredumpOnCrash", "-Xmx128m", "-Xshare:on", TestCDSVMCrash.class.getName(),"throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // executeAndLog should throw an exception in the VM crashed diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/AppCDSOptions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/AppCDSOptions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/AppCDSOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/AppCDSOptions.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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.cds.CDSOptions; - -// This class represents options used for -// during creation of the archive and/or running JVM with archive - -public class AppCDSOptions extends CDSOptions { - public String appJar; - public String appJarDir; - - public AppCDSOptions setAppJar(String appJar) { - this.appJar = appJar; - return this; - } - - public AppCDSOptions setAppJarDir(String appJarDir) { - this.appJarDir = appJarDir; - return this; - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java 2025-01-04 20:25:18.000000000 +0000 @@ -54,7 +54,7 @@ // will be ignored during dumping. TestCommon.dump(appJar, classlist, "-Xlog:cds") .shouldContain("Dumping") - .shouldContain("[cds] Prohibited package for non-bootstrap classes: java/lang/Prohibited.class") + .shouldContain("Prohibited package for non-bootstrap classes: java/lang/Prohibited.class") .shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -156,7 +156,7 @@ // Create AppCDS archive using most common args - convenience method public static OutputAnalyzer createArchive(String appJar, String classList[], String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()).setAppJar(appJar); + CDSOptions opts = (new CDSOptions()).setAppJar(appJar); opts.setClassList(classList); opts.addSuffix(suffix); return createArchive(opts); @@ -164,7 +164,7 @@ public static OutputAnalyzer createArchive(String appJarDir, String appJar, String classList[], String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()).setAppJar(appJar); + CDSOptions opts = (new CDSOptions()).setAppJar(appJar); opts.setAppJarDir(appJarDir); opts.setClassList(classList); opts.addSuffix(suffix); @@ -194,7 +194,7 @@ } // Create AppCDS archive using appcds options - public static OutputAnalyzer createArchive(AppCDSOptions opts) + public static OutputAnalyzer createArchive(CDSOptions opts) throws Exception { ArrayList cmd = new ArrayList(); ArrayList verifyOpts = new ArrayList(); @@ -285,7 +285,7 @@ } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); if (opts.appJarDir != null) { pb.directory(new File(opts.appJarDir)); } @@ -394,8 +394,8 @@ } } - // Execute JVM using AppCDS archive with specified AppCDSOptions - public static OutputAnalyzer runWithArchive(AppCDSOptions opts) + // Execute JVM using AppCDS archive with specified CDSOptions + public static OutputAnalyzer runWithArchive(CDSOptions opts) throws Exception { ArrayList cmd = new ArrayList(); @@ -432,7 +432,7 @@ } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); if (opts.appJarDir != null) { pb.directory(new File(opts.appJarDir)); } @@ -441,7 +441,7 @@ public static OutputAnalyzer execCommon(String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addSuffix(suffix); return runWithArchive(opts); } @@ -449,53 +449,53 @@ // This is the new API for running a Java process with CDS enabled. // See comments in the CDSTestUtils.Result class for how to use this method. public static Result run(String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addSuffix(suffix); return new Result(opts, runWithArchive(opts)); } public static Result runWithoutCDS(String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addSuffix(suffix).setXShareMode("off");; return new Result(opts, runWithArchive(opts)); } public static Result runWithRelativePath(String jarDir, String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.setAppJarDir(jarDir); opts.addSuffix(suffix); return new Result(opts, runWithArchive(opts)); } public static OutputAnalyzer exec(String appJar, String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()).setAppJar(appJar); + CDSOptions opts = (new CDSOptions()).setAppJar(appJar); opts.addSuffix(suffix); return runWithArchive(opts); } public static Result runWithModules(String prefix[], String upgrademodulepath, String modulepath, String mid, String... testClassArgs) throws Exception { - AppCDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath, + CDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath, mid, testClassArgs); return new Result(opts, runWithArchive(opts)); } public static OutputAnalyzer execAuto(String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addSuffix(suffix).setXShareMode("auto"); return runWithArchive(opts); } public static OutputAnalyzer execOff(String... suffix) throws Exception { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addSuffix(suffix).setXShareMode("off"); return runWithArchive(opts); } - private static AppCDSOptions makeModuleOptions(String prefix[], String upgrademodulepath, String modulepath, + private static CDSOptions makeModuleOptions(String prefix[], String upgrademodulepath, String modulepath, String mid, String testClassArgs[]) { - AppCDSOptions opts = (new AppCDSOptions()); + CDSOptions opts = (new CDSOptions()); opts.addPrefix(prefix); if (upgrademodulepath == null) { @@ -511,7 +511,7 @@ public static OutputAnalyzer execModule(String prefix[], String upgrademodulepath, String modulepath, String mid, String... testClassArgs) throws Exception { - AppCDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath, + CDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath, mid, testClassArgs); return runWithArchive(opts); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,7 +37,7 @@ public class VerifyWithDefaultArchive { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:cds", "-XX:+VerifySharedSpaces", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:cds", "-XX:+VerifySharedSpaces", "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("relocation bitmap CRC error"); out.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBench.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBench.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBench.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBench.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023, 2024, 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 id=static + * @summary Run JavacBenchApp with the classic static archive workflow + * @requires vm.cds + * @library /test/lib + * @run driver JavacBench STATIC + */ + +/* + * @test id=dynamic + * @summary Run JavacBenchApp with the classic dynamic archive workflow + * @requires vm.cds + * @library /test/lib + * @run driver JavacBench DYNAMIC + */ + +import jdk.test.lib.cds.CDSAppTester; +import jdk.test.lib.helpers.ClassFileInstaller; + +public class JavacBench { + static String mainClass = JavacBenchApp.class.getName(); + static String appJar; + + public static void main(String args[]) throws Exception { + appJar = ClassFileInstaller.writeJar("JavacBenchApp.jar", + "JavacBenchApp", + "JavacBenchApp$ClassFile", + "JavacBenchApp$FileManager", + "JavacBenchApp$SourceFile"); + JavacBenchTester tester = new JavacBenchTester(); + tester.run(args); + } + + static class JavacBenchTester extends CDSAppTester { + public JavacBenchTester() { + super("JavacBench"); + } + + @Override + public String classpath(RunMode runMode) { + return appJar; + } + + @Override + public String[] appCommandLine(RunMode runMode) { + return new String[] { + mainClass, + "90", + }; + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBenchApp.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBenchApp.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBenchApp.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/applications/JavacBenchApp.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2023, 2024, 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.lang.invoke.MethodHandles; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import javax.tools.Diagnostic; +import javax.tools.DiagnosticCollector; +import javax.tools.FileObject; +import javax.tools.ForwardingJavaFileManager; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +/** + * This program tries to compile a large number of classes that exercise a fair amount of + * features in javac. + */ +public class JavacBenchApp { + static class ClassFile extends SimpleJavaFileObject { + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + protected ClassFile(String name) { + super(URI.create("memo:///" + name.replace('.', '/') + Kind.CLASS.extension), Kind.CLASS); + } + @Override + public ByteArrayOutputStream openOutputStream() { + return this.baos; + } + byte[] toByteArray() { + return baos.toByteArray(); + } + } + + static class FileManager extends ForwardingJavaFileManager { + private Map classesMap = new HashMap(); + protected FileManager(JavaFileManager fileManager) { + super(fileManager); + } + @Override + public ClassFile getJavaFileForOutput(Location location, String name, JavaFileObject.Kind kind, FileObject source) { + ClassFile classFile = new ClassFile(name); + classesMap.put(name, classFile); + return classFile; + } + public Map getCompiledClasses() { + Map result = new HashMap<>(); + for (Map.Entry entry : classesMap.entrySet()) { + result.put(entry.getKey(), entry.getValue().toByteArray()); + } + return result; + } + } + + static class SourceFile extends SimpleJavaFileObject { + private CharSequence sourceCode; + public SourceFile(String name, CharSequence sourceCode) { + super(URI.create("memo:///" + name.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); + this.sourceCode = sourceCode; + } + @Override + public CharSequence getCharContent(boolean ignore) { + return this.sourceCode; + } + } + + public Map compile() { + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + DiagnosticCollector ds = new DiagnosticCollector<>(); + Collection sourceFiles = sources; + + try (FileManager fileManager = new FileManager(compiler.getStandardFileManager(ds, null, null))) { + JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, null, null, null, sourceFiles); + if (task.call()) { + return fileManager.getCompiledClasses(); + } else { + for (Diagnostic d : ds.getDiagnostics()) { + System.out.format("Line: %d, %s in %s", d.getLineNumber(), d.getMessage(null), d.getSource().getName()); + } + throw new InternalError("compilation failure"); + } + } catch (IOException e) { + throw new InternalError(e); + } + } + + List sources; + + static final String imports = """ + import java.lang.*; + import java.util.*; + """; + + static final String testClassBody = """ + // Some comments + static long x; + static final long y; + static { + y = System.currentTimeMillis(); + } + /* More comments */ + @Deprecated + String func() { return "String " + this + y; } + public static void main(String args[]) { + try { + x = Long.parseLong(args[0]); + } catch (Throwable t) { + t.printStackTrace(); + } + doit(() -> { + System.out.println("Hello Lambda"); + Thread.dumpStack(); + }); + } + static List list = List.of("1", "2"); + class InnerClass1 { + static final long yy = y; + } + static void doit(Runnable r) { + for (var x : list) { + r.run(); + } + } + static String patternMatch(String arg, Object o) { + if (o instanceof String s) { + return "1234"; + } + final String b = "B"; + return switch (arg) { + case "A" -> "a"; + case b -> "b"; + default -> "c"; + }; + } + public sealed class SealedInnerClass {} + public final class Foo extends SealedInnerClass {} + enum Expression { + ADDITION, + SUBTRACTION, + MULTIPLICATION, + DIVISION + } + public record Point(int x, int y) { + public Point(int x) { + this(x, 0); + } + } + """; + + String sanitySource = """ + public class Sanity implements java.util.concurrent.Callable { + public String call() { + return "this is a test"; + } + } + """; + + void setup(int count) { + sources = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + String source = imports + "public class Test" + i + " {" + testClassBody + "}"; + sources.add(new SourceFile("Test" + i, source)); + } + + sources.add(new SourceFile("Sanity", sanitySource)); + } + + @SuppressWarnings("unchecked") + static void validate(byte[] sanityClassFile) throws Throwable { + MethodHandles.Lookup lookup = MethodHandles.lookup(); + Class cls = lookup.defineClass(sanityClassFile); + Callable obj = (Callable)cls.getDeclaredConstructor().newInstance(); + String s = obj.call(); + if (!s.equals("this is a test")) { + throw new RuntimeException("Expected \"this is a test\", but got \"" + s + "\""); + } + } + + public static void main(String args[]) throws Throwable { + long started = System.currentTimeMillis(); + JavacBenchApp bench = new JavacBenchApp(); + + int count = 0; + if (args.length > 0) { + count = Integer.parseInt(args[0]); + if (count >= 0) { + bench.setup(count); + Map allClasses = bench.compile(); + validate(allClasses.get("Sanity")); + } + } + if (System.getProperty("JavacBenchApp.silent") == null) { + // Set this property when running with "perf stat", etc + long elapsed = System.currentTimeMillis() - started; + System.out.println("Generated source code for " + bench.sources.size() + " classes and compiled them in " + elapsed + " ms"); + } + } +} + diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -242,7 +242,7 @@ if (!executedIn_run) { throw new Exception("Test error: dynamic archive tests must be executed via DynamicArchiveTestBase.run()"); } - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); if (jarDir != null) { pb.directory(new File(jarDir)); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -130,7 +130,7 @@ private static void dumpStaticArchive(String archiveFile) throws Exception { String javapath = JDKToolFinder.getJDKTool("java"); String cmd[] = {javapath, "-Xshare:dump", "-XX:SharedArchiveFile=" + archiveFile}; - // Do not use ProcessTools.createTestJvm(cmd) here, it copies jtreg env. + // Do not use ProcessTools.createTestJavaProcessBuilder(cmd) here, it copies jtreg env. ProcessBuilder pb = new ProcessBuilder(cmd); CDSTestUtils.executeAndLog(pb, "dump") .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023, 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 ResolvedReferencesNotNullTest + * @bug 8313638 + * @summary Testing resolved references array to ensure elements are non-null + * @requires vm.cds.write.archived.java.heap + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * @build jdk.test.whitebox.WhiteBox ResolvedReferencesWb ResolvedReferencesTestApp + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run driver ResolvedReferencesNotNullTest + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.whitebox.WhiteBox; + +public class ResolvedReferencesNotNullTest { + public static void main(String[] args) throws Exception { + SharedStringsUtils.buildJarAndWhiteBox("ResolvedReferencesWb", "ResolvedReferencesTestApp"); + String appJar = TestCommon.getTestJar(SharedStringsUtils.TEST_JAR_NAME_FULL); + String whiteboxParam = SharedStringsUtils.getWbParam(); + + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-cp", + appJar, + whiteboxParam, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "ResolvedReferencesWb", + "false" // ResolvedReferencesTestApp is not archived + ); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + + TestCommon.dump(appJar, + TestCommon.list("ResolvedReferencesWb", "ResolvedReferencesTestApp"), + TestCommon.concat("-XX:SharedArchiveFile=ResolvedRef.jsa", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + whiteboxParam)); + + // Since ResolvedReferencesTestApp is now archived, all of the strings should be in the resolved + // references array + TestCommon.run("-cp", + appJar, + whiteboxParam, + "-XX:SharedArchiveFile=ResolvedRef.jsa", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "ResolvedReferencesWb", + "true" // ResolvedReferencesTestApp is archived + ).assertNormalExit(); + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class ResolvedReferencesTestApp { + // These strings must be in the resolved references array + static String foo = "fooString"; + static String bar = "barString"; + + // This method is never called so the string should not be added to the resolved references array + String qux() { return "quxString"; } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023, 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.whitebox.WhiteBox; + +public class ResolvedReferencesWb { + public static void main(String[] args) throws Exception { + WhiteBox wb = WhiteBox.getWhiteBox(); + + if (args.length < 1) { + throw new RuntimeException("Test requires arg: [true|false]"); + } + + if (!args[0].equals("true") && !args[0].equals("false")) { + throw new RuntimeException("Invalid argument: Test requires arg: [true|false]"); + } + + ResolvedReferencesTestApp t = new ResolvedReferencesTestApp(); + Object[] resolvedReferences = wb.getResolvedReferences(ResolvedReferencesTestApp.class); + boolean isArchived = (args[0].equals("true")); + + if (resolvedReferences.length <= 0) { + throw new RuntimeException("Resolved reference should not be null"); + } + + boolean foundFoo = false; + boolean foundBar = false; + boolean foundQux = false; + + for (Object o : resolvedReferences) { + if (o != null) { + foundFoo |= (o.equals("fooString")); + foundBar |= (o.equals("barString")); + foundQux |= (o.equals("quxString")); + } + } + + if (isArchived) { + // CDS eagerly resolves all the string literals in the ConstantPool. At this point, all + // three strings should be in the resolvedReferences array. + if (!foundFoo || !foundBar || !foundQux) { + throwException(resolvedReferences, "Incorrect resolved references array, all strings should be present"); + } + } else { + // If the class is not archived, the string literals in the ConstantPool are resolved + // on-demand. At this point, ResolvedReferencesTestApp:: has been executed + // so the two strings used there should be in the resolvedReferences array. + // ResolvedReferencesTestApp::qux() is not executed so "quxString" + // should not yet be resolved. + if (!foundFoo || !foundBar || foundQux) { + throwException(resolvedReferences, "Incorrect resolved references array, quxString should not be archived"); + } + } + } + + static void throwException(Object[] resolvedRefs, String errMsg) throws RuntimeException { + System.out.printf("Resolved References Array Length: %d\n", resolvedRefs.length); + for (Object o : resolvedRefs) { + System.out.println(o); + } + throw new RuntimeException(errMsg); + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022, 2023, 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 8288976 + * @library /test/lib + * @summary Check that the right message is displayed for NoClassDefFoundError exception. + * @requires vm.flagless + * @modules java.base/jdk.internal.misc + * java.management + * @compile C.java + * @run driver Bad_NCDFE_Msg + */ + +import java.io.File; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +public class Bad_NCDFE_Msg { + + public static void main(String args[]) throws Throwable { + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( + "-cp", System.getProperty("test.classes") + File.separator + "pkg", "C"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("java.lang.NoClassDefFoundError: C (wrong name: pkg/C"); + output.shouldHaveExitValue(1); + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/C.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/C.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/C.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/C.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022, 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. + */ + +// class used by test Bad_NCDFE_Msg.java. +package pkg; +public class C { } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public static void main(String args[]) throws Throwable { System.out.println("Regression test for bug 8040018"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("LambdaMath"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("LambdaMath"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Bad length on BootstrapMethods"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class TestBadPackageWithInterface { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", System.getProperty("test.classes"), "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeExit", MyLoader.class.getName()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ // ======= execute test case #1 // Expect a lack of main method, this implies that the class loaded correctly // with an empty bootstrap_methods and did not generate a ClassFormatError. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Duser.language=en", "-Duser.country=US", className); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); @@ -65,7 +65,7 @@ // ======= execute test case #2 // Expect a lack of main method, this implies that the class loaded correctly // with an empty bootstrap_methods and did not generate ClassFormatError. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Duser.language=en", "-Duser.country=US", className); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public static void main(String args[]) throws Throwable { // 1. Test a CONSTANT_Dynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_InvokeDynamic_info - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("CondyUsesIndyBSM"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyUsesIndyBSM"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Indybsm target CallSite method foo"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); @@ -50,7 +50,7 @@ // 2. Test a CONSTANT_InvokeDynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_Dynamic_info - pb = ProcessTools.createJavaProcessBuilder("IndyUsesCondyBSM"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("IndyUsesCondyBSM"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Condybsm"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,16 +42,16 @@ public static void main(String args[]) throws Throwable { // 1. Test a ldc_w instruction can be used with condy's which generate // loadable constants of the following types: byte, char, short, float, integer, boolean. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyUseLDC_W"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyUseLDC_W"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldNotContain("VerifyError"); oa.shouldHaveExitValue(0); // 2. Test ldc2_w of a condy which returns a dynamically generated // float constant, generates a VerifyError. - pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyBadLDC2_W"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyBadLDC2_W"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); oa.shouldContain("CondyBadLDC2_W.F()F @0: ldc2_w"); @@ -59,8 +59,8 @@ // 3. Test a ldc of a condy which returns a dynamically generated // double constant, generates a VerifyError. - pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyBadLDC"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyBadLDC"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); oa.shouldContain("CondyBadLDC.D()D @0: ldc"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,8 @@ public class CondyNewInvokeSpecialTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyNewInvokeSpecial"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyNewInvokeSpecial"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In CondyNewInvokeSpecial method"); oa.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -43,7 +43,7 @@ public static void main(String args[]) throws Throwable { // 1. Test escape analysis of a method that contains // a ldc instruction of a condy whose return type is an array of boolean - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:CompileCommand=dontinline,runtime.condy.TestEscapeThroughInvokeWithCondy::create", "runtime.condy.TestEscapeThroughInvokeWithCondy"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class TestInitException { public static void main(java.lang.String[] unused) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("Example"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("Example"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); // First call stack trace // shouldMatch is used to workaround CODETOOLS-7902686 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/contended/Options.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/contended/Options.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/contended/Options.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/contended/Options.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,59 +40,59 @@ ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=1", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=1", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("must be a multiple of 8"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8184", "-version"); // 8192-8 = 8184 + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8184", "-version"); // 8192-8 = 8184 output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8191", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8191", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("must be a multiple of 8"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8192", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8192", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8193", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8193", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200 + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200 output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ static final String testsrc = System.getProperty("test.src"); public static void runTest(String test, String result) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(test); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(test); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Multiple " + result); output.shouldNotHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/execstack/Testexecstack.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/execstack/Testexecstack.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/execstack/Testexecstack.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/execstack/Testexecstack.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -47,7 +47,7 @@ // Create a new java process for the Test Java/JNI test without // an executeable stack - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "Test", "test-rw"); // Start the process and check the output @@ -56,7 +56,7 @@ // Create a new java process for the Test Java/JNI test with an // executable stack - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "Test", "test-rwx"); // Start the process and check the output @@ -65,7 +65,7 @@ // Create a new java process for the TestMT Java/JNI test with an // executable stack - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "TestMT", "test-rwx"); // Start the process and check the output diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -53,7 +53,7 @@ ClassFileInstaller.writeClassToDisk("P/Test", InMemoryJavaCompiler.compile("P.Test", Test_src), test_classes); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:" + test_classes, "P.Test") .start()).shouldContain("Test Passed") .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,7 +100,7 @@ InMemoryJavaCompiler.compile("GetSysPkg_package.GetSysClass", source); ClassFileInstaller.writeClassToDisk("GetSysPkg_package/GetSysClass", klassbuf); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:bl_dir", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:bl_dir", "--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "GetSysPkgTest", "do_tests"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class HandshakeTimeoutTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createTestJvm( + ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createTestJvm( + ProcessTools.createTestJavaProcessBuilder( "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, "-XX:+SafepointALot", "-XX:+HandshakeALot", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -47,9 +47,9 @@ // Uses executeProcess() instead of executeTestJvm() to avoid passing options // that might generate output on stderr (which should be empty for this test). ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestCheckedReleaseArrayElements"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestCheckedReleaseArrayElements"); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); output.stderrShouldBeEmpty(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/jsig/Testjsig.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jsig/Testjsig.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/jsig/Testjsig.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/jsig/Testjsig.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ String libpath = System.getProperty("java.library.path"); // Create a new java process for the TestJNI Java/JNI test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "TestJNI", "100"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/BiasedLockingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/BiasedLockingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/BiasedLockingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/BiasedLockingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -48,16 +48,16 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseBiasedLocking", - "-Xlog:biasedlocking", - "-XX:BiasedLockingStartupDelay=0", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseBiasedLocking", + "-Xlog:biasedlocking", + "-XX:BiasedLockingStartupDelay=0", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseBiasedLocking", - "-Xlog:biasedlocking=off", - "-XX:BiasedLockingStartupDelay=0", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseBiasedLocking", + "-Xlog:biasedlocking=off", + "-XX:BiasedLockingStartupDelay=0", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,10 +41,10 @@ public static void main(String... args) throws Exception { // (1) - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=info", - "-Xverify:all", - "-Xmx128m", - "BadMap50"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+init=info", + "-Xverify:all", + "-Xmx128m", + "BadMap50"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotHaveExitValue(0); out.shouldContain("Start class verification for:"); @@ -55,21 +55,21 @@ // (2) if (Platform.isDebugBuild()) { - pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=info", - "-Xverify:all", - "-XX:+EagerInitialization", - "-Xmx128m", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+init=info", + "-Xverify:all", + "-XX:+EagerInitialization", + "-Xmx128m", + InnerClass.class.getName()); out = new OutputAnalyzer(pb.start()); out.shouldContain("[Initialized").shouldContain("without side effects]"); out.shouldHaveExitValue(0); } // (3) class+init should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=off", - "-Xverify:all", - "-Xmx128m", - "BadMap50"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+init=off", + "-Xverify:all", + "-Xmx128m", + "BadMap50"); out = new OutputAnalyzer(pb.start()); out.shouldNotHaveExitValue(0); out.shouldNotContain("[class,init]"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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,6 +30,8 @@ * @library /test/lib * @library classes * @build test.Empty + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run driver ClassLoadUnloadTest */ @@ -68,11 +70,14 @@ // Use the same command-line heap size setting as ../ClassUnload/UnloadTest.java static OutputAnalyzer exec(String... args) throws Exception { + String classPath = System.getProperty("test.class.path", "."); + + // Sub-process does not get all the properties automatically, so the test class path needs to be passed explicitly List argsList = new ArrayList<>(); Collections.addAll(argsList, args); - Collections.addAll(argsList, "-Xmn8m", "-Dtest.class.path=" + System.getProperty("test.class.path", "."), - "-XX:+ClassUnloading", ClassUnloadTestMain.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(argsList); + Collections.addAll(argsList, "-Xmn8m", "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", "-XX:+ClassUnloading", "-Dtest.class.path=" + classPath, ClassUnloadTestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(argsList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; @@ -84,7 +89,7 @@ // -Xlog:class+unload=info output = exec("-Xlog:class+unload=info"); - checkFor(output, "[class,unload]", "unloading class"); + checkFor(output, "[class,unload]", "unloading class test.Empty"); // -Xlog:class+unload=off output = exec("-Xlog:class+unload=off"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,17 +60,17 @@ public static void main(String... args) throws Exception { // (1) class+resolve should turn on. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug", - ClassResolutionTestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+resolve=debug", + ClassResolutionTestMain.class.getName()); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); o.shouldContain("[class,resolve] resolve JVM_CONSTANT_MethodHandle"); // (2) class+resolve should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug", - "-Xlog:class+resolve=off", - ClassResolutionTestMain.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+resolve=debug", + "-Xlog:class+resolve=off", + ClassResolutionTestMain.class.getName()); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[class,resolve]"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,20 +51,20 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops=debug", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops", + InnerClass.class.getName()); // No coops logging on info level. analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,8 +40,8 @@ public static void main(String... args) throws Exception { // (1) methodhandles should turn on, no indy, no condy - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles", - "CondyIndy"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles", + "CondyIndy"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[info][methodhandles"); @@ -49,8 +49,8 @@ o.shouldNotContain("[debug][methodhandles,condy"); // (2) methodhandles+condy=debug only - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+condy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles+condy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[info ][methodhandles"); @@ -58,8 +58,8 @@ o.shouldContain("[debug][methodhandles,condy"); // (3) methodhandles+indy=debug only - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+indy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles+indy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[info ][methodhandles"); @@ -67,10 +67,10 @@ o.shouldNotContain("[debug][methodhandles,condy"); // (4) methodhandles, condy, indy all on - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles=info", - "-Xlog:methodhandles+condy=debug", - "-Xlog:methodhandles+indy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles=info", + "-Xlog:methodhandles+condy=debug", + "-Xlog:methodhandles+indy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[info ][methodhandles"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -37,8 +37,8 @@ public class DefaultMethodsTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:defaultmethods=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:defaultmethods=debug", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Slots that need filling:"); output.shouldContain("requires default method processing"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,25 +57,25 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=info", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:exceptions=info", + InternalClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=off", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:exceptions=off", + InternalClass.class.getName()); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(InternalClass.class.getName()); updateEnvironment(pb, "_JAVA_OPTIONS", "-Xlog:exceptions=info"); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(InternalClass.class.getName()); updateEnvironment(pb, "JAVA_TOOL_OPTIONS", "-Xlog:exceptions=info -Xlog:exceptions=off"); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".") - + File.separator + "ExceptionsTest_options_file", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".") + + File.separator + "ExceptionsTest_options_file", + InternalClass.class.getName()); analyzeOutputOn(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ItablesTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ItablesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class ItablesTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:itables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(": Initializing itables for ClassB"); output.shouldContain(": Initializing itable indices for interface "); @@ -53,7 +53,7 @@ output.shouldContain("invokeinterface selected method: receiver-class"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ItablesVtableTest"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:itables=trace", "ItablesVtableTest"); output = new OutputAnalyzer(pb.start()); output.shouldContain("vtable index "); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -29,6 +29,8 @@ * @modules java.base/jdk.internal.misc * @library /test/lib classes * @build test.Empty + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run driver LoaderConstraintsTest */ @@ -60,9 +62,11 @@ List argsList = new ArrayList<>(); Collections.addAll(argsList, args); Collections.addAll(argsList, "-Xmn8m"); - Collections.addAll(argsList, "-Dtest.classes=" + System.getProperty("test.classes",".")); + Collections.addAll(argsList, "-Xbootclasspath/a:."); + Collections.addAll(argsList, "-XX:+UnlockDiagnosticVMOptions"); + Collections.addAll(argsList, "-XX:+WhiteBoxAPI"); Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); - return ProcessTools.createJavaProcessBuilder(argsList); + return ProcessTools.createLimitedTestJavaProcessBuilder(argsList); } public static void main(String... args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ModulesTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -75,7 +75,7 @@ } static OutputAnalyzer run(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,12 +51,12 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=trace", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:monitorinflation=trace", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:monitorinflation=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,19 +40,19 @@ public static void main(String... args) throws Exception { // monitormismatch should turn on. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcomp", - "-XX:+TieredCompilation", - "-Xlog:monitormismatch=info", - "MonitorMismatchHelper"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", + "-XX:+TieredCompilation", + "-Xlog:monitormismatch=info", + "MonitorMismatchHelper"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[monitormismatch] Monitor mismatch in method"); // monitormismatch should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xcomp", - "-XX:+TieredCompilation", - "-Xlog:monitormismatch=off", - "MonitorMismatchHelper"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", + "-XX:+TieredCompilation", + "-Xlog:monitormismatch=off", + "MonitorMismatchHelper"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[monitormismatch]"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,14 +52,14 @@ public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+cpu", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+cpu", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); analyzeOutputForOsCpuLog(output); // PPC64 only uses polling pages when UseSIGTRAP is off. pb = (Platform.isPPC() && Platform.is64bit()) - ? ProcessTools.createJavaProcessBuilder("-Xlog:os", "-XX:-UseSIGTRAP", "-version") - : ProcessTools.createJavaProcessBuilder("-Xlog:os", "-version"); + ? ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os", "-XX:-UseSIGTRAP", "-version") + : ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os", "-version"); output = new OutputAnalyzer(pb.start()); analyzeOutputForOsLog(output); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,30 +39,30 @@ public static void main(String... args) throws Exception { // -Xlog:protectiondomain=trace - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=trace", - "-Xmx128m", - "-Djava.security.manager=allow", - Hello.class.getName(), "security_manager"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=trace", + "-Xmx128m", + "-Djava.security.manager=allow", + Hello.class.getName(), "security_manager"); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldContain("[protectiondomain] Checking package access") .shouldContain("[protectiondomain] adding protection domain for class"); // -Xlog:protectiondomain=debug - pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=debug", - "-Xmx128m", - "-Djava.security.manager=allow", - Hello.class.getName(), "security_manager"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=debug", + "-Xmx128m", + "-Djava.security.manager=allow", + Hello.class.getName(), "security_manager"); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldContain("[protectiondomain] Checking package access") .shouldNotContain("[protectiondomain] adding protection domain for class"); // -Xlog:protectiondomain=debug - pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=trace", - "-Xmx128m", - "-Djava.security.manager=disallow", - Hello.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=trace", + "-Xmx128m", + "-Djava.security.manager=disallow", + Hello.class.getName()); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldNotContain("[protectiondomain] Checking package access") diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,12 +51,12 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=info", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint+cleanup=info", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint+cleanup=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/SafepointTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/SafepointTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,8 @@ public class SafepointTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint=trace", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint=trace", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Safepoint synchronization initiated"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/StackWalkTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/StackWalkTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,12 +49,12 @@ } public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stackwalk=debug", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stackwalk=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,12 +52,12 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:startuptime", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:startuptime=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -56,11 +56,11 @@ public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); analyzeOutputForInfoLevel(output); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread=debug", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread=debug", "-version"); output = new OutputAnalyzer(pb.start()); analyzeOutputForDebugLevel(output); output.reportDiagnosticSummary(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VMOperationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VMOperationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,10 +38,10 @@ public class VMOperationTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vmoperation=debug", - "-Xmx128m", - "-Xms128m", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vmoperation=debug", + "-Xmx128m", + "-Xms128m", + InternalClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("VM_Operation ("); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VerificationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VerificationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,17 +63,17 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=info", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=info", + InternalClass.class.getName()); analyzeOutputOn(pb, true); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=off", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=off", + InternalClass.class.getName()); analyzeOutputOff(pb); // logging level 'debug' should output stackmaps and bytecode data. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=debug", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=debug", + InternalClass.class.getName()); analyzeOutputOn(pb, false); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VtablesTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/VtablesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -44,7 +44,7 @@ public class VtablesTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vtables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("copy vtable from ClassA to ClassB"); output.shouldContain("Initializing: ClassB"); @@ -55,7 +55,7 @@ output.shouldContain("NOT overriding with p2.D.nooverride()V"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); output = new OutputAnalyzer(pb.start()); output.shouldContain("transitive overriding superclass "); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -118,7 +118,7 @@ public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xmn8m", "-Xlog:library=info", "-Djava.library.path=" + System.getProperty("java.library.path"), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -328,7 +328,7 @@ args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,7 +44,7 @@ public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/ReserveMemory.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReserveMemory.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/memory/ReserveMemory.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/memory/ReserveMemory.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -48,7 +48,7 @@ // expected to crash WhiteBox.getWhiteBox().readReservedMemory(); } else { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/MethodAccessReadTwice.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/MethodAccessReadTwice.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/MethodAccessReadTwice.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/MethodAccessReadTwice.java 2025-01-04 20:25:18.000000000 +0000 @@ -29,8 +29,8 @@ * after the module read edge is added. * @compile ModuleLibrary.java * p2/c2.java - * p5/c5.java - * p7/c7.java + * p5/c5.jasm + * p7/c7.jasm * @run main/othervm MethodAccessReadTwice */ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/p5/c5.jasm openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p5/c5.jasm --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/p5/c5.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p5/c5.jasm 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, Google LLC. 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 input for the fix for JDK-8174954, which checks for an expected + * IllegalAccessError when the parameter type of an invokedynamic is + * inaccessible. + * + * The test assumes that given the string concatenation expression "" + param, + * javac generates an invokedynamic that uses the specific type of param. The + * fix for JDK-8273914 make javac eagerly convert param to a String before + * passing it to the invokedynamic call, which avoids the accessibility issue + * the test is trying to exercise. + * + * This jasm file contains the bytecode javac generated before the fix for + * JDK-8273914, to continue to exercise the invokedynamic behaviour that + * JDK-8174954 is testing. + */ + +package p5; + +super public class c5 + version 61:0 +{ + public Method "":"()V" + stack 1 locals 1 + { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; + } + public Method method5:"(Lp2/c2;)V" + stack 2 locals 2 + { + getstatic Field java/lang/System.out:"Ljava/io/PrintStream;"; + aload_1; + invokedynamic InvokeDynamic REF_invokeStatic:Method java/lang/invoke/StringConcatFactory.makeConcatWithConstants:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;":makeConcatWithConstants:"(Lp2/c2;)Ljava/lang/String;" { + String "In c5\'s method5 with param = " + }; + invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V"; + return; + } + public Method methodAddReadEdge:"(Ljava/lang/Module;)V" + stack 2 locals 2 + { + ldc class c5; + invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/Module;"; + aload_1; + invokevirtual Method java/lang/Module.addReads:"(Ljava/lang/Module;)Ljava/lang/Module;"; + pop; + return; + } + + public static final InnerClass Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles; + +} // end Class c5 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/p7/c7.jasm openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p7/c7.jasm --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/AccessCheck/p7/c7.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/AccessCheck/p7/c7.jasm 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021, Google LLC. 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 input for the fix for JDK-8174954, which checks for an expected + * IllegalAccessError when the parameter type of an invokedynamic is + * inaccessible. + * + * The test assumes that given the string concatenation expression "" + param, + * javac generates an invokedynamic that uses the specific type of param. The + * fix for JDK-8273914 make javac eagerly convert param to a String before + * passing it to the invokedynamic call, which avoids the accessibility issue + * the test is trying to exercise. + * + * This jasm file contains the bytecode javac generated before the fix for + * JDK-8273914, to continue to exercise the invokedynamic behaviour that + * JDK-8174954 is testing. + */ + +package p7; + +super public class c7 + version 61:0 +{ + public Method "":"()V" + stack 1 locals 1 + { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; + } + public Method method7:"(Lp2/c2;Ljava/lang/Module;)V" + stack 3 locals 4 + { + try t0; + getstatic Field java/lang/System.out:"Ljava/io/PrintStream;"; + aload_1; + invokedynamic InvokeDynamic REF_invokeStatic:Method java/lang/invoke/StringConcatFactory.makeConcatWithConstants:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;":makeConcatWithConstants:"(Lp2/c2;)Ljava/lang/String;" { + String "In c7\'s method7 with param = " + }; + invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V"; + new class java/lang/RuntimeException; + dup; + ldc String "c7 failed to throw expected IllegalAccessError"; + invokespecial Method java/lang/RuntimeException."":"(Ljava/lang/String;)V"; + athrow; + endtry t0; + catch t0 java/lang/IllegalAccessError; + stack_frame_type stack1; + stack_map class java/lang/IllegalAccessError; + astore_3; + aload_0; + aload_2; + invokevirtual Method methodAddReadEdge:"(Ljava/lang/Module;)V"; + try t1; + getstatic Field java/lang/System.out:"Ljava/io/PrintStream;"; + aload_1; + invokedynamic InvokeDynamic REF_invokeStatic:Method java/lang/invoke/StringConcatFactory.makeConcatWithConstants:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;":makeConcatWithConstants:"(Lp2/c2;)Ljava/lang/String;" { + String "In c7\'s method7 with param = " + }; + invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V"; + endtry t1; + goto L61; + catch t1 java/lang/IllegalAccessError; + stack_frame_type stack1; + stack_map class java/lang/IllegalAccessError; + astore_3; + new class java/lang/RuntimeException; + dup; + aload_3; + invokevirtual Method java/lang/IllegalAccessError.getMessage:"()Ljava/lang/String;"; + invokedynamic InvokeDynamic REF_invokeStatic:Method java/lang/invoke/StringConcatFactory.makeConcatWithConstants:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;":makeConcatWithConstants:"(Ljava/lang/String;)Ljava/lang/String;" { + String "Unexpected IllegalAccessError: " + }; + invokespecial Method java/lang/RuntimeException."":"(Ljava/lang/String;)V"; + athrow; + L61: stack_frame_type same; + return; + } + public Method methodAddReadEdge:"(Ljava/lang/Module;)V" + stack 2 locals 2 + { + ldc class c7; + invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/Module;"; + aload_1; + invokevirtual Method java/lang/Module.addReads:"(Ljava/lang/Module;)Ljava/lang/Module;"; + pop; + return; + } + + public static final InnerClass Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles; + +} // end Class c7 diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -37,7 +37,7 @@ public class ClassLoaderNoUnnamedModuleTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=java.base", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -43,7 +43,7 @@ // bogus for that property. But, since the property is ignored no exception is // thrown. public static void testProperty(String prop, String value) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-D" + prop + "=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(" version "); @@ -62,7 +62,7 @@ public static void testOption(boolean shouldVMFail, String option, String value, String prop, String result) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( option + "=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldVMFail) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ // Test that multiple --add-modules options are cumulative, not last one wins. // An exception should be thrown because module i_dont_exist doesn't exist. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=i_dont_exist", "--add-modules=java.base", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("FindException"); @@ -51,7 +51,7 @@ // Test that the last --limit-modules is the only one recognized. No exception // should be thrown. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--limit-modules=i_dont_exist", "--limit-modules=java.base", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,77 +41,77 @@ public static void main(String[] args) throws Exception { // Test that a warning is not issued for extraneous jdk.module properties. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.ignored", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addmods", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in '.'. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.limitmods.", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in '='. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addexports=", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in ".stuff" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addreads.stuff", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in "=stuff" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.path=stuff", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in ".=" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.upgrade.path.=xx", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in "." - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.patch.3=xx", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning can be suppressed for module related properties that get ignored. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djdk.module.addmods", "-XX:-PrintWarnings", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is not issued for properties of the form "jdk.module.main" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.main.ignored", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for module related properties specified using _JAVA_OPTIONS. - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintWarnings", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintWarnings", "-version"); Map env = pb.environment(); env.put("_JAVA_OPTIONS", "-Djdk.module.addreads"); output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -71,7 +71,7 @@ // Sanity check that the test, jdk.test/test/Main.java // runs without error. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-p", MODS_DIR.toString(), "-m", "jdk.test/test.Main"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ // loaders (boot, application, platform). Thus there is // not a need to walk those lists at a GC safepoint since // those loaders never die. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "-version"); @@ -85,7 +85,7 @@ // m1x's module readability list and package p2's exportability should // not be walked at a GC safepoint since both modules are defined to // the same loader and thus have the exact same life cycle. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "ModuleSameCLMain"); @@ -99,7 +99,7 @@ // m1x's module readability list and package p2's exportability list must // be walked at a GC safepoint since both modules are defined to non-builtin // class loaders which could die and thus be unloaded. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "ModuleNonBuiltinCLMain"); @@ -116,7 +116,7 @@ // m3x is defined to the system class loader, m2x's module readability // list does not have to be walked at a GC safepoint, but package p2's // exportability list does. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.system.class.loader=CustomSystemClassLoader", "-Xbootclasspath/a:.", "-Xlog:module=trace", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -72,7 +72,7 @@ // Check that jdk.test/test.MainGC walks module jdk.test's // reads list and walks the exports list for package test, // defined in module jdk.test, during a GC. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-Xlog:module=trace", "-p", MODS_DIR.toString(), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ InMemoryJavaCompiler.compile("java.beans.Encoder", source2, "--patch-module=java.desktop"), "mods2/java.desktop"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.naming=mods/java.naming", "--patch-module=java.desktop=mods2/java.desktop", "PatchModule2DirsMain", "javax.naming.spi.NamingManager", "java.beans.Encoder"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ // Case 1: Test that --patch-module and -Xshare:dump are compatible String filename = "patch_module.jsa"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -69,7 +69,7 @@ InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), System.getProperty("test.classes")); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -84,7 +84,7 @@ // Case 3a: Test CDS dumping with jar file in --patch-module BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager"); String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -98,7 +98,7 @@ .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); // Case 3b: Test CDS run with jar file in --patch-module - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:auto", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -64,7 +64,7 @@ String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); String classList = "javanaming.list"; - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "--patch-module=java.naming=" + moduleJar, "PatchModuleMain", BOOT_CLASS.replace('/', '.')); @@ -98,7 +98,7 @@ moduleJar = BasicJarBuilder.getTestJar("javasql.jar"); classList = "javasql.list"; - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "--patch-module=java.sql=" + moduleJar, "PatchModuleMain", PLATFORM_CLASS.replace('/', '.')); @@ -130,7 +130,7 @@ moduleJar = BasicJarBuilder.getTestJar("hello.jar"); classList = "hello.list"; - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "-Xbootclasspath/a:" + moduleJar, "Hello"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -37,7 +37,7 @@ // The VM should exit initialization if java.base is specified // more than once to --patch-module. public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.base=javabase_dir", "--patch-module=java.base=javabase_dir", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ // if --patch-module is specified with the same module more than once. public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=module_one=module_one_dir", "--patch-module=module_one=module_one_dir", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,7 +51,7 @@ InMemoryJavaCompiler.compile("java.lang.NewClass", source, "--patch-module=java.base"), "mods/java.base"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.base=mods/java.base", "PatchModuleMain", "java.lang.NewClass"); new OutputAnalyzer(pb.start()) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,7 +51,7 @@ InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -76,7 +76,7 @@ System.getProperty("test.classes")); // Supply --patch-module with the name of the jar file for the module java.naming. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=" + moduleJar, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=" + moduleJar, "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -92,13 +92,13 @@ // Supply --patch-module with the name of the jar file for the module java.naming. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=" + - moduleJar + - File.pathSeparator + - System.getProperty("test.classes") + "/mods/java.naming", - "PatchModule2DirsMain", - "javax.naming.spi.NamingManager1", - "javax.naming.spi.NamingManager2"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=" + + moduleJar + + File.pathSeparator + + System.getProperty("test.classes") + "/mods/java.naming", + "PatchModule2DirsMain", + "javax.naming.spi.NamingManager1", + "javax.naming.spi.NamingManager2"); new OutputAnalyzer(pb.start()) .shouldContain("I pass one!") diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -53,7 +53,7 @@ InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", "-Xlog:class+load=info", "PatchModuleMain", "javax.naming.spi.NamingManager"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -77,7 +77,7 @@ InMemoryJavaCompiler.compile("PatchModuleTraceCL_pkg.ItIsI", source), "xbcp"); - pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:xbcp", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:xbcp", "-Xlog:class+load=info", "PatchModuleMain", "PatchModuleTraceCL_pkg.ItIsI"); output = new OutputAnalyzer(pb.start()); // -Xbootclasspath/a case. diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -86,7 +86,7 @@ Files.delete(Paths.get(System.getProperty("test.classes") + File.separator + "p2" + File.separator + "Vis2_B.class")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.base=mods2/java.base", "--add-exports=java.base/p2=ALL-UNNAMED", "Vis2_A") diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,7 +73,7 @@ ClassFileInstaller.writeClassToDisk("Vis3_A", InMemoryJavaCompiler.compile("Vis3_A", Vis3_A_src), System.getProperty("test.classes")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "Vis3_A") .start()) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -104,7 +104,7 @@ Files.delete(Paths.get(System.getProperty("test.classes") + File.separator + "p2" + File.separator + "Vis1_C.class")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:nonexistent.jar", "-Xbootclasspath/a:mods1", "Vis1_A") diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/AvailableProcessors.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/AvailableProcessors.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/AvailableProcessors.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/AvailableProcessors.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -69,8 +69,8 @@ // Get the java command we want to execute // Enable logging for easier failure diagnosis ProcessBuilder master = - ProcessTools.createJavaProcessBuilder("-Xlog:os=trace", - "AvailableProcessors"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os=trace", + "AvailableProcessors"); int[] expected = new int[] { 1, available/2, available-1, available }; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -179,7 +179,7 @@ switch (args[0]) { case "PATCH-ENABLED": { finalargs.add(TestMain.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -216,7 +216,7 @@ finalargs.add("-XX:-THPStackMitigation"); finalargs.add(TestMain.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java 2025-01-04 20:25:18.000000000 +0000 @@ -146,7 +146,7 @@ boolean useTHP = allOptions.contains("-XX:+UseTransparentHugePages"); System.out.println("useLP: " + useLP + " useTHP: " + useTHP); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(allOptions.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(allOptions.toArray(new String[0])); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.reportDiagnosticSummary(); HugePageConfiguration configuration = HugePageConfiguration.readFromOS(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java 2025-01-04 20:25:18.000000000 +0000 @@ -48,7 +48,7 @@ finalargs.addAll(Arrays.asList(defaultArgs)); finalargs.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( new String[] {"-Xlog:pagesize", "-Xmx64M", "-version"}); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTimerSlack.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTimerSlack.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTimerSlack.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTimerSlack.java 2025-01-04 20:25:18.000000000 +0000 @@ -42,7 +42,7 @@ // Check the timer slack value is not printed by default { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "TestTimerSlack$TestMain"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -52,7 +52,7 @@ // Check the timer slack value is not printed when explicitly disabled { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=-1", "TestTimerSlack$TestMain"); @@ -64,7 +64,7 @@ // Check the timer slack value is good when system-wide default is requested { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=0", "TestTimerSlack$TestMain"); @@ -82,7 +82,7 @@ // Check the timer slack value is accepted by all threads for (int slack : new int[] {1, 10, 100, 1000, 10000, 100000, 1000000}) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=" + slack, "TestTimerSlack$TestMain"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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,6 +28,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" + * @requires os.arch != "ppc64le" * @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log TestTracePageSizes */ @@ -51,6 +52,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" + * @requires os.arch != "ppc64le" * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache -XX:+UseLargePages TestTracePageSizes @@ -63,6 +65,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" + * @requires os.arch != "ppc64le" * @requires vm.gc.G1 * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseG1GC TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseG1GC -XX:+UseLargePages TestTracePageSizes @@ -75,6 +78,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" + * @requires os.arch != "ppc64le" * @requires vm.gc.Parallel * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseParallelGC TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseParallelGC -XX:+UseLargePages TestTracePageSizes @@ -87,6 +91,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" + * @requires os.arch != "ppc64le" * @requires vm.gc.Serial * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseSerialGC TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:+UseSerialGC -XX:+UseLargePages TestTracePageSizes @@ -248,12 +253,6 @@ throw new SkippedException("Kernel older than 3.8 - skipping this test."); } - // For similar reasons, we skip the test on ppc platforms, since there the smaps - // format may follow a different logic. - if (Platform.isPPC()) { - throw new SkippedException("PPC - skipping this test."); - } - // Parse /proc/self/smaps to compare with values logged in the VM. parseSmaps(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTrimNative.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTrimNative.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestTrimNative.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestTrimNative.java 2025-01-04 20:25:18.000000000 +0000 @@ -167,7 +167,7 @@ } private static OutputAnalyzer runTestWithOptions(String[] extraOptions, String[] programOptions) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(prepareOptions(extraOptions, programOptions)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(prepareOptions(extraOptions, programOptions)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,10 +42,10 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-Xlog:os=trace", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+UseCpuAllocPath", - "-version"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os=trace", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+UseCpuAllocPath", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/records/RedefineRecord.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/records/RedefineRecord.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/records/RedefineRecord.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/records/RedefineRecord.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -102,7 +102,7 @@ return; } if (argv.length == 1 && argv[0].equals("runtest")) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,7 @@ if (argv.length == 1 && argv[0].equals("runtest")) { String[] javaArgs1 = { "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", "RedefinePermittedSubclass"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs1); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs1); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("processing of -javaagent failed"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -108,7 +108,7 @@ if (argv.length == 1 && argv[0].equals("runtest")) { String[] javaArgs1 = { "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", "RedefineSealedClass"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs1); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs1); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("processing of -javaagent failed"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack001.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack001.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack001.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack001.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack001. + * VM testbase keywords: [stress, quick, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * Provoke StackOverflowError by infinite recursion in Java method, + * intercept the exception try to make one more invocation. + * COMMENTS + * Kestrel for Solaris_JDK_1.3-b10 crashes while trying to execute + * this test with Client HS VM. + * See lots of bugs concerning similar failures: + * Evaluated: + * 4217960 [native stack overflow bug] reflection test causes crash + * Accepted: + * 4285716 native stack overflow causes crash on Solaris + * 4281578 Second stack overflow crashes HotSpot VM + * Closed (duplicate): + * 4027933 Native stack overflows not detected or handled correctly + * 4134353 (hpi) sysThreadCheckStack is a no-op on win32 + * 4185411 Various crashes when using recursive reflection. + * 4167055 infinite recursion in FindClass + * 4222359 Infinite recursion crashes jvm + * Closed (will not fix): + * 4231968 StackOverflowError in a native method causes Segmentation Fault + * 4254634 println() while catching StackOverflowError causes hotspot VM crash + * 4302288 the second stack overflow causes Classic VM to exit on win32 + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack001 + */ + +public class Stack001 { + public static void main(String[] args) { + Stack001 test = new Stack001(); + test.recurse(0); + System.out.println("Maximal depth: " + test.maxdepth); + } + + private int maxdepth; + + private void recurse(int depth) { + maxdepth = depth; + try { + recurse(depth + 1); + } catch (StackOverflowError | OutOfMemoryError e) { + if (maxdepth == depth) { + recurse(depth + 1); + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack002.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack002.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack002.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack002.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack002. + * VM testbase keywords: [stress, quick, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * Provoke StackOverflowError by infinite recursion in Java method, + * intercept the exception and continue to invoke that method until + * the test exceeds timeout, or until Java VM crashes. + * COMMENTS + * I believe that the test causes HS crashes due to the following bug: + * 4330318 (P2/S2) NSK test fails as An irrecoverable stack overflow + * See also bugs (lots of bugs!): + * Evaluated: + * 4217960 [native stack overflow bug] reflection test causes crash + * Accepted: + * 4285716 native stack overflow causes crash on Solaris + * 4281578 Second stack overflow crashes HotSpot VM + * Closed (duplicate): + * 4027933 Native stack overflows not detected or handled correctly + * 4134353 (hpi) sysThreadCheckStack is a no-op on win32 + * 4185411 Various crashes when using recursive reflection. + * 4167055 infinite recursion in FindClass + * 4222359 Infinite recursion crashes jvm + * Closed (will not fix): + * 4231968 StackOverflowError in a native method causes Segmentation Fault + * 4254634 println() while catching StackOverflowError causes hotspot VM crash + * 4302288 the second stack overflow causes Classic VM to exit on win32 + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack002 + */ + +public class Stack002 { + static final long timeout = 10000; // 10 seconds + + public static void main(String[] args) { + Tester tester = new Tester(); + Timer timer = new Timer(tester); + timer.start(); + tester.start(); + while (timer.isAlive()) + try { + timer.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + // if (tester.isAlive()) +// return 2; + System.out.println("Maximal depth: " + tester.maxdepth); + } + + private static class Tester extends Thread { + int maxdepth; + + public Tester() { + maxdepth = 0; + } + + public void run() { + recurse(0); + } + + void recurse(int depth) { + maxdepth = depth; + try { + recurse(depth + 1); +// } catch (StackOverflowError e) { +// +// OutOfMemoryError is also eligible to indicate stack overflow: +// + } catch (StackOverflowError | OutOfMemoryError e) { + +/*** + *** Originally, I supposed that VM crashes because of unexpected + *** native stack overflow (println() invokes native method). + *** However, I found that HS 1.3 and HS 2.0 crash even on + *** invocation of Java (not native) method. + *** + out.println("StackOverflowError, depth=" + depth); + ***/ + recurse(depth + 1); + } + } + } + + private static class Timer extends Thread { + private Tester tester; + + public Timer(Tester tester) { + this.tester = tester; + } + + public void run() { + long started; + started = System.currentTimeMillis(); + while (System.currentTimeMillis() - started < timeout) + ; /*** + *** The test hangs on JDK 1.2.2 Classic VM if sleep() is invoked. + *** + try { + this.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(tester.out); + return; + }; + ***/ + tester.stop(); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack003.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack003.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack003.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack003.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack003. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invoking static recursive method for the given fixed depth + * of recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 100 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is twice that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes all HS versions (2.0, 1.3, 1.4) on all + * platforms (Win32, Solaris, Linux) in all execution modes + * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which + * I had tryied it. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack003 + */ + +public class Stack003 { + final static int ITERATIONS = 100; + final static int INCREMENT = 100; + + public static void main(String[] args) { + + int depth; + for (depth = 1; ; depth += INCREMENT) { + try { + recurse(depth); + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + depth); + for (int i = 0; i < ITERATIONS; i++) { + try { + recurse(2 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError err) { + // OK. + } + } + } + + static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack004.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack004.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack004.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack004.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @key stress + * + * @summary converted from VM testbase nsk/stress/stack/stack004. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invoking final static recursive method for the given fixed + * depth of recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 100 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is twice that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes all HS versions (2.0, 1.3, 1.4) on all + * platforms (Win32, Solaris, Linux) in all execution modes + * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which + * I had tryied it. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack004 + */ + +public class Stack004 { + public static void main(String[] args) { + Stack004 test = new Stack004(); + test.doRun(); + } + + public void doRun() { + int depth; + for (depth = 100; ; depth += 100) { + try { + recurse(depth); + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + depth); + for (int i = 0; i < 100; i++) { + try { + recurse(2 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError err) { + // OK. + } + } + } + + final static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack005.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack005.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack005.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack005.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack005. + * VM testbase keywords: [stress, quick, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invoking final recursive method for the given fixed depth of + * recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 100 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is twice that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes all HS versions (2.0, 1.3, 1.4) on all + * platforms (Win32, Solaris, Linux) in all execution modes + * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which + * I had tryied it. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack005 + */ + +public class Stack005 { + public static void main(String[] args) { + Stack005 test = new Stack005(); + int depth; + for (depth = 100; ; depth += 100) { + try { + test.recurse(depth); + } catch (StackOverflowError | OutOfMemoryError soe) { + break; + } + } + System.out.println("Max. depth: " + depth); + for (int i = 0; i < 100; i++) { + try { + test.recurse(2 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError err) { + // OK. + } + } + } + + final void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack006.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack006.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack006.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack006.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack006. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invoking virtual recursive method for the given fixed depth + * of recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 100 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is twice that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes all HS versions (2.0, 1.3, 1.4) on all + * platforms (Win32, Solaris, Linux) in all execution modes + * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which + * I had tryied it. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack006 + */ + +public class Stack006 implements Stack006i { + public static void main(String[] args) { + Stack006i test = new Stack006(); + int depth; + for (depth = 100; ; depth += 100) { + try { + test.recurse(depth); + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + depth); + for (int i = 0; i < 100; i++) { + try { + test.recurse(2 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError err) { + // OK. + } + } + } + + public void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} + +interface Stack006i { + void recurse(int depth); +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack007.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack007.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack007.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack007.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack007. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invoking synchronized virtual recursive method for the given + * fixed depth of recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 10000 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is 10 times that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes HS versions 1.3 and 1.4 on Win32, Solaris, + * and Linux platforms in all execution modes. However, it passes + * against HS 2.0 on Win32 platform. + * See also the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack007 + */ + +public class Stack007 implements Stack007i { + final static int ITERATIONS = 1000; + final static int INCREMENT = 100; + + public static void main(String[] args) { + Stack007i test = new Stack007(); + int depth; + for (depth = 100; ; depth += INCREMENT) { + try { + test.recurse(depth); + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + depth); + for (int i = 0; i < ITERATIONS; i++) { + try { + test.recurse(10 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError err) { + // OK. + } + } + } + + public synchronized void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} + +interface Stack007i { + void recurse(int depth); +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack008.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack008.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack008.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack008.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack008. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the same thread + * by invocations via reflection. Recursive method is invoked for + * the given fixed depth of recursion (though, for a large depth). + * This test makes measures a number of recursive invocations + * before 1st StackOverflowError, and then tries to reproduce + * such StackOverflowError 100 times -- each time by trying to + * invoke the same recursive method for the given fixed depth + * of invocations (which is twice that depth just measured). + * The test is deemed passed, if VM have not crashed. + * COMMENTS + * This test crashes all HS versions (2.0, 1.3, 1.4) on Solaris, + * and crashes HS 2.0 on win32. However, it passes against HS 1.3 + * and 1.4 on Win32. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * The stack size is too small to run on systems with > 4K page size. + * Making it bigger could cause timeouts on other platform. + * + * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) + * @run main/othervm/timeout=900 -Xss200K Stack008 + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class Stack008 { + public static void main(String[] args) { + int depth; + // + // Measure maximal recursion depth until stack overflow: + // + for (depth = 100; ; depth += 100) { + try { + invokeRecurse(depth); + } catch (Throwable exception) { + Throwable target = getTargetException(exception); + if ((target instanceof StackOverflowError) || + (target instanceof OutOfMemoryError)) + break; // OK. + target.printStackTrace(); + throw new RuntimeException(exception); + } + } + System.out.println("Max. depth: " + depth); + // + // Provoke stack overflow multiple times: + // + for (int i = 0; i < 100; i++) { + try { + invokeRecurse(2 * depth); +// System.out.println("?"); + } catch (Throwable exception) { + Throwable target = getTargetException(exception); + if ((target instanceof StackOverflowError) || + (target instanceof OutOfMemoryError)) + continue; // OK. + target.printStackTrace(); + throw new RuntimeException(exception); + } + } + } + + private static Throwable getTargetException(Throwable exception) { + Throwable target; + // + // Unwrap deep chain of exceptions: + // + for ( + target = exception; + target instanceof InvocationTargetException; + target = ((InvocationTargetException) target).getTargetException() + ) + ; + return target; + } + + static Method method = null; + static Stack008 instance = null; + static Object params[] = null; + + private static void invokeRecurse(int depth) throws Exception { + if (method == null) { + // + // Optimization trick: allocate once, use everywhere. + // + instance = new Stack008(); + method = Stack008.class.getMethod("recurse"); + params = new Object[]{}; + } + // + // Note, that the same instance.depth is used in all invocations: + // + instance.depth = depth; + method.invoke(instance, params); + } + + int depth = 0; + + public void recurse() throws Exception { + if (depth > 0) { + // + // Self-invoke via reflection: + // + invokeRecurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack009.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack009.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack009.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack009.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack009. + * VM testbase keywords: [stress, quick, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * The test provokes second stack overflow from within the + * stack overflow handler. + * This test measures a number of recursive invocations until + * StackOverflowError, and then tries to make an invocation + * for the fixed invocations depth from within the "catch" + * block just caught the 1st stack overflow. The depth of new + * invocations is 10 times that depth seen at the 1st stack + * overflow; so that another stack overflow occurs. + * The test is deemed passed, if VM have not crashed, and + * if there is no exception thrown other than due to stack + * overflow. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on Win32 + * and Solaris platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack009 + */ + +public class Stack009 { + public static void main(String[] args) { + for (int depth = 100; ; depth += 100) { + try { + recurse(depth); + } catch (StackOverflowError | OutOfMemoryError error1) { + + System.out.println("Max. depth: " + depth); + + try { + recurse(10 * depth); + System.out.println("?"); + } catch (StackOverflowError | OutOfMemoryError error2) { + // ignore + } + break; + } + } + } + + static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack010.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack010.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack010.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack010.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack010. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking static recursive method for the given + * fixed depth of recursion (though, for a large depth). + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, 1.4 on Win32 and Solaris + * platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack010 + */ + +public class Stack010 extends Thread { + final static int THREADS = 1; + final static int CYCLES = 1; + + public static void main(String[] args) { + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 10; ; depth += 10) { + try { + recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack010 threads[] = new Stack010[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack010(); + threads[i].depthToTry = 100 * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were not thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + int depthToTry = 0; + Throwable thrown = null; + + public void run() { + for (int i = 0; i < CYCLES; i++) { + try { + System.out.println("depth = " +depthToTry); + recurse(depthToTry); + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } + + static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack011.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack011.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack011.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack011.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack011. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking final static recursive method for the + * given fixed depth of recursion (though, for a large depth). + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, 1.4 on Win32 and Solaris + * platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack011 + */ + +public class Stack011 extends Thread { + final static int THREADS = 10; + final static int CYCLES = 10; + + public static void main(String[] args) { + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 10; ; depth += 10) { + try { + recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError soe) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack011 threads[] = new Stack011[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack011(); + threads[i].depthToTry = 10 * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were not thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + int depthToTry = 0; + Throwable thrown = null; + + public void run() { + for (int i = 0; i < CYCLES; i++) { + try { + recurse(depthToTry); + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } + + final static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack012.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack012.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack012.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack012.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack012. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking final recursive method for the given + * fixed depth of recursion (though, for a large depth). + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 1.3, 1.4 on Win32, and HS versions + * 2.0, 1.3, and 1.4 on Solaris. However, it passes against HS 2.0 + * on Win32. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack012 + */ + +public class Stack012 extends Thread { + final static int THREADS = 10; + final static int CYCLES = 10; + + public static void main(String[] args) { + Stack012 test = new Stack012(); + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 10; ; depth += 10) { + try { + test.recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack012 threads[] = new Stack012[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack012(); + threads[i].depthToTry = 10 * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were not thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + int depthToTry = 0; + Throwable thrown = null; + + public void run() { + for (int i = 0; i < CYCLES; i++) { + try { + this.recurse(depthToTry); + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } + + final void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack013.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack013.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack013.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack013.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack013. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking virtual recursive method for the given + * fixed depth of recursion (though, for a large depth). + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on both Win32 + * and Solaris platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack013 + */ + +public class Stack013 extends Stack013i { + final static int THREADS = 10; + final static int CYCLES = 10; + + public static void main(String[] args) { + Stack013i test = new Stack013(); + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 10; ; depth += 10) { + try { + test.recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack013i threads[] = new Stack013i[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack013(); + threads[i].depthToTry = 10 * maxDepth; + threads[i].cycles = CYCLES; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} + +abstract class Stack013i extends Thread { + // + // Pure virtual method: + // + abstract void recurse(int depth); + + Throwable thrown = null; + int depthToTry; + int cycles; + + public void run() { + // + // Provoke multiple stack overflows: + // + for (int i = 0; i < cycles; i++) { + try { + recurse(depthToTry); + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack014.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack014.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack014.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack014.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack014. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking synchronized virtual recursive method + * for the given fixed depth of recursion (though, for a large + * depth). Note however, that different threads are not actual + * synchronized, because different instances having the recursive + * method are used. + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on Solaris. + * However, it passes against all these HS versions on Win32. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack014 + */ + +public class Stack014 extends Stack014i { + final static int THREADS = 10; + final static int CYCLES = 10; + + public static void main(String[] args) { + Stack014i test = new Stack014(); + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 10; ; depth += 10) { + try { + test.recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack014i threads[] = new Stack014i[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack014(); + threads[i].depthToTry = 10 * maxDepth; + threads[i].cycles = CYCLES; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + synchronized void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } +} + +abstract class Stack014i extends Thread { + // + // Pure virtual method: + // + abstract void recurse(int depth); + + Throwable thrown = null; + int depthToTry; + int cycles; + + public void run() { + // + // Provoke multiple stack overflows: + // + for (int i = 0; i < cycles; i++) { + try { + recurse(depthToTry); + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack015.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack015.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack015.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack015.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack015. + * VM testbase keywords: [stress, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows in the multiple + * threads -- by invoking synchronized virtual recursive method + * for the given fixed depth of recursion from within another + * recursive method already deeply invoked. + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * in 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on Solaris. + * However, it passes against all these HS versions on Win32. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires vm.opt.DeoptimizeALot != true + * @run main/othervm/timeout=900 Stack015 + */ + +public class Stack015 extends Stack015i { + final static int THREADS = 10; + final static int CYCLES = 10; + final static int STEP = 10; + final static int RESERVE = 10; + + public static void main(String[] args) { + // + // The test will invoke the particular Stack015.recurse() + // method via abstract test.recurse() invocations. + // + Stack015i test = new Stack015(); + Stack015i.test = test; + + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (int depth = 0; ; depth += STEP) { + try { + test.recurse(depth); + maxDepth = depth; + } catch (StackOverflowError | OutOfMemoryError err) { + break; + } + } + System.out.println("Max. depth: " + maxDepth); + + // + // Execute multiple threads repeatedly provoking stack overflows: + // + Stack015i threads[] = new Stack015i[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack015(); + threads[i].depthToTry = RESERVE * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + synchronized void syncRecurse(int depth) { + if (depth > 0) { + syncRecurse(depth - 1); + } + } +} + +abstract class Stack015i extends Thread { + // + // Pure virtual method: + // + abstract void syncRecurse(int depth); + + void recurse(int depth) { + // + // Stack overflow must occur here: + // + syncRecurse(Stack015.STEP); + // + // If no stack overflow occured, try again with deeper stack: + // + if (depth > 0) { + recurse(depth - 1); + } + } + + Throwable thrown = null; + int depthToTry; + + static Stack015i test; + + public void run() { + // + // Provoke multiple stack overflows: + // + for (int i = 0; i < Stack015.CYCLES; i++) { + try { + // + // All threads invoke the same synchronized method: + // + test.recurse(depthToTry); + + throw new Exception( + "TEST_RFE: no stack overflow thrown" + + ", need to try deeper recursion?"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack016.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack016.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack016.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack016.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2000, 2024, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack016. + * VM testbase keywords: [stress, diehard, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * The test provokes second stack overflow from within the + * stack overflow handler -- repeatedly multiple times, and + * in multiple threads. + * This test measures a number of recursive invocations until + * stack overflow, and then tries to provoke similar stack overflows + * in 10 times in each of 10 threads. Each provocation consists of + * invoking that recursive method for the given fixed depth + * of invocations which is 10 times that depth measured before, + * and then trying to invoke that recursive method once again + * from within the catch clause just caught StackOverflowError. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on both + * Solaris and Win32 platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp") + * @run main/othervm/timeout=900 -Xint -Xss448K Stack016 + * @run main/othervm/timeout=900 -Xcomp -Xss448K Stack016 + * @run main/othervm/timeout=900 -Xcomp -XX:-TieredCompilation -Xss448K Stack016 + */ + +public class Stack016 extends Thread { + private final static int THREADS = 10; + private final static int CYCLES = 10; + private final static int STEP = 10; + private final static int RESERVE = 10; + private final static int PROBES = STEP * RESERVE; + + public static void main(String[] args) { + Stack016 test = new Stack016(); + test.doRun(); + } + + private void doRun() { + // + // Measure recursive depth before stack overflow: + // + int maxDepth = 0; + for (depthToTry = 0; ; depthToTry += STEP) { + try { + trickyRecurse(depthToTry); + maxDepth = depthToTry; + } catch (StackOverflowError | OutOfMemoryError ex) { + break; + } + } + System.out.println("Maximal recursion depth: " + maxDepth); + + // + // Run the tested threads: + // + Stack016 threads[] = new Stack016[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack016(); + threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); + threads[i].depthToTry = RESERVE * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + + // + // Check if unexpected exceptions were thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + private int stackTop = 0; + private int depthToTry = 0; + private Throwable thrown = null; + + private void trickyRecurse(int depth) { + stackTop = depthToTry - depth; + if (depth > 0) { + try { + trickyRecurse(depth - 1); + } catch (StackOverflowError | OutOfMemoryError error) { + // + // Provoke more stack overflow, + // if current stack is deep enough: + // + if (depthToTry - depth < stackTop - PROBES) + throw error; + recurse(depthToTry); + + throw new Error("TEST_RFE: try deeper recursion!"); + } + } + } + + private static void recurse(int depth) { + if (depth > 0) { + recurse(depth - 1); + } + } + + public void run() { + String threadName = Thread.currentThread().getName(); + for (int i = 1; i <= CYCLES; i++) { + try { + System.out.println(threadName + ", iteration: " + i + "/" + CYCLES + + ", depthToTry: " + depthToTry); + trickyRecurse(depthToTry); + throw new Error( + "TEST_BUG: trickyRecursion() must throw an error anyway!"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + thrown = throwable; + break; + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack017.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack017.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack017.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack017.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack017. + * VM testbase keywords: [stress, diehard, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * The test invokes infinitely recursive method from within stack + * overflow handler -- repeatedly multiple times, and in multiple + * threads. + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on both + * Solaris and Win32 platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) + * @run main/othervm/timeout=900 -Xss220K Stack017 + */ + +public class Stack017 extends Thread { + private final static int THREADS = 10; + private final static int CYCLES = 10; + private final static int PROBES = 100; + + public static void main(String[] args) { + Stack017 test = new Stack017(); + test.doRun(); + } + + private static int depthToTry; + + private void doRun() { + // + // Measure recursive depth before stack overflow: + // + try { + recurse(0); + } catch (StackOverflowError | OutOfMemoryError err) { + } + System.out.println("Maximal recursion depth: " + maxDepth); + depthToTry = maxDepth; + + // + // Run the tested threads: + // + Stack017 threads[] = new Stack017[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack017(); + threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were thrown: + // + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + threads[i].thrown.printStackTrace(); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + private int maxDepth = 0; + + private void recurse(int depth) { + maxDepth = depth; + recurse(depth + 1); + } + + private void trickyRecurse(int depth) { + try { + maxDepth = depth; + trickyRecurse(depth + 1); + } catch (StackOverflowError | OutOfMemoryError error) { + // + // Stack problem caught: provoke it again, + // if current stack is enough deep: + // + if (depth < depthToTry - PROBES) + throw error; + recurse(depth + 1); + } + } + + private Throwable thrown = null; + + public void run() { + String threadName = Thread.currentThread().getName(); + for (int i = 1; i <= CYCLES; i++) + try { + System.out.println(threadName + ", iteration: " + i + "/" + CYCLES); + trickyRecurse(0); + throw new Exception( + "TEST_BUG: stack overflow was expected!"); + + } catch (StackOverflowError | OutOfMemoryError err) { + // It's OK + } catch (Throwable throwable) { + // It isn't OK! + thrown = throwable; + break; + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack018.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack018.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack018.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack018.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2000, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack018. + * VM testbase keywords: [stress, diehard, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * This test provokes multiple stack overflows by invocations via + * reflection -- repeatedly multiple times, and in multiple threads. + * Recursive method is invoked for the given fixed depth of recursion + * (though, for a large depth). The test measures a number of recursive + * invocations until stack overflow, and then tries to reproduce similar + * stack overflows 10 times in each of 10 threads -- each time by trying + * to invoke the same recursive method for the given fixed depth + * of invocations (which is 10 times that crucial depth just measured). + * The test is deemed passed, if VM have not crashed, and + * if exception other than due to stack overflow was not + * thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on both + * Solaris and Win32 platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * + * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) + * @run main/othervm/timeout=900 -Xss220K Stack018 + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class Stack018 extends Thread { + private final static int THREADS = 10; + private final static int CYCLES = 10; + private final static int STEP = 100; + private final static int RESERVE = 100; + + public static void main(String[] args) { + Stack018 test = new Stack018(); + test.doRun(); + } + + private void doRun() { + // + // Measure maximal recursion depth until stack overflow: + // + int maxDepth = 0; + for (depthToTry = 0; ; depthToTry += STEP) + try { + invokeRecurse(depthToTry); + maxDepth = depthToTry; + } catch (Throwable exception) { + Throwable target = getTargetException(exception); + if ((target instanceof StackOverflowError) || + (target instanceof OutOfMemoryError)) + break; // OK. + target.printStackTrace(); + throw new RuntimeException(exception); + } + System.out.println("Maximal recursion depth: " + maxDepth); + + // + // Run the tested threads: + // + Stack018 threads[] = new Stack018[THREADS]; + for (int i = 0; i < threads.length; i++) { + threads[i] = new Stack018(); + threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); + threads[i].depthToTry = RESERVE * maxDepth; + threads[i].start(); + } + for (int i = 0; i < threads.length; i++) { + if (threads[i].isAlive()) { + try { + threads[i].join(); + } catch (InterruptedException exception) { + throw new RuntimeException(exception); + } + } + } + // + // Check if unexpected exceptions were thrown: + // + int exitCode = 0; + for (int i = 0; i < threads.length; i++) { + if (threads[i].thrown != null) { + System.out.println("# " + threads[i].getName() + + ": " + threads[i].thrown); + throw new RuntimeException("Exception in the thread " + threads[i], threads[i].thrown); + } + } + } + + private int depthToTry = 0; + private Throwable thrown = null; + + public void run() { + String threadName = Thread.currentThread().getName(); + for (int i = 1; i <= CYCLES; i++) + try { + System.out.println(threadName + ", iteration: " + i + "/" + CYCLES); + invokeRecurse(depthToTry); + throw new Error("TEST_RFE: try deeper invocations!"); + + } catch (Throwable exception) { + Throwable target = getTargetException(exception); + if ((target instanceof StackOverflowError) || + (target instanceof OutOfMemoryError)) + continue; // OK. + thrown = target; + break; + } + } + + private static Throwable getTargetException(Throwable exception) { + Throwable target; + // + // Unwrap deep chain of exceptions to find StackOverflowError: + // + for ( + target = exception; + target instanceof InvocationTargetException; + target = ((InvocationTargetException) target).getTargetException() + ) + ; + return target; + } + + private Method method = null; + private Object params[] = null; + + private void invokeRecurse(int depth) throws Exception { + if (method == null) { + // + // Optimization trick: allocate once, use everywhere. + // + method = Stack018.class.getMethod("recurse"); + params = new Object[]{}; + } + this.depth = depth; // actual parameter + method.invoke(this, params); + } + + private int depth = 0; // actual parameter for recurse() + + public void recurse() throws Exception { + if (depth > 0) { + // + // Self-invoke via reflection: + // + invokeRecurse(depth - 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack019.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack019.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stack/Stack019.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stack/Stack019.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2000, 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 stress + * + * @summary converted from VM testbase nsk/stress/stack/stack019. + * VM testbase keywords: [stress, diehard, stack, nonconcurrent] + * VM testbase readme: + * DESCRIPTION + * The test invokes infinitely recursive method from within stack + * overflow handler -- repeatedly multiple times in a single thread. + * The test is deemed passed, if VM have not crashed, and if exception + * other than due to stack overflow was not thrown. + * COMMENTS + * This test crashes HS versions 2.0, 1.3, and 1.4 on both + * Solaris and Win32 platforms. + * See the bug: + * 4366625 (P4/S4) multiple stack overflow causes HS crash + * The stack size is too small to run on systems with > 4K page size. + * Making it bigger could cause timeouts on other platform. + * + * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) + * @requires os.family != "windows" + * @run main/othervm/timeout=900 -Xss200K Stack019 + */ + +public class Stack019 { + private final static int CYCLES = 50; + private final static int PROBES = 50; + + public static void main(String[] args) { + // + // Measure recursive depth before stack overflow: + // + try { + recurse(0); + } catch (StackOverflowError | OutOfMemoryError err) { + } + System.out.println("Maximal recursion depth: " + maxDepth); + depthToTry = maxDepth; + + // + // Run the tested threads: + // + for (int i = 0; i < CYCLES; i++) { + try { + System.out.println("Iteration: " + i + "/" + CYCLES); + trickyRecurse(0); + throw new RuntimeException("# TEST_BUG: stack overflow was expected!"); + } catch (StackOverflowError | OutOfMemoryError error) { + // It's OK + } catch (Throwable throwable) { + throw new RuntimeException(throwable); + } + } + } + + private static int maxDepth; + private static int depthToTry; + + private static void recurse(int depth) { + maxDepth = depth; + recurse(depth + 1); + } + + private static void trickyRecurse(int depth) { + try { + maxDepth = depth; + trickyRecurse(depth + 1); + } catch (StackOverflowError | OutOfMemoryError error){ + // + // Stack problem caught: provoke it again, + // if current stack is enough deep: + // + if (depth < depthToTry - PROBES) { + throw error; + } + recurse(depth + 1); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -36,7 +36,7 @@ public class StringTableVerifyTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyStringTableAtExit", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyStringTableAtExit", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,13 +89,13 @@ } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:symboltable=trace", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:symboltable=trace", + "-version"); int size = getSymbolTableSize(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintSymbolTableSizeHistogram", - LotsOfTempSymbols.class.getName(), - Integer.toString(size)); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintSymbolTableSizeHistogram", + LotsOfTempSymbols.class.getName(), + Integer.toString(size)); analyzeOutputOn(size, pb); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ public static void main(String... args) throws Exception { dump_HasFinal(); dump_Overrider(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "Overrider"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "Overrider"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain( "java.lang.IncompatibleClassChangeError: class Overrider overrides final method HasFinal.m(Ljava/lang/String;)V"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TestANewArray.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestANewArray.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TestANewArray.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestANewArray.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -69,7 +69,7 @@ byte[] classFile_254 = dumpClassFile(cfv, test_Dimension_254, array_Dimension_254); writeClassFileFromByteArray(classFile_254); System.err.println("Running with cfv: " + cfv + ", test_Dimension_254"); - ProcessBuilder pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.VerifyError"); output.shouldHaveExitValue(0); @@ -78,7 +78,7 @@ byte[] classFile_255 = dumpClassFile(cfv, test_Dimension_255, array_Dimension_255); writeClassFileFromByteArray(classFile_255); System.err.println("Running with cfv: " + cfv + ", test_Dimension_255"); - pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); output = new OutputAnalyzer(pb.start()); // If anewarray has an operand with 255 array dimensions then VerifyError should // be thrown because the resulting array would have 256 dimensions. @@ -95,7 +95,7 @@ byte[] classFile_264 = dumpClassFile(cfv, test_Dimension_264, array_Dimension_264); writeClassFileFromByteArray(classFile_264); System.err.println("Running with cfv: " + cfv + ", test_Dimension_264"); - pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -48,7 +48,7 @@ int cfv = Integer.parseInt(args[0]); writeClassFile(cfv); System.err.println("Running with cfv: " + cfv); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "ClassFile"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "ClassFile"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("VerifyError"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class TraceClassRes { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:class+resolve=debug", "-verify", "-Xshare:off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -44,7 +44,7 @@ static final int N_TRIES = 5; // number of times to try deflation public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java 2025-01-04 20:25:18.000000000 +0000 @@ -67,7 +67,7 @@ } public static ProcessBuilder runTarget(String flagName, String flagValue) throws Exception { - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "AttachSetGetFlag$Target"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +59,7 @@ } public static boolean runTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PauseAtStartup", "AttachWithStalePidFileTarget"); Process target = pb.start(); Path pidFile = null; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java 2025-01-04 20:25:18.000000000 +0000 @@ -94,7 +94,7 @@ // creates target process builder for the specified shmem transport name private static ProcessBuilder getTarget(String shmemName) throws IOException { log("starting target with shmem name: '" + shmemName + "'..."); - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( "-Xrunjdwp:transport=" + transport + ",server=y,suspend=n,address=" + shmemName, "ShMemLongName$Target"); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ javaArgs.add("-cp"); javaArgs.add(System.getProperty("test.class.path")); javaArgs.add(TEST_APP_NAME); - ProcessBuilder testAppPb = ProcessTools.createJavaProcessBuilder(javaArgs); + ProcessBuilder testAppPb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs); final AtomicBoolean failed = new AtomicBoolean(); final AtomicBoolean passed = new AtomicBoolean(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -63,7 +63,7 @@ }; for (String opt : options) { - var pb = ProcessTools.createJavaProcessBuilder("-XX:+" + opt, "-version"); + var pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+" + opt, "-version"); var oa = new OutputAnalyzer(pb.start()); if (dtraceEnabled) { oa.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -72,12 +72,6 @@ jdwpLatch.countDown(); } - @Override - public void onDebuggeeError(String message) { - System.err.println("Debuggee error: '" + message + "'"); - System.exit(1); - } - private void doJdwp() throws Exception { try { // Establish JDWP socket connection diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,9 +22,9 @@ */ import java.util.StringTokenizer; -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.JDWP; import static jdk.test.lib.Asserts.assertFalse; +import jdk.test.lib.process.ProcessTools; /** * Launches the debuggee with the necessary JDWP options and handles the output @@ -45,21 +45,14 @@ */ void onDebuggeeSendingCompleted(); - /** - * Callback to handle any debuggee error - * - * @param line line from the debuggee's stderr - */ - void onDebuggeeError(String line); } private int jdwpPort = -1; - private static final String CLS_DIR = System.getProperty("test.classes", "").trim(); private static final String DEBUGGEE = "AllModulesCommandTestDebuggee"; + private static final String JDWP_OPT = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0"; + private Process p; private final Listener listener; - private StreamHandler inputHandler; - private StreamHandler errorHandler; /** * @param listener the listener we report the debuggee events to @@ -70,37 +63,21 @@ /** * Starts the debuggee with the necessary JDWP options and handles the - * debuggee's stdout and stderr outputs + * debuggee's stdout output. stderr might contain jvm output, which is just printed to the log. * * @throws Throwable */ public void launchDebuggee() throws Throwable { - ProcessBuilder pb = new ProcessBuilder(getCommand()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(JDWP_OPT, DEBUGGEE); p = pb.start(); - inputHandler = new StreamHandler(p.getInputStream(), this); - errorHandler = new StreamHandler(p.getErrorStream(), this); + StreamHandler inputHandler = new StreamHandler(p.getInputStream(), this); + StreamHandler errorHandler = new StreamHandler(p.getErrorStream(), l -> System.out.println("[stderr]: " + l)); inputHandler.start(); errorHandler.start(); } /** - * Command to start the debuggee with the JDWP options and using the JDK - * under test - * - * @return the command - */ - private String[] getCommand() { - return new String[]{ - JDKToolFinder.getTestJDKTool("java"), - getJdwpOptions(), - "-cp", - CLS_DIR, - DEBUGGEE - }; - } - - /** * Terminates the debuggee */ public void terminateDebuggee() { @@ -110,15 +87,6 @@ } /** - * Debuggee JDWP options - * - * @return the JDWP options to start the debuggee with - */ - private static String getJdwpOptions() { - return "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0"; - } - - /** * Gets JDWP port debuggee is listening on. * * @return JDWP port @@ -129,16 +97,8 @@ } @Override - public void onStringRead(StreamHandler handler, String line) { - if (handler.equals(errorHandler)) { - terminateDebuggee(); - listener.onDebuggeeError(line); - } else { - processDebuggeeOutput(line); - } - } - - private void processDebuggeeOutput(String line) { + public void onStringRead(String line) { + System.out.println("[stdout]: " + line); if (jdwpPort == -1) { JDWP.ListenAddress addr = JDWP.parseListenAddress(line); if (addr != null) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,10 +37,9 @@ public interface Listener { /** * Called when a line has been read from the process output stream - * @param handler this StreamHandler * @param s the line */ - void onStringRead(StreamHandler handler, String s); + void onStringRead(String s); } private final ExecutorService executor; @@ -71,7 +70,7 @@ BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { - listener.onStringRead(this, line); + listener.onStringRead(line); } } catch (Exception x) { throw new RuntimeException(x); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2014 SAP SE. All rights reserved. + * Copyright (c) 2023, 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 @@ -56,12 +57,14 @@ import com.sun.jdi.request.ClassPrepareRequest; import com.sun.jdi.request.EventRequestManager; +import jdk.test.lib.Utils; /* * @test GetObjectLockCount.java * @bug 8036666 * @summary verify jvm returns correct lock recursion count * @requires vm.jvmti + * @library /test/lib * @run compile -g RecursiveObjectLock.java * @run main/othervm GetObjectLockCount * @author axel.siebenborn@sap.com @@ -71,8 +74,6 @@ public static final String CLASS_NAME = "RecursiveObjectLock"; public static final String METHOD_NAME = "breakpoint1"; - public static final String ARGUMENTS = ""; - /** * Find a com.sun.jdi.CommandLineLaunch connector @@ -119,7 +120,7 @@ if (optionsArg == null) { throw new Error("Bad launching connector"); } - optionsArg.setValue(ARGUMENTS); + optionsArg.setValue(String.join(" ", Utils.getTestJavaOpts())); return arguments; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ } private static OutputAnalyzer execJava(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,7 +51,7 @@ pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "GetObjectSizeClassAgent.class"}); pb.start().waitFor(); - ProcessBuilder pt = ProcessTools.createTestJvm("-javaagent:agent.jar", "GetObjectSizeClassAgent"); + ProcessBuilder pt = ProcessTools.createTestJavaProcessBuilder("-javaagent:agent.jar", "GetObjectSizeClassAgent"); OutputAnalyzer output = new OutputAnalyzer(pt.start()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -104,7 +104,7 @@ } if (argv.length == 1 && argv[0].equals("runtest")) { // run outside of jtreg to not OOM on jtreg classes that are loaded after metaspace is full - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -82,7 +82,7 @@ if (args.length > 0) { // java -javaagent:redefineagent.jar -Xlog:stuff RedefinePreviousVersions - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-javaagent:redefineagent.jar", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:redefineagent.jar", "-Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace", "RedefinePreviousVersions"); new OutputAnalyzer(pb.start()) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java 2025-01-04 20:25:18.000000000 +0000 @@ -75,7 +75,7 @@ List offCommand = new ArrayList<>(); offCommand.add("-Xshare:off"); offCommand.addAll(baseCommand); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(offCommand); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(offCommand); new OutputAnalyzer(pb.start()) // We can't expect any of the transformed classes to be in use // so the only thing we can verify is that no scratch classes @@ -89,7 +89,7 @@ List onCommand = new ArrayList<>(); onCommand.add("-Xshare:on"); onCommand.addAll(baseCommand); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(onCommand); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(onCommand); new OutputAnalyzer(pb.start()) .shouldContain(SHOULD_CLEAN_FALSE) .shouldNotContain(SHOULD_CLEAN_TRUE) diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -56,7 +56,7 @@ public static void main(String args[]) throws Throwable { String agentJar = buildAgent(); ProcessTools.executeProcess( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentJar, "-version") ).shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ public static void main(String args[]) throws Throwable { String agentJar = buildAgent(); ProcessTools.executeProcess( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentJar, TransformerDeadlockTest.Agent.class.getName()) ).shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -36,7 +36,7 @@ public class TestBasicLogOutput { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:all=trace", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:all=trace", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("\\[logging *\\]"); // expected tag(s) output.shouldContain("Log configuration fully initialized."); // expected message diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -36,7 +36,7 @@ public class TestDefaultLogOutput { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:badTag"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:badTag"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.stdoutShouldMatch("\\[error *\\]\\[logging *\\]"); output.shouldHaveExitValue(1); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestFullNames.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestFullNames.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestFullNames.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestFullNames.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,9 +63,9 @@ for (String logOutput : validOutputs) { Asserts.assertFalse(file.exists()); // Run with logging=trace on stdout so that we can verify the log configuration afterwards. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); Asserts.assertTrue(file.exists()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -71,7 +71,7 @@ } public static void runTest(int numberOfFiles) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-cp", System.getProperty("java.class.path"), "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k" diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -36,13 +36,13 @@ public class TestMultipleXlogArgs { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=debug", - "-Xlog:logging=trace", - "-Xlog:defaultmethods=trace", - "-Xlog:defaultmethods=warning", - "-Xlog:safepoint=info", - "-Xlog:safepoint=info", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=debug", + "-Xlog:logging=trace", + "-Xlog:defaultmethods=trace", + "-Xlog:defaultmethods=warning", + "-Xlog:safepoint=info", + "-Xlog:safepoint=info", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // -Xlog:logging=trace means that the log configuration will be printed. String stdoutConfigLine = "\\[logging *\\] #0: stdout .*"; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,9 +73,9 @@ }; for (String logOutput : validOutputs) { // Run with logging=trace on stdout so that we can verify the log configuration afterwards. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); Asserts.assertTrue(file.exists()); @@ -98,9 +98,9 @@ "A" + quote + quote + "B" }; for (String logOutput : invalidOutputs) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(1); // Ensure error message was logged diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,7 +90,7 @@ try { List options = new ArrayList<>(); options.addAll(Arrays.asList(jArgs)); - ProcessBuilder pb = ProcessTools.createTestJvm(options); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(options); // Add "ulimit -c unlimited" if we can since we are generating a core file. pb = CoreUtils.addCoreUlimitCommand(pb); crashOutput = ProcessTools.executeProcess(pb); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestClassDump.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestClassDump.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestClassDump.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestClassDump.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.jvm.hotspot.tools.jcore.outputDir=jtreg_classes", "-m", "jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore.ClassDump", String.valueOf(lingeredAppPid)); SATestUtils.addPrivilegesIfNeeded(pb); @@ -68,7 +68,7 @@ throw new RuntimeException("jtreg_classes/sun/net/util/URLUtil.class not found"); } - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.jvm.hotspot.tools.jcore.outputDir=jtreg_classes2", "-Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=jdk,sun", "-m", "jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore.ClassDump", String.valueOf(lingeredAppPid)); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ String[] instanceKlassNames, long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,7 +98,7 @@ String[] instanceKlassNames, long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -72,7 +72,7 @@ private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.gc.g1=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -82,7 +82,7 @@ } try { // Run this app with the LingeredApp PID to get SA output from the LingeredApp - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ String[] instanceKlassNames, int lingeredAppPid) throws Exception { // Start a new process to attach to the LingeredApp process to get SA info - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -71,7 +71,7 @@ } static void test(String type) throws Throwable { - ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash", + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-XX:+CreateCoredumpOnCrash", "-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", // The test loads lots of small classes to exhaust Metaspace, skip method // dependency verification to improve performance in debug builds. diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -64,7 +64,7 @@ private static void createAnotherToAttach(long lingeredAppPid, int expectedAlign) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java 2025-01-04 20:25:18.000000000 +0000 @@ -73,7 +73,7 @@ private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -66,7 +66,7 @@ private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,11 +25,11 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.InputStreamReader; import java.io.IOException; import java.io.Reader; import java.nio.CharBuffer; import java.util.Arrays; -import java.util.Scanner; import jdk.test.lib.Asserts; import jdk.test.lib.JDKToolLauncher; @@ -77,20 +77,27 @@ private static void testHProfFileFormat(String vmArgs, long heapSize, String expectedFormat) throws Exception, IOException, InterruptedException, FileNotFoundException { - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder procBuilder = ProcessTools.createTestJavaProcessBuilder( "--add-exports=java.management/sun.management=ALL-UNNAMED", vmArgs, "JMapHProfLargeHeapProc", String.valueOf(heapSize)); procBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); Process largeHeapProc = procBuilder.start(); - try (Scanner largeHeapScanner = new Scanner( - largeHeapProc.getInputStream());) { + try (BufferedReader r = new BufferedReader( + new InputStreamReader(largeHeapProc.getInputStream()))) { String pidstring = null; - if (!largeHeapScanner.hasNext()) { - throw new RuntimeException ("Test failed: could not open largeHeapScanner."); + while ((pidstring = r.readLine()) != null) { + // The output might contain different VM output, skip it while searching PID line. + if (pidstring.matches("PID\\[[0-9].*\\]")) { + System.out.println("Found: " + pidstring); + break; + } else { + System.out.println("Ignoring: " + pidstring); + } } - while ((pidstring = largeHeapScanner.findInLine("PID\\[[0-9].*\\]")) == null) { - Thread.sleep(500); + if (pidstring == null) { + throw new RuntimeException("Not able to find string matching PID."); } + int pid = Integer.parseInt(pidstring.substring(4, pidstring.length() - 1)); System.out.println("Extracted pid: " + pid); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java 2025-01-04 20:25:18.000000000 +0000 @@ -174,7 +174,7 @@ while (!done) { String[] cmd = cmd(classStart, classStop); try { - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); String commandLine = pb.command() .stream() .collect(Collectors.joining(" ")); @@ -290,6 +290,7 @@ "-XX:+StressGCM", "-XX:+StressIGVN", "-XX:+StressCCP", + "-XX:+StressIncrementalInlining", // StressSeed is uint "-XX:StressSeed=" + Math.abs(rng.nextLong()), // CTW entry point diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ } OutputAnalyzer oa; try { - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); oa = new OutputAnalyzer(pb.start()); } catch (Exception e) { throw new Error("Unexpected exception on test jvm start :" + e, e); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ } } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); OutputAnalyzer output = new OutputAnalyzer(pb.start()); dump(output, "compile"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ } else { // Test invalid -DScenario flag. OutputAnalyzer oa; - ProcessBuilder process = ProcessTools.createJavaProcessBuilder( + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + Utils.TEST_JDK, "-DScenarios=a,1,b,10", "ir_framework.tests.TestDScenarios", " test3"); oa = ProcessTools.executeProcess(process); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -97,7 +97,7 @@ protected static void run(String dTest, String dExclude, String arg) throws Exception { System.out.println("Run -DTest=" + dTest + " -DExclude=" + dExclude + " arg=" + arg); OutputAnalyzer oa; - ProcessBuilder process = ProcessTools.createJavaProcessBuilder( + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.class.path=" + Utils.TEST_CLASS_PATH, "-Dtest.jdk=" + Utils.TEST_JDK, "-Dtest.vm.opts=-DTest=" + dTest + " -DExclude=" + dExclude, "ir_framework.tests.TestDTestAndExclude", arg); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/UnloadingTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/UnloadingTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/UnloadingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/UnloadingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -149,8 +149,6 @@ } private static void checkGCCounters() { -// System.out.println("WhiteBox.getWhiteBox().g1GetTotalCollections() = \t" + WhiteBox.getWhiteBox().g1GetTotalCollections()); -// System.out.println("WhiteBox.getWhiteBox().g1GetTotalFullCollections() = \t" + WhiteBox.getWhiteBox().g1GetTotalFullCollections()); GarbageCollectorMXBean oldGenBean = null; for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) { System.out.println("bean.getName() = \t\"" + bean.getName() + "\", bean.getCollectionCount() = \t" + bean.getCollectionCount()); @@ -158,9 +156,9 @@ oldGenBean = bean; } } -// if (WhiteBox.getWhiteBox().g1GetTotalFullCollections() != 0 || (oldGenBean != null && oldGenBean.getCollectionCount() != 0)) { + if (oldGenBean != null && oldGenBean.getCollectionCount() != 0) { - throw new RuntimeException("Full gc happened. Test was useless."); + throw new SkippedException("Full gc happened, skip the test."); } } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -93,7 +93,7 @@ var cmd = new ArrayList(); Collections.addAll(cmd, opts); cmd.add(MemStat.class.getName()); - var pb = ProcessTools.createTestJvm(cmd); + var pb = ProcessTools.createTestJavaProcessBuilder(cmd); var output = new OutputAnalyzer(pb.start()); if (output.getExitValue() != 0) { output.reportDiagnosticSummary(); @@ -106,7 +106,7 @@ var cmd = new ArrayList(); Collections.addAll(cmd, opts); cmd.add(MemStat.class.getName()); - var pb = ProcessTools.createTestJvm(cmd); + var pb = ProcessTools.createTestJavaProcessBuilder(cmd); var output = new OutputAnalyzer(pb.start()); if (output.getExitValue() == 0) { output.reportDiagnosticSummary(); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,8 +40,8 @@ public class TestMaxMetaspaceSize { public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createTestJvm("-XX:MaxMetaspaceSize=100m", - maxMetaspaceSize.class.getName()); + ProcessTools.createTestJavaProcessBuilder("-XX:MaxMetaspaceSize=100m", + maxMetaspaceSize.class.getName()); OutputAnalyzer out = new OutputAnalyzer(pb.start()); if (out.getExitValue() == 0) { diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp001.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp001.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp001.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp001.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -109,24 +109,8 @@ logHandler = new Log(out, argsHandler); Binder binder = new Binder(argsHandler, logHandler); - - if (argsHandler.verbose()) { - debugee = binder.bindToDebugee(debugeeName + " -vbs"); - } else { - debugee = binder.bindToDebugee(debugeeName); - } - - IOPipe pipe = new IOPipe(debugee); - - - debugee.redirectStderr(out); - debugee.resume(); - - String line = pipe.readln(); - if (!line.equals("ready")) { - logHandler.complain("# Cannot recognize debugee's signal: " + line); - return 2; - }; + debugee = Debugee.prepareDebugee(argsHandler, logHandler, + debugeeName + (argsHandler.verbose() ? " -vbs" : "")); // ReferenceType classes[] = debugee.classes(); // for (int i=0; i cArgs1 = initConnector(argHandler.getTransportPort()); Map cArgs2 = initConnector(null); if ((addr = startListen(cArgs2)) == null) { log.complain("FAILURE: unable to start listening the address " + @@ -93,6 +92,12 @@ else log.display("TEST: start listening the address " + addr); + // argHandler.getTransportPort() returns a free port (different from the port allocated by startListen(cArgs2)) + Map cArgs1 = initConnector(argHandler.getTransportPort()); + + log.display("cArgs1: " + cArgs1); + log.display("cArgs2: " + cArgs2); + /* Check that an Exception is thrown if ListeningConnector.stopListening has been invoked with argument map different from the one given for a previous ListeningConnector.startListening() invocation */ diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ -80,7 +80,7 @@ private static final int STATUS_NO_OOM = 3 + STATUS_BASE; public static void main(String[] args) throws Throwable { - String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm( + String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder( "-XX:MaxHeapSize=" + (Platform.is32bit() ? "256m" : "512m"), "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, "-agentpath:" + Utils.TEST_NATIVE_PATH + File.separator + System.mapLibraryName("alloc001"), diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -68,7 +68,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:retransform003-01=id=1 can_retransform_classes=1", "-agentlib:retransform003-02=id=2 can_retransform_classes=0", "-agentlib:retransform003-03=id=3 can_retransform_classes=1", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:SetNativeMethodPrefix001=trace=all", "-agentlib:SetNativeMethodPrefix002-01=trace=all prefix=wa_", "-agentlib:SetNativeMethodPrefix002-02=trace=all prefix=wb_", diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/README openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/README --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/README 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/README 2025-01-04 20:25:18.000000000 +0000 @@ -54,7 +54,7 @@ text processing: Grep.java, Paragrep.java timeouts handling: - Terminator.java, TimeoutHandler.java + TimeoutHandler.java tree structures support: Denotation.java, TreeNodesDenotation.java RAS mode support: diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2001, 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 nsk.share; - -/** - * Terminator is used to terminate a stress test with PASS exit status - * before the test is terminated as timed out (and so failed). - * - *

    Terminator class holds a thread which sleeps for the given amount - * of time, and then wakes up and executes System.exit() - * with the given exit status. That thread is daemon, so it doesn't - * prevent application from exiting once all its threads finish - * before it's time for termination. Appointing terminator in zero - * delay implies immediate exit(). - * - *

    There is a limitation: you may appoint no more than one terminator - * per application. - */ -public class Terminator { - /** - * Use specific appoint() method to appoint terminator. - * - * @see #appoint(int) - * @see #appoint(int,int) - */ - protected Terminator() {} - - /** - * One terminator per application, or null (by default). - */ - private static Thread terminator = null; - - /** - *

    Return timeout (or waittime) value munus the margin - * value (which is assumed 1 minute by default). - * - *

    Treat args[0] as $TIMEOUT value, or seek for - * -waittime=$WAITTIME value. If both parameters - * (or either none of them) are assigned, throw an exception to - * report parameters inconsistency. - * - *

    Also, seek for -margin=... assignment, or assume margin - * is 1 minute. - * - * @param args Is usually obtained via the application's command-line. - * - * @throws IllegalArgumentException If args[] is inconsistent. - * - * @see #appoint(int) - * @see #appoint(int,int) - */ - public static int parseAppointment(String args[]) { - int timeout=-1, margin=1; - int timeouts=0, waittimes=0, margins=0; - for (int i=0; i 1) - throw new IllegalArgumentException( - "more than one -waittime=... is set"); - if (margins > 1) - throw new IllegalArgumentException( - "more than one -margin=... is set"); - - int result = timeout - margin; - if (result <= 0) - throw new IllegalArgumentException( - "delay appointment must be greater than "+margin+" minutes"); - return result; - } - - /** - * Appoint terminator after the given amount of minutes, - * so that exit status would be 95 (to simulate JCK-like PASS - * status). - * - * @throws IllegalStateException If terminator is already appointed. - * - * @see #appoint(int,int) - * @see #parseAppointment(String[]) - */ - public static void appoint(int minutes) { - appoint(minutes,95); // JCK-like PASS status - } - - /** - * Appoint Terminator for the given amount of minutes, - * so that the given status would be exited when time - * is over. - * - * @throws IllegalStateException If terminator is already appointed. - * - * @see #appoint(int) - * @see #parseAppointment(String[]) - */ - public static void appoint(int minutes, int status) { - if (terminator != null) - throw new IllegalStateException("Terminator is already appointed."); - - final long timeToExit = System.currentTimeMillis() + 60*1000L*minutes; - final int exitStatus = status; - - terminator = new Thread(Terminator.class.getName()) { - public void run() { - long timeToSleep = timeToExit - System.currentTimeMillis(); - if (timeToSleep > 0) - try { - // - // Use wait() instead of sleep(), because Java 2 - // specification doesn't guarantee the method - // sleep() to yield to other threads. - // - Object someDummyObject = new Object(); - synchronized (someDummyObject) { - someDummyObject.wait(timeToSleep); - } - } catch (InterruptedException exception) { - exception.printStackTrace(System.err); - return; - }; - // - // OK, lets do it now: - // - System.err.println( - "#\n# Terminator: prescheduled program termination.\n#"); - System.exit(exitStatus); // terminator to all threads - } - }; - - terminator.setPriority(Thread.MAX_PRIORITY); - terminator.setDaemon(true); - terminator.start(); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ } public void runTargetApplication() { - pipe = SocketIOPipe.createClientIOPipe(log, "localhost", argParser.getPort(), 0); + pipe = SocketIOPipe.createClientIOPipe(log, argParser.getPort(), 0); log.display("Sending signal '" + AODTestRunner.SIGNAL_READY_FOR_ATTACH + "'"); pipe.println(AODTestRunner.SIGNAL_READY_FOR_ATTACH); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -341,7 +341,7 @@ /* * When target application initialized send signal to AODTestRunner */ - pipe = SocketIOPipe.createClientIOPipe(log, "localhost", argParser.getPort(), 0); + pipe = SocketIOPipe.createClientIOPipe(log, argParser.getPort(), 0); log.display("Sending signal '" + AODTestRunner.SIGNAL_READY_FOR_ATTACH + "'"); pipe.println(AODTestRunner.SIGNAL_READY_FOR_ATTACH); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeArgumentHandler.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeArgumentHandler.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeArgumentHandler.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeArgumentHandler.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -108,12 +108,12 @@ /** * Return name of the host where test executes, specified by * -test.host command line option or - * "localhost" string by default. + * empty string (represents an address of the loopback interface) by default. * * @see #setRawArguments(String[]) */ public String getTestHost() { - return options.getProperty("test.host", "localhost"); + return options.getProperty("test.host", ""); } /** diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -180,7 +180,7 @@ try { pipeServerSocket = new ServerSocket(); pipeServerSocket.setReuseAddress(false); - pipeServerSocket.bind(null); + pipeServerSocket.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); } catch (IOException e) { e.printStackTrace(getOutStream()); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java 2025-01-04 20:25:18.000000000 +0000 @@ -110,12 +110,16 @@ // --------------------------------------------------- // - /** Created and return new IOPipe channel to the debugee VM. */ + /** Create and return new IOPipe channel to the debuggee VM. + * The channel should be created before debuggee starts execution, + * i.e. the method assumes debuggee is started, but suspended before + * its main class is loaded. + */ public IOPipe createIOPipe() { if (pipe != null) { throw new TestBug("IOPipe channel is already created"); } - pipe = new IOPipe(this); + pipe = IOPipe.startDebuggerPipe(binder); return pipe; } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java 2025-01-04 20:25:18.000000000 +0000 @@ -84,7 +84,7 @@ /** * Creates and starts listening IOPipe at debugger side. */ - public static IOPipe startDebuggerPipe(Binder binder) { + public static IOPipe startDebuggerPipe(DebugeeBinder binder) { IOPipe ioPipe = new IOPipe(binder.getLog(), binder.getArgumentHandler().getDebugeeHost(), binder.getArgumentHandler().getPipePortNumber(), @@ -95,7 +95,6 @@ return ioPipe; } - protected void connect() { super.connect(); } diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/SocketIOPipe.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/SocketIOPipe.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/SocketIOPipe.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/SocketIOPipe.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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,6 +23,7 @@ package nsk.share.jpda; import java.io.IOException; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import nsk.share.*; @@ -35,13 +36,13 @@ * * Server and client objects should be created using special static methods provided by this class, * for example 'createServerIOPipe(Log log, int port, long timeout)' for server SocketIOPipe - * and 'createClientIOPipe(Log log, String host, int port, long timeout)' for client SocketIOPipe. + * and 'createClientIOPipe(Log log, int port, long timeout)' for client SocketIOPipe. * * When SocketIOPipe is created it can be used to send and receive strings using methods 'readln()' and 'println(String s)'. * TCP/IP connection is established at the first attempt to read or write data. * - * For example, if client process should send string 'OK' to the server process which is run - * at the host 'SERVER_HOST' following code can be written: + * For example, if client process should send string 'OK' to the server process, + * the following code can be written: * * Server side: * @@ -53,8 +54,8 @@ * * Client side: * - * // initialize SocketIOPipe with given values of server host name and port - * SocketIOPipe pipe = SocketIOPipe.createClientIOPipe(log, 'SERVER_HOST', port, timeoutValue); + * // initialize SocketIOPipe with given port + * SocketIOPipe pipe = SocketIOPipe.createClientIOPipe(log, port, timeoutValue); * * String command = "OK"; * // SocketIOPipe tries to create socket and send command to the server @@ -120,7 +121,7 @@ // then we should retry the bind() a few times. ss.setReuseAddress(false); } - ss.bind(new InetSocketAddress(port)); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), port)); pipe.setServerSocket(ss); } catch (IOException e) { e.printStackTrace(log.getOutStream()); @@ -140,8 +141,9 @@ /** * Create attaching SocketIOPipe using given port and timeout */ - public static SocketIOPipe createClientIOPipe(Log log, String host, int port, long timeout) { - return new SocketIOPipe(log, DEFAULT_PIPE_LOG_PREFIX, host, port, timeout, false); + public static SocketIOPipe createClientIOPipe(Log log, int port, long timeout) { + // use null for host to connect to loopback address + return new SocketIOPipe(log, DEFAULT_PIPE_LOG_PREFIX, null, port, timeout, false); } /** diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/test/Tests.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/test/Tests.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/share/test/Tests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/share/test/Tests.java 2025-01-04 20:25:18.000000000 +0000 @@ -23,6 +23,8 @@ package nsk.share.test; +import jtreg.SkippedException; + import nsk.share.log.*; import nsk.share.runner.*; import nsk.share.TestFailure; @@ -82,6 +84,8 @@ ((Runnable) o).run(); if (o instanceof TestExitCode) exitCode = ((TestExitCode) o).getExitCode(); + } catch (SkippedException se) { + throw se; } catch (RuntimeException t) { getLog().error(t); exitCode = 97; diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack001. - * VM testbase keywords: [stress, quick, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * Provoke StackOverflowError by infinite recursion in Java method, - * intercept the exception try to make one more invocation. - * COMMENTS - * Kestrel for Solaris_JDK_1.3-b10 crashes while trying to execute - * this test with Client HS VM. - * See lots of bugs concerning similar failures: - * Evaluated: - * 4217960 [native stack overflow bug] reflection test causes crash - * Accepted: - * 4285716 native stack overflow causes crash on Solaris - * 4281578 Second stack overflow crashes HotSpot VM - * Closed (duplicate): - * 4027933 Native stack overflows not detected or handled correctly - * 4134353 (hpi) sysThreadCheckStack is a no-op on win32 - * 4185411 Various crashes when using recursive reflection. - * 4167055 infinite recursion in FindClass - * 4222359 Infinite recursion crashes jvm - * Closed (will not fix): - * 4231968 StackOverflowError in a native method causes Segmentation Fault - * 4254634 println() while catching StackOverflowError causes hotspot VM crash - * 4302288 the second stack overflow causes Classic VM to exit on win32 - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack001 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack001 { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack001 test = new stack001(); - test.recurse(0); - out.println("Maximal depth: " + test.maxdepth); - return 0; - } - - private int maxdepth; - - private void recurse(int depth) { - maxdepth = depth; - try { - recurse(depth + 1); - } catch (Error error) { - if (!(error instanceof StackOverflowError) && - !(error instanceof OutOfMemoryError)) - throw error; - - if (maxdepth == depth) - recurse(depth + 1); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack002.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack002.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack002.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack002.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack002. - * VM testbase keywords: [stress, quick, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * Provoke StackOverflowError by infinite recursion in Java method, - * intercept the exception and continue to invoke that method until - * the test exceeds timeout, or until Java VM crashes. - * COMMENTS - * I believe that the test causes HS crashes due to the following bug: - * 4330318 (P2/S2) NSK test fails as An irrecoverable stack overflow - * See also bugs (lots of bugs!): - * Evaluated: - * 4217960 [native stack overflow bug] reflection test causes crash - * Accepted: - * 4285716 native stack overflow causes crash on Solaris - * 4281578 Second stack overflow crashes HotSpot VM - * Closed (duplicate): - * 4027933 Native stack overflows not detected or handled correctly - * 4134353 (hpi) sysThreadCheckStack is a no-op on win32 - * 4185411 Various crashes when using recursive reflection. - * 4167055 infinite recursion in FindClass - * 4222359 Infinite recursion crashes jvm - * Closed (will not fix): - * 4231968 StackOverflowError in a native method causes Segmentation Fault - * 4254634 println() while catching StackOverflowError causes hotspot VM crash - * 4302288 the second stack overflow causes Classic VM to exit on win32 - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack002 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack002 { - static final long timeout = 10000; // 10 seconds - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - Tester tester = new Tester(out); - Timer timer = new Timer(tester); - timer.start(); - tester.start(); - while (timer.isAlive()) - try { - timer.join(); - } catch (InterruptedException e) { - e.printStackTrace(out); - return 2; - } - // if (tester.isAlive()) -// return 2; - out.println("Maximal depth: " + tester.maxdepth); - return 0; - } - - private static class Tester extends Thread { - int maxdepth; - PrintStream out; - - public Tester(PrintStream out) { - this.out = out; - maxdepth = 0; - } - - public void run() { - recurse(0); - } - - void recurse(int depth) { - maxdepth = depth; - try { - recurse(depth + 1); -// } catch (StackOverflowError e) { -// -// OutOfMemoryError is also eligible to indicate stack overflow: -// - } catch (Error error) { - if (!(error instanceof StackOverflowError) && - !(error instanceof OutOfMemoryError)) - throw error; - -/*** - *** Originally, I supposed that VM crashes because of unexpected - *** native stack overflow (println() invokes native method). - *** However, I found that HS 1.3 and HS 2.0 crash even on - *** invocation of Java (not native) method. - *** - out.println("StackOverflowError, depth=" + depth); - ***/ - recurse(depth + 1); - } - } - } - - private static class Timer extends Thread { - private Tester tester; - - public Timer(Tester tester) { - this.tester = tester; - } - - public void run() { - long started; - started = System.currentTimeMillis(); - while (System.currentTimeMillis() - started < timeout) - ; /*** - *** The test hangs on JDK 1.2.2 Classic VM if sleep() is invoked. - *** - try { - this.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(tester.out); - return; - }; - ***/ - tester.stop(); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack003.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack003.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack003.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack003.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack003. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invoking static recursive method for the given fixed depth - * of recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 100 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is twice that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes all HS versions (2.0, 1.3, 1.4) on all - * platforms (Win32, Solaris, Linux) in all execution modes - * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which - * I had tryied it. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack003 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack003 { - final static int ITERATIONS = 100; - final static int INCREMENT = 100; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - int depth; - for (depth = 1; ; depth += INCREMENT) - try { - recurse(depth); - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + depth); - for (int i = 0; i < ITERATIONS; i++) - try { - recurse(2 * depth); - out.println("?"); - } catch (StackOverflowError soe) { - // OK. - } catch (OutOfMemoryError oome) { - // Also OK. - } - return 0; - } - - static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack004.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack004.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack004.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack004.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack004. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invoking final static recursive method for the given fixed - * depth of recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 100 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is twice that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes all HS versions (2.0, 1.3, 1.4) on all - * platforms (Win32, Solaris, Linux) in all execution modes - * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which - * I had tryied it. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack004 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack004 { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack004 test = new stack004(); - int exitCode = test.doRun(args, out); - return exitCode; - } - - public int doRun(String args[], PrintStream out) { - int depth; - for (depth = 100; ; depth += 100) - try { - recurse(depth); - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + depth); - for (int i = 0; i < 100; i++) - try { - recurse(2 * depth); - out.println("?"); - } catch (StackOverflowError soe) { - // OK. - } catch (OutOfMemoryError oome) { - // Also OK. - } - return 0; - } - - final static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack005.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack005.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack005.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack005.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack005. - * VM testbase keywords: [stress, quick, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invoking final recursive method for the given fixed depth of - * recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 100 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is twice that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes all HS versions (2.0, 1.3, 1.4) on all - * platforms (Win32, Solaris, Linux) in all execution modes - * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which - * I had tryied it. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack005 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack005 { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack005 test = new stack005(); - int depth; - for (depth = 100; ; depth += 100) - try { - test.recurse(depth); - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + depth); - for (int i = 0; i < 100; i++) - try { - test.recurse(2 * depth); - out.println("?"); - } catch (StackOverflowError soe) { - // OK. - } catch (OutOfMemoryError oome) { - // Also OK. - } - return 0; - } - - final void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack006.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack006.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack006.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack006.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack006. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invoking virtual recursive method for the given fixed depth - * of recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 100 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is twice that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes all HS versions (2.0, 1.3, 1.4) on all - * platforms (Win32, Solaris, Linux) in all execution modes - * (-Xint, -Xmixed, -Xcomp) in 100% of executions in which - * I had tryied it. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack006 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack006 implements stack006i { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack006i test = new stack006(); - int depth; - for (depth = 100; ; depth += 100) - try { - test.recurse(depth); - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + depth); - for (int i = 0; i < 100; i++) - try { - test.recurse(2 * depth); - out.println("?"); - } catch (StackOverflowError soe) { - // OK. - } catch (OutOfMemoryError oome) { - // Also OK. - } - return 0; - } - - public void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} - -interface stack006i { - void recurse(int depth); -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack007.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack007.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack007.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack007.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack007. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invoking synchronized virtual recursive method for the given - * fixed depth of recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 10000 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is 10 times that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes HS versions 1.3 and 1.4 on Win32, Solaris, - * and Linux platforms in all execution modes. However, it passes - * against HS 2.0 on Win32 platform. - * See also the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack007 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack007 implements stack007i { - final static int ITERATIONS = 1000; - final static int INCREMENT = 100; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack007i test = new stack007(); - int depth; - for (depth = 100; ; depth += INCREMENT) - try { - test.recurse(depth); - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + depth); - for (int i = 0; i < ITERATIONS; i++) - try { - test.recurse(10 * depth); - out.println("?"); - } catch (StackOverflowError soe) { - // OK. - } catch (OutOfMemoryError oome) { - // Also OK. - } - return 0; - } - - public synchronized void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} - -interface stack007i { - void recurse(int depth); -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack008.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack008.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack008.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack008.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2000, 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 stress - * - * @summary converted from VM testbase nsk/stress/stack/stack008. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the same thread - * by invocations via reflection. Recursive method is invoked for - * the given fixed depth of recursion (though, for a large depth). - * This test makes measures a number of recursive invocations - * before 1st StackOverflowError, and then tries to reproduce - * such StackOverflowError 100 times -- each time by trying to - * invoke the same recursive method for the given fixed depth - * of invocations (which is twice that depth just measured). - * The test is deemed passed, if VM have not crashed. - * COMMENTS - * This test crashes all HS versions (2.0, 1.3, 1.4) on Solaris, - * and crashes HS 2.0 on win32. However, it passes against HS 1.3 - * and 1.4 on Win32. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * The stack size is too small to run on systems with > 4K page size. - * Making it bigger could cause timeouts on other platform. - * - * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) - * @run main/othervm/timeout=900 -Xss200K nsk.stress.stack.stack008 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class stack008 { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - int depth; - // - // Measure maximal recursion depth until stack overflow: - // - for (depth = 100; ; depth += 100) - try { - invokeRecurse(depth); - } catch (Throwable exception) { - Throwable target = getTargetException(exception); - if ((target instanceof StackOverflowError) || - (target instanceof OutOfMemoryError)) - break; // OK. - target.printStackTrace(out); - if (target instanceof ThreadDeath) - throw (ThreadDeath) target; - return 2; - } - out.println("Max. depth: " + depth); - // - // Provoke stack overflow multiple times: - // - for (int i = 0; i < 100; i++) - try { - invokeRecurse(2 * depth); -// out.println("?"); - } catch (Throwable exception) { - Throwable target = getTargetException(exception); - if ((target instanceof StackOverflowError) || - (target instanceof OutOfMemoryError)) - continue; // OK. - target.printStackTrace(out); - if (target instanceof ThreadDeath) - throw (ThreadDeath) target; - return 2; - } - return 0; - } - - private static Throwable getTargetException(Throwable exception) { - Throwable target; - // - // Unwrap deep chain of exceptions: - // - for ( - target = exception; - target instanceof InvocationTargetException; - target = ((InvocationTargetException) target).getTargetException() - ) - ; - return target; - } - - static Method method = null; - static stack008 instance = null; - static Object params[] = null; - - private static void invokeRecurse(int depth) throws Exception { - if (method == null) { - // - // Optimization trick: allocate once, use everywhere. - // - instance = new stack008(); - method = stack008.class.getMethod("recurse"); - params = new Object[]{}; - } - // - // Note, that the same instance.depth is used in all invocations: - // - instance.depth = depth; - method.invoke(instance, params); - } - - int depth = 0; - - public void recurse() throws Exception { - if (depth > 0) - // - // Self-invoke via reflection: - // - invokeRecurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack009.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack009.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack009.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack009.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack009. - * VM testbase keywords: [stress, quick, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * The test provokes second stack overflow from within the - * stack overflow handler. - * This test measures a number of recursive invocations until - * StackOverflowError, and then tries to make an invocation - * for the fixed invocations depth from within the "catch" - * block just caught the 1st stack overflow. The depth of new - * invocations is 10 times that depth seen at the 1st stack - * overflow; so that another stack overflow occurs. - * The test is deemed passed, if VM have not crashed, and - * if there is no exception thrown other than due to stack - * overflow. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on Win32 - * and Solaris platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack009 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack009 { - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - for (int depth = 100; ; depth += 100) - try { - recurse(depth); - } catch (Error error1) { - if (!(error1 instanceof StackOverflowError) && - !(error1 instanceof OutOfMemoryError)) - throw error1; - - out.println("Max. depth: " + depth); - - try { - recurse(10 * depth); - out.println("?"); - } catch (Error error2) { - if (!(error2 instanceof StackOverflowError) && - !(error2 instanceof OutOfMemoryError)) - throw error2; - - // Stack overflow is OK here. - } - - break; - } - return 0; - } - - static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack010.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack010.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack010.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack010.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack010. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking static recursive method for the given - * fixed depth of recursion (though, for a large depth). - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, 1.4 on Win32 and Solaris - * platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack010 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack010 extends Thread { - final static int THREADS = 10; - final static int CYCLES = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 10; ; depth += 10) - try { - recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack010 threads[] = new stack010[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack010(); - threads[i].depthToTry = 10 * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were not thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - int depthToTry = 0; - Throwable thrown = null; - - public void run() { - for (int i = 0; i < CYCLES; i++) - try { - recurse(depthToTry); - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError soe) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: out of memory may indacate stack overflow. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } - - static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack011.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack011.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack011.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack011.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack011. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking final static recursive method for the - * given fixed depth of recursion (though, for a large depth). - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, 1.4 on Win32 and Solaris - * platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack011 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack011 extends Thread { - final static int THREADS = 10; - final static int CYCLES = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 10; ; depth += 10) - try { - recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack011 threads[] = new stack011[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack011(); - threads[i].depthToTry = 10 * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were not thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - int depthToTry = 0; - Throwable thrown = null; - - public void run() { - for (int i = 0; i < CYCLES; i++) - try { - recurse(depthToTry); - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: recursion may result in memory lack. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } - - final static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack012.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack012.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack012.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack012.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack012. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking final recursive method for the given - * fixed depth of recursion (though, for a large depth). - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 1.3, 1.4 on Win32, and HS versions - * 2.0, 1.3, and 1.4 on Solaris. However, it passes against HS 2.0 - * on Win32. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack012 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack012 extends Thread { - final static int THREADS = 10; - final static int CYCLES = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack012 test = new stack012(); - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 10; ; depth += 10) - try { - test.recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack012 threads[] = new stack012[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack012(); - threads[i].depthToTry = 10 * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were not thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - int depthToTry = 0; - Throwable thrown = null; - - public void run() { - for (int i = 0; i < CYCLES; i++) - try { - this.recurse(depthToTry); - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: invocation may result in out of memory. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } - - final void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack013.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack013.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack013.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack013.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack013. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking virtual recursive method for the given - * fixed depth of recursion (though, for a large depth). - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on both Win32 - * and Solaris platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack013 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack013 extends stack013i { - final static int THREADS = 10; - final static int CYCLES = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack013i test = new stack013(); - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 10; ; depth += 10) - try { - test.recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack013i threads[] = new stack013i[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack013(); - threads[i].depthToTry = 10 * maxDepth; - threads[i].cycles = CYCLES; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} - -abstract class stack013i extends Thread { - // - // Pure virtual method: - // - abstract void recurse(int depth); - - Throwable thrown = null; - int depthToTry; - int cycles; - - public void run() { - // - // Provoke multiple stack overflows: - // - for (int i = 0; i < cycles; i++) - try { - recurse(depthToTry); - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: out of memory is eligible here. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack014.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack014.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack014.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack014.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack014. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking synchronized virtual recursive method - * for the given fixed depth of recursion (though, for a large - * depth). Note however, that different threads are not actual - * synchronized, because different instances having the recursive - * method are used. - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on Solaris. - * However, it passes against all these HS versions on Win32. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack014 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack014 extends stack014i { - final static int THREADS = 10; - final static int CYCLES = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - stack014i test = new stack014(); - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 10; ; depth += 10) - try { - test.recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack014i threads[] = new stack014i[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack014(); - threads[i].depthToTry = 10 * maxDepth; - threads[i].cycles = CYCLES; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - synchronized void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } -} - -abstract class stack014i extends Thread { - // - // Pure virtual method: - // - abstract void recurse(int depth); - - Throwable thrown = null; - int depthToTry; - int cycles; - - public void run() { - // - // Provoke multiple stack overflows: - // - for (int i = 0; i < cycles; i++) - try { - recurse(depthToTry); - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: if there is no memory for stack expansion. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack015.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack015.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack015.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack015.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @key stress - * - * @summary converted from VM testbase nsk/stress/stack/stack015. - * VM testbase keywords: [stress, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows in the multiple - * threads -- by invoking synchronized virtual recursive method - * for the given fixed depth of recursion from within another - * recursive method already deeply invoked. - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * in 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on Solaris. - * However, it passes against all these HS versions on Win32. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires vm.opt.DeoptimizeALot != true - * @run main/othervm/timeout=900 nsk.stress.stack.stack015 - */ - -package nsk.stress.stack; - - -import java.io.PrintStream; - -public class stack015 extends stack015i { - final static int THREADS = 10; - final static int CYCLES = 10; - final static int STEP = 10; - final static int RESERVE = 10; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - // - // The test will invoke the particular stack015.recurse() - // method via abstract test.recurse() invocations. - // - stack015i test = new stack015(); - stack015i.test = test; - - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (int depth = 0; ; depth += STEP) - try { - test.recurse(depth); - maxDepth = depth; - } catch (StackOverflowError soe) { - break; - } catch (OutOfMemoryError oome) { - break; - } - out.println("Max. depth: " + maxDepth); - - // - // Execute multiple threads repeatedly provoking stack overflows: - // - stack015i threads[] = new stack015i[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack015(); - threads[i].depthToTry = RESERVE * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - synchronized void syncRecurse(int depth) { - if (depth > 0) - syncRecurse(depth - 1); - } -} - -abstract class stack015i extends Thread { - // - // Pure virtual method: - // - abstract void syncRecurse(int depth); - - void recurse(int depth) { - // - // Stack overflow must occur here: - // - syncRecurse(stack015.STEP); - // - // If no stack overflow occured, try again with deeper stack: - // - if (depth > 0) - recurse(depth - 1); - } - - Throwable thrown = null; - int depthToTry; - - static stack015i test; - - public void run() { - // - // Provoke multiple stack overflows: - // - for (int i = 0; i < stack015.CYCLES; i++) - try { - // - // All threads invoke the same synchronized method: - // - test.recurse(depthToTry); - - throw new Exception( - "TEST_RFE: no stack overflow thrown" + - ", need to try deeper recursion?"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK: there may be no memory for stack expansion. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2000, 2021, 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 stress - * - * @summary converted from VM testbase nsk/stress/stack/stack016. - * VM testbase keywords: [stress, diehard, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * The test provokes second stack overflow from within the - * stack overflow handler -- repeatedly multiple times, and - * in multiple threads. - * This test measures a number of recursive invocations until - * stack overflow, and then tries to provoke similar stack overflows - * in 10 times in each of 10 threads. Each provocation consists of - * invoking that recursive method for the given fixed depth - * of invocations which is 10 times that depth measured before, - * and then trying to invoke that recursive method once again - * from within the catch clause just caught StackOverflowError. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on both - * Solaris and Win32 platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp") - * @library /vmTestbase - * @build nsk.share.Terminator - * @run main/othervm/timeout=900 -Xint -Xss448K nsk.stress.stack.stack016 -eager - * @run main/othervm/timeout=900 -Xcomp -Xss448K nsk.stress.stack.stack016 -eager - * @run main/othervm/timeout=900 -Xcomp -XX:-TieredCompilation -Xss448K nsk.stress.stack.stack016 -eager - */ - -package nsk.stress.stack; - - -import nsk.share.Terminator; - -import java.io.PrintStream; - -public class stack016 extends Thread { - private final static int THREADS = 10; - private final static int CYCLES = 10; - private final static int STEP = 10; - private final static int RESERVE = 10; - private final static int PROBES = STEP * RESERVE; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - verbose = false; - boolean eager = false; - for (int i = 0; i < args.length; i++) - if (args[i].toLowerCase().equals("-verbose")) - verbose = true; - else if (args[i].toLowerCase().equals("-eager")) - eager = true; - if (!eager) - Terminator.appoint(Terminator.parseAppointment(args)); - stack016.out = out; - stack016 test = new stack016(); - return test.doRun(); - } - - private static boolean verbose; - private static PrintStream out; - - private void display(Object message) { - if (!verbose) - return; - synchronized (out) { - out.println(message.toString()); - } - } - - private int doRun() { - // - // Measure recursive depth before stack overflow: - // - int maxDepth = 0; - for (depthToTry = 0; ; depthToTry += STEP) { - try { - trickyRecurse(depthToTry); - maxDepth = depthToTry; - } catch (StackOverflowError | OutOfMemoryError ex) { - break; - } - } - out.println("Maximal recursion depth: " + maxDepth); - - // - // Run the tested threads: - // - stack016 threads[] = new stack016[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack016(); - threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); - threads[i].depthToTry = RESERVE * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) { - if (threads[i].isAlive()) { - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - } - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) { - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - } - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - private int stackTop = 0; - private int depthToTry = 0; - private Throwable thrown = null; - - private void trickyRecurse(int depth) { - stackTop = depthToTry - depth; - if (depth > 0) { - try { - trickyRecurse(depth - 1); - } catch (Error error) { - if (!(error instanceof StackOverflowError) && - !(error instanceof OutOfMemoryError)) - throw error; - - // - // Provoke more stack overflow, - // if current stack is deep enough: - // - if (depthToTry - depth < stackTop - PROBES) - throw error; - recurse(depthToTry); - - throw new Error("TEST_RFE: try deeper recursion!"); - } - } - } - - private static void recurse(int depth) { - if (depth > 0) - recurse(depth - 1); - } - - public void run() { - String threadName = Thread.currentThread().getName(); - for (int i = 1; i <= CYCLES; i++) { - try { - display(threadName + ", iteration: " + i + "/" + CYCLES + - ", depthToTry: " + depthToTry); - trickyRecurse(depthToTry); - throw new Error( - "TEST_BUG: trickyRecursion() must throw an error anyway!"); - - } catch (StackOverflowError error) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK, if there is no memory for stack expansion. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - thrown = throwable; - break; - } - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2000, 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 stress - * - * @summary converted from VM testbase nsk/stress/stack/stack017. - * VM testbase keywords: [stress, diehard, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * The test invokes infinitely recursive method from within stack - * overflow handler -- repeatedly multiple times, and in multiple - * threads. - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on both - * Solaris and Win32 platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) - * @library /vmTestbase - * @build nsk.share.Terminator - * @run main/othervm/timeout=900 -Xss220K nsk.stress.stack.stack017 -eager - */ - -package nsk.stress.stack; - - -import nsk.share.Terminator; - -import java.io.PrintStream; - -public class stack017 extends Thread { - private final static int THREADS = 10; - private final static int CYCLES = 10; - private final static int PROBES = 100; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - verbose = false; - boolean eager = false; - for (int i = 0; i < args.length; i++) - if (args[i].toLowerCase().equals("-verbose")) - verbose = true; - else if (args[i].toLowerCase().equals("-eager")) - eager = true; - if (!eager) - Terminator.appoint(Terminator.parseAppointment(args)); - stack017.out = out; - stack017 test = new stack017(); - return test.doRun(); - } - - private static boolean verbose; - private static PrintStream out; - - private void display(Object message) { - if (!verbose) - return; - synchronized (out) { - out.println(message.toString()); - } - } - - private static int depthToTry; - - private int doRun() { - // - // Measure recursive depth before stack overflow: - // - try { - recurse(0); - } catch (StackOverflowError soe) { - } catch (OutOfMemoryError oome) { - } - out.println("Maximal recursion depth: " + maxDepth); - depthToTry = maxDepth; - - // - // Run the tested threads: - // - stack017 threads[] = new stack017[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack017(); - threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - threads[i].thrown.printStackTrace(out); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - private int maxDepth = 0; - - private void recurse(int depth) { - maxDepth = depth; - recurse(depth + 1); - } - - private void trickyRecurse(int depth) { - try { - maxDepth = depth; - trickyRecurse(depth + 1); - } catch (Error error) { - if (!(error instanceof StackOverflowError) && - !(error instanceof OutOfMemoryError)) - throw error; - - // - // Stack problem caught: provoke it again, - // if current stack is enough deep: - // - if (depth < depthToTry - PROBES) - throw error; - recurse(depth + 1); - } - } - - private Throwable thrown = null; - - public void run() { - String threadName = Thread.currentThread().getName(); - for (int i = 1; i <= CYCLES; i++) - try { - display(threadName + ", iteration: " + i + "/" + CYCLES); - trickyRecurse(0); - throw new Exception( - "TEST_BUG: stack overflow was expected!"); - - } catch (StackOverflowError oome) { - // It's OK: stack overflow was expected. - } catch (OutOfMemoryError oome) { - // Also OK, if there is no memory for stack expansion. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - // It isn't OK! - thrown = throwable; - break; - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2000, 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 stress - * - * @summary converted from VM testbase nsk/stress/stack/stack018. - * VM testbase keywords: [stress, diehard, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * This test provokes multiple stack overflows by invocations via - * reflection -- repeatedly multiple times, and in multiple threads. - * Recursive method is invoked for the given fixed depth of recursion - * (though, for a large depth). The test measures a number of recursive - * invocations until stack overflow, and then tries to reproduce similar - * stack overflows 10 times in each of 10 threads -- each time by trying - * to invoke the same recursive method for the given fixed depth - * of invocations (which is 10 times that crucial depth just measured). - * The test is deemed passed, if VM have not crashed, and - * if exception other than due to stack overflow was not - * thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on both - * Solaris and Win32 platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * - * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) - * @library /vmTestbase - * @build nsk.share.Terminator - * @run main/othervm/timeout=900 -Xss220K nsk.stress.stack.stack018 -eager - */ - -package nsk.stress.stack; - - -import nsk.share.Terminator; - -import java.io.PrintStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class stack018 extends Thread { - private final static int THREADS = 10; - private final static int CYCLES = 10; - private final static int STEP = 100; - private final static int RESERVE = 100; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - verbose = false; - boolean eager = false; - for (int i = 0; i < args.length; i++) - if (args[i].toLowerCase().equals("-verbose")) - verbose = true; - else if (args[i].toLowerCase().equals("-eager")) - eager = true; - if (!eager) - Terminator.appoint(Terminator.parseAppointment(args)); - stack018.out = out; - stack018 test = new stack018(); - return test.doRun(); - } - - private static boolean verbose; - private static PrintStream out; - - private void display(Object message) { - if (!verbose) - return; - synchronized (out) { - out.println(message.toString()); - } - } - - private int doRun() { - // - // Measure maximal recursion depth until stack overflow: - // - int maxDepth = 0; - for (depthToTry = 0; ; depthToTry += STEP) - try { - invokeRecurse(depthToTry); - maxDepth = depthToTry; - } catch (Throwable exception) { - Throwable target = getTargetException(exception); - if ((target instanceof StackOverflowError) || - (target instanceof OutOfMemoryError)) - break; // OK. - target.printStackTrace(out); - if (target instanceof ThreadDeath) - throw (ThreadDeath) target; - return 2; - } - out.println("Maximal recursion depth: " + maxDepth); - - // - // Run the tested threads: - // - stack018 threads[] = new stack018[THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new stack018(); - threads[i].setName("Thread: " + (i + 1) + "/" + THREADS); - threads[i].depthToTry = RESERVE * maxDepth; - threads[i].start(); - } - for (int i = 0; i < threads.length; i++) - if (threads[i].isAlive()) - try { - threads[i].join(); - } catch (InterruptedException exception) { - exception.printStackTrace(out); - return 2; - } - - // - // Check if unexpected exceptions were thrown: - // - int exitCode = 0; - for (int i = 0; i < threads.length; i++) - if (threads[i].thrown != null) { - out.println("# " + threads[i].getName() - + ": " + threads[i].thrown); - exitCode = 2; - } - - if (exitCode != 0) - out.println("# TEST FAILED"); - return exitCode; - } - - private int depthToTry = 0; - private Throwable thrown = null; - - public void run() { - String threadName = Thread.currentThread().getName(); - for (int i = 1; i <= CYCLES; i++) - try { - display(threadName + ", iteration: " + i + "/" + CYCLES); - invokeRecurse(depthToTry); - throw new Error("TEST_RFE: try deeper invocations!"); - - } catch (Throwable exception) { - Throwable target = getTargetException(exception); - if ((target instanceof StackOverflowError) || - (target instanceof OutOfMemoryError)) - continue; // OK. - if (target instanceof ThreadDeath) - throw (ThreadDeath) target; - thrown = target; - break; - } - } - - private static Throwable getTargetException(Throwable exception) { - Throwable target; - // - // Unwrap deep chain of exceptions to find StackOverflowError: - // - for ( - target = exception; - target instanceof InvocationTargetException; - target = ((InvocationTargetException) target).getTargetException() - ) - ; - return target; - } - - private Method method = null; - private Object params[] = null; - - private void invokeRecurse(int depth) throws Exception { - if (method == null) { - // - // Optimization trick: allocate once, use everywhere. - // - method = stack018.class.getMethod("recurse"); - params = new Object[]{}; - } - this.depth = depth; // actual parameter - method.invoke(this, params); - } - - private int depth = 0; // actual parameter for recurse() - - public void recurse() throws Exception { - if (depth > 0) - // - // Self-invoke via reflection: - // - invokeRecurse(depth - 1); - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2000, 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 stress - * - * @summary converted from VM testbase nsk/stress/stack/stack019. - * VM testbase keywords: [stress, diehard, stack, nonconcurrent] - * VM testbase readme: - * DESCRIPTION - * The test invokes infinitely recursive method from within stack - * overflow handler -- repeatedly multiple times in a single thread. - * The test is deemed passed, if VM have not crashed, and if exception - * other than due to stack overflow was not thrown. - * COMMENTS - * This test crashes HS versions 2.0, 1.3, and 1.4 on both - * Solaris and Win32 platforms. - * See the bug: - * 4366625 (P4/S4) multiple stack overflow causes HS crash - * The stack size is too small to run on systems with > 4K page size. - * Making it bigger could cause timeouts on other platform. - * - * @requires (vm.opt.DeoptimizeALot != true & vm.compMode != "Xcomp" & vm.pageSize == 4096) - * @requires os.family != "windows" - * @library /vmTestbase - * @build nsk.share.Terminator - * @run main/othervm/timeout=900 -Xss200K nsk.stress.stack.stack019 -eager - */ - -package nsk.stress.stack; - - -import nsk.share.Terminator; - -import java.io.PrintStream; - -public class stack019 { - private final static int CYCLES = 50; - private final static int PROBES = 50; - - public static void main(String[] args) { - int exitCode = run(args, System.out); - System.exit(exitCode + 95); - } - - public static int run(String args[], PrintStream out) { - boolean verbose = false, eager = false; - for (int i = 0; i < args.length; i++) - if (args[i].toLowerCase().equals("-verbose")) - verbose = true; - else if (args[i].toLowerCase().equals("-eager")) - eager = true; - if (!eager) - Terminator.appoint(Terminator.parseAppointment(args)); - // - // Measure recursive depth before stack overflow: - // - try { - recurse(0); - } catch (StackOverflowError soe) { - } catch (OutOfMemoryError oome) { - } - out.println("Maximal recursion depth: " + maxDepth); - depthToTry = maxDepth; - - // - // Run the tested threads: - // - for (int i = 0; i < CYCLES; i++) { - try { - out.println("Iteration: " + i + "/" + CYCLES); - trickyRecurse(0); - out.println("# TEST_BUG: stack overflow was expected!"); - return 2; - - } catch (StackOverflowError error) { - } catch (OutOfMemoryError oome) { - // It's OK: stack overflow was expected. - - } catch (Throwable throwable) { - if (throwable instanceof ThreadDeath) - throw (ThreadDeath) throwable; - throwable.printStackTrace(out); - return 2; - } - } - return 0; - } - - private static int maxDepth; - private static int depthToTry; - - private static void recurse(int depth) { - maxDepth = depth; - recurse(depth + 1); - } - - private static void trickyRecurse(int depth) { - try { - maxDepth = depth; - trickyRecurse(depth + 1); - } catch (Error error) { - if (!(error instanceof StackOverflowError) && - !(error instanceof OutOfMemoryError)) - throw error; - - // - // Stack problem caught: provoke it again, - // if current stack is enough deep: - // - if (depth < depthToTry - PROBES) - throw error; - recurse(depth + 1); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -69,7 +69,7 @@ public static void main(String[] args) throws Exception { { System.out.println("SegmentedCodeCache is enabled"); - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+SegmentedCodeCache", "-XX:+PrintCodeCache", "-version"); @@ -79,7 +79,7 @@ } { System.out.println("SegmentedCodeCache is disabled"); - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-SegmentedCodeCache", "-XX:+PrintCodeCache", "-version"); diff -Nru openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java --- openjdk-17-17.0.13+11/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ private static String REGEXP = "^(CodeCache|(CodeHeap.*)): size=\\d+Kb used=\\d+Kb max_used=\\d+Kb free=\\d+Kb"; public static void main(String[] args) throws Exception { - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-PrintCodeCache", "-XX:+PrintCodeCacheOnCompilation", "-XX:-Inline", diff -Nru openjdk-17-17.0.13+11/test/jdk/ProblemList-zgc.txt openjdk-17-17.0.14+7/test/jdk/ProblemList-zgc.txt --- openjdk-17-17.0.13+11/test/jdk/ProblemList-zgc.txt 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/ProblemList-zgc.txt 2025-01-04 20:25:18.000000000 +0000 @@ -27,3 +27,6 @@ # ############################################################################# + +sun/tools/jhsdb/JShellHeapDumpTest.java 8276539 generic-all +sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8276539 generic-all diff -Nru openjdk-17-17.0.13+11/test/jdk/ProblemList.txt openjdk-17-17.0.14+7/test/jdk/ProblemList.txt --- openjdk-17-17.0.13+11/test/jdk/ProblemList.txt 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/ProblemList.txt 2025-01-04 20:25:18.000000000 +0000 @@ -385,7 +385,7 @@ java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java 8198665 macosx-all java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java 8198665 macosx-all java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all -java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all +java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021,8332158 macosx-all,linux-x64 java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170 macosx-all @@ -460,7 +460,7 @@ java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all -java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8202926 linux-all +java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8339929 linux-all java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882 linux-all java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 7124275 macosx-all @@ -509,8 +509,9 @@ java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-x64 java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 8266243 macosx-aarch64 -# This test fails on macOS 14 -java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java 8324782 macosx-all +# Wayland related + +java/awt/FullScreen/FullscreenWindowProps/FullscreenWindowProps.java 8280991 linux-x64 ############################################################################ @@ -581,8 +582,8 @@ # jdk_net -java/net/DatagramSocket/DatagramSocketExample.java 8308807 aix-ppc64 -java/net/DatagramSocket/DatagramSocketMulticasting.java 8308807 aix-ppc64 +java/net/DatagramSocket/DatagramSocketExample.java 8144003,8308807 macosx-all,aix-ppc64 +java/net/DatagramSocket/DatagramSocketMulticasting.java 8144003,8308807 macosx-all,aix-ppc64 java/net/MulticastSocket/B6427403.java 8308807 aix-ppc64 java/net/MulticastSocket/IPMulticastIF.java 8308807 aix-ppc64 @@ -604,17 +605,18 @@ # jdk_nio -java/nio/channels/DatagramChannel/AdaptorMulticasting.java 8308807 aix-ppc64 +java/nio/channels/DatagramChannel/AdaptorMulticasting.java 8144003,8308807 macosx-all,aix-ppc64 java/nio/channels/DatagramChannel/AfterDisconnect.java 8308807 aix-ppc64 +java/nio/channels/DatagramChannel/BasicMulticastTests.java 8144003 macosx-all java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64 +java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java 8144003 macosx-all +java/nio/channels/DatagramChannel/Promiscuous.java 8144003 macosx-all java/nio/channels/DatagramChannel/Unref.java 8233437 generic-all java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 java/nio/file/Files/probeContentType/Basic.java 8320943 windows-all -java/nio/channels/DatagramChannel/AfterDisconnect.java 8308807 aix-ppc64 - ############################################################################ # jdk_rmi @@ -657,8 +659,6 @@ sun/security/smartcardio/TestMultiplePresent.java 8039280 generic-all sun/security/smartcardio/TestPresent.java 8039280 generic-all sun/security/smartcardio/TestTransmit.java 8039280 generic-all -com/sun/crypto/provider/Cipher/DES/PerformanceTest.java 8039280 generic-all -com/sun/security/auth/callback/TextCallbackHandler/Default.java 8039280 generic-all com/sun/security/auth/callback/TextCallbackHandler/Password.java 8039280 generic-all com/sun/security/sasl/gsskerb/AuthOnly.java 8039280 generic-all com/sun/security/sasl/gsskerb/ConfSecurityLayer.java 8039280 generic-all @@ -696,6 +696,7 @@ # jdk_swing javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,windows-all +javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java 8333880 windows-all javax/swing/JFrame/MaximizeWindowTest.java 8321289 linux-all javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582 linux-all @@ -759,6 +760,11 @@ ############################################################################ +# core_svc +tools/launcher/TestXcheckJNIWarnings.java#jdwp-agent 8296936 generic-all + +############################################################################ + # jdk_jdi com/sun/jdi/RepStep.java 8043571 generic-all @@ -794,6 +800,7 @@ sun/tools/jstat/jstatLineCounts2.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 sun/tools/jstat/jstatLineCounts3.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 sun/tools/jstat/jstatLineCounts4.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 +sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8313798 generic-aarch64 ############################################################################ diff -Nru openjdk-17-17.0.13+11/test/jdk/TEST.groups openjdk-17-17.0.14+7/test/jdk/TEST.groups --- openjdk-17-17.0.13+11/test/jdk/TEST.groups 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/TEST.groups 2025-01-04 20:25:18.000000000 +0000 @@ -550,26 +550,26 @@ jdk_core_manual = \ :jdk_core_manual_no_input \ - :jdk_core_manual_no_input_security \ - :jdk_core_manual_requires_human_input + :jdk_security_manual_no_input \ + :jdk_core_manual_interactive \ + :jdk_security_manual_interactive jdk_core_manual_no_input = \ java/net/HugeDataTransferTest.java \ java/net/httpclient/BodyProcessorInputStreamTest.java \ java/net/httpclient/HttpInputStreamTest.java \ - java/nio/MappedByteBuffer/PmemTest.java \ - java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java \ java/util/zip/ZipFile/TestZipFile.java \ javax/net/ssl/compatibility/AlpnTest.java \ javax/net/ssl/compatibility/BasicConnectTest.java \ javax/net/ssl/compatibility/HrrTest.java \ javax/net/ssl/compatibility/SniTest.java \ - jdk/nio/zipfs/TestLocOffsetFromZip64EF.java + jdk/nio/zipfs/TestLocOffsetFromZip64EF.java \ + jdk/nio/zipfs/LargeCompressedEntrySizeTest.java -jdk_core_manual_no_input_security = \ +jdk_security_manual_no_input = \ :jdk_security_infra \ - com/sun/crypto/provider/Cipher/DES/PerformanceTest.java \ - com/sun/security/auth/callback/TextCallbackHandler/Default.java \ + com/sun/crypto/provider/Cipher/AEAD/GCMIncrementByte4.java \ + com/sun/crypto/provider/Cipher/AEAD/GCMIncrementDirect4.java \ com/sun/security/auth/callback/TextCallbackHandler/Password.java \ com/sun/security/sasl/gsskerb/AuthOnly.java \ com/sun/security/sasl/gsskerb/ConfSecurityLayer.java \ @@ -591,14 +591,24 @@ sun/security/smartcardio/TestTransmit.java \ sun/security/tools/jarsigner/compatibility/Compatibility.java -jdk_core_manual_requires_human_input = \ +jdk_core_manual_interactive = \ com/sun/jndi/dns/Test6991580.java \ java/util/TimeZone/DefaultTimeZoneTest.java \ - sun/security/tools/keytool/i18n.java + java/nio/MappedByteBuffer/PmemTest.java \ + java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java \ + java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java +jdk_security_manual_interactive = \ + sun/security/tools/keytool/i18n.java \ + java/security/Policy/Root/Root.java \ + sun/security/krb5/config/native/TestDynamicStore.java # Test sets for running inside container environment jdk_containers_extended = \ :jdk_io \ :jdk_nio \ :jdk_svc + +jdk_core_no_security = \ + :jdk_core \ + -:jdk_security \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -66,7 +66,8 @@ private static final int IV_LENGTH = 8; public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); if (provider == null) { throw new RuntimeException("SunJCE provider does not exist."); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -75,7 +75,7 @@ "OFB", "OFB64", "PCBC"}; private static final String[] PADDINGS = {"NoPadding", "Pkcs5Padding"}; private static final String[] PBE_ALGOS = {"PBEWithMD5AndDES", - "PBEWithMD5AndDES/CBC/PKCS5Padding"}; + "PBEWithMD5AndDES/CBC/PKCS5Padding", "PBEWithSHA1AndDESede"}; public static void main(String[] args) throws Exception { // how many kinds of padding mode such as PKCS5padding and NoPadding @@ -204,9 +204,10 @@ AlgorithmParameterSpec aps) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException { - Provider provider = Security.getProvider("SunJCE"); + String providerName = System.getProperty("test.provider.name", "SunJCE"); + Provider provider = Security.getProvider(providerName); if (provider == null) { - throw new RuntimeException("SunJCE provider does not exist."); + throw new RuntimeException(providerName + " provider does not exist."); } Cipher ci1 = Cipher.getInstance(algo, provider); ci1.init(Cipher.ENCRYPT_MODE, key, aps); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -69,9 +69,10 @@ */ @Override protected Cipher initCipher(int mode) throws GeneralSecurityException { - Provider provider = Security.getProvider("SunJCE"); + String providerName = System.getProperty("test.provider.name", "SunJCE"); + Provider provider = Security.getProvider(providerName); if (provider == null) { - throw new RuntimeException("SunJCE provider does not exist."); + throw new RuntimeException(providerName + ": provider does not exist."); } // get Cipher instance Cipher ci = Cipher.getInstance(transformation, provider); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,9 +58,10 @@ */ @Override protected Cipher initCipher(int mode) throws GeneralSecurityException { - Provider provider = Security.getProvider("SunJCE"); + String providerName = System.getProperty("test.provider.name", "SunJCE"); + Provider provider = Security.getProvider(providerName); if (provider == null) { - throw new RuntimeException("SunJCE provider does not exist."); + throw new RuntimeException(providerName + ": provider does not exist."); } SecretKey key = SecretKeyFactory.getInstance(baseAlgo) .generateSecret(new PBEKeySpec(password.toCharArray())); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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,9 +89,10 @@ */ @Override protected Cipher initCipher(int mode) throws GeneralSecurityException { - Provider provider = Security.getProvider("SunJCE"); + String providerName = System.getProperty("test.provider.name", "SunJCE"); + Provider provider = Security.getProvider(providerName); if (provider == null) { - throw new RuntimeException("SunJCE provider does not exist."); + throw new RuntimeException(providerName + ": provider does not exist."); } // Generate secret key PBEKeySpec pbeKeySpec = new PBEKeySpec(password.toCharArray(), diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -122,7 +122,8 @@ } public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); for (String alg : ALGORITHMS) { for (int keyStrength : KEY_STRENGTHS) { if (keyStrength > Cipher.getMaxAllowedKeyLength(alg)) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -102,7 +102,8 @@ byte[] encrypt(int inLen) { try { - cipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + cipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); cipher.init(Cipher.ENCRYPT_MODE, key, spec); return cipher.doFinal(plaintext, 0, inLen); } catch (Exception e) { @@ -125,7 +126,8 @@ return false; } try { - cipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + cipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); cipher.init(Cipher.DECRYPT_MODE, key, spec); result = cipher.doFinal(data); } catch (Exception e) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -87,7 +87,8 @@ AAD = Helper.generateBytes(AADLength); // init a secret key - KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance("AES", + System.getProperty("test.provider.name", "SunJCE")); kg.init(keyLength); key = kg.generateKey(); } @@ -211,7 +212,8 @@ private Cipher createCipher(int mode, GCMParameterSpec spec) throws Exception { - Cipher cipher = Cipher.getInstance(TRANSFORMATION, "SunJCE"); + Cipher cipher = Cipher.getInstance(TRANSFORMATION, + System.getProperty("test.provider.name", "SunJCE")); cipher.init(mode, key, spec); return cipher; } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -37,7 +37,7 @@ static final String AES = "AES"; static final String TRANSFORMATION = "AES/GCM/NoPadding"; - static final String PROVIDER = "SunJCE"; + static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); static final int KEY_LENGTH = 128; public static void main(String argv[]) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ static final int BLOCK = 50; static final int SAVE = 45; static final int DISCARD = BLOCK - SAVE; - static final String PROVIDER = "SunJCE"; + static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); static final String AES = "AES"; static final String GCM = "GCM"; static final String PADDING = "NoPadding"; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ */ public class SameBuffer { - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); private static final String AES = "AES"; private static final String GCM = "GCM"; private static final String PADDING = "NoPadding"; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -37,7 +37,7 @@ private static final String AES = "AES"; private static final String TRANSFORMATION = "AES/GCM/NoPadding"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); private static final int KEY_LENGTH = 128; public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -44,7 +44,7 @@ */ public class WrongAAD { - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); private static final String TRANSFORMATION = "AES/GCM/NoPadding"; private static final int TEXT_SIZE = 800; private static final int KEY_SIZE = 128; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ "cFB24", "cFB32", "Cfb40", "CFB72", "OfB", "OfB20", "OfB48", "OfB56", "OFB64", "OFB112", "CFB112", "pCbC" }; private static final String[] PADDING = { "noPadding", "pkcs5padding" }; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); private static final int NREADS = 3; private static final int KEY_LENGTH = 128; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,8 @@ private static final String ALGORITHM = "AES"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunJCE"); private static final String[] MODES = {"CTR","CFB24","OFB32","GCM"}; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -47,7 +47,8 @@ public class Padding { private static final String ALGORITHM = "AES"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunJCE"); private static final String[] MODES_PKCS5PAD = { "ECb", "CbC", "PCBC", "OFB", "OFB150", "cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32", diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,10 +41,12 @@ public boolean execute() throws Exception { - Cipher ci = Cipher.getInstance(ALGO, "SunJCE"); + Cipher ci = Cipher.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); // TEST FIX 4511676 - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); try { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,10 +45,12 @@ public void execute(String mode) throws Exception { String transformation = ALGO+"/"+mode+"/"+PADDING; - Cipher ci = Cipher.getInstance(transformation, "SunJCE"); + Cipher ci = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); // TEST FIX 4512524 - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,9 +45,11 @@ AlgorithmParameterSpec aps = null; String transformation = ALGO + "/" + mode + "/"+PADDING; - Cipher ci = Cipher.getInstance(transformation, "SunJCE"); + Cipher ci = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); // TEST FIX 4512704 diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,10 +52,12 @@ byte[] plainText=new byte[125]; rdm.nextBytes(plainText); - Cipher ci = Cipher.getInstance(ALGO+"/"+MODE+"/"+PADDING, "SunJCE"); + Cipher ci = Cipher.getInstance(ALGO+"/"+MODE+"/"+PADDING, + System.getProperty("test.provider.name", "SunJCE")); // TEST FIX 4513830 - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -48,8 +48,10 @@ public void execute(String mode, String padding) throws Exception { String transformation = ALGO + "/" + mode + "/" + padding; - Cipher ci = Cipher.getInstance(transformation, "SunJCE"); - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + Cipher ci = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,10 @@ public void execute(String mode, String padding) throws Exception { String transformation = ALGO + "/" + mode + "/" + padding; - Cipher ci = Cipher.getInstance(transformation, "SunJCE"); - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + Cipher ci = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); SecretKey key = kg.generateKey(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -48,7 +48,7 @@ public class TestAESCipher { private static final String ALGORITHM = "AES"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); private static final String[] MODES = { "ECb", "CbC", "CTR", "PCBC", "OFB", "OFB150", "cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32", "Cfb40", "cfB48", "cfB56", "cfB64", "cfB72", "cfB80", "cfB88", diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ static final String[] PADDING = { "NoPadding", "PKCS5Padding", "ISO10126Padding" }; - static final String SUNJCE = "SunJCE"; + static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE"); Cipher ci = null; byte[] iv = null; @@ -128,8 +128,8 @@ new Random().nextBytes(plainText); String transformation = algo + "/" + mo + "/" + pad; - ci = Cipher.getInstance(transformation, SUNJCE); - KeyGenerator kg = KeyGenerator.getInstance(algo, SUNJCE); + ci = Cipher.getInstance(transformation, PROVIDER); + KeyGenerator kg = KeyGenerator.getInstance(algo, PROVIDER); if (keyStrength > Cipher.getMaxAllowedKeyLength(transformation)) { // skip if this key length is larger than what's // configured in the jce jurisdiction policy files diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java 2025-01-04 20:25:18.000000000 +0000 @@ -33,7 +33,7 @@ public class TestAESWithProviderChange extends Dynamic { public static void main(String argv[]) throws Exception { - Security.removeProvider(SUNJCE); + Security.removeProvider(PROVIDER); Security.addProvider(new com.sun.crypto.provider.SunJCE()); new TestAESWithProviderChange().run(argv); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java 2025-01-04 20:25:18.000000000 +0000 @@ -34,8 +34,8 @@ public class TestAESWithRemoveAddProvider extends Dynamic { public static void main(String argv[]) throws Exception { - Provider pJCE = Security.getProvider(SUNJCE); - Security.removeProvider(SUNJCE); + Provider pJCE = Security.getProvider(PROVIDER); + Security.removeProvider(PROVIDER); Security.addProvider(pJCE); new TestAESWithRemoveAddProvider().run(argv); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,7 @@ grant codeBase "file:${test.classes}/*" { - permission java.security.SecurityPermission "removeProvider.SunJCE"; - permission java.security.SecurityPermission "insertProvider.SunJCE"; + permission java.security.SecurityPermission "removeProvider.*"; + permission java.security.SecurityPermission "insertProvider.*"; permission java.lang.RuntimePermission "accessClassInPackage.com.sun.crypto.provider"; + permission java.util.PropertyPermission "test.provider.name", "read"; }; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -43,7 +43,8 @@ public class TestCICOWithGCM { public static void main(String[] args) throws Exception { //init Secret Key - KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance("AES", + System.getProperty("test.provider.name", "SunJCE")); kg.init(128); SecretKey key = kg.generateKey(); @@ -53,9 +54,11 @@ rdm.nextBytes(plainText); //init ciphers - Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); encCipher.init(Cipher.ENCRYPT_MODE, key); - Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters()); //init cipher streams diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ public class TestCICOWithGCMAndAAD { public static void main(String[] args) throws Exception { //init Secret Key - KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance("AES", + System.getProperty("test.provider.name", "SunJCE")); kg.init(128); SecretKey key = kg.generateKey(); @@ -53,10 +54,12 @@ byte[] aad2 = aad.clone(); aad2[50]++; - Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); encCipher.init(Cipher.ENCRYPT_MODE, key); encCipher.updateAAD(aad); - Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters()); decCipher.updateAAD(aad); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,8 @@ public static void main(String[] argv) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); AlgorithmParameterSpec params = null; boolean result = true; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -68,7 +68,8 @@ } public void test() throws Exception { - Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher c = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); SecretKey key = new SecretKeySpec(new byte[16], "AES"); // First try parameter-less init. diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,8 @@ private TestISO10126Padding() throws Exception { // setup - KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); kg.init(KEYSIZE*8); key = kg.generateKey(); } @@ -59,7 +60,8 @@ // TEST#1 -- // generate the cipher text using manually-supplied // XML Encryption padding - Cipher ci = Cipher.getInstance(TRANS + "/NoPadding", "SunJCE"); + Cipher ci = Cipher.getInstance(TRANS + "/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); ci.init(Cipher.ENCRYPT_MODE, key); byte[] paddedData = new byte[ci.getBlockSize()]; System.arraycopy(data, 0, paddedData, 0, data.length); @@ -68,7 +70,8 @@ byte[] cipherText = ci.doFinal(paddedData); // decrypt using ISO10126Padding - ci = Cipher.getInstance(TRANS + "/ISO10126Padding", "SunJCE"); + ci = Cipher.getInstance(TRANS + "/ISO10126Padding", + System.getProperty("test.provider.name", "SunJCE")); ci.init(Cipher.DECRYPT_MODE, key); byte[] recovered = ci.doFinal(cipherText); if (!Arrays.equals(data, recovered)) { @@ -76,7 +79,8 @@ } // TEST#2 -- // generate the cipher text using ISO10126Padding - ci = Cipher.getInstance(TRANS + "/ISO10126Padding", "SunJCE"); + ci = Cipher.getInstance(TRANS + "/ISO10126Padding", + System.getProperty("test.provider.name", "SunJCE")); ci.init(Cipher.ENCRYPT_MODE, key); cipherText = ci.doFinal(data); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -83,7 +83,8 @@ public boolean execute() throws Exception { String transformation = ALGO+"/"+MODE+"/"+PADDING; - Cipher c = Cipher.getInstance(transformation, "SunJCE"); + Cipher c = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); for (int i=0; i diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -707,7 +707,8 @@ public boolean execute() throws Exception { String transformation = ALGO+"/"+MODE+"/"+PADDING; - Cipher c = Cipher.getInstance(transformation, "SunJCE"); + Cipher c = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); for (int i=0; i diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -513,7 +513,8 @@ public boolean execute() throws Exception { String transformation = ALGO+"/"+MODE+"/"+PADDING; - Cipher c = Cipher.getInstance(transformation, "SunJCE"); + Cipher c = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); for (int i=0; i diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -278,7 +278,8 @@ }; void executeArray(TestVector tv) throws Exception { - Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher c = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); try { System.out.println("Test #" + tv.id + ": byte[]."); @@ -320,7 +321,8 @@ } void executeByteBuffer(TestVector tv, boolean direct, int offset) throws Exception { - Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + Cipher c = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); ByteBuffer src; ByteBuffer ctdst; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,8 @@ }; public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); String transformation; for (String mode : MODES) { for (String padding : PADDINGS) { @@ -50,7 +51,8 @@ System.out.println("Test using " + transformation); try { - Cipher c = Cipher.getInstance(transformation, "SunJCE"); + Cipher c = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); throw new RuntimeException("=> Fail, no exception thrown"); } catch (NoSuchAlgorithmException | NoSuchPaddingException ex) { System.out.println("=> Expected ex: " + ex); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,8 @@ public class TestNonexpanding { private static final String ALGORITHM = "AES"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunJCE"); private static final String[] MODES = { "ECb", "CbC", "OFB", "OFB150", "cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32", "Cfb40", "cfB48", "cfB56", "cfB64", "cfB72", "cfB80", "cfB88", "cfB96", "cfb104", diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -47,7 +47,8 @@ public class TestSameBuffer { private static final String ALGORITHM = "AES"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunJCE"); private static final String[] MODES = { "ECb", "CbC", "OFB", "CFB150", "cFB", "CFB7", " cFB8", "cFB16", "cFB24", "cFB32", "Cfb40", "cfB48", " cfB56", "cfB64", "cfB72", "cfB80", "cfB88", "cfB96", diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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 @@ -71,7 +71,7 @@ for (int i = 0; i < MODES.length; i++) { System.out.println("===== TESTING MODE " + MODES[i] + " ====="); Cipher ci = Cipher.getInstance(ALGO+"/"+MODES[i]+"/PKCS5Padding", - "SunJCE"); + System.getProperty("test.provider.name", "SunJCE")); TestShortBuffer test = null; int stored = 0; AlgorithmParameters params = null; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -162,7 +162,8 @@ continue; } System.out.println("Running test " + i + " (" + alg + ")"); - Cipher cipher = Cipher.getInstance(alg + "/CTR/NoPadding", "SunJCE"); + Cipher cipher = Cipher.getInstance(alg + "/CTR/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); SecretKeySpec key = new SecretKeySpec(KEYS[i], alg); IvParameterSpec iv = new IvParameterSpec(IVS[i]); byte[] plainText = PLAIN[i]; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -156,7 +156,7 @@ } System.out.println("Running test1_" + i + " (" + algo + ")"); Cipher cipher = Cipher.getInstance(algo+ "/CTS/NoPadding", - "SunJCE"); + System.getProperty("test.provider.name", "SunJCE")); byte[] plainText = PLAIN1[i]; byte[] cipherText = CIPHER1[i]; cipher.init(Cipher.ENCRYPT_MODE, KEY1, IV1); @@ -194,7 +194,8 @@ continue; } Cipher cipher = - Cipher.getInstance(algo+"/CTS/NoPadding", "SunJCE"); + Cipher.getInstance(algo+"/CTS/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); int blockSize = cipher.getBlockSize(); SecretKeySpec key = new SecretKeySpec(new byte[keySize], algo); // Make sure encryption works for inputs with valid length @@ -226,7 +227,8 @@ IvParameterSpec iv2 = new IvParameterSpec(IV2_SRC, 0, blockSize); cipher.init(Cipher.ENCRYPT_MODE, key, iv2); Cipher cipher2 = - Cipher.getInstance(algo+"/CBC/NoPadding", "SunJCE"); + Cipher.getInstance(algo+"/CBC/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); cipher2.init(Cipher.ENCRYPT_MODE, key, iv2); byte[] eout = cipher.doFinal(IV2_SRC, 0, blockSize); @@ -294,7 +296,8 @@ continue; } Cipher cipher = - Cipher.getInstance(algo+ "/CTS/NoPadding", "SunJCE"); + Cipher.getInstance(algo+ "/CTS/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); byte[] plainText = PLAIN1[i]; byte[] cipherText = CIPHER1[i]; byte[] enc = new byte[plainText.length]; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,16 +24,19 @@ /* * @test * @bug 0000000 + * @library /test/lib * @summary KeyWrapping * @author Jan Luehe */ import javax.crypto.*; import java.security.*; +import jdk.test.lib.security.SecurityUtils; public class KeyWrapping { public static void main(String[] args) throws Exception { - Cipher c1 = Cipher.getInstance("DES", "SunJCE"); + Cipher c1 = Cipher.getInstance("DES", + System.getProperty("test.provider.name", "SunJCE")); Cipher c2 = Cipher.getInstance("DES"); KeyGenerator keyGen = KeyGenerator.getInstance("DES"); @@ -70,8 +73,9 @@ if (!msg.equals(new String(clearText))) throw new Exception("The unwrapped session key is corrupted."); - KeyPairGenerator kpairGen = KeyPairGenerator.getInstance("DSA"); - kpairGen.initialize(1024); + String kpgAlgorithm = "DSA"; + KeyPairGenerator kpairGen = KeyPairGenerator.getInstance(kpgAlgorithm); + kpairGen.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kpair = kpairGen.genKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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,11 +26,8 @@ * @bug 0000000 * @summary This test checks performance of various ciphers. * @author Jan Luehe - * @run main/manual PerformanceTest */ -import java.security.*; import java.security.spec.*; -import java.io.*; import javax.crypto.*; import javax.crypto.spec.*; @@ -178,14 +175,16 @@ long start, end; cipher.init(Cipher.ENCRYPT_MODE, cipherKey, params); - start = System.currentTimeMillis(); + start = getTimeInMicroseconds(); for (int i=0; i skip, exceeds max allowed size " + allowed); return; } - Cipher c1 = Cipher.getInstance(algo, "SunJCE"); - Cipher c2 = Cipher.getInstance(algo, "SunJCE"); - Cipher c3 = Cipher.getInstance(algo, "SunJCE"); + Cipher c1 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); + Cipher c2 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); + Cipher c3 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); byte[] keyVal = toBytes(key, keyLen << 1); byte[] dataVal = toBytes(data, dataLen << 1); @@ -318,9 +321,12 @@ System.out.println("=> skip, exceeds max allowed size " + allowed); return; } - Cipher c1 = Cipher.getInstance(algo, "SunJCE"); - Cipher c2 = Cipher.getInstance(algo, "SunJCE"); - Cipher c3 = Cipher.getInstance(algo, "SunJCE"); + Cipher c1 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); + Cipher c2 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); + Cipher c3 = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); byte[] keyVal = toBytes(key, keyLen << 1); byte[] dataVal = toBytes(data, dataLen << 1); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,15 +50,18 @@ import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; +import jdk.test.lib.security.SecurityUtils; /* * @test * @bug 8048599 8248268 + * @library /test/lib * @summary Tests for key wrap and unwrap operations */ public class TestCipherKeyWrapperTest { - private static final String SUN_JCE = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); // Blowfish Variable key length: 32 bits to 448 bits private static final int BLOWFISH_MIN_KEYSIZE = 32; private static final int BLOWFISH_MAX_KEYSIZE = 448; @@ -152,14 +155,15 @@ // PBE and public wrapper test. String[] publicPrivateAlgos = new String[] { "DiffieHellman", "DSA", "RSA" }; - Provider provider = Security.getProvider(SUN_JCE); + Provider provider = Security.getProvider(PROVIDER_NAME); if (provider == null) { - throw new RuntimeException("SUN_JCE provider not exist"); + throw new RuntimeException(PROVIDER_NAME + " provider not exist"); } test.wrapperPBEKeyTest(provider); // Public and private key wrap test - test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos); + test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos, "DES"); + test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos, "AES"); } private void wrapperAesDESedeKeyTest(String algo, String wrapAlgo, @@ -253,7 +257,7 @@ } } - private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms) + private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms, String algoWrap) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException { @@ -262,10 +266,9 @@ System.out.println("Generate key pair (algorithm: " + algo + ", provider: " + p.getName() + ")"); KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo); - kpg.initialize(512); + kpg.initialize(SecurityUtils.getTestKeySize(algo)); KeyPair kp = kpg.genKeyPair(); // key generated - String algoWrap = "DES"; KeyGenerator kg = KeyGenerator.getInstance(algoWrap, p); Key key = kg.generateKey(); wrapTest(algo, algoWrap, key, kp.getPrivate(), Cipher.PRIVATE_KEY, diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -176,7 +176,8 @@ String ALGO = "AES/KW/PKCS5Padding"; System.out.println("Testing " + ALGO); - Cipher c = Cipher.getInstance(ALGO, "SunJCE"); + Cipher c = Cipher.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); // test all possible pad lengths, i.e. 1 - 16 for (int i = 1; i <= MAX_KW_PKCS5PAD_LEN; i++) { @@ -187,7 +188,8 @@ ALGO = "AES/KW/NoPadding"; System.out.println("Testing " + ALGO); - c = Cipher.getInstance(ALGO, "SunJCE"); + c = Cipher.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); testEnc(c, data, data.length, KW_IV_LEN, 0); testEnc(c, data, data.length >> 1, KW_IV_LEN, 0); testWrap(c, data, data.length, KW_IV_LEN, 0); @@ -196,7 +198,8 @@ ALGO = "AES/KWP/NoPadding"; System.out.println("Testing " + ALGO); - c = Cipher.getInstance(ALGO, "SunJCE"); + c = Cipher.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); // test all possible pad lengths, i.e. 0 - 7 for (int i = 0; i <= MAX_KWP_PAD_LEN; i++) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 8248268 + * @bug 8248268 8302225 * @summary Verify cipher key size restriction is enforced properly with IKE * @run main TestKeySizeCheck */ @@ -43,6 +43,8 @@ } } + private static final int[] AES_KEYSIZES = { 128, 192, 256 }; + private static SecretKey getKey(int sizeInBytes) { if (sizeInBytes <= BYTES_32.length) { return new SecretKeySpec(BYTES_32, 0, sizeInBytes, "AES"); @@ -59,12 +61,13 @@ throws Exception { System.out.println("Testing " + algo); - Cipher c = Cipher.getInstance(algo, "SunJCE"); + Cipher c = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); int[] modes = { Cipher.ENCRYPT_MODE, Cipher.WRAP_MODE }; for (int ks : invalidKeySizes) { System.out.println("keysize: " + ks); - SecretKey key = getKey(ks); + SecretKey key = getKey(ks >> 3); for (int m : modes) { try { @@ -72,11 +75,25 @@ throw new RuntimeException("Expected IKE not thrown for " + getModeStr(m)); } catch (InvalidKeyException ike) { - System.out.println(" => expected IKE thrown for " - + getModeStr(m)); + System.out.println(getModeStr(m) + " => got expected IKE"); } } } + + // now test against the valid key size(s) and make sure they work + int underscoreIdx = algo.indexOf("_"); + int[] validKeySizes = (algo.indexOf("_") == -1 ? + AES_KEYSIZES : new int[] { Integer.parseInt(algo.substring + (underscoreIdx + 1, underscoreIdx + 4)) }); + for (int ks : validKeySizes) { + System.out.println("keysize: " + ks); + SecretKey key = getKey(ks >> 3); + + for (int m : modes) { + c.init(m, key); + System.out.println(getModeStr(m) + " => ok"); + } + } } public static void main(String[] argv) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,8 @@ String cKeyAlg, String[] base64Wrapped) throws Exception { System.out.println("Testing " + cAlg + " Cipher with " + 8*cKeyVal.length + "-bit key"); - Cipher c = Cipher.getInstance(cAlg, "SunJCE"); + Cipher c = Cipher.getInstance(cAlg, + System.getProperty("test.provider.name", "SunJCE")); SecretKey cKey = new SecretKeySpec(cKeyVal, cKeyAlg); c.init(Cipher.UNWRAP_MODE, cKey); Key[] key = new SecretKey[base64Wrapped.length]; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,8 @@ public static void main(String argv[]) throws Exception { String algo = "PBEWithMD5AndDES"; - Cipher cipher = Cipher.getInstance(algo, "SunJCE"); + Cipher cipher = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); SecretKey key = new SecretKeySpec(new byte[5], algo); try { cipher.init(Cipher.DECRYPT_MODE, key); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,9 @@ public static void main(String[] args) throws Exception { SecretKeyFactory skf = SecretKeyFactory.getInstance( - "PBKDF2WithHmacSHA1", "SunJCE"); + "PBKDF2WithHmacSHA1", + System.getProperty("test.provider.name", "SunJCE")); + // Create a valid PBEKeySpec PBEKeySpec pbeks = new PBEKeySpec( diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -65,7 +65,8 @@ System.out.println("=>testing " + algo); SecretKeyFactory skf = SecretKeyFactory.getInstance(algo); SecretKey key = skf.generateSecret(ks); - Cipher c = Cipher.getInstance(algo, "SunJCE"); + Cipher c = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); try { c.init(Cipher.ENCRYPT_MODE, key, INVALID_PARAMS); throw new Exception("Test Failed: expected IAPE is " + diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +23,7 @@ /* * @test + * @library /test/lib * @modules java.base/com.sun.crypto.provider:+open * @run main/othervm PBEKeyCleanupTest * @summary Verify that key storage is cleared @@ -38,6 +39,7 @@ import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; +import jdk.test.lib.security.SecurityUtils; /** * Test that the array holding the key bytes is cleared when it is @@ -45,7 +47,8 @@ */ public class PBEKeyCleanupTest { - private final static String SunJCEProvider = "SunJCE"; + private final static String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); private static final String PASS_PHRASE = "some hidden string"; private static final int ITERATION_COUNT = 1000; @@ -60,19 +63,19 @@ char[] password = new char[] {'f', 'o', 'o'}; PBEKeySpec pbeKeySpec = new PBEKeySpec(password); SecretKeyFactory keyFac = - SecretKeyFactory.getInstance(algorithm, SunJCEProvider); + SecretKeyFactory.getInstance(algorithm, PROVIDER_NAME); testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec)); } private static void testPBKSecret(String algorithm) throws Exception { - byte[] salt = new byte[8]; + byte[] salt = new byte[SecurityUtils.getTestSaltSize()]; new Random().nextBytes(salt); char[] password = new char[] {'f', 'o', 'o'}; PBEKeySpec pbeKeySpec = new PBEKeySpec(PASS_PHRASE.toCharArray(), salt, ITERATION_COUNT, KEY_SIZE); SecretKeyFactory keyFac = - SecretKeyFactory.getInstance(algorithm, SunJCEProvider); + SecretKeyFactory.getInstance(algorithm, PROVIDER_NAME); testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec)); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,8 @@ for (String s : algs) { System.out.println("Testing " + s); - SecretKeyFactory skf = SecretKeyFactory.getInstance(s, "SunJCE"); + SecretKeyFactory skf = SecretKeyFactory.getInstance(s, + System.getProperty("test.provider.name", "SunJCE")); System.out.println(" Checking skf.getAlgorithm()"); if (!skf.getAlgorithm().equalsIgnoreCase(s)) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,7 +59,8 @@ String algo = PBE_ALGOS[i]; SecretKeyFactory skf = SecretKeyFactory.getInstance(algo); SecretKey key = skf.generateSecret(ks); - Cipher c = Cipher.getInstance(algo, "SunJCE"); + Cipher c = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.ENCRYPT_MODE, key); c.doFinal(new byte[10]); // force the generation of parameters AlgorithmParameters params = c.getParameters(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -81,7 +81,7 @@ public boolean test(String[] args, PrintStream out) { boolean result = true; - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); for (int loop : OFFSETS) { OUTPUT_OFFSET = loop; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -76,9 +76,12 @@ "PBEWithHmacSHA512AndAES_256" }; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); + public static void main(String[] args) { PBESealedObject test = new PBESealedObject(); - Provider sunjce = Security.getProvider("SunJCE"); + Provider sunjce = Security.getProvider(PROVIDER_NAME); if (!test.runAll(sunjce, System.out)) { throw new RuntimeException("One or more tests have failed...."); @@ -158,7 +161,7 @@ return false; } - unsealedKey = (SecretKey) so.getObject(key, "SunJCE"); + unsealedKey = (SecretKey) so.getObject(key, PROVIDER_NAME); return Arrays.equals(unsealedKey.getEncoded(), key.getEncoded()); } catch (InvalidKeyException ex) { if (baseAlgo.endsWith("TRIPLEDES") || baseAlgo.endsWith("AES_256")) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -84,7 +84,8 @@ new SecureRandom().nextBytes(input); char[] PASSWD = { 'p','a','s','s','w','o','r','d' }; long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); runTest("PBEWithSHA1AndDESede", input, PASSWD, p); runTest("PBEWithSHA1AndRC2_40", input, PASSWD, p); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -179,7 +179,8 @@ static void runTests(Test[] tests) throws Exception { long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); Cipher.getInstance("PBEWithSHA1AndRC2_40", p); Cipher.getInstance("PBEWithSHA1AndDESede", p); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -79,7 +79,8 @@ public static void main(String[] args) { TestCipherKeyWrapperPBEKey test = new TestCipherKeyWrapperPBEKey(); - Provider sunjce = Security.getProvider("SunJCE"); + Provider sunjce = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); if (!test.runAll(sunjce, System.out)) { throw new RuntimeException("One or more tests have failed...."); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,14 +40,15 @@ public class TestCipherPBECons { private static final String[] PBEAlgorithms = {"pbeWithMD5ANDdes", - "PBEWithMD5AndTripleDES"}; + "PBEWithMD5AndTripleDES", "PBEWithSHA1AndDESede"}; private static final String[] cipherModes = {"ECb", "cbC", "cFB", "Cfb32", "OfB", "oFb64", "pCbC"}; private static final String[] cipherPaddings = {"Pkcs5Padding", "NoPaDDing"}; public static void main(String[] args) { TestCipherPBECons test = new TestCipherPBECons(); - Provider sunjce = Security.getProvider("SunJCE"); + Provider sunjce = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); if (!test.runAll(sunjce, System.out)) { throw new RuntimeException("One or more tests have failed...."); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -47,9 +47,10 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - cp = Security.getProvider("SunJCE"); + cp = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + cp.getName() + "..."); - Provider kfp = Security.getProvider("SunRsaSign"); + Provider kfp = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp); kpg.initialize(768); KeyPair kp = kpg.generateKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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,6 +24,7 @@ /* * @test * @bug 8020081 8022669 + * @library /test/lib * @summary encryption/decryption test for using OAEPPadding with * OAEPParameterSpec specified and not specified during a Cipher.init(). * @author Anthony Scarpino @@ -43,7 +44,7 @@ import javax.crypto.spec.OAEPParameterSpec; import javax.crypto.IllegalBlockSizeException; import javax.crypto.spec.PSource; - +import jdk.test.lib.security.SecurityUtils; public class TestOAEPPadding { private static RSAPrivateKey privateKey; @@ -52,11 +53,14 @@ static boolean failed = false; public static void main(String args[]) throws Exception { - cp = Security.getProvider("SunJCE"); + cp = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + cp.getName() + "..."); - Provider kfp = Security.getProvider("SunRsaSign"); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp); - kpg.initialize(2048); + Provider kfp = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); + String kpgAlgorithm = "RSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, kfp); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); privateKey = (RSAPrivateKey)kp.getPrivate(); publicKey = (RSAPublicKey)kp.getPublic(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -44,7 +44,8 @@ byte[] p) throws Exception { OAEPParameterSpec spec = new OAEPParameterSpec(mdName, "MGF1", mgfSpec, new PSource.PSpecified(p)); - cp = Security.getProvider("SunJCE"); + cp = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + cp.getName() + "..."); AlgorithmParameters ap = AlgorithmParameters.getInstance("OAEP", cp); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +24,7 @@ /* * @test * @bug 4923484 8146293 + * @library /test/lib * @summary encryption/decryption test for using OAEPParameterSpec. * @author Valerie Peng */ @@ -35,6 +36,7 @@ import javax.crypto.*; import javax.crypto.spec.PSource; import javax.crypto.spec.OAEPParameterSpec; +import jdk.test.lib.security.SecurityUtils; public class TestOAEPWithParams { @@ -54,11 +56,14 @@ }; public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - cp = Security.getProvider("SunJCE"); + cp = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + cp.getName() + "..."); - Provider kfp = Security.getProvider("SunRsaSign"); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp); - kpg.initialize(768); + Provider kfp = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); + String kpgAlgorithm = "RSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, kfp); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); privateKey = kp.getPrivate(); publicKey = kp.getPublic(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,8 +57,10 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - Provider provider = Security.getProvider("SunJCE"); - Provider kfProvider = Security.getProvider("SunRsaSign"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); + Provider kfProvider = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); System.out.println("Testing provider " + provider.getName() + "..."); Cipher c = Cipher.getInstance("RSA/ECB/OAEPwithSHA1andMGF1Padding", provider); KeyFactory kf = KeyFactory.getInstance("RSA", kfProvider); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,20 +101,28 @@ } private final static BigInteger N = new BigInteger - ("116231208661367609700141079576488663663527180869991078124978203037949869" - +"312762870627991319537001781149083155962615105864954367253799351549459177" - +"839995715202060014346744789001273681801687605044315560723525700773069112" - +"214443196787519930666193675297582113726306864236010438506452172563580739" - +"994193451997175316921"); + ("188266606413163647033284152746165049309898453322378171182320013745371408" + +"184225151227340555539225381200565037956400694325061098310480360339435446" + +"755336872372614880713694669514510970895097323213784523223711244354375506" + +"545371740274561954822416119304686041493350049135717091225288845575963270" + +"990119098295690603875646206002898855577388327774594330896529948536446408" + +"529165060686851725546480612209956477350581924733034990053737541249952501" + +"521769091148873248215142518797910690254486909784694829645856181407041627" + +"170373444275842961547787746324163594572697634605250977434548015081503826" + +"85269006571608614747965903308253511034583"); private final static BigInteger E = BigInteger.valueOf(65537); private final static BigInteger D = new BigInteger - ("528278531576995741358027120152717979850387435582102361125581844437708890" - +"736418759997555187916546691958396015481089485084669078137376029510618510" - +"203389286674134146181629472813419906337170366867244770096128371742241254" - +"843638089774095747779777512895029847721754360216404183209801002443859648" - +"26168432372077852785"); + ("559658959270449023652159986632594861346314765962941829914811303419116045" + +"486272857832294696380057096672262714220410818939360476461317579410769250" + +"330981320689411092912185059149606517928125605236733543203155054153225543" + +"370812803235323701309554652228655108862291812277980776744407549833834128" + +"186640306349843950814414209051640048163781518404082259622597528271617305" + +"214590875955949331568915021275293633454662841999317653268823194135508673" + +"577887397954709453731172900970199673444683653554380810128925964066225098" + +"009484055412274405773246950554037029408478181447349886871279557912030178" + +"079306593910311097342934485929224862873"); private final static Random RANDOM = new Random(); @@ -154,21 +162,22 @@ } private final static String in2 = "0f:7d:6c:20:75:99:a5:bc:c1:53:b0:4e:8d:ef:98:fb:cf:2d:e5:1d:d4:bf:71:56:12:b7:a3:c3:e4:53:1b:07:d3:bb:94:a7:a7:28:75:1e:83:46:c9:80:4e:3f:ac:b2:47:06:9f:1b:68:38:73:b8:69:9e:6b:8b:8b:23:60:31:ae:ea:36:24:6f:85:af:de:a5:2a:88:7d:6a:9f:8a:9f:61:f6:59:3f:a8:ce:91:75:49:e9:34:b8:9f:b6:21:8c"; - private final static String out2 = "7d:84:d1:3a:dc:ac:46:09:3a:0c:e5:4b:85:5d:fa:bb:52:f1:0f:de:d9:87:ef:b3:f7:c8:e3:9a:29:be:e9:b5:51:57:fd:07:5b:3c:1c:1c:56:aa:0c:a6:3f:79:40:16:ee:2c:2c:2e:fe:b8:3e:fd:45:90:1c:e7:87:1d:0a:0a:c5:de:9d:2b:a9:dd:77:d2:89:ba:98:fe:78:5b:a3:91:b4:ac:b5:ae:ce:45:21:f7:74:97:3e:a9:58:59:bc:14:13:02:3f:09:7b:97:90:b3:bd:53:cb:15:c0:6e:36:ea:d4:a3:3e:fc:94:85:a9:66:7f:57:b4:2a:ae:70:2e:fb"; + private final static String out2 = "4d:17:15:23:d9:f6:97:4d:4b:5b:9b:37:bd:a7:c5:33:b9:40:1f:c4:63:fa:7c:2a:fb:19:0b:d8:c4:3a:bd:e7:46:6b:1b:09:20:93:39:7c:e5:5f:7b:83:a7:a6:f6:f5:42:20:e7:7f:d3:14:9a:14:25:f9:31:9e:3c:c9:04:20:be:31:ac:77:45:37:4d:76:1b:10:3a:aa:42:c7:df:4c:61:a4:35:4d:28:41:c2:f9:b7:ce:00:94:42:06:c7:35:06:ca:f2:9e:96:c3:89:54:10:82:d8:de:f3:6c:23:8c:47:41:5a:13:fa:33:e0:a5:7f:ec:43:5d:b0:ea:c9:43:17:72:73:ce:11:48:fb:19:ee:13:6a:92:13:06:5c:55:dc:9e:86:b9:fb:44:62:44:9e:a9:e8:bd:6a:c0:c1:64:4b:fd:a9:5d:ef:59:1e:16:fe:64:c1:07:31:9e:9f:4d:4e:28:34:ea:39:e0:65:68:d4:8b:02:0b:8b:ed:bb:a6:a6:4a:29:b9:b5:08:f3:7a:a8:fd:03:3e:0d:d0:9e:25:47:2c:45:f2:40:39:58:e8:95:64:04:2b:50:1e:a5:ff:00:a4:cf:a9:13:4b:17:3a:e8:d1:2c:c1:4a:ab:1c:07:b4:b5:f6:c9:3f:38:48:89:55:59:00:c1:25:c9:d7:68"; private final static String in1 = "17:a3:a7:b1:86:29:06:c5:81:33:cd:2f:da:32:7c:0e:26:a8:18:aa:37:9b:dd:4a:b0:b0:a7:1c:14:82:6c:d9:c9:14:9f:55:19:91:02:0d:d9:d7:95:c2:2b:a6:fa:ba:a3:51:00:83:6b:ec:97:27:40:a3:8f:ba:b1:09:15:11:44:33:c6:3c:47:95:50:71:50:5a:f4:aa:00:4e:b9:48:6a:b1:34:e9:d0:c8:b8:92:bf:95:f3:3d:91:66:93:2b"; - private final static String out1 = "28:b7:b4:73:f2:16:11:c0:67:70:96:ee:dc:3e:23:87:9f:30:a7:e5:f0:db:aa:67:33:27:0e:75:79:af:29:f5:88:3d:93:22:14:d2:59:b4:eb:ce:95:7f:24:74:df:f2:aa:4d:e6:65:5a:63:6d:64:30:ef:31:f1:a6:df:17:42:b6:d1:ed:22:1f:b0:96:69:9d:f8:ce:ff:3a:47:96:51:ba:d9:8d:57:39:40:dc:fc:d3:03:92:39:f4:dd:4b:1b:07:8b:33:60:27:2d:5f:c6:cf:17:92:c6:12:69:a3:54:2e:b8:0f:ca:d9:46:0f:da:95:34:d0:84:35:9c:f6:44"; + private final static String out1 = "18:6d:d2:89:43:cb:ec:5c:ff:3d:fd:d5:23:2d:aa:fc:db:a7:63:5f:c7:2d:6f:81:c2:9f:aa:47:ed:fc:79:39:8a:6d:8f:c3:d0:f9:64:c3:e1:5f:1a:b3:20:03:1e:8a:3a:c5:58:ef:78:6b:fc:50:98:0a:11:d3:30:d9:68:44:9b:93:a6:b3:92:8f:09:0c:7a:d0:64:ac:e2:c7:b5:6a:37:35:00:3b:4e:d7:64:fb:54:c2:54:90:b9:71:6a:48:c4:6c:1e:e4:e6:4c:3f:fc:34:69:16:b9:53:8c:9f:30:4e:2e:7e:9c:fb:5f:26:18:c0:6e:69:32:18:30:40:59:8c:d1:c2:7a:41:75:06:9d:1c:0f:14:74:a9:f0:47:3a:97:0d:c4:c6:3f:24:ee:ed:c5:f8:2c:b6:ae:1d:e5:64:33:cd:e1:e0:21:d6:10:c0:8b:59:06:59:81:73:28:b4:f4:ef:fa:e8:67:a8:65:a5:e4:3c:c3:7e:99:f8:55:7a:e9:0d:41:3a:bf:c1:8c:41:f3:71:32:b6:c0:05:8b:91:8a:90:35:60:95:52:78:8e:a7:e5:a9:a1:bf:a3:de:55:c6:02:03:d5:98:01:59:fb:91:da:37:9e:3f:39:85:e1:3f:79:23:6c:0e:68:25:4c:13:3a:52:a2:f8:d9:4c:ce"; - private final static String rin1 = "09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c"; - private final static String rout1 = "4a:21:64:20:56:5f:27:0c:90:1d:f3:1b:64:8e:16:d3:af:79:ca:c6:65:56:19:77:8f:25:35:70:be:f3:15:b3:e3:d8:8f:04:ec:c3:60:59:d0:9a:66:be:1c:ad:f7:09:46:a9:09:46:12:5f:28:b6:28:b1:53:fb:fe:07:73:b8:8b:f8:83:64:8e:2d:45:ca:1a:fd:85:4a:2c:fa:fc:e6:58:f7:e4:83:68:8c:38:49:2b:f3:5c:c1:2d:24:6a:cd:22:6d:cb:f4:f1:8c:9e:1a:94:a7:4b:6f:d1:b4:b4:ab:56:8b:a3:a9:89:88:c3:5d:a8:47:2a:67:50:32:71:19"; + private final static String rin1 = "09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c:09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c"; + private final static String rout1 = "19:dd:a2:f9:57:d4:6b:60:85:ec:2d:5d:f9:64:f8:a0:c0:33:36:a2:8c:59:0f:74:9b:62:a8:ad:42:ed:be:34:0e:dc:13:db:d5:b9:aa:64:38:35:18:d7:6c:1d:da:5b:ff:f2:98:f5:fc:67:36:fb:9f:84:df:84:a3:af:ce:02:e5:05:ca:a7:e4:29:c0:5c:55:6a:8d:dc:8f:f7:6e:d4:ee:2e:6c:5b:ea:f8:bf:4c:7d:5f:af:6a:c3:77:02:80:33:be:13:4c:98:cf:dc:aa:e8:7d:73:69:6e:30:2c:35:c5:90:83:45:0d:64:04:af:b6:94:c3:a8:e2:d4:08:98:1d:b1:73:e3:fc:10:1f:71:0f:d0:13:f3:58:80:c4:a3:a9:02:52:cf:aa:41:b6:9b:69:33:9d:2a:d6:f6:02:07:ec:ce:19:01:f1:2f:90:27:fe:00:a5:d7:8d:01:97:36:fd:88:34:2f:f3:ab:38:ed:9d:69:91:af:b2:0d:ca:92:ca:9e:e7:24:37:d6:e3:c7:02:30:69:5b:ea:b4:b2:68:5f:4e:8c:cc:fd:bb:2e:96:2f:a3:c6:f7:71:93:24:5c:ca:8f:bc:f9:d8:bd:d3:b9:d1:16:ba:5a:ac:62:41:b4:d8:56:45:74:55:c2:a5:ef:23:f5:e3:27:ce:99:97:e9"; - private final static String rin2 = "1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c"; - private final static String rout2 = "65:28:b9:48:8d:68:3f:5e:9a:85:e7:09:78:4c:0c:0e:60:6c:89:43:3c:d3:72:b9:2f:5a:eb:4f:15:77:93:9d:47:05:a6:52:48:72:ee:ce:e8:5a:6d:28:b0:06:5a:a1:93:58:a1:61:3f:9b:42:0d:c1:ec:32:0a:7a:1e:38:45:47:87:52:16:62:c9:44:c6:04:4d:82:64:01:f4:b1:26:dc:7f:61:82:52:7a:f6:6b:ab:22:98:87:93:63:4c:3f:92:c7:5b:cc:e5:2b:15:db:f7:d3:c7:b5:38:6f:15:3b:1e:88:3d:31:0c:b4:f9:6d:66:41:b7:1b:a0:4a:b8:16"; + private final static String rin2 = "1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c:1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c"; + private final static String rout2 = "7a:11:19:cf:76:97:4b:29:48:66:69:e7:f0:db:18:53:d4:50:71:a4:9d:90:47:9f:e6:8a:f3:ba:2e:96:fd:c8:4b:02:7e:06:a9:2b:47:0d:68:3c:6a:f9:21:62:77:0d:4e:e1:1b:82:97:66:13:01:c2:3b:b2:d3:f8:9e:cc:c9:2a:1a:76:05:3f:d4:f7:fb:9d:9b:bf:a8:2d:fd:81:e5:f4:bb:ca:3b:5f:93:ea:ef:88:1c:c1:18:52:38:be:50:42:29:08:d9:65:43:5f:01:7d:50:22:7a:2f:f1:29:14:95:30:c1:b8:fd:eb:da:c1:4e:8a:ef:97:84:f9:cf:34:ab:89:a6:3c:4a:ff:a4:98:a8:7c:c6:2c:c3:e3:10:a9:8b:67:32:47:35:37:15:03:3b:d0:f3:23:fc:bb:42:64:a2:ba:63:3e:94:6e:7a:e6:94:05:79:29:28:d5:99:5b:f9:67:fd:ea:d3:5f:b5:7b:f4:10:9b:0a:1c:20:6b:0c:59:56:76:45:07:56:cb:d0:ab:08:fc:19:8e:f1:27:03:22:f1:e9:23:d3:01:b1:4d:cf:96:f7:a6:44:59:de:2a:52:fd:bb:14:ae:39:c4:e4:0f:4e:10:f7:c6:61:79:0a:a6:4c:ed:ee:d7:40:fe:ef:f3:85:ae:3e:f3:bb:6e:de"; public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - p = Security.getProvider("SunJCE"); + p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); KeyFactory kf; @@ -189,8 +198,8 @@ // blocktype 1 testEncDec("RSA/ECB/PKCS1Padding", 96, privateKey, publicKey); - testEncDec("RSA/ECB/NoPadding", 128, publicKey, privateKey); - testEncDec("RSA/ECB/NoPadding", 128, privateKey, publicKey); + testEncDec("RSA/ECB/NoPadding", 256, publicKey, privateKey); + testEncDec("RSA/ECB/NoPadding", 256, privateKey, publicKey); // expected failure, blocktype 2 random padding bytes are different testKat("RSA/ECB/PKCS1Padding", Cipher.ENCRYPT_MODE, publicKey, in2, out2, false); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -44,7 +44,7 @@ */ public abstract class TestCipher { - private final String SUNJCE = "SunJCE"; + private final String PROVIDER_NAME = System.getProperty("test.provider.name", "SunJCE"); private final String ALGORITHM; private final String[] MODES; private final String[] PADDINGS; @@ -138,8 +138,8 @@ out.println("Testing: " + TRANSFORMATION); // Initialization - Cipher ci = Cipher.getInstance(TRANSFORMATION, SUNJCE); - KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM, SUNJCE); + Cipher ci = Cipher.getInstance(TRANSFORMATION, PROVIDER_NAME); + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM, PROVIDER_NAME); if (keySize != 0) { kg.init(keySize); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -44,9 +44,11 @@ SameBufferOverwrite(String algo, String transformation) throws Exception { - KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); skey = kg.generateKey(); - c = Cipher.getInstance(transformation, "SunJCE"); + c = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); } /* diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,8 @@ // decide if the installed jurisdiction policy file is the // unlimited version boolean isUnlimited = true; - Cipher c = Cipher.getInstance("AES", "SunJCE"); + Cipher c = Cipher.getInstance("AES", + System.getProperty("test.provider.name", "SunJCE")); try { c.init(Cipher.ENCRYPT_MODE, diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,9 +40,10 @@ Cipher jce; try{ + String providerName = System.getProperty("test.provider.name", "SunJCE"); // Remove SunJCE from Provider list - Provider prov = Security.getProvider("SunJCE"); - Security.removeProvider("SunJCE"); + Provider prov = Security.getProvider(providerName); + Security.removeProvider(providerName); // Create our own instance of SunJCE provider. Purposefully not // using SunJCE.getInstance() so we can have our own instance // for the test. diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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,6 +24,7 @@ /* * @test * @bug 0000000 + * @library /test/lib * @summary DHGenSharedSecret * @author Jan Luehe */ @@ -33,40 +34,11 @@ import javax.crypto.*; import javax.crypto.spec.*; import java.math.BigInteger; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; public class DHGenSharedSecret { - static byte[] DHPrime = { -(byte)0x00, (byte)0x8D, (byte)0x8A, (byte)0x6C, (byte)0x7F, (byte)0xCC, -(byte)0xA5, (byte)0xBF, (byte)0x9C, (byte)0xE1, (byte)0xFA, (byte)0x3C, -(byte)0xCA, (byte)0x98, (byte)0xB7, (byte)0x99, (byte)0xD1, (byte)0xE5, -(byte)0x2C, (byte)0xC0, (byte)0x26, (byte)0x97, (byte)0x12, (byte)0x80, -(byte)0x12, (byte)0xEF, (byte)0x0B, (byte)0xDE, (byte)0x71, (byte)0x76, -(byte)0xAA, (byte)0x2D, (byte)0x86, (byte)0x41, (byte)0x0E, (byte)0x6A, -(byte)0xC2, (byte)0x12, (byte)0xAA, (byte)0xAA, (byte)0xE4, (byte)0x84, -(byte)0x80, (byte)0x13, (byte)0x95, (byte)0x06, (byte)0xC4, (byte)0x83, -(byte)0xB9, (byte)0xD3, (byte)0x72, (byte)0xC5, (byte)0xC8, (byte)0x85, -(byte)0x96, (byte)0x59, (byte)0x08, (byte)0xFA, (byte)0x9E, (byte)0x3C, -(byte)0xDC, (byte)0x92, (byte)0x28, (byte)0xC3, (byte)0x1D, (byte)0x6F, -(byte)0x44, (byte)0x36, (byte)0x70, (byte)0x40, (byte)0x80, (byte)0xF1, -(byte)0x35 - }; - - static byte[] DHBase = { -(byte)0x72, (byte)0x21, (byte)0xB3, (byte)0xA8, (byte)0x83, (byte)0xDD, -(byte)0x76, (byte)0xF5, (byte)0x0D, (byte)0x9B, (byte)0x81, (byte)0x11, -(byte)0x15, (byte)0x03, (byte)0x6D, (byte)0x4D, (byte)0x46, (byte)0x65, -(byte)0x30, (byte)0xB0, (byte)0xFA, (byte)0xFE, (byte)0xBE, (byte)0xA8, -(byte)0xD9, (byte)0x83, (byte)0x33, (byte)0x54, (byte)0xC7, (byte)0xF6, -(byte)0x81, (byte)0xAC, (byte)0xCC, (byte)0xA3, (byte)0xAE, (byte)0xAA, -(byte)0xC8, (byte)0x11, (byte)0x38, (byte)0xD4, (byte)0x4F, (byte)0xC4, -(byte)0x89, (byte)0xD3, (byte)0x72, (byte)0xEE, (byte)0x22, (byte)0x5A, -(byte)0x68, (byte)0xF7, (byte)0xAC, (byte)0x24, (byte)0x01, (byte)0x9B, -(byte)0xE9, (byte)0x08, (byte)0xFE, (byte)0x58, (byte)0x0A, (byte)0xCF, -(byte)0xB9, (byte)0x52, (byte)0xB4, (byte)0x02, (byte)0x73, (byte)0xA4, -(byte)0xA6, (byte)0xB9, (byte)0x0C, (byte)0x8D, (byte)0xA7, (byte)0xFB, - }; - public static void main(String[] args) throws Exception { DHGenSharedSecret test = new DHGenSharedSecret(); test.run(); @@ -75,8 +47,9 @@ public void run() throws Exception { long start, end; - BigInteger p = new BigInteger(1, DHPrime); - BigInteger g = new BigInteger(1, DHBase); + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); + BigInteger p = dhGroup.getPrime(); + BigInteger g = new BigInteger(1, dhGroup.getBase().toByteArray()); int l = 512; DHParameterSpec spec = diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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,6 +24,7 @@ /* * @test * @bug 7146728 + * @library /test/lib * @summary DHKeyAgreement2 * @author Jan Luehe * @run main/othervm -Djdk.crypto.KeyAgreement.legacyKDF=true DHKeyAgreement2 @@ -38,13 +39,14 @@ import javax.crypto.*; import javax.crypto.spec.*; import javax.crypto.interfaces.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; /** * This test utility executes the Diffie-Hellman key agreement protocol * between 2 parties: Alice and Bob. * - * By default, preconfigured parameters (1024 bit prime modulus and base - * generator used by SKIP) are used. + * By default, preconfigured parameters are used. * If this program is called with the "-gen" option, a new set of parameters * are created. */ @@ -59,7 +61,7 @@ private DHKeyAgreement2() {} public static void main(String argv[]) throws Exception { - String mode = "USE_SKIP_DH_PARAMS"; + String mode = "USE_PRECONFIGURED_DH_PARAMS"; DHKeyAgreement2 keyAgree = new DHKeyAgreement2(); @@ -80,22 +82,25 @@ private void run(String mode) throws Exception { - DHParameterSpec dhSkipParamSpec; + DHParameterSpec dhParameterSpec; + String algorithm = "DH"; + int primeSize = SecurityUtils.getTestKeySize(algorithm); if (mode.equals("GENERATE_DH_PARAMS")) { // Some central authority creates new DH parameters System.err.println("Creating Diffie-Hellman parameters ..."); AlgorithmParameterGenerator paramGen = AlgorithmParameterGenerator.getInstance("DH", SUNJCE); - paramGen.init(512); + paramGen.init(primeSize); AlgorithmParameters params = paramGen.generateParameters(); - dhSkipParamSpec = (DHParameterSpec)params.getParameterSpec + dhParameterSpec = (DHParameterSpec)params.getParameterSpec (DHParameterSpec.class); } else { - // use some pre-generated, default DH parameters - System.err.println("Using SKIP Diffie-Hellman parameters"); - dhSkipParamSpec = new DHParameterSpec(skip1024Modulus, - skip1024Base); + // use some pre-generated, test default DH parameters + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(primeSize); + System.err.println("Using " + dhGroup.name() + " Diffie-Hellman parameters"); + dhParameterSpec = new DHParameterSpec(dhGroup.getPrime(), + dhGroup.getBase()); } /* @@ -104,7 +109,7 @@ */ System.err.println("ALICE: Generate DH keypair ..."); KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH", SUNJCE); - aliceKpairGen.initialize(dhSkipParamSpec); + aliceKpairGen.initialize(dhParameterSpec); KeyPair aliceKpair = aliceKpairGen.generateKeyPair(); System.out.println("Alice DH public key:\n" + aliceKpair.getPublic().toString()); @@ -227,20 +232,26 @@ } System.err.println("Shared secrets are the same"); + testSecretKey(bobKeyAgree, alicePubKey, "DES"); + testSecretKey(bobKeyAgree, alicePubKey, "AES"); + } + + private static void testSecretKey(KeyAgreement bobKeyAgree, PublicKey alicePubKey, String algo) + throws Exception { // Now let's return the shared secret as a SecretKey object // and use it for encryption - System.out.println("Return shared secret as SecretKey object ..."); + System.out.println("Return shared secret as SecretKey object with algorithm: " + algo); bobKeyAgree.doPhase(alicePubKey, true); - SecretKey desKey = bobKeyAgree.generateSecret("DES"); + SecretKey key = bobKeyAgree.generateSecret(algo); - Cipher desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); - desCipher.init(Cipher.ENCRYPT_MODE, desKey); + Cipher cipher = Cipher.getInstance(algo + "/ECB/PKCS5Padding"); + cipher.init(Cipher.ENCRYPT_MODE, key); byte[] cleartext = "This is just an example".getBytes(); - byte[] ciphertext = desCipher.doFinal(cleartext); + byte[] ciphertext = cipher.doFinal(cleartext); - desCipher.init(Cipher.DECRYPT_MODE, desKey); - byte[] cleartext1 = desCipher.doFinal(ciphertext); + cipher.init(Cipher.DECRYPT_MODE, key); + byte[] cleartext1 = cipher.doFinal(ciphertext); int clearLen = cleartext.length; int clear1Len = cleartext1.length; @@ -274,47 +285,4 @@ System.err.print("DHKeyAgreement usage: "); System.err.println("[-gen]"); } - - // The 1024 bit Diffie-Hellman modulus values used by SKIP - private static final byte skip1024ModulusBytes[] = { - (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58, - (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD, - (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4, - (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B, - (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D, - (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C, - (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C, - (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6, - (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0, - (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B, - (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB, - (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D, - (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD, - (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43, - (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C, - (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C, - (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C, - (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40, - (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C, - (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72, - (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03, - (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29, - (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C, - (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB, - (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B, - (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08, - (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D, - (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C, - (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22, - (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB, - (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55, - (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7 - }; - - // The SKIP 1024 bit modulus - private static final BigInteger skip1024Modulus - = new BigInteger(1, skip1024ModulusBytes); - - // The base used with the SKIP 1024 bit modulus - private static final BigInteger skip1024Base = BigInteger.valueOf(2); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,6 +24,7 @@ /* * @test * @bug 0000000 + * @library /test/lib * @summary DHKeyAgreement3 * @author Jan Luehe */ @@ -37,13 +38,14 @@ import javax.crypto.*; import javax.crypto.spec.*; import javax.crypto.interfaces.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; /** * This test utility executes the Diffie-Hellman key agreement protocol * between 3 parties: Alice, Bob, and Carol. * - * We use the same 1024 bit prime modulus and base generator that are used by - * SKIP. + * By default, preconfigured parameters are used. */ public class DHKeyAgreement3 { @@ -61,27 +63,27 @@ private void run() throws Exception { - DHParameterSpec dhSkipParamSpec; - - System.err.println("Using SKIP Diffie-Hellman parameters"); - dhSkipParamSpec = new DHParameterSpec(skip1024Modulus, skip1024Base); + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); + DHParameterSpec dhParamSpec; + System.err.println("Using " + dhGroup.name() + " Diffie-Hellman parameters"); + dhParamSpec = new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase()); // Alice creates her own DH key pair System.err.println("ALICE: Generate DH keypair ..."); KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE"); - aliceKpairGen.initialize(dhSkipParamSpec); + aliceKpairGen.initialize(dhParamSpec); KeyPair aliceKpair = aliceKpairGen.generateKeyPair(); // Bob creates his own DH key pair System.err.println("BOB: Generate DH keypair ..."); KeyPairGenerator bobKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE"); - bobKpairGen.initialize(dhSkipParamSpec); + bobKpairGen.initialize(dhParamSpec); KeyPair bobKpair = bobKpairGen.generateKeyPair(); // Carol creates her own DH key pair System.err.println("CAROL: Generate DH keypair ..."); KeyPairGenerator carolKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE"); - carolKpairGen.initialize(dhSkipParamSpec); + carolKpairGen.initialize(dhParamSpec); KeyPair carolKpair = carolKpairGen.generateKeyPair(); @@ -178,47 +180,4 @@ System.err.print("DHKeyAgreement usage: "); System.err.println("[-gen]"); } - - // The 1024 bit Diffie-Hellman modulus values used by SKIP - private static final byte skip1024ModulusBytes[] = { - (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58, - (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD, - (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4, - (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B, - (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D, - (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C, - (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C, - (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6, - (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0, - (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B, - (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB, - (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D, - (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD, - (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43, - (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C, - (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C, - (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C, - (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40, - (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C, - (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72, - (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03, - (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29, - (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C, - (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB, - (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B, - (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08, - (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D, - (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C, - (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22, - (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB, - (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55, - (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7 - }; - - // The SKIP 1024 bit modulus - private static final BigInteger skip1024Modulus - = new BigInteger(1, skip1024ModulusBytes); - - // The base used with the SKIP 1024 bit modulus - private static final BigInteger skip1024Base = BigInteger.valueOf(2); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,21 +34,22 @@ import java.security.KeyPairGenerator; import java.util.Arrays; import java.util.HexFormat; +import jdk.test.lib.security.SecurityUtils; public class DHKeyAgreementPadding { public static void main(String[] args) throws Exception { - - byte[] aliceSecret = new byte[80]; - byte[] bobSecret = new byte[80]; - - KeyAgreement alice = KeyAgreement.getInstance("DiffieHellman"); - KeyAgreement bob = KeyAgreement.getInstance("DiffieHellman"); + String kpgAlgorithm = "DiffieHellman"; + KeyAgreement alice = KeyAgreement.getInstance(kpgAlgorithm); + KeyAgreement bob = KeyAgreement.getInstance(kpgAlgorithm); + int keySizeBits = SecurityUtils.getTestKeySize(kpgAlgorithm); + byte[] aliceSecret = new byte[keySizeBits / 8]; + byte[] bobSecret = new byte[keySizeBits / 8]; // The probability of an error is 0.2% or 1/500. Try more times. for (int i = 0; i < 5000; i++) { - KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("DiffieHellman"); - keyPairGen.initialize(512); + KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(kpgAlgorithm); + keyPairGen.initialize(keySizeBits); KeyPair aliceKeyPair = keyPairGen.generateKeyPair(); KeyPair bobKeyPair = keyPairGen.generateKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,6 +24,7 @@ /* * @test * @bug 0000000 + * @library /test/lib * @summary DHKeyFactory * @author Jan Luehe */ @@ -36,6 +37,8 @@ import javax.crypto.*; import javax.crypto.spec.*; import javax.crypto.interfaces.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; /** * This test creates a DH keypair, retrieves the encodings of the DH public and @@ -55,15 +58,13 @@ private void run() throws Exception { - DHParameterSpec dhSkipParamSpec; - - // use some pre-generated, default DH parameters - System.err.println("Using SKIP Diffie-Hellman parameters"); - dhSkipParamSpec = new DHParameterSpec(skip1024Modulus, - skip1024Base); - - KeyPairGenerator kpgen = KeyPairGenerator.getInstance("DH", "SunJCE"); - kpgen.initialize(dhSkipParamSpec); + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); + DHParameterSpec dhParamSpec = new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase()); + System.out.println("Using " + dhGroup.name() + " Diffie-Hellman parameters"); + + KeyPairGenerator kpgen = KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); + kpgen.initialize(dhParamSpec); KeyPair kp = kpgen.generateKeyPair(); // get the public key encoding @@ -72,7 +73,8 @@ // get the private key encoding byte[] privKeyEnc = kp.getPrivate().getEncoded(); - KeyFactory kfac = KeyFactory.getInstance("DH", "SunJCE"); + KeyFactory kfac = KeyFactory.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKeyEnc); PublicKey pubKey = kfac.generatePublic(x509KeySpec); @@ -80,47 +82,4 @@ PKCS8EncodedKeySpec pkcsKeySpec = new PKCS8EncodedKeySpec(privKeyEnc); PrivateKey privKey = kfac.generatePrivate(pkcsKeySpec); } - - // The 1024 bit Diffie-Hellman modulus values used by SKIP - private static final byte skip1024ModulusBytes[] = { - (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58, - (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD, - (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4, - (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B, - (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D, - (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C, - (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C, - (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6, - (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0, - (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B, - (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB, - (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D, - (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD, - (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43, - (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C, - (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C, - (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C, - (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40, - (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C, - (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72, - (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03, - (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29, - (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C, - (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB, - (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B, - (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08, - (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D, - (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C, - (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22, - (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB, - (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55, - (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7 - }; - - // The SKIP 1024 bit modulus - private static final BigInteger skip1024Modulus - = new BigInteger(1, skip1024ModulusBytes); - - // The base used with the SKIP 1024 bit modulus - private static final BigInteger skip1024Base = BigInteger.valueOf(2); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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,6 +24,7 @@ /* * @test * @bug 0000000 + * @library /test/lib * @summary DHKeyGenSpeed * @author Jan Luehe */ @@ -33,42 +34,11 @@ import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; public class DHKeyGenSpeed { - static byte[] DHPrime = { -(byte)0x00, (byte)0x91, (byte)0x18, (byte)0x26, (byte)0x9A, (byte)0x26, -(byte)0x43, (byte)0xA6, (byte)0x1E, (byte)0x11, (byte)0x02, (byte)0xA0, -(byte)0x88, (byte)0xFE, (byte)0x12, (byte)0xEA, (byte)0x63, (byte)0x20, -(byte)0x6D, (byte)0x4F, (byte)0x40, (byte)0x3C, (byte)0x4F, (byte)0x13, -(byte)0x10, (byte)0x97, (byte)0xEC, (byte)0x3A, (byte)0x38, (byte)0x87, -(byte)0x9B, (byte)0x08, (byte)0x66, (byte)0x0C, (byte)0x82, (byte)0xD0, -(byte)0x57, (byte)0xE0, (byte)0x37, (byte)0x16, (byte)0x8E, (byte)0xB4, -(byte)0xEA, (byte)0xB7, (byte)0xE6, (byte)0xAF, (byte)0x4C, (byte)0xE0, -(byte)0x40, (byte)0x07, (byte)0xF4, (byte)0x81, (byte)0xDD, (byte)0x36, -(byte)0x33, (byte)0xAD, (byte)0x92, (byte)0xC6, (byte)0x0F, (byte)0xB5, -(byte)0xE4, (byte)0x0F, (byte)0x0E, (byte)0xEA, (byte)0x91, (byte)0x35, -(byte)0xFB, (byte)0x55, (byte)0x7A, (byte)0x39, (byte)0xD1, (byte)0xF0, -(byte)0x6B, (byte)0x9A, (byte)0xB9, (byte)0xFA, (byte)0x19, (byte)0xBE, -(byte)0x1B, (byte)0xFD, (byte)0x77 - }; - static byte[] DHBase = { -(byte)0x29, (byte)0xF2, (byte)0x29, (byte)0xC8, (byte)0x42, (byte)0x25, -(byte)0x29, (byte)0xC3, (byte)0xF2, (byte)0xAA, (byte)0xF2, (byte)0x6A, -(byte)0x3C, (byte)0xD2, (byte)0xD2, (byte)0xDE, (byte)0xD3, (byte)0x6B, -(byte)0x85, (byte)0xA5, (byte)0xE1, (byte)0x43, (byte)0x90, (byte)0xA2, -(byte)0xB6, (byte)0xA5, (byte)0x0C, (byte)0xBA, (byte)0xB9, (byte)0x4C, -(byte)0x25, (byte)0xE0, (byte)0xC8, (byte)0xEA, (byte)0xA1, (byte)0x7B, -(byte)0xB9, (byte)0xF8, (byte)0xFF, (byte)0x15, (byte)0x66, (byte)0x5B, -(byte)0xB0, (byte)0x00, (byte)0x18, (byte)0xE2, (byte)0xF4, (byte)0xF1, -(byte)0xB4, (byte)0x7A, (byte)0xC2, (byte)0xCF, (byte)0x9C, (byte)0x61, -(byte)0x36, (byte)0xED, (byte)0x14, (byte)0x72, (byte)0xD7, (byte)0xD4, -(byte)0x94, (byte)0x20, (byte)0x5E, (byte)0x1E, (byte)0xE4, (byte)0xB1, -(byte)0x60, (byte)0xC8, (byte)0x10, (byte)0x85, (byte)0xBD, (byte)0x74, -(byte)0x34, (byte)0x8C, (byte)0x3C, (byte)0x2A, (byte)0xBD, (byte)0x3C, -(byte)0xFF, (byte)0x14 - }; - public static void main(String[] args) throws Exception { DHKeyGenSpeed test = new DHKeyGenSpeed(); test.run(); @@ -78,8 +48,9 @@ public void run() throws Exception { long start, end; - BigInteger p = new BigInteger(1, DHPrime); - BigInteger g = new BigInteger(1, DHBase); + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); + BigInteger p = dhGroup.getPrime(); + BigInteger g = new BigInteger(1, dhGroup.getBase().toByteArray()); int l = 576; DHParameterSpec spec = @@ -87,14 +58,15 @@ // generate keyPairs using parameters KeyPairGenerator keyGen = - KeyPairGenerator.getInstance("DH", "SunJCE"); + KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); start = System.currentTimeMillis(); keyGen.initialize(spec); KeyPair keys = keyGen.generateKeyPair(); end = System.currentTimeMillis(); System.out.println("PrimeBits\tExponentBits"); - System.out.println(DHPrime.length*8 + "\t\t" + l); + System.out.println(dhGroup.getPrime().bitLength() + "\t\t" + l); System.out.println("keyGen(millisecond): " + (end - start)); System.out.println("Test Passed!"); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -78,7 +78,8 @@ Key[] keyArchives = new Key[numParties]; try { // generate AlogirhtmParameterSpec - AlgorithmParameterGenerator apg = AlgorithmParameterGenerator.getInstance("DH","SunJCE"); + AlgorithmParameterGenerator apg = AlgorithmParameterGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); AlgorithmParameterSpec aps = new DHGenParameterSpec(512, 64); apg.init(aps); DHParameterSpec spec = apg.generateParameters(). @@ -139,8 +140,10 @@ public KAParticipant(String pName, String algo) throws NoSuchAlgorithmException, NoSuchProviderException { name = pName; algorithm = algo; - keyGen = KeyPairGenerator.getInstance(algo,"SunJCE"); - ka = KeyAgreement.getInstance(algo,"SunJCE"); + keyGen = KeyPairGenerator.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); + ka = KeyAgreement.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); } public void initialize(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException, InvalidKeyException { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -55,7 +55,8 @@ public static void main(String[] args) throws Exception { for (SupportedKeySize keySize : SupportedKeySize.values()) { System.out.println("Checking " + keySize.primeSize + " ..."); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); kpg.initialize(keySize.primeSize); KeyPair kp = kpg.generateKeyPair(); checkKeyPair(kp, keySize.primeSize); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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,6 +24,7 @@ /** * @test * @bug 8072452 8163498 + * @library /test/lib * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits * This test has been split based on lower/higher key sizes in order to * reduce individual execution times and run in parallel @@ -33,14 +34,16 @@ * @run main/timeout=300 SupportedDHParamGens 832 * @run main/timeout=300 SupportedDHParamGens 1024 * @run main/timeout=600 SupportedDHParamGens 2048 + * @run main/timeout=600 SupportedDHParamGens 3072 + * @run main/timeout=600 SupportedDHParamGens 4096 */ - import java.math.BigInteger; import java.security.*; -import javax.crypto.*; import javax.crypto.interfaces.*; import javax.crypto.spec.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; public class SupportedDHParamGens { @@ -48,18 +51,31 @@ int primeSize = Integer.valueOf(args[0]).intValue(); System.out.println("Checking " + primeSize + " ..."); - AlgorithmParameterGenerator apg = - AlgorithmParameterGenerator.getInstance("DH", "SunJCE"); - apg.init(primeSize); - AlgorithmParameters ap = apg.generateParameters(); - DHParameterSpec spec = ap.getParameterSpec(DHParameterSpec.class); + DHParameterSpec spec = null; + switch (primeSize) { + case 2048, 3072, 4096 -> spec = getDHParameterSpec(primeSize); + default -> { + AlgorithmParameterGenerator apg = + AlgorithmParameterGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); + apg.init(primeSize); + AlgorithmParameters ap = apg.generateParameters(); + spec = ap.getParameterSpec(DHParameterSpec.class); + } + } - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); kpg.initialize(spec); KeyPair kp = kpg.generateKeyPair(); checkKeyPair(kp, primeSize); } + private static DHParameterSpec getDHParameterSpec(int primeSize) { + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(primeSize); + return new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase()); + } + private static void checkKeyPair(KeyPair kp, int pSize) throws Exception { DHPrivateKey privateKey = (DHPrivateKey)kp.getPrivate(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,6 +24,7 @@ /** * @test * @bug 8072452 8163498 + * @library /test/lib * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits * This test has been split based on lower/higher key sizes in order to * reduce individual execution times and run in parallel diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -81,7 +81,8 @@ public static void main(String[] args) throws Exception { KeyPair kp; - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); // Sun's default uses a default psize of 2048 and // lsize of (pSize / 2) but at least 384 bits diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -61,7 +61,8 @@ try { System.out.println("Checking " + keySize.primeSize + " ..."); KeyPairGenerator kpg = - KeyPairGenerator.getInstance("DH", "SunJCE"); + KeyPairGenerator.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); kpg.initialize(keySize.primeSize); throw new Exception("Should not support " + keySize.primeSize); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -69,7 +69,8 @@ }; private static void test() throws Exception { - SecretKeyFactory skf = SecretKeyFactory.getInstance(ALGO, "SunJCE"); + SecretKeyFactory skf = SecretKeyFactory.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); for (int i = 0; i < TEST_VECTORS.length; i++) { System.out.println("=>Testing vector#" + (i+1)); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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,6 +24,7 @@ /* * @test * @bug 6578538 8027624 + * @library /test/lib * @summary com.sun.crypto.provider.SunJCE instance leak using KRB5 and * LoginContext * @author Brad Wetmore @@ -45,6 +46,7 @@ import java.util.*; import java.util.concurrent.*; +import jdk.test.lib.security.SecurityUtils; public class TestProviderLeak { private static final int MB = 1024 * 1024; @@ -106,9 +108,10 @@ public static void main(String [] args) throws Exception { // Prepare the test final SecretKeyFactory skf = - SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", "SunJCE"); + SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", + System.getProperty("test.provider.name", "SunJCE")); final PBEKeySpec pbeKS = new PBEKeySpec( - "passPhrase".toCharArray(), new byte [] { 0 }, 5, 512); + "passPhrase".toCharArray(), new byte [SecurityUtils.getTestSaltSize()], 1000, 512); ExecutorService executor = Executors.newSingleThreadExecutor(); Callable task = new Callable() { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,8 @@ private static final int[] HMACSHA512_SIZES = { 64 }; public boolean execute(String algo, int[] keySizes) throws Exception { - KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); // TEST FIX 4628062 Key keyWithDefaultSize = kg.generateKey(); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,13 +35,14 @@ public class TestExplicitKeyLength { - private static final String ALGOS[] = { "RC2", "ARCFOUR" }; + private static final String ALGOS[] = { "RC2", "ARCFOUR", "AES", "AES", "AES" }; private static final int KEY_SIZES[] = - { 64, 80 }; // in bits + { 64, 80, 128, 192, 256 }; // in bits public static void runTest(String algo, int keysize) throws Exception { - KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE"); + KeyGenerator kg = KeyGenerator.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); kg.init(keysize); Key generatedKey = kg.generateKey(); int actualSizeInBits = generatedKey.getEncoded().length*8; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,8 @@ // make SampleProvider the most preferred, so its digest impl is picked int status = Security.insertProviderAt(p, 1); try { - Mac mac = Mac.getInstance(ALGO, "SunJCE"); + Mac mac = Mac.getInstance(ALGO, + System.getProperty("test.provider.name", "SunJCE")); // do a complete mac generation and check if the supplied // digest is used mac.init(new SecretKeySpec(new byte[512>>3], ALGO)); @@ -72,7 +73,8 @@ public CloneableDigest() throws NoSuchAlgorithmException { try { - md = MessageDigest.getInstance("SHA-512", "SUN"); + md = MessageDigest.getInstance("SHA-512", + System.getProperty("test.provider.name", "SUN")); } catch (NoSuchProviderException nspe) { // should never happen } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -51,7 +51,8 @@ SecretKey key = Utils.getSecretKeySpec(); // instantiate Mac object and init it with a SecretKey - Mac mac = Mac.getInstance(alg, "SunJCE"); + Mac mac = Mac.getInstance(alg, + System.getProperty("test.provider.name", "SunJCE")); mac.init(key); // prepare buffer diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,8 @@ }; private static final int[] MAC_LENGTHS = { 20, 20, 28, 32, 48, 64 }; private static final String KEY_ALGO = "PBE"; - private static final String PROVIDER = "SunJCE"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunJCE"); private static SecretKey key = null; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,10 @@ private static final String[] ALGOS = { "HmacPBESHA1", + "HmacPBESHA224", + "HmacPBESHA256", + "HmacPBESHA384", + "HmacPBESHA512", "PBEWithHmacSHA1", "PBEWithHmacSHA224", "PBEWithHmacSHA256", @@ -89,7 +93,8 @@ new SecureRandom().nextBytes(input); char[] PASSWD = { 'p','a','s','s','w','o','r','d' }; long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); for (String algo : ALGOS) { runTest(algo, input, PASSWD, p); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -53,7 +53,8 @@ SecretKey key = Utils.getSecretKeySpec(); // instantiate Mac object and init it with a SecretKey - Mac mac = Mac.getInstance(alg, "SunJCE"); + Mac mac = Mac.getInstance(alg, + System.getProperty("test.provider.name", "SunJCE")); mac.init(key); // prepare buffer diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacClone.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacClone.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacClone.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacClone.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,8 @@ * @bug 7087021 8013069 * @summary Clone tests for all MAC algorithms. * @author Jan Luehe + * @run main MacClone DES + * @run main MacClone AES */ import java.security.spec.AlgorithmParameterSpec; import javax.crypto.*; @@ -37,7 +39,8 @@ String[] algos = { "HmacMD5", "HmacSHA1", "HmacSHA224", "HmacSHA256", "HmacSHA384", "HmacSHA512" }; - KeyGenerator kgen = KeyGenerator.getInstance("DES"); + String keyAlgo = args[0]; + KeyGenerator kgen = KeyGenerator.getInstance(keyAlgo); SecretKey skey = kgen.generateKey(); for (String algo : algos) { doTest(algo, skey, null); @@ -60,7 +63,8 @@ // // Clone an uninitialized Mac object // - Mac mac = Mac.getInstance(algo, "SunJCE"); + Mac mac = Mac.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); Mac macClone = (Mac)mac.clone(); System.out.println(macClone.getProvider().toString()); System.out.println(macClone.getAlgorithm()); @@ -77,7 +81,8 @@ // // Clone an initialized Mac object // - mac = Mac.getInstance(algo, "SunJCE"); + mac = Mac.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); mac.init(skey, params); macClone = (Mac)mac.clone(); System.out.println(macClone.getProvider().toString()); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -333,7 +333,8 @@ static void runTests(Test[] tests) throws Exception { long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); for (int i = 0; i < tests.length; i++) { Test test = tests[i]; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,8 @@ NoSuchProviderException, InvalidKeyException { Mac mac; try { - mac = Mac.getInstance(algo, "SunJCE"); + mac = Mac.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); } catch (NoSuchAlgorithmException nsae) { // depending on Solaris configuration, // it can support HMAC or not with Mac diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -51,7 +51,8 @@ SecretKey key = Utils.getSecretKeySpec(); // instantiate Mac object and init it with a SecretKey - Mac mac = Mac.getInstance(alg, "SunJCE"); + Mac mac = Mac.getInstance(alg, + System.getProperty("test.provider.name", "SunJCE")); mac.init(key); try { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -51,7 +51,8 @@ */ public class TestAESOids { - private static final String PROVIDER_NAME = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); private static final byte[] INPUT = "1234567890123456".getBytes(); private static final List DATA = Arrays.asList( diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,8 @@ */ public class TestAESWrapOids { - private static final String PROVIDER_NAME = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); private static final List DATA = Arrays.asList( new DataTuple("2.16.840.1.101.3.4.1.5", "AESWrap_128"), diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,8 @@ */ public class TestHmacSHAOids { - private static final String PROVIDER_NAME = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); private static final byte[] INPUT = "1234567890".getBytes(); private static final List DATA = Arrays.asList( diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -47,7 +47,8 @@ private static int PREFIX_LENGTH = "km-master: ".length(); public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); InputStream in = new FileInputStream(new File(BASE, "keymatdata.txt")); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -47,7 +47,8 @@ public class TestLeadingZeroes { - private static final String SUNJCE = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); // Hex formatter to upper case with ":" delimiter private static final HexFormat HEX_FORMATTER = HexFormat.ofDelimiter(":").withUpperCase(); @@ -73,14 +74,14 @@ kfac.generatePrivate(new PKCS8EncodedKeySpec(bobPrivKeyEnc)); // generate normal shared secret - KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", SUNJCE); + KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", PROVIDER_NAME); aliceKeyAgree.init(alicePrivKey); aliceKeyAgree.doPhase(bobPubKey, true); byte[] sharedSecret = aliceKeyAgree.generateSecret(); System.out.println("shared secret:\n" + HEX_FORMATTER.formatHex(sharedSecret)); // verify that leading zero is present - if (sharedSecret.length != 128) { + if (sharedSecret.length != 256) { throw new Exception("Unexpected shared secret length"); } if (sharedSecret[0] != 0) { @@ -96,7 +97,7 @@ "tls premaster secret:\n" + HEX_FORMATTER.formatHex(tlsPremasterSecret)); // check that leading zero has been stripped - if (tlsPremasterSecret.length != 127) { + if (tlsPremasterSecret.length != 255) { throw new Exception("Unexpected TLS premaster secret length"); } if (tlsPremasterSecret[0] == 0) { @@ -111,279 +112,455 @@ } private static final byte alicePubKeyEnc[] = { - (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x24, - (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06, - (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48, - (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01, - (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81, - (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81, - (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD, - (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB, - (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D, - (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36, - (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38, - (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F, - (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C, - (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E, - (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23, - (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5, - (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E, - (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8, - (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34, - (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57, - (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18, - (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21, - (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF, - (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29, - (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D, - (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A, - (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4, - (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07, - (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95, - (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F, - (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50, - (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3, - (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4, - (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C, - (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B, - (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA, - (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3, - (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78, - (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02, - (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00, - (byte)0x03, (byte)0x81, (byte)0x85, (byte)0x00, - (byte)0x02, (byte)0x81, (byte)0x81, (byte)0x00, - (byte)0xEE, (byte)0xD6, (byte)0xB1, (byte)0xA3, - (byte)0xB4, (byte)0x78, (byte)0x2B, (byte)0x35, - (byte)0xEF, (byte)0xCD, (byte)0x17, (byte)0x86, - (byte)0x63, (byte)0x2B, (byte)0x97, (byte)0x0E, - (byte)0x7A, (byte)0xD1, (byte)0xFF, (byte)0x7A, - (byte)0xEB, (byte)0x57, (byte)0x61, (byte)0xA1, - (byte)0xF7, (byte)0x90, (byte)0x11, (byte)0xA7, - (byte)0x79, (byte)0x28, (byte)0x69, (byte)0xBA, - (byte)0xA7, (byte)0xB2, (byte)0x37, (byte)0x17, - (byte)0xAE, (byte)0x3C, (byte)0x92, (byte)0x89, - (byte)0x88, (byte)0xE5, (byte)0x7E, (byte)0x8E, - (byte)0xF0, (byte)0x24, (byte)0xD0, (byte)0xE1, - (byte)0xC4, (byte)0xB0, (byte)0x26, (byte)0x5A, - (byte)0x1E, (byte)0xBD, (byte)0xA0, (byte)0xCF, - (byte)0x3E, (byte)0x97, (byte)0x2A, (byte)0x13, - (byte)0x92, (byte)0x3B, (byte)0x39, (byte)0xD0, - (byte)0x1D, (byte)0xA3, (byte)0x6B, (byte)0x3E, - (byte)0xC2, (byte)0xBB, (byte)0x14, (byte)0xB6, - (byte)0xE2, (byte)0x4C, (byte)0x0E, (byte)0x5B, - (byte)0x4B, (byte)0xA4, (byte)0x9D, (byte)0xA6, - (byte)0x21, (byte)0xB0, (byte)0xF9, (byte)0xDE, - (byte)0x55, (byte)0xAE, (byte)0x5C, (byte)0x29, - (byte)0x0E, (byte)0xC1, (byte)0xFC, (byte)0xBA, - (byte)0x51, (byte)0xD3, (byte)0xB6, (byte)0x6D, - (byte)0x75, (byte)0x72, (byte)0xDF, (byte)0x43, - (byte)0xAB, (byte)0x94, (byte)0x21, (byte)0x6E, - (byte)0x0C, (byte)0xD1, (byte)0x93, (byte)0x54, - (byte)0x56, (byte)0x7D, (byte)0x4B, (byte)0x90, - (byte)0xF1, (byte)0x94, (byte)0x45, (byte)0xD4, - (byte)0x2A, (byte)0x71, (byte)0xA1, (byte)0xB8, - (byte)0xDD, (byte)0xAA, (byte)0x05, (byte)0xF0, - (byte)0x27, (byte)0x37, (byte)0xBD, (byte)0x44 + (byte)0x30, (byte)0x82, (byte)0x02, (byte)0x25, + (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x17, + (byte)0x06, (byte)0x09, (byte)0x2a, (byte)0x86, + (byte)0x48, (byte)0x86, (byte)0xf7, (byte)0x0d, + (byte)0x01, (byte)0x03, (byte)0x01, (byte)0x30, + (byte)0x82, (byte)0x01, (byte)0x08, (byte)0x02, + (byte)0x82, (byte)0x01, (byte)0x01, (byte)0x00, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xad, (byte)0xf8, (byte)0x54, (byte)0x58, + (byte)0xa2, (byte)0xbb, (byte)0x4a, (byte)0x9a, + (byte)0xaf, (byte)0xdc, (byte)0x56, (byte)0x20, + (byte)0x27, (byte)0x3d, (byte)0x3c, (byte)0xf1, + (byte)0xd8, (byte)0xb9, (byte)0xc5, (byte)0x83, + (byte)0xce, (byte)0x2d, (byte)0x36, (byte)0x95, + (byte)0xa9, (byte)0xe1, (byte)0x36, (byte)0x41, + (byte)0x14, (byte)0x64, (byte)0x33, (byte)0xfb, + (byte)0xcc, (byte)0x93, (byte)0x9d, (byte)0xce, + (byte)0x24, (byte)0x9b, (byte)0x3e, (byte)0xf9, + (byte)0x7d, (byte)0x2f, (byte)0xe3, (byte)0x63, + (byte)0x63, (byte)0x0c, (byte)0x75, (byte)0xd8, + (byte)0xf6, (byte)0x81, (byte)0xb2, (byte)0x02, + (byte)0xae, (byte)0xc4, (byte)0x61, (byte)0x7a, + (byte)0xd3, (byte)0xdf, (byte)0x1e, (byte)0xd5, + (byte)0xd5, (byte)0xfd, (byte)0x65, (byte)0x61, + (byte)0x24, (byte)0x33, (byte)0xf5, (byte)0x1f, + (byte)0x5f, (byte)0x06, (byte)0x6e, (byte)0xd0, + (byte)0x85, (byte)0x63, (byte)0x65, (byte)0x55, + (byte)0x3d, (byte)0xed, (byte)0x1a, (byte)0xf3, + (byte)0xb5, (byte)0x57, (byte)0x13, (byte)0x5e, + (byte)0x7f, (byte)0x57, (byte)0xc9, (byte)0x35, + (byte)0x98, (byte)0x4f, (byte)0x0c, (byte)0x70, + (byte)0xe0, (byte)0xe6, (byte)0x8b, (byte)0x77, + (byte)0xe2, (byte)0xa6, (byte)0x89, (byte)0xda, + (byte)0xf3, (byte)0xef, (byte)0xe8, (byte)0x72, + (byte)0x1d, (byte)0xf1, (byte)0x58, (byte)0xa1, + (byte)0x36, (byte)0xad, (byte)0xe7, (byte)0x35, + (byte)0x30, (byte)0xac, (byte)0xca, (byte)0x4f, + (byte)0x48, (byte)0x3a, (byte)0x79, (byte)0x7a, + (byte)0xbc, (byte)0x0a, (byte)0xb1, (byte)0x82, + (byte)0xb3, (byte)0x24, (byte)0xfb, (byte)0x61, + (byte)0xd1, (byte)0x08, (byte)0xa9, (byte)0x4b, + (byte)0xb2, (byte)0xc8, (byte)0xe3, (byte)0xfb, + (byte)0xb9, (byte)0x6a, (byte)0xda, (byte)0xb7, + (byte)0x60, (byte)0xd7, (byte)0xf4, (byte)0x68, + (byte)0x1d, (byte)0x4f, (byte)0x42, (byte)0xa3, + (byte)0xde, (byte)0x39, (byte)0x4d, (byte)0xf4, + (byte)0xae, (byte)0x56, (byte)0xed, (byte)0xe7, + (byte)0x63, (byte)0x72, (byte)0xbb, (byte)0x19, + (byte)0x0b, (byte)0x07, (byte)0xa7, (byte)0xc8, + (byte)0xee, (byte)0x0a, (byte)0x6d, (byte)0x70, + (byte)0x9e, (byte)0x02, (byte)0xfc, (byte)0xe1, + (byte)0xcd, (byte)0xf7, (byte)0xe2, (byte)0xec, + (byte)0xc0, (byte)0x34, (byte)0x04, (byte)0xcd, + (byte)0x28, (byte)0x34, (byte)0x2f, (byte)0x61, + (byte)0x91, (byte)0x72, (byte)0xfe, (byte)0x9c, + (byte)0xe9, (byte)0x85, (byte)0x83, (byte)0xff, + (byte)0x8e, (byte)0x4f, (byte)0x12, (byte)0x32, + (byte)0xee, (byte)0xf2, (byte)0x81, (byte)0x83, + (byte)0xc3, (byte)0xfe, (byte)0x3b, (byte)0x1b, + (byte)0x4c, (byte)0x6f, (byte)0xad, (byte)0x73, + (byte)0x3b, (byte)0xb5, (byte)0xfc, (byte)0xbc, + (byte)0x2e, (byte)0xc2, (byte)0x20, (byte)0x05, + (byte)0xc5, (byte)0x8e, (byte)0xf1, (byte)0x83, + (byte)0x7d, (byte)0x16, (byte)0x83, (byte)0xb2, + (byte)0xc6, (byte)0xf3, (byte)0x4a, (byte)0x26, + (byte)0xc1, (byte)0xb2, (byte)0xef, (byte)0xfa, + (byte)0x88, (byte)0x6b, (byte)0x42, (byte)0x38, + (byte)0x61, (byte)0x28, (byte)0x5c, (byte)0x97, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x03, + (byte)0x82, (byte)0x01, (byte)0x06, (byte)0x00, + (byte)0x02, (byte)0x82, (byte)0x01, (byte)0x01, + (byte)0x00, (byte)0xb0, (byte)0x6e, (byte)0x76, + (byte)0x73, (byte)0x32, (byte)0xd4, (byte)0xcf, + (byte)0xb8, (byte)0x16, (byte)0x46, (byte)0x76, + (byte)0x8b, (byte)0x2b, (byte)0x2b, (byte)0xda, + (byte)0x6e, (byte)0x25, (byte)0x52, (byte)0x87, + (byte)0x9e, (byte)0x0c, (byte)0x97, (byte)0xc7, + (byte)0x16, (byte)0x42, (byte)0xb6, (byte)0x30, + (byte)0xc6, (byte)0x30, (byte)0xce, (byte)0xc5, + (byte)0xf4, (byte)0x8e, (byte)0x28, (byte)0xe0, + (byte)0x8d, (byte)0x5b, (byte)0x44, (byte)0x59, + (byte)0xae, (byte)0x5e, (byte)0xb6, (byte)0x5f, + (byte)0x48, (byte)0x8e, (byte)0x13, (byte)0x91, + (byte)0x00, (byte)0x72, (byte)0x9b, (byte)0x1b, + (byte)0xd8, (byte)0x69, (byte)0xe4, (byte)0xdf, + (byte)0x10, (byte)0x50, (byte)0x53, (byte)0x0f, + (byte)0x3d, (byte)0xba, (byte)0x82, (byte)0x02, + (byte)0x1c, (byte)0x78, (byte)0xf3, (byte)0xf3, + (byte)0x9a, (byte)0x01, (byte)0x3d, (byte)0xb6, + (byte)0x65, (byte)0xc2, (byte)0x6f, (byte)0x70, + (byte)0xec, (byte)0x67, (byte)0x14, (byte)0x56, + (byte)0xa0, (byte)0x98, (byte)0xef, (byte)0xc8, + (byte)0x63, (byte)0xbe, (byte)0x14, (byte)0x78, + (byte)0x1d, (byte)0xff, (byte)0xf8, (byte)0xf9, + (byte)0xd9, (byte)0x53, (byte)0xb2, (byte)0xc4, + (byte)0x40, (byte)0x3e, (byte)0x90, (byte)0x5c, + (byte)0x10, (byte)0xf8, (byte)0xa4, (byte)0xd3, + (byte)0xa2, (byte)0x39, (byte)0xc6, (byte)0xeb, + (byte)0xcd, (byte)0x3d, (byte)0xd1, (byte)0x27, + (byte)0x51, (byte)0xc8, (byte)0x4f, (byte)0x9b, + (byte)0x86, (byte)0xce, (byte)0xcf, (byte)0x80, + (byte)0x96, (byte)0x3d, (byte)0xb9, (byte)0x25, + (byte)0x05, (byte)0x54, (byte)0x15, (byte)0x8d, + (byte)0x02, (byte)0xd2, (byte)0x6f, (byte)0xed, + (byte)0xaf, (byte)0x49, (byte)0x0d, (byte)0x3e, + (byte)0xda, (byte)0xe6, (byte)0x3d, (byte)0x1a, + (byte)0x91, (byte)0x8f, (byte)0xca, (byte)0x6d, + (byte)0x88, (byte)0xff, (byte)0x0f, (byte)0x75, + (byte)0xf5, (byte)0x4e, (byte)0x08, (byte)0x42, + (byte)0xf0, (byte)0xa3, (byte)0x4a, (byte)0x95, + (byte)0xca, (byte)0x18, (byte)0xc1, (byte)0x3d, + (byte)0x9a, (byte)0x12, (byte)0x3e, (byte)0x09, + (byte)0x29, (byte)0x82, (byte)0x8e, (byte)0xe5, + (byte)0x3a, (byte)0x4c, (byte)0xcc, (byte)0x8f, + (byte)0x94, (byte)0x14, (byte)0xe3, (byte)0xc7, + (byte)0x63, (byte)0x8a, (byte)0x23, (byte)0x11, + (byte)0x03, (byte)0x77, (byte)0x7d, (byte)0xe8, + (byte)0x03, (byte)0x15, (byte)0x37, (byte)0xa9, + (byte)0xe5, (byte)0xd7, (byte)0x38, (byte)0x8f, + (byte)0xa8, (byte)0x49, (byte)0x5d, (byte)0xe4, + (byte)0x0d, (byte)0xed, (byte)0xb9, (byte)0x92, + (byte)0xc4, (byte)0xd7, (byte)0x72, (byte)0xf2, + (byte)0x29, (byte)0x26, (byte)0x99, (byte)0x11, + (byte)0xac, (byte)0xa8, (byte)0x45, (byte)0xb1, + (byte)0x6b, (byte)0x5a, (byte)0x01, (byte)0xc4, + (byte)0xe0, (byte)0x08, (byte)0xbf, (byte)0xa1, + (byte)0x49, (byte)0x2a, (byte)0x9c, (byte)0x8c, + (byte)0x89, (byte)0x31, (byte)0x07, (byte)0x36, + (byte)0x7d, (byte)0xec, (byte)0xa3, (byte)0x9a, + (byte)0x1e, (byte)0xd6, (byte)0xc6, (byte)0x01, + (byte)0x0e, (byte)0xc8, (byte)0x85, (byte)0x55, + (byte)0x42, (byte)0xa4, (byte)0x87, (byte)0x58, + (byte)0xfa, (byte)0xec, (byte)0x71, (byte)0x2e, + (byte)0x4c, (byte)0x46, (byte)0xd2, (byte)0x19, + (byte)0x23, (byte)0x0a, (byte)0x59, (byte)0x1a, + (byte)0x56 }; private static final byte alicePrivKeyEnc[] = { - (byte)0x30, (byte)0x81, (byte)0xE3, (byte)0x02, - (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81, - (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A, - (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7, - (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01, - (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02, - (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4, - (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E, - (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20, - (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91, - (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33, - (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45, - (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88, - (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B, - (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3, - (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43, - (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18, - (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55, - (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38, - (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C, - (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3, - (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE, - (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5, - (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1, - (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18, - (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84, - (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6, - (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19, - (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A, - (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9, - (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0, - (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02, - (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D, - (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41, - (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD, - (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19, - (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2, - (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9, - (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02, - (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02, - (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x42, - (byte)0x02, (byte)0x40, (byte)0x36, (byte)0x4D, - (byte)0xD0, (byte)0x58, (byte)0x64, (byte)0x91, - (byte)0x78, (byte)0xA2, (byte)0x4B, (byte)0x79, - (byte)0x46, (byte)0xFE, (byte)0xC9, (byte)0xD9, - (byte)0xCA, (byte)0x5C, (byte)0xF9, (byte)0xFD, - (byte)0x6C, (byte)0x5D, (byte)0x76, (byte)0x3A, - (byte)0x41, (byte)0x6D, (byte)0x44, (byte)0x62, - (byte)0x75, (byte)0x93, (byte)0x81, (byte)0x93, - (byte)0x00, (byte)0x4C, (byte)0xB1, (byte)0xD8, - (byte)0x7D, (byte)0x9D, (byte)0xF3, (byte)0x16, - (byte)0x2C, (byte)0x6C, (byte)0x9F, (byte)0x7A, - (byte)0x84, (byte)0xA3, (byte)0x7A, (byte)0xC1, - (byte)0x4F, (byte)0x60, (byte)0xE3, (byte)0xB5, - (byte)0x86, (byte)0x28, (byte)0x08, (byte)0x4D, - (byte)0x94, (byte)0xB6, (byte)0x04, (byte)0x0D, - (byte)0xAC, (byte)0xBD, (byte)0x1F, (byte)0x42, - (byte)0x8F, (byte)0x1B + (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x3f, + (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x30, + (byte)0x82, (byte)0x01, (byte)0x17, (byte)0x06, + (byte)0x09, (byte)0x2a, (byte)0x86, (byte)0x48, + (byte)0x86, (byte)0xf7, (byte)0x0d, (byte)0x01, + (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x82, + (byte)0x01, (byte)0x08, (byte)0x02, (byte)0x82, + (byte)0x01, (byte)0x01, (byte)0x00, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xad, + (byte)0xf8, (byte)0x54, (byte)0x58, (byte)0xa2, + (byte)0xbb, (byte)0x4a, (byte)0x9a, (byte)0xaf, + (byte)0xdc, (byte)0x56, (byte)0x20, (byte)0x27, + (byte)0x3d, (byte)0x3c, (byte)0xf1, (byte)0xd8, + (byte)0xb9, (byte)0xc5, (byte)0x83, (byte)0xce, + (byte)0x2d, (byte)0x36, (byte)0x95, (byte)0xa9, + (byte)0xe1, (byte)0x36, (byte)0x41, (byte)0x14, + (byte)0x64, (byte)0x33, (byte)0xfb, (byte)0xcc, + (byte)0x93, (byte)0x9d, (byte)0xce, (byte)0x24, + (byte)0x9b, (byte)0x3e, (byte)0xf9, (byte)0x7d, + (byte)0x2f, (byte)0xe3, (byte)0x63, (byte)0x63, + (byte)0x0c, (byte)0x75, (byte)0xd8, (byte)0xf6, + (byte)0x81, (byte)0xb2, (byte)0x02, (byte)0xae, + (byte)0xc4, (byte)0x61, (byte)0x7a, (byte)0xd3, + (byte)0xdf, (byte)0x1e, (byte)0xd5, (byte)0xd5, + (byte)0xfd, (byte)0x65, (byte)0x61, (byte)0x24, + (byte)0x33, (byte)0xf5, (byte)0x1f, (byte)0x5f, + (byte)0x06, (byte)0x6e, (byte)0xd0, (byte)0x85, + (byte)0x63, (byte)0x65, (byte)0x55, (byte)0x3d, + (byte)0xed, (byte)0x1a, (byte)0xf3, (byte)0xb5, + (byte)0x57, (byte)0x13, (byte)0x5e, (byte)0x7f, + (byte)0x57, (byte)0xc9, (byte)0x35, (byte)0x98, + (byte)0x4f, (byte)0x0c, (byte)0x70, (byte)0xe0, + (byte)0xe6, (byte)0x8b, (byte)0x77, (byte)0xe2, + (byte)0xa6, (byte)0x89, (byte)0xda, (byte)0xf3, + (byte)0xef, (byte)0xe8, (byte)0x72, (byte)0x1d, + (byte)0xf1, (byte)0x58, (byte)0xa1, (byte)0x36, + (byte)0xad, (byte)0xe7, (byte)0x35, (byte)0x30, + (byte)0xac, (byte)0xca, (byte)0x4f, (byte)0x48, + (byte)0x3a, (byte)0x79, (byte)0x7a, (byte)0xbc, + (byte)0x0a, (byte)0xb1, (byte)0x82, (byte)0xb3, + (byte)0x24, (byte)0xfb, (byte)0x61, (byte)0xd1, + (byte)0x08, (byte)0xa9, (byte)0x4b, (byte)0xb2, + (byte)0xc8, (byte)0xe3, (byte)0xfb, (byte)0xb9, + (byte)0x6a, (byte)0xda, (byte)0xb7, (byte)0x60, + (byte)0xd7, (byte)0xf4, (byte)0x68, (byte)0x1d, + (byte)0x4f, (byte)0x42, (byte)0xa3, (byte)0xde, + (byte)0x39, (byte)0x4d, (byte)0xf4, (byte)0xae, + (byte)0x56, (byte)0xed, (byte)0xe7, (byte)0x63, + (byte)0x72, (byte)0xbb, (byte)0x19, (byte)0x0b, + (byte)0x07, (byte)0xa7, (byte)0xc8, (byte)0xee, + (byte)0x0a, (byte)0x6d, (byte)0x70, (byte)0x9e, + (byte)0x02, (byte)0xfc, (byte)0xe1, (byte)0xcd, + (byte)0xf7, (byte)0xe2, (byte)0xec, (byte)0xc0, + (byte)0x34, (byte)0x04, (byte)0xcd, (byte)0x28, + (byte)0x34, (byte)0x2f, (byte)0x61, (byte)0x91, + (byte)0x72, (byte)0xfe, (byte)0x9c, (byte)0xe9, + (byte)0x85, (byte)0x83, (byte)0xff, (byte)0x8e, + (byte)0x4f, (byte)0x12, (byte)0x32, (byte)0xee, + (byte)0xf2, (byte)0x81, (byte)0x83, (byte)0xc3, + (byte)0xfe, (byte)0x3b, (byte)0x1b, (byte)0x4c, + (byte)0x6f, (byte)0xad, (byte)0x73, (byte)0x3b, + (byte)0xb5, (byte)0xfc, (byte)0xbc, (byte)0x2e, + (byte)0xc2, (byte)0x20, (byte)0x05, (byte)0xc5, + (byte)0x8e, (byte)0xf1, (byte)0x83, (byte)0x7d, + (byte)0x16, (byte)0x83, (byte)0xb2, (byte)0xc6, + (byte)0xf3, (byte)0x4a, (byte)0x26, (byte)0xc1, + (byte)0xb2, (byte)0xef, (byte)0xfa, (byte)0x88, + (byte)0x6b, (byte)0x42, (byte)0x38, (byte)0x61, + (byte)0x28, (byte)0x5c, (byte)0x97, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x02, + (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x1f, + (byte)0x02, (byte)0x1d, (byte)0x00, (byte)0xc7, + (byte)0x06, (byte)0xe9, (byte)0x24, (byte)0xf8, + (byte)0xb1, (byte)0xdf, (byte)0x98, (byte)0x61, + (byte)0x34, (byte)0x7f, (byte)0xcf, (byte)0xf1, + (byte)0xcc, (byte)0xcd, (byte)0xc8, (byte)0xcc, + (byte)0xd9, (byte)0x6a, (byte)0xb8, (byte)0x7d, + (byte)0x72, (byte)0x4c, (byte)0x58, (byte)0x5a, + (byte)0x97, (byte)0x39, (byte)0x69 }; private static final byte bobPubKeyEnc[] = { - (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x23, - (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06, - (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48, - (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01, - (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81, - (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81, - (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD, - (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB, - (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D, - (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36, - (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38, - (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F, - (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C, - (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E, - (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23, - (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5, - (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E, - (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8, - (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34, - (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57, - (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18, - (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21, - (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF, - (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29, - (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D, - (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A, - (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4, - (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07, - (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95, - (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F, - (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50, - (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3, - (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4, - (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C, - (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B, - (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA, - (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3, - (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78, - (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02, - (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00, - (byte)0x03, (byte)0x81, (byte)0x84, (byte)0x00, - (byte)0x02, (byte)0x81, (byte)0x80, (byte)0x2C, - (byte)0x40, (byte)0xFA, (byte)0xF6, (byte)0xA6, - (byte)0xF8, (byte)0xAC, (byte)0xC2, (byte)0x4F, - (byte)0xCD, (byte)0xC7, (byte)0x37, (byte)0x93, - (byte)0xE5, (byte)0xE4, (byte)0x5E, (byte)0x18, - (byte)0x14, (byte)0xE6, (byte)0x50, (byte)0xDA, - (byte)0x55, (byte)0x38, (byte)0x5D, (byte)0x24, - (byte)0xF5, (byte)0x42, (byte)0x68, (byte)0x5F, - (byte)0xF5, (byte)0x15, (byte)0xC8, (byte)0x9B, - (byte)0x5D, (byte)0x06, (byte)0x3D, (byte)0xE1, - (byte)0x52, (byte)0x2F, (byte)0x98, (byte)0xFF, - (byte)0x37, (byte)0xBB, (byte)0x75, (byte)0x48, - (byte)0x48, (byte)0xE9, (byte)0x65, (byte)0x84, - (byte)0x37, (byte)0xBB, (byte)0xB3, (byte)0xE9, - (byte)0x36, (byte)0x01, (byte)0xB4, (byte)0x6A, - (byte)0x1C, (byte)0xB2, (byte)0x11, (byte)0x82, - (byte)0xCE, (byte)0x3D, (byte)0x65, (byte)0xE5, - (byte)0x3C, (byte)0x89, (byte)0xE9, (byte)0x52, - (byte)0x19, (byte)0xBD, (byte)0x58, (byte)0xF6, - (byte)0xA2, (byte)0x03, (byte)0xA8, (byte)0xB2, - (byte)0xA5, (byte)0xDB, (byte)0xEB, (byte)0xF5, - (byte)0x94, (byte)0xF9, (byte)0x46, (byte)0xBE, - (byte)0x45, (byte)0x4C, (byte)0x65, (byte)0xD2, - (byte)0xD1, (byte)0xCF, (byte)0xFF, (byte)0xFF, - (byte)0xFA, (byte)0x38, (byte)0xF1, (byte)0x72, - (byte)0xAB, (byte)0xB9, (byte)0x14, (byte)0x4E, - (byte)0xF5, (byte)0xF0, (byte)0x7A, (byte)0x8E, - (byte)0x45, (byte)0xFD, (byte)0x5B, (byte)0xF9, - (byte)0xA2, (byte)0x97, (byte)0x1B, (byte)0xAE, - (byte)0x2C, (byte)0x7B, (byte)0x6B, (byte)0x7C, - (byte)0x98, (byte)0xFE, (byte)0x58, (byte)0xDD, - (byte)0xBE, (byte)0xF6, (byte)0x1C, (byte)0x8E, - (byte)0xD0, (byte)0xA1, (byte)0x72 + (byte)0x30, (byte)0x82, (byte)0x02, (byte)0x25, + (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x17, + (byte)0x06, (byte)0x09, (byte)0x2a, (byte)0x86, + (byte)0x48, (byte)0x86, (byte)0xf7, (byte)0x0d, + (byte)0x01, (byte)0x03, (byte)0x01, (byte)0x30, + (byte)0x82, (byte)0x01, (byte)0x08, (byte)0x02, + (byte)0x82, (byte)0x01, (byte)0x01, (byte)0x00, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xad, (byte)0xf8, (byte)0x54, (byte)0x58, + (byte)0xa2, (byte)0xbb, (byte)0x4a, (byte)0x9a, + (byte)0xaf, (byte)0xdc, (byte)0x56, (byte)0x20, + (byte)0x27, (byte)0x3d, (byte)0x3c, (byte)0xf1, + (byte)0xd8, (byte)0xb9, (byte)0xc5, (byte)0x83, + (byte)0xce, (byte)0x2d, (byte)0x36, (byte)0x95, + (byte)0xa9, (byte)0xe1, (byte)0x36, (byte)0x41, + (byte)0x14, (byte)0x64, (byte)0x33, (byte)0xfb, + (byte)0xcc, (byte)0x93, (byte)0x9d, (byte)0xce, + (byte)0x24, (byte)0x9b, (byte)0x3e, (byte)0xf9, + (byte)0x7d, (byte)0x2f, (byte)0xe3, (byte)0x63, + (byte)0x63, (byte)0x0c, (byte)0x75, (byte)0xd8, + (byte)0xf6, (byte)0x81, (byte)0xb2, (byte)0x02, + (byte)0xae, (byte)0xc4, (byte)0x61, (byte)0x7a, + (byte)0xd3, (byte)0xdf, (byte)0x1e, (byte)0xd5, + (byte)0xd5, (byte)0xfd, (byte)0x65, (byte)0x61, + (byte)0x24, (byte)0x33, (byte)0xf5, (byte)0x1f, + (byte)0x5f, (byte)0x06, (byte)0x6e, (byte)0xd0, + (byte)0x85, (byte)0x63, (byte)0x65, (byte)0x55, + (byte)0x3d, (byte)0xed, (byte)0x1a, (byte)0xf3, + (byte)0xb5, (byte)0x57, (byte)0x13, (byte)0x5e, + (byte)0x7f, (byte)0x57, (byte)0xc9, (byte)0x35, + (byte)0x98, (byte)0x4f, (byte)0x0c, (byte)0x70, + (byte)0xe0, (byte)0xe6, (byte)0x8b, (byte)0x77, + (byte)0xe2, (byte)0xa6, (byte)0x89, (byte)0xda, + (byte)0xf3, (byte)0xef, (byte)0xe8, (byte)0x72, + (byte)0x1d, (byte)0xf1, (byte)0x58, (byte)0xa1, + (byte)0x36, (byte)0xad, (byte)0xe7, (byte)0x35, + (byte)0x30, (byte)0xac, (byte)0xca, (byte)0x4f, + (byte)0x48, (byte)0x3a, (byte)0x79, (byte)0x7a, + (byte)0xbc, (byte)0x0a, (byte)0xb1, (byte)0x82, + (byte)0xb3, (byte)0x24, (byte)0xfb, (byte)0x61, + (byte)0xd1, (byte)0x08, (byte)0xa9, (byte)0x4b, + (byte)0xb2, (byte)0xc8, (byte)0xe3, (byte)0xfb, + (byte)0xb9, (byte)0x6a, (byte)0xda, (byte)0xb7, + (byte)0x60, (byte)0xd7, (byte)0xf4, (byte)0x68, + (byte)0x1d, (byte)0x4f, (byte)0x42, (byte)0xa3, + (byte)0xde, (byte)0x39, (byte)0x4d, (byte)0xf4, + (byte)0xae, (byte)0x56, (byte)0xed, (byte)0xe7, + (byte)0x63, (byte)0x72, (byte)0xbb, (byte)0x19, + (byte)0x0b, (byte)0x07, (byte)0xa7, (byte)0xc8, + (byte)0xee, (byte)0x0a, (byte)0x6d, (byte)0x70, + (byte)0x9e, (byte)0x02, (byte)0xfc, (byte)0xe1, + (byte)0xcd, (byte)0xf7, (byte)0xe2, (byte)0xec, + (byte)0xc0, (byte)0x34, (byte)0x04, (byte)0xcd, + (byte)0x28, (byte)0x34, (byte)0x2f, (byte)0x61, + (byte)0x91, (byte)0x72, (byte)0xfe, (byte)0x9c, + (byte)0xe9, (byte)0x85, (byte)0x83, (byte)0xff, + (byte)0x8e, (byte)0x4f, (byte)0x12, (byte)0x32, + (byte)0xee, (byte)0xf2, (byte)0x81, (byte)0x83, + (byte)0xc3, (byte)0xfe, (byte)0x3b, (byte)0x1b, + (byte)0x4c, (byte)0x6f, (byte)0xad, (byte)0x73, + (byte)0x3b, (byte)0xb5, (byte)0xfc, (byte)0xbc, + (byte)0x2e, (byte)0xc2, (byte)0x20, (byte)0x05, + (byte)0xc5, (byte)0x8e, (byte)0xf1, (byte)0x83, + (byte)0x7d, (byte)0x16, (byte)0x83, (byte)0xb2, + (byte)0xc6, (byte)0xf3, (byte)0x4a, (byte)0x26, + (byte)0xc1, (byte)0xb2, (byte)0xef, (byte)0xfa, + (byte)0x88, (byte)0x6b, (byte)0x42, (byte)0x38, + (byte)0x61, (byte)0x28, (byte)0x5c, (byte)0x97, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x03, + (byte)0x82, (byte)0x01, (byte)0x06, (byte)0x00, + (byte)0x02, (byte)0x82, (byte)0x01, (byte)0x01, + (byte)0x00, (byte)0x8d, (byte)0xb4, (byte)0x1c, + (byte)0xfc, (byte)0xc0, (byte)0x5f, (byte)0x38, + (byte)0x4c, (byte)0x7f, (byte)0x31, (byte)0xaa, + (byte)0x03, (byte)0x06, (byte)0xf0, (byte)0xec, + (byte)0xfd, (byte)0x45, (byte)0x8d, (byte)0x69, + (byte)0x8a, (byte)0xb6, (byte)0x60, (byte)0x2f, + (byte)0xa2, (byte)0xb4, (byte)0xda, (byte)0xc0, + (byte)0x2e, (byte)0xe1, (byte)0x31, (byte)0x12, + (byte)0x5a, (byte)0x49, (byte)0xef, (byte)0xf7, + (byte)0x17, (byte)0x77, (byte)0x26, (byte)0xa8, + (byte)0x91, (byte)0x0b, (byte)0xbc, (byte)0x84, + (byte)0x5c, (byte)0x20, (byte)0x84, (byte)0xd3, + (byte)0x38, (byte)0xc9, (byte)0xa1, (byte)0x5b, + (byte)0xad, (byte)0x84, (byte)0x83, (byte)0xb9, + (byte)0xe1, (byte)0x59, (byte)0x87, (byte)0xd9, + (byte)0x9b, (byte)0x36, (byte)0x6b, (byte)0x3c, + (byte)0xb6, (byte)0x3c, (byte)0x3a, (byte)0x0c, + (byte)0xf4, (byte)0x0b, (byte)0xad, (byte)0x23, + (byte)0x8d, (byte)0x5f, (byte)0x80, (byte)0x16, + (byte)0xa3, (byte)0x96, (byte)0xbd, (byte)0x28, + (byte)0x2f, (byte)0x9f, (byte)0xd1, (byte)0x7e, + (byte)0x13, (byte)0x86, (byte)0x6a, (byte)0x22, + (byte)0x26, (byte)0xdb, (byte)0x3b, (byte)0x42, + (byte)0xf0, (byte)0x21, (byte)0x7a, (byte)0x6c, + (byte)0xe3, (byte)0xb0, (byte)0x8d, (byte)0x9c, + (byte)0x3b, (byte)0xfb, (byte)0x17, (byte)0x27, + (byte)0xde, (byte)0xe4, (byte)0x82, (byte)0x2e, + (byte)0x6d, (byte)0x08, (byte)0xeb, (byte)0x2b, + (byte)0xb9, (byte)0xb0, (byte)0x94, (byte)0x0e, + (byte)0x56, (byte)0xc1, (byte)0xf2, (byte)0x54, + (byte)0xd8, (byte)0x94, (byte)0x21, (byte)0xc2, + (byte)0x2d, (byte)0x4d, (byte)0x28, (byte)0xf2, + (byte)0xc3, (byte)0x96, (byte)0x5b, (byte)0x24, + (byte)0xb6, (byte)0xee, (byte)0xa4, (byte)0xbf, + (byte)0x20, (byte)0x19, (byte)0x29, (byte)0x1a, + (byte)0x55, (byte)0x46, (byte)0x7a, (byte)0x2a, + (byte)0x14, (byte)0x12, (byte)0x4d, (byte)0xf4, + (byte)0xee, (byte)0xf5, (byte)0x6f, (byte)0x4f, + (byte)0xf7, (byte)0x99, (byte)0x1c, (byte)0xa3, + (byte)0x72, (byte)0x33, (byte)0x7d, (byte)0xfe, + (byte)0xae, (byte)0x0b, (byte)0xda, (byte)0x2c, + (byte)0xc7, (byte)0xf3, (byte)0xba, (byte)0xb7, + (byte)0x83, (byte)0x58, (byte)0x4c, (byte)0x93, + (byte)0x5d, (byte)0x90, (byte)0x65, (byte)0xc9, + (byte)0xb8, (byte)0x6d, (byte)0x2d, (byte)0xda, + (byte)0x10, (byte)0x55, (byte)0xe6, (byte)0x27, + (byte)0xb9, (byte)0x4b, (byte)0x75, (byte)0x30, + (byte)0xfa, (byte)0xe4, (byte)0xa3, (byte)0xff, + (byte)0xae, (byte)0xf9, (byte)0xfb, (byte)0xe4, + (byte)0x62, (byte)0x89, (byte)0x7c, (byte)0x7d, + (byte)0x20, (byte)0x50, (byte)0xf9, (byte)0xd1, + (byte)0xe2, (byte)0x0e, (byte)0x56, (byte)0xf6, + (byte)0x3c, (byte)0x8b, (byte)0x24, (byte)0x8a, + (byte)0x6d, (byte)0x92, (byte)0x3f, (byte)0x85, + (byte)0x7b, (byte)0x3b, (byte)0x49, (byte)0x21, + (byte)0x9d, (byte)0x26, (byte)0x1b, (byte)0x58, + (byte)0x08, (byte)0x9e, (byte)0x5f, (byte)0xea, + (byte)0x23, (byte)0x20, (byte)0xc2, (byte)0x3d, + (byte)0x87, (byte)0xbe, (byte)0x1a, (byte)0x17, + (byte)0x34, (byte)0xd8, (byte)0x10, (byte)0x0f, + (byte)0x81, (byte)0xb6, (byte)0xc7, (byte)0xa5, + (byte)0xe9, (byte)0x8b, (byte)0x21, (byte)0xab, + (byte)0x09, (byte)0x88, (byte)0x5e, (byte)0xbd, + (byte)0xa2, (byte)0x8a, (byte)0xc4, (byte)0xa8, + (byte)0x83 }; private static final byte bobPrivKeyEnc[] = { - (byte)0x30, (byte)0x81, (byte)0xE4, (byte)0x02, - (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81, - (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A, - (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7, - (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01, - (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02, - (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4, - (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E, - (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20, - (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91, - (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33, - (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45, - (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88, - (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B, - (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3, - (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43, - (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18, - (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55, - (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38, - (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C, - (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3, - (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE, - (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5, - (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1, - (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18, - (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84, - (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6, - (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19, - (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A, - (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9, - (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0, - (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02, - (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D, - (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41, - (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD, - (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19, - (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2, - (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9, - (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02, - (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02, - (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x43, - (byte)0x02, (byte)0x41, (byte)0x00, (byte)0xE0, - (byte)0x31, (byte)0xE7, (byte)0x77, (byte)0xB8, - (byte)0xD0, (byte)0x7E, (byte)0x0A, (byte)0x9B, - (byte)0x94, (byte)0xD5, (byte)0x3D, (byte)0x33, - (byte)0x62, (byte)0x32, (byte)0x51, (byte)0xCE, - (byte)0x74, (byte)0x5C, (byte)0xA5, (byte)0x72, - (byte)0xD9, (byte)0x36, (byte)0xF3, (byte)0x8A, - (byte)0x3F, (byte)0x8B, (byte)0xC6, (byte)0xFE, - (byte)0xEF, (byte)0x94, (byte)0x8B, (byte)0x50, - (byte)0x41, (byte)0x9B, (byte)0x14, (byte)0xC8, - (byte)0xE9, (byte)0x1F, (byte)0x24, (byte)0x1F, - (byte)0x65, (byte)0x8E, (byte)0xD3, (byte)0x85, - (byte)0xD0, (byte)0x68, (byte)0x6C, (byte)0xF1, - (byte)0x79, (byte)0x45, (byte)0xD0, (byte)0x06, - (byte)0xA4, (byte)0xB8, (byte)0xE0, (byte)0x64, - (byte)0xF5, (byte)0x38, (byte)0x72, (byte)0x97, - (byte)0x00, (byte)0x23, (byte)0x5F + (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x3f, + (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x30, + (byte)0x82, (byte)0x01, (byte)0x17, (byte)0x06, + (byte)0x09, (byte)0x2a, (byte)0x86, (byte)0x48, + (byte)0x86, (byte)0xf7, (byte)0x0d, (byte)0x01, + (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x82, + (byte)0x01, (byte)0x08, (byte)0x02, (byte)0x82, + (byte)0x01, (byte)0x01, (byte)0x00, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xad, + (byte)0xf8, (byte)0x54, (byte)0x58, (byte)0xa2, + (byte)0xbb, (byte)0x4a, (byte)0x9a, (byte)0xaf, + (byte)0xdc, (byte)0x56, (byte)0x20, (byte)0x27, + (byte)0x3d, (byte)0x3c, (byte)0xf1, (byte)0xd8, + (byte)0xb9, (byte)0xc5, (byte)0x83, (byte)0xce, + (byte)0x2d, (byte)0x36, (byte)0x95, (byte)0xa9, + (byte)0xe1, (byte)0x36, (byte)0x41, (byte)0x14, + (byte)0x64, (byte)0x33, (byte)0xfb, (byte)0xcc, + (byte)0x93, (byte)0x9d, (byte)0xce, (byte)0x24, + (byte)0x9b, (byte)0x3e, (byte)0xf9, (byte)0x7d, + (byte)0x2f, (byte)0xe3, (byte)0x63, (byte)0x63, + (byte)0x0c, (byte)0x75, (byte)0xd8, (byte)0xf6, + (byte)0x81, (byte)0xb2, (byte)0x02, (byte)0xae, + (byte)0xc4, (byte)0x61, (byte)0x7a, (byte)0xd3, + (byte)0xdf, (byte)0x1e, (byte)0xd5, (byte)0xd5, + (byte)0xfd, (byte)0x65, (byte)0x61, (byte)0x24, + (byte)0x33, (byte)0xf5, (byte)0x1f, (byte)0x5f, + (byte)0x06, (byte)0x6e, (byte)0xd0, (byte)0x85, + (byte)0x63, (byte)0x65, (byte)0x55, (byte)0x3d, + (byte)0xed, (byte)0x1a, (byte)0xf3, (byte)0xb5, + (byte)0x57, (byte)0x13, (byte)0x5e, (byte)0x7f, + (byte)0x57, (byte)0xc9, (byte)0x35, (byte)0x98, + (byte)0x4f, (byte)0x0c, (byte)0x70, (byte)0xe0, + (byte)0xe6, (byte)0x8b, (byte)0x77, (byte)0xe2, + (byte)0xa6, (byte)0x89, (byte)0xda, (byte)0xf3, + (byte)0xef, (byte)0xe8, (byte)0x72, (byte)0x1d, + (byte)0xf1, (byte)0x58, (byte)0xa1, (byte)0x36, + (byte)0xad, (byte)0xe7, (byte)0x35, (byte)0x30, + (byte)0xac, (byte)0xca, (byte)0x4f, (byte)0x48, + (byte)0x3a, (byte)0x79, (byte)0x7a, (byte)0xbc, + (byte)0x0a, (byte)0xb1, (byte)0x82, (byte)0xb3, + (byte)0x24, (byte)0xfb, (byte)0x61, (byte)0xd1, + (byte)0x08, (byte)0xa9, (byte)0x4b, (byte)0xb2, + (byte)0xc8, (byte)0xe3, (byte)0xfb, (byte)0xb9, + (byte)0x6a, (byte)0xda, (byte)0xb7, (byte)0x60, + (byte)0xd7, (byte)0xf4, (byte)0x68, (byte)0x1d, + (byte)0x4f, (byte)0x42, (byte)0xa3, (byte)0xde, + (byte)0x39, (byte)0x4d, (byte)0xf4, (byte)0xae, + (byte)0x56, (byte)0xed, (byte)0xe7, (byte)0x63, + (byte)0x72, (byte)0xbb, (byte)0x19, (byte)0x0b, + (byte)0x07, (byte)0xa7, (byte)0xc8, (byte)0xee, + (byte)0x0a, (byte)0x6d, (byte)0x70, (byte)0x9e, + (byte)0x02, (byte)0xfc, (byte)0xe1, (byte)0xcd, + (byte)0xf7, (byte)0xe2, (byte)0xec, (byte)0xc0, + (byte)0x34, (byte)0x04, (byte)0xcd, (byte)0x28, + (byte)0x34, (byte)0x2f, (byte)0x61, (byte)0x91, + (byte)0x72, (byte)0xfe, (byte)0x9c, (byte)0xe9, + (byte)0x85, (byte)0x83, (byte)0xff, (byte)0x8e, + (byte)0x4f, (byte)0x12, (byte)0x32, (byte)0xee, + (byte)0xf2, (byte)0x81, (byte)0x83, (byte)0xc3, + (byte)0xfe, (byte)0x3b, (byte)0x1b, (byte)0x4c, + (byte)0x6f, (byte)0xad, (byte)0x73, (byte)0x3b, + (byte)0xb5, (byte)0xfc, (byte)0xbc, (byte)0x2e, + (byte)0xc2, (byte)0x20, (byte)0x05, (byte)0xc5, + (byte)0x8e, (byte)0xf1, (byte)0x83, (byte)0x7d, + (byte)0x16, (byte)0x83, (byte)0xb2, (byte)0xc6, + (byte)0xf3, (byte)0x4a, (byte)0x26, (byte)0xc1, + (byte)0xb2, (byte)0xef, (byte)0xfa, (byte)0x88, + (byte)0x6b, (byte)0x42, (byte)0x38, (byte)0x61, + (byte)0x28, (byte)0x5c, (byte)0x97, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, + (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x02, + (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x1f, + (byte)0x02, (byte)0x1d, (byte)0x01, (byte)0x62, + (byte)0x8e, (byte)0xfc, (byte)0xf3, (byte)0x25, + (byte)0xf3, (byte)0x2a, (byte)0xf4, (byte)0x49, + (byte)0x20, (byte)0x83, (byte)0x61, (byte)0x7f, + (byte)0x97, (byte)0x8f, (byte)0x48, (byte)0xac, + (byte)0xf9, (byte)0xc3, (byte)0xad, (byte)0x3c, + (byte)0x56, (byte)0x95, (byte)0x1c, (byte)0x85, + (byte)0xd3, (byte)0x85, (byte)0xd6 }; } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java 2025-01-04 20:25:18.000000000 +0000 @@ -49,7 +49,8 @@ private static int PREFIX_LENGTH = "m-premaster: ".length(); public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); InputStream in = new FileInputStream(new File(BASE, "masterdata.txt")); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -47,7 +47,8 @@ private static int PREFIX_LENGTH = "prf-output: ".length(); public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); InputStream in = new FileInputStream(new File(BASE, "prfdata.txt")); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,8 @@ private static int PREFIX_LENGTH = "prf-output: ".length(); public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); InputStream in = new FileInputStream(new File(BASE, "prf12data.txt")); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,8 @@ public class TestPremaster { public static void main(String[] args) throws Exception { - Provider provider = Security.getProvider("SunJCE"); + Provider provider = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); KeyGenerator kg; diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/ClassesByName2Test.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ClassesByName2Test.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/ClassesByName2Test.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ClassesByName2Test.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -62,7 +62,8 @@ public void run () { try { java.security.KeyPairGenerator keyGen = - java.security.KeyPairGenerator.getInstance("DSA", "SUN"); + java.security.KeyPairGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); } catch (Exception e) { e.printStackTrace(); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/JITDebug.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JITDebug.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/JITDebug.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JITDebug.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, 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 @@ -104,7 +104,7 @@ } void testLaunch() { - ProcessBuilder pb = ProcessTools.createTestJvm(); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(); List largs = pb.command(); largs.add("-classpath"); largs.add(Utils.TEST_CLASSES); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/JdbLockTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JdbLockTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/JdbLockTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/JdbLockTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -56,7 +56,7 @@ } class sleeper extends Thread { - public static int started = 0; + public static volatile int started = 0; public void run() { started = 1; System.out.println(" sleeper starts sleeping"); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/NoLaunchOptionTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/NoLaunchOptionTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/NoLaunchOptionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/NoLaunchOptionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ "onthrow=java.lang.ClassNotFoundException,suspend=n", "NotAClass" }); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmd); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmd); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/PrivateTransportTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/PrivateTransportTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/PrivateTransportTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/PrivateTransportTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -82,7 +82,7 @@ String libName = transportLib.getFileName().toString().replace("dt_socket", "private_dt_socket"); Files.copy(transportLib, Paths.get(Utils.TEST_CLASSES).resolve(libName)); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:jdwp=transport=private_dt_socket,server=y,suspend=n", "-classpath", Utils.TEST_CLASSES, "HelloWorld"); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/ProcessAttachTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ProcessAttachTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/ProcessAttachTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/ProcessAttachTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,8 +58,6 @@ public class ProcessAttachTest { - public static final String TESTCLASSES = System.getProperty("test.classes"); - public static void main(String[] args) throws Exception { System.out.println("Test 1: Debuggee start with suspend=n"); @@ -71,9 +69,8 @@ } private static void runTest(String jdwpArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( jdwpArg, - "-classpath", TESTCLASSES, "ProcessAttachTestTarg"); Process p = null; try { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/RunToExit.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/RunToExit.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/RunToExit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/RunToExit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -79,7 +79,7 @@ }; args = VMConnection.insertDebuggeeVMOptions(args); - ProcessBuilder launcher = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder launcher = ProcessTools.createLimitedTestJavaProcessBuilder(args); System.out.println(launcher.command().stream().collect(Collectors.joining(" ", "Starting: ", ""))); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/cds/CDSJDITest.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/cds/CDSJDITest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/cds/CDSJDITest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/cds/CDSJDITest.java 2025-01-04 20:25:18.000000000 +0000 @@ -39,7 +39,7 @@ File jarClasslistFile = makeClassList(jarClasses); String appJar = buildJar(testname, jarClasses); - // These are the arguments passed to createJavaProcessBuilder() to launch + // These are the arguments passed to createLimitedTestJavaProcessBuilder() to launch // the JDI test. String[] testArgs = { // JVM Args: @@ -67,7 +67,7 @@ }; // Dump the archive - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:" + appJar, "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-XX:ExtraSharedClassListFile=" + jarClasslistFile.getPath(), @@ -80,7 +80,7 @@ outputDump.shouldHaveExitValue(0); // Run the test specified JDI test - pb = ProcessTools.createTestJvm(testArgs); + pb = ProcessTools.createTestJavaProcessBuilder(testArgs); OutputAnalyzer outputRun = executeAndLog(pb, "exec"); try { outputRun.shouldContain("sharing"); diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java 2025-01-04 20:25:18.000000000 +0000 @@ -122,7 +122,7 @@ + onthrowArgs); debuggeeArgs.addAll(options); debuggeeArgs.add(mainClass); - return ProcessTools.createTestJvm(debuggeeArgs); + return ProcessTools.createTestJavaProcessBuilder(debuggeeArgs); } public Debuggee launch(String name) { diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java openjdk-17-17.0.14+7/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ import java.io.InputStream; import java.io.PrintWriter; import java.lang.management.ManagementFactory; +import java.nio.file.Path; import java.util.Map; import jdk.test.lib.process.ProcessTools; import sun.tools.attach.HotSpotVirtualMachine; @@ -53,14 +54,14 @@ if (args.length == 0) { // start a process that has options set in a number of different ways - File flagsFile = File.createTempFile("CheckOriginFlags", null); + File flagsFile = File.createTempFile("CheckOriginFlags", null, Path.of(".").toFile()); try (PrintWriter pw = new PrintWriter(new FileWriter(flagsFile))) { pw.println("+PrintCodeCache"); } ProcessBuilder pb = ProcessTools. - createJavaProcessBuilder( + createLimitedTestJavaProcessBuilder( "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED", "-XX:+UseG1GC", // this will cause MaxNewSize to be FLAG_SET_ERGO "-XX:+UseCodeAging", diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/net/httpserver/AuthenticatorTest openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest --- openjdk-17-17.0.13+11/test/jdk/com/sun/net/httpserver/AuthenticatorTest 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * 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 8251496 - * @summary Tests for methods in Authenticator - * @run testng/othervm AuthenticatorTest - */ - -import com.sun.net.httpserver.Authenticator; -import com.sun.net.httpserver.BasicAuthenticator; -import com.sun.net.httpserver.HttpPrincipal; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertEquals; - - -public class AuthenticatorTest { - @Test - public void testFailure() { - var failureResult = new Authenticator.Failure(666); - assertEquals(failureResult.getResponseCode(), 666); - } - - @Test - public void testRetry() { - var retryResult = new Authenticator.Retry(333); - assertEquals(retryResult.getResponseCode(), 333); - } - - @Test - public void TestSuccess() { - var principal = new HttpPrincipal("test", "123"); - var successResult = new Authenticator.Success(principal); - assertEquals(successResult.getPrincipal(), principal); - assertEquals("test", principal.getName()); - assertEquals("123", principal.getRealm()); - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/net/httpserver/AuthenticatorTest.java openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/net/httpserver/AuthenticatorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/net/httpserver/AuthenticatorTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2020, 2024, 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 8251496 + * @summary Tests for methods in Authenticator + * @run junit AuthenticatorTest + */ + +import com.sun.net.httpserver.Authenticator; +import com.sun.net.httpserver.HttpPrincipal; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +public class AuthenticatorTest { + @Test + public void testFailure() { + var failureResult = new Authenticator.Failure(666); + assertEquals(666, failureResult.getResponseCode()); + } + + @Test + public void testRetry() { + var retryResult = new Authenticator.Retry(333); + assertEquals(333, retryResult.getResponseCode()); + } + + @Test + public void testSuccess() { + var principal = new HttpPrincipal("test", "123"); + var successResult = new Authenticator.Success(principal); + assertEquals(principal, successResult.getPrincipal()); + assertEquals("test", principal.getUsername()); + assertEquals("123", principal.getRealm()); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java openjdk-17-17.0.14+7/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -62,6 +62,7 @@ import java.io.File; import java.math.BigInteger; import java.security.*; +import jdk.test.lib.security.SecurityUtils; import static jdk.test.lib.Asserts.assertEquals; @@ -160,7 +161,7 @@ private static KeyPair getKeyPair(String algorithm) throws NoSuchAlgorithmException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance(algorithm); - keyGen.initialize(2048); + keyGen.initialize(SecurityUtils.getTestKeySize(algorithm)); return keyGen.genKeyPair(); } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java openjdk-17-17.0.14+7/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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,31 +23,48 @@ /* * @test + * @library /test/lib /java/security/testlibrary * @bug 4470717 * @summary fix default handling and other misc - * @run main/manual Default + * @run main/othervm Default */ import com.sun.security.auth.callback.TextCallbackHandler; +import jdk.test.lib.Asserts; + import javax.security.auth.callback.*; +import java.io.*; public class Default { - public static void main(String args[]) throws Exception { - TextCallbackHandler h = new TextCallbackHandler(); - NameCallback nc = new NameCallback("Name: ", "charlie"); - ConfirmationCallback cc = new ConfirmationCallback - ("Correct?", - ConfirmationCallback.INFORMATION, - ConfirmationCallback.YES_NO_OPTION, - ConfirmationCallback.NO); - - Callback[] callbacks = { nc, cc }; - h.handle(callbacks); - - if (cc.getSelectedIndex() == ConfirmationCallback.YES) { - System.out.println("yes"); - } else { - System.out.println("no"); + public static void main(String args[]) throws Exception { + InputStream in = System.in; + PrintStream err = System.err; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final String defaultName = "charlie"; + final String simulatedInput = "-1\n-1\n"; + HumanInputStream humanInputStream = new HumanInputStream(simulatedInput); + + try (PrintStream prints = new PrintStream(baos)) { + System.setIn(humanInputStream); + System.setErr(prints); + NameCallback nameCallback = new NameCallback("Name: ", defaultName); + ConfirmationCallback confirmationCallback = new ConfirmationCallback( + "Correct?", + ConfirmationCallback.INFORMATION, + ConfirmationCallback.YES_NO_OPTION, + ConfirmationCallback.NO); + new TextCallbackHandler().handle(new Callback[]{nameCallback, confirmationCallback}); + + Asserts.assertEquals(nameCallback.getDefaultName(), defaultName); + Asserts.assertEquals(confirmationCallback.getSelectedIndex(), ConfirmationCallback.NO); + + } finally { + System.setIn(in); + System.setErr(err); } - } + + // check that the default name and confirmation were visible in the output + Asserts.assertTrue(baos.toString().contains(String.format("Name: [%s]", defaultName))); + Asserts.assertTrue(baos.toString().contains("1. No [default]")); + } } diff -Nru openjdk-17-17.0.13+11/test/jdk/com/sun/tools/attach/RunnerUtil.java openjdk-17-17.0.14+7/test/jdk/com/sun/tools/attach/RunnerUtil.java --- openjdk-17-17.0.13+11/test/jdk/com/sun/tools/attach/RunnerUtil.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/com/sun/tools/attach/RunnerUtil.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -53,7 +53,7 @@ "-Dattach.test=true", "-classpath", classpath, "Application" }); String[] args = Utils.addTestJavaOpts(myArgs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); ProcessThread pt = new ProcessThread("runApplication", (line) -> line.equals(Application.READY_MSG), pb); pt.start(); return pt; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -113,6 +113,8 @@ robot.setAutoDelay(100); robot.setAutoWaitForIdle(true); robot.waitForIdle(); + robot.delay(500); + Point pt = choice.getLocationOnScreen(); robot.mouseMove(pt.x + choice.getWidth() / 2, pt.y + choice.getHeight() / 2); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/PopupPosTest/PopupPosTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/PopupPosTest/PopupPosTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/PopupPosTest/PopupPosTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/PopupPosTest/PopupPosTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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,8 +30,18 @@ @run main PopupPosTest */ -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; public class PopupPosTest { @@ -66,6 +76,7 @@ robot = new Robot(); robot.setAutoDelay(50); robot.waitForIdle(); + robot.delay(500); // fix for 6175418. When we take "choice.getHeight()/2" // divider 2 is not sufficiently big to hit into the // small box Choice. We should use bigger divider to get @@ -108,9 +119,9 @@ public void mouseMoveAndPressOnChoice(int x, int y){ openChoice(); robot.mouseMove(x, y); - robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.delay(30); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); //should close choice after each test stage closeChoice(); @@ -121,9 +132,9 @@ Point pt = choice.getLocationOnScreen(); robot.mouseMove(pt.x + choice.getWidth() - choice.getHeight()/4, pt.y + choice.getHeight()/2); - robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.delay(30); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); } public void closeChoice(){ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - @test - @bug 4902933 8197810 - @summary Test that selecting the current item doesnot send an ItemEvent - @key headful - @run main SelectCurrentItemTest -*/ - -import java.awt.Choice; -import java.awt.Robot; -import java.awt.Frame; -import java.awt.BorderLayout; -import java.awt.AWTException; -import java.awt.Point; -import java.awt.Dimension; -import java.awt.event.InputEvent; -import java.awt.event.ItemListener; -import java.awt.event.WindowListener; -import java.awt.event.ItemEvent; -import java.awt.event.WindowEvent; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -public class SelectCurrentItemTest implements ItemListener, WindowListener { - //Declare things used in the test, like buttons and labels here - private Frame frame; - private Choice theChoice; - private Robot robot; - - private CountDownLatch latch = new CountDownLatch(1); - private volatile boolean passed = true; - - private void init() - { - try { - robot = new Robot(); - robot.setAutoDelay(500); - } catch (AWTException e) { - throw new RuntimeException("Unable to create Robot. Test fails."); - } - - frame = new Frame("SelectCurrentItemTest"); - frame.setLayout(new BorderLayout()); - theChoice = new Choice(); - for (int i = 0; i < 10; i++) { - theChoice.add(new String("Choice Item " + i)); - } - theChoice.addItemListener(this); - frame.add(theChoice); - frame.addWindowListener(this); - - frame.setLocation(1,20); - robot.mouseMove(10, 30); - frame.pack(); - frame.setVisible(true); - } - - public static void main(String... args) { - SelectCurrentItemTest test = new SelectCurrentItemTest(); - test.init(); - try { - test.latch.await(12000, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) {} - test.robot.waitForIdle(); - - try { - if (!test.passed) { - throw new RuntimeException("TEST FAILED."); - } - } finally { - test.frame.dispose(); - } - } - - private void run() { - try {Thread.sleep(1000);} catch (InterruptedException e){} - // get loc of Choice on screen - Point loc = theChoice.getLocationOnScreen(); - // get bounds of Choice - Dimension size = theChoice.getSize(); - robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2); - - robot.setAutoDelay(250); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); - - robot.delay(1000); - - robot.mouseMove(loc.x + size.width / 2, loc.y + size.height); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); - robot.waitForIdle(); - latch.countDown(); - } - - @Override public void itemStateChanged(ItemEvent e) { - System.out.println("ItemEvent received. Test fails"); - passed = false; - } - - @Override public void windowOpened(WindowEvent e) { - System.out.println("windowActivated()"); - (new Thread(this::run)).start(); - } - - @Override public void windowActivated(WindowEvent e) {} - @Override public void windowDeactivated(WindowEvent e) {} - @Override public void windowClosed(WindowEvent e) {} - @Override public void windowClosing(WindowEvent e) {} - @Override public void windowIconified(WindowEvent e) {} - @Override public void windowDeiconified(WindowEvent e) {} -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectItem/SelectCurrentItemTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectCurrentItemTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectItem/SelectCurrentItemTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectCurrentItemTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2002, 2024, 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.AWTException; +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +/* + * @test + * @bug 4902933 8197810 + * @summary Test that selecting the current item does not send an ItemEvent + * @key headful + * @run main SelectCurrentItemTest +*/ +public class SelectCurrentItemTest + extends WindowAdapter + implements ItemListener { + private static Frame frame; + private static Choice choice; + + private final Robot robot; + + private final CountDownLatch windowOpened = new CountDownLatch(1); + private final CountDownLatch mouseClicked = new CountDownLatch(1); + + protected final CountDownLatch itemStateChanged = new CountDownLatch(1); + + protected SelectCurrentItemTest() throws AWTException { + robot = new Robot(); + robot.setAutoDelay(250); + } + + private void createUI() { + frame = new Frame(getClass().getName()); + frame.setLayout(new BorderLayout()); + + choice = new Choice(); + for (int i = 0; i < 10; i++) { + choice.add("Choice Item " + i); + } + choice.addItemListener(this); + choice.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + System.out.println("mouseClicked()"); + mouseClicked.countDown(); + } + }); + + frame.add(choice, BorderLayout.CENTER); + + frame.addWindowListener(this); + + frame.setLocationRelativeTo(null); + frame.setResizable(false); + frame.pack(); + frame.setVisible(true); + } + + protected final void runTest() + throws InterruptedException, InvocationTargetException { + try { + doTest(); + } finally { + EventQueue.invokeAndWait(this::dispose); + } + } + + private void doTest() + throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(this::createUI); + + if (!windowOpened.await(2, TimeUnit.SECONDS)) { + throw new RuntimeException("Frame is not open in time"); + } + robot.waitForIdle(); + + final int initialIndex = getSelectedIndex(); + + final Rectangle choiceRect = getChoiceRect(); + + // Open the choice popup + robot.mouseMove(choiceRect.x + choiceRect.width - 10, + choiceRect.y + choiceRect.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + if (!mouseClicked.await(500, TimeUnit.MILLISECONDS)) { + throw new RuntimeException("Mouse is not clicked in time"); + } + robot.waitForIdle(); + + // Click an item in the choice popup + final Point pt = getClickLocation(choiceRect); + robot.mouseMove(pt.x, pt.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + + checkItemStateChanged(); + + final int currentIndex = getSelectedIndex(); + System.out.println("initialIndex = " + initialIndex); + System.out.println("currentIndex = " + currentIndex); + checkSelectedIndex(initialIndex, currentIndex); + } + + protected void checkItemStateChanged() throws InterruptedException { + if (itemStateChanged.await(500, TimeUnit.MILLISECONDS)) { + throw new RuntimeException("ItemEvent is received but unexpected"); + } + } + + protected void checkSelectedIndex(final int initialIndex, + final int currentIndex) { + if (initialIndex != currentIndex) { + throw new RuntimeException("Selected index in Choice should not change"); + } + } + + /** + * {@return the location for clicking choice popup to select an item} + * @param choiceRect the bounds of the Choice component + */ + protected Point getClickLocation(final Rectangle choiceRect) { + // Click on the first item in the popup, it's the selected item + return new Point(choiceRect.x + choiceRect.width / 2, + choiceRect.y + choiceRect.height + 3); + } + + private int getSelectedIndex() + throws InterruptedException, InvocationTargetException { + AtomicInteger index = new AtomicInteger(); + EventQueue.invokeAndWait(() -> index.set(choice.getSelectedIndex())); + return index.get(); + } + + private Rectangle getChoiceRect() + throws InterruptedException, InvocationTargetException { + AtomicReference rect = new AtomicReference<>(); + EventQueue.invokeAndWait( + () -> rect.set(new Rectangle(choice.getLocationOnScreen(), + choice.getSize()))); + return rect.get(); + } + + public static void main(String... args) throws Exception { + new SelectCurrentItemTest().runTest(); + } + + private void dispose() { + if (frame != null) { + frame.dispose(); + } + } + + @Override + public final void itemStateChanged(ItemEvent e) { + System.out.println("itemStateChanged: " + e); + itemStateChanged.countDown(); + } + + @Override + public final void windowOpened(WindowEvent e) { + System.out.println("windowActivated()"); + windowOpened.countDown(); + } + +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectItem/SelectNewItemTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectNewItemTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectItem/SelectNewItemTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectItem/SelectNewItemTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019, 2024, 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.AWTException; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.concurrent.TimeUnit; + +/* + * @test + * @bug 8215921 + * @summary Test that selecting a different item does send an ItemEvent + * @key headful + * @run main SelectNewItemTest +*/ +public final class SelectNewItemTest + extends SelectCurrentItemTest { + + private SelectNewItemTest() throws AWTException { + super(); + } + + @Override + protected void checkItemStateChanged() throws InterruptedException { + if (!itemStateChanged.await(500, TimeUnit.MILLISECONDS)) { + throw new RuntimeException("ItemEvent is not received"); + } + } + + @Override + protected void checkSelectedIndex(final int initialIndex, + final int currentIndex) { + if (initialIndex == currentIndex) { + throw new RuntimeException("Selected index in Choice should've changed"); + } + } + + @Override + protected Point getClickLocation(final Rectangle choiceRect) { + // Click a different item the popup, not the first one + return new Point(choiceRect.x + choiceRect.width / 2, + choiceRect.y + choiceRect.height * 3); + } + + public static void main(String... args) throws Exception { + new SelectNewItemTest().runTest(); + } + +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/* - * 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 8215921 - @summary Test that selecting a different item does send an ItemEvent - @key headful - @run main SelectNewItemTest -*/ - -import java.awt.Choice; -import java.awt.Robot; -import java.awt.Frame; -import java.awt.BorderLayout; -import java.awt.AWTException; -import java.awt.Point; -import java.awt.Dimension; -import java.awt.event.InputEvent; -import java.awt.event.ItemListener; -import java.awt.event.WindowListener; -import java.awt.event.ItemEvent; -import java.awt.event.WindowEvent; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -public class SelectNewItemTest implements ItemListener, WindowListener { - //Declare things used in the test, like buttons and labels here - private Frame frame; - private Choice theChoice; - private Robot robot; - - private CountDownLatch latch = new CountDownLatch(1); - private volatile boolean passed = false; - - private void init() - { - try { - robot = new Robot(); - robot.setAutoDelay(500); - } catch (AWTException e) { - throw new RuntimeException("Unable to create Robot. Test fails."); - } - - frame = new Frame("SelectNewItemTest"); - frame.setLayout(new BorderLayout()); - theChoice = new Choice(); - for (int i = 0; i < 10; i++) { - theChoice.add(new String("Choice Item " + i)); - } - theChoice.addItemListener(this); - frame.add(theChoice); - frame.addWindowListener(this); - - frame.setLocation(1,20); - frame.setSize(200, 50); - robot.mouseMove(10, 30); - frame.pack(); - frame.setVisible(true); - } - - public static void main(String... args) { - SelectNewItemTest test = new SelectNewItemTest(); - test.init(); - try { - test.latch.await(12000, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) {} - test.robot.waitForIdle(); - - try { - if (!test.passed) { - throw new RuntimeException("TEST FAILED."); - } - } finally { - test.frame.dispose(); - } - } - - private void run() { - try { - Thread.sleep(1000); - - Point loc = theChoice.getLocationOnScreen(); - int selectedIndex = theChoice.getSelectedIndex(); - Dimension size = theChoice.getSize(); - - robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2); - - robot.setAutoDelay(250); - robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - - robot.delay(1000); - - //make sure that the mouse moves to a different item, so that - //itemStateChanged is called. - robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height); - robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - robot.waitForIdle(); - - if (selectedIndex == theChoice.getSelectedIndex()) - throw new RuntimeException("Test case failed - expected to select" + - " a different item than " + selectedIndex); - - selectedIndex = theChoice.getSelectedIndex(); - //now click on the same item and make sure that item event is - //not generated. - robot.delay(1000); - robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2); - - robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - //Make sure that the popup menu scrolls back to show the index from - //beginning, so that the second mouse click happens on the previously - //selected item. - //For example, on windows, it automatically scrolls the list to show - //the currently selected item just below the choice, which can - //throw off the test. - if (System.getProperty("os.name").toLowerCase().startsWith("win")) { - robot.mouseWheel(-100); - } - robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - - robot.delay(1000); - robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height); - robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - robot.waitForIdle(); - - if (selectedIndex != theChoice.getSelectedIndex()) - throw new RuntimeException("Test failed. Expected to select the same item " + - "located at: " + selectedIndex + " but got an item selected at: " + theChoice.getSelectedIndex()); - } catch(InterruptedException e) { - throw new RuntimeException(e.getCause()); - } finally { - latch.countDown(); - } - } - - @Override public void itemStateChanged(ItemEvent e) { - if (!passed) { - System.out.println("ItemEvent received. Test passes"); - passed = true; - } else { - System.out.println("ItemEvent received for second click. Test fails"); - passed = false; - } - } - - @Override public void windowOpened(WindowEvent e) { - System.out.println("windowActivated()"); - (new Thread(this::run)).start(); - } - - @Override public void windowActivated(WindowEvent e) {} - @Override public void windowDeactivated(WindowEvent e) {} - @Override public void windowClosed(WindowEvent e) {} - @Override public void windowClosing(WindowEvent e) {} - @Override public void windowIconified(WindowEvent e) {} - @Override public void windowDeiconified(WindowEvent e) {} -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -79,6 +79,7 @@ } waitTillShown(dialog); + robot.delay(500); clickOn(button); if (frame == KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow()) { throw new RuntimeException("Test failed!"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/RowToleranceTransitivityTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/RowToleranceTransitivityTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/RowToleranceTransitivityTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/RowToleranceTransitivityTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ @summary Tests for a transitivity problem with ROW_TOLERANCE in SortingFTP. @run main RowToleranceTransitivityTest */ -import java.awt.BorderLayout; + import java.awt.Component; import java.awt.Dimension; import java.awt.EventQueue; @@ -36,7 +36,6 @@ import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.KeyboardFocusManager; -import java.awt.Panel; import java.awt.Point; import java.awt.Robot; import java.awt.event.FocusAdapter; @@ -49,8 +48,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import java.util.concurrent.atomic.AtomicBoolean; -import java.lang.reflect.InvocationTargetException; -import java.util.concurrent.atomic.AtomicBoolean; public class RowToleranceTransitivityTest { static JFrame frame; @@ -60,7 +57,7 @@ static GridBagConstraints gc; static Robot robot; - static AtomicBoolean focusGained = new AtomicBoolean(false); + static final AtomicBoolean focusGained = new AtomicBoolean(false); public static void main(String[] args) throws Exception { robot = new Robot(); @@ -121,6 +118,7 @@ robot.delay(1000); test(); } finally { + robot.keyRelease(KeyEvent.VK_TAB); if (frame != null) { frame.dispose(); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -75,6 +75,7 @@ frame.setLocationRelativeTo(null); frame.setVisible(true); Util.waitForIdle(robot); + robot.delay(500); if (!frame.isActive()) { throw new RuntimeException("Test Fialed: frame isn't active"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/DefaultSizeTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/DefaultSizeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/DefaultSizeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/DefaultSizeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,6 @@ * questions. */ -import java.awt.EventQueue; import java.awt.Frame; /* @@ -44,25 +43,15 @@ public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("DefaultSizeTest Instructions Frame") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(10) .columns(45) + .testUI(() -> new Frame("DefaultSize")) .screenCapture() - .build(); - - EventQueue.invokeAndWait(() -> { - Frame frame = new Frame("DefaultSize"); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame - .positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameRepackTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameRepackTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameRepackTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameRepackTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,25 +77,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("FrameRepackTest Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(30) .columns(45) - .build(); - - EventQueue.invokeAndWait(() -> { - FrameRepack frame = new FrameRepack(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(FrameRepack::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_1.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_1.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_1.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,6 @@ import java.awt.BorderLayout; import java.awt.Canvas; import java.awt.Color; -import java.awt.EventQueue; import java.awt.Frame; /* @@ -53,25 +52,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("FrameResizeTest_1 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(12) .columns(45) - .build(); - - EventQueue.invokeAndWait(() -> { - FrameResize_1 frame = new FrameResize_1(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(FrameResize_1::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_2.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_2.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,6 @@ import java.awt.Color; import java.awt.Container; import java.awt.Dimension; -import java.awt.EventQueue; import java.awt.Frame; import java.awt.Graphics; import java.awt.GridBagConstraints; @@ -57,25 +56,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("FrameResizeTest_2 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(10) .columns(45) - .build(); - - EventQueue.invokeAndWait(() -> { - FrameResize_2 frame = new FrameResize_2(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(FrameResize_2::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java 2025-01-04 20:25:18.000000000 +0000 @@ -45,7 +45,7 @@ public class MaximizedToIconified { - static volatile int lastFrameState = Frame.NORMAL; + static volatile int lastFrameState; static volatile boolean failed = false; static volatile Toolkit myKit; private static Robot robot; @@ -77,6 +77,8 @@ frame.setSize(200, 200); frame.setVisible(true); + lastFrameState = Frame.NORMAL; + robot.waitForIdle(); frame.addWindowStateListener(new WindowStateListener() { @@ -114,7 +116,12 @@ // because Toolkit.isFrameStateSupported() method reports these states // as not supported. And such states will simply be skipped. examineStates(new int[] {Frame.MAXIMIZED_BOTH, Frame.ICONIFIED, Frame.NORMAL}); + System.out.println("------"); examineStates(new int[] {Frame.ICONIFIED, Frame.MAXIMIZED_BOTH, Frame.NORMAL}); + System.out.println("------"); + examineStates(new int[] {Frame.NORMAL, Frame.MAXIMIZED_BOTH, Frame.ICONIFIED}); + System.out.println("------"); + examineStates(new int[] {Frame.NORMAL, Frame.ICONIFIED, Frame.MAXIMIZED_BOTH}); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,17 +40,27 @@ private Frame frame, frame2; private Button button, button2; private TextField textField, textField2; - private int eventType, eventType1; - private ExtendedRobot robot; - private Object lock1 = new Object(); - private Object lock2 = new Object(); - private Object lock3 = new Object(); + private volatile int eventType; + private final Object lock1 = new Object(); + private final Object lock2 = new Object(); + private final Object lock3 = new Object(); private boolean passed = true; - private int delay = 150; + private final int delay = 150; public static void main(String[] args) { ActiveAWTWindowTest test = new ActiveAWTWindowTest(); - test.doTest(); + try { + test.doTest(); + } finally { + EventQueue.invokeLater(() -> { + if (test.frame != null) { + test.frame.dispose(); + } + if (test.frame2 != null) { + test.frame2.dispose(); + } + }); + } } public ActiveAWTWindowTest() { @@ -105,7 +115,7 @@ System.out.println("Undecorated Frame got Deactivated\n"); synchronized (lock2) { try { - lock2.notifyAll(); + lock2.notifyAll(); } catch (Exception ex) { ex.printStackTrace(); } @@ -146,6 +156,7 @@ } public void doTest() { + ExtendedRobot robot; try { robot = new ExtendedRobot(); } catch (Exception e) { @@ -153,13 +164,14 @@ throw new RuntimeException("Cannot create robot"); } + robot.setAutoDelay(delay); + robot.setAutoWaitForIdle(true); + robot.waitForIdle(5*delay); robot.mouseMove(button.getLocationOnScreen().x + button.getSize().width / 2, button.getLocationOnScreen().y + button.getSize().height / 2); - robot.waitForIdle(delay); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.waitForIdle(delay); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); if (eventType != WindowEvent.WINDOW_ACTIVATED) { synchronized (lock1) { @@ -176,15 +188,12 @@ "undecorated frame is activated!"); } - eventType1 = -1; eventType = -1; robot.mouseMove(button2.getLocationOnScreen().x + button2.getSize().width / 2, button2.getLocationOnScreen().y + button2.getSize().height / 2); - robot.waitForIdle(delay); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.waitForIdle(delay); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); if (eventType != WindowEvent.WINDOW_DEACTIVATED) { synchronized (lock2) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MiscUndecorated/RepaintTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/RepaintTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Frame/MiscUndecorated/RepaintTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Frame/MiscUndecorated/RepaintTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,27 +28,29 @@ * all the components on it are repainted correctly * @author Jitender(jitender.singh@eng.sun.com) area=AWT * @author yan - * @library /lib/client - * @build ExtendedRobot + * @library /lib/client /test/lib + * @build ExtendedRobot jdk.test.lib.Platform * @run main RepaintTest */ +import jdk.test.lib.Platform; + import java.awt.BorderLayout; import java.awt.Button; import java.awt.Color; import java.awt.Component; import java.awt.Container; +import java.awt.EventQueue; import java.awt.Frame; import java.awt.Panel; import java.awt.Point; import java.awt.Rectangle; import java.awt.TextField; -import java.awt.Toolkit; -import java.awt.event.*; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JPanel; +import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.awt.image.PixelGrabber; import java.io.File; @@ -57,38 +59,24 @@ private static final int delay = 150; private Frame frame; - private Container panel1, panel2; private Component button; private Component textField; private ExtendedRobot robot; private final Object buttonLock = new Object(); - private boolean passed = true; - private boolean buttonClicked = false; + private volatile boolean buttonClicked = false; private final int MAX_TOLERANCE_LEVEL = 10; - public static void main(String[] args) { + public static void main(String[] args) throws Exception { RepaintTest test = new RepaintTest(); - test.doTest(false); try { - Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() { - public void run() { - test.frame.dispose(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Unexpected Exception occured"); + test.doTest(false); + } finally { + EventQueue.invokeAndWait(test::dispose); } - test.doTest(true); try { - Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() { - public void run() { - test.frame.dispose(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Unexpected Exception occured"); + test.doTest(true); + } finally { + EventQueue.invokeAndWait(test::dispose); } } @@ -101,8 +89,8 @@ button = createButton(swingControl, (swingControl ? "Swing Button" : "AWT Button")); textField = swingControl ? new JTextField("TextField") : new TextField("TextField"); - panel1 = swingControl ? new JPanel() : new Panel(); - panel2 = swingControl ? new JPanel() : new Panel(); + Container panel1 = swingControl ? new JPanel() : new Panel(); + Container panel2 = swingControl ? new JPanel() : new Panel(); panel1.add(button); panel2.add(textField); frame.add(panel2, BorderLayout.SOUTH); @@ -112,58 +100,44 @@ frame.setBackground(Color.green); frame.setVisible(true); } + + private void dispose() { + if (frame != null) { + frame.dispose(); + } + } + private Component createButton(boolean swingControl, String txt) { + ActionListener actionListener = e -> { + buttonClicked = true; + System.out.println("Clicked!!"); + synchronized (buttonLock) { + try { + buttonLock.notifyAll(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }; + if(swingControl) { JButton jbtn = new JButton(txt); - jbtn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - buttonClicked = true; - synchronized (buttonLock) { - try { - buttonLock.notifyAll(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - } - }); + jbtn.addActionListener(actionListener); return jbtn; } else { Button btn = new Button(txt); - btn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - buttonClicked = true; - synchronized (buttonLock) { - try { - buttonLock.notifyAll(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - } - }); + btn.addActionListener(actionListener); return btn; } } - public void doTest(boolean swingControl) { - try { - Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() { - public void run() { - initializeGUI(swingControl); - } - }); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Interrupted or unexpected Exception occured"); - } - try { - robot = new ExtendedRobot(); - robot.waitForIdle(1000); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Cannot create robot"); - } + public void doTest(boolean swingControl) throws Exception { + + robot = new ExtendedRobot(); + robot.setAutoDelay(50); + + EventQueue.invokeAndWait(() -> initializeGUI(swingControl)); + robot.waitForIdle(1000); robot.mouseMove(button.getLocationOnScreen().x + button.getSize().width / 2, button.getLocationOnScreen().y + button.getSize().height / 2); @@ -180,54 +154,50 @@ } } if (! buttonClicked) { - passed = false; System.err.println("ActionEvent not triggered when " + "button is clicked!"); throw new RuntimeException("ActionEvent not triggered"); } - robot.waitForIdle(delay * 5); // Need to wait until look of the button + robot.waitForIdle(1000); // Need to wait until look of the button // returns to normal undepressed - passed = paintAndRepaint(button, (swingControl? "J": "")+"Button"); - if( !paintAndRepaint(button, (swingControl? "J": "")+"TextField") ) { - passed = false; - } - if(!passed) { + + if (!paintAndRepaint(button, (swingControl ? "J" : "") + "Button") + || !paintAndRepaint(textField, (swingControl ? "J" : "") + "TextField")) { throw new RuntimeException("Test failed"); } } - private boolean paintAndRepaint(Component comp, String prefix) { + private boolean paintAndRepaint(Component comp, String prefix) throws Exception { + boolean passed = true; //Capture the component & compare it's dimensions //before iconifying & after frame comes back from //iconified to normal state - System.out.println("paintAndRepaint "+prefix); + System.out.printf("paintAndRepaint %s %s\n", prefix, comp); Point p = comp.getLocationOnScreen(); Rectangle bRect = new Rectangle((int)p.getX(), (int)p.getY(), comp.getWidth(), comp.getHeight()); BufferedImage capturedImage = robot.createScreenCapture(bRect); + BufferedImage frameImage = robot.createScreenCapture(frame.getBounds()); - try { - Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() { - public void run() { - frame.setExtendedState(Frame.ICONIFIED); - } - }); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Exception while setting extended state ICONIFIED"); + EventQueue.invokeAndWait(() -> frame.setExtendedState(Frame.ICONIFIED)); + robot.waitForIdle(1500); + EventQueue.invokeAndWait(() -> frame.setExtendedState(Frame.NORMAL)); + robot.waitForIdle(1500); + + if (Platform.isOnWayland()) { + // Robot.mouseMove does not move the actual mouse cursor on the + // screen in X11 compatibility mode on Wayland, but only within + // the XWayland server. + // This can cause the test to fail if the actual mouse cursor on + // the screen is somewhere over the test window, so that when the + // test window is restored from the iconified state, it's detected + // that the mouse cursor has moved to the mouse cursor position on + // the screen, and is no longer hovering over the button, so the + // button is painted differently. + robot.mouseMove(button.getLocationOnScreen().x + button.getSize().width / 2, + button.getLocationOnScreen().y + button.getSize().height / 2); + robot.waitForIdle(); } - robot.waitForIdle(delay * 5); - try { - Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() { - public void run() { - frame.setExtendedState(Frame.NORMAL); - } - }); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Exception while setting extended state NORMAL"); - } - robot.waitForIdle(delay * 5); if (! p.equals(comp.getLocationOnScreen())) { passed = false; @@ -238,14 +208,20 @@ bRect = new Rectangle((int)p.getX(), (int)p.getY(), comp.getWidth(), comp.getHeight()); BufferedImage capturedImage2 = robot.createScreenCapture(bRect); + BufferedImage frameImage2 = robot.createScreenCapture(frame.getBounds()); - if (! compareImages(capturedImage, capturedImage2)) { + if (!compareImages(capturedImage, capturedImage2)) { passed = false; + try { - javax.imageio.ImageIO.write(capturedImage, "jpg", new File( - prefix+"BeforeMinimize.jpg")); - javax.imageio.ImageIO.write(capturedImage2, "jpg", new File( - prefix+"AfterMinimize.jpg")); + javax.imageio.ImageIO.write(capturedImage, "png", + new File(prefix + "BeforeMinimize.png")); + javax.imageio.ImageIO.write(capturedImage2, "png", + new File(prefix + "AfterMinimize.png")); + javax.imageio.ImageIO.write(frameImage, "png", + new File("Frame" + prefix + "BeforeMinimize.png")); + javax.imageio.ImageIO.write(frameImage2, "png", + new File("Frame" + prefix + "AfterMinimize.png")); } catch (Exception e) { e.printStackTrace(); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, 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,34 +33,50 @@ import jdk.test.lib.Platform; -import java.awt.*; -import javax.swing.*; -import java.awt.event.*; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import java.awt.Robot; +import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; public class ConsumeNextMnemonicKeyTypedTest { - Robot robot; - JFrame frame = new JFrame("Test Frame"); - JTextField text = new JTextField(); - JMenuBar bar = new JMenuBar(); - JMenu menu = new JMenu("Menu"); - JMenuItem item = new JMenuItem("item"); - - public static void main(String[] args) { - ConsumeNextMnemonicKeyTypedTest app = new ConsumeNextMnemonicKeyTypedTest(); - app.init(); - app.start(); - } - - public void init() { + static Robot robot; + static JFrame frame; + static JTextField text; + static JMenuBar bar; + static JMenu menu; + static JMenuItem item; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(50); try { - robot = new Robot(); - robot.setAutoDelay(50); - } catch (AWTException e) { - throw new RuntimeException("Error: unable to create robot", e); + SwingUtilities.invokeAndWait(ConsumeNextMnemonicKeyTypedTest::init); + + robot.waitForIdle(); + robot.delay(500); + + test(); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); } } - public void start() { + public static void init() { + frame = new JFrame("Test Frame"); + text = new JTextField(); + bar = new JMenuBar(); + menu = new JMenu("Menu"); + item = new JMenuItem("item"); + menu.setMnemonic('f'); item.setMnemonic('i'); menu.add(item); @@ -72,20 +88,18 @@ frame.setLocationRelativeTo(null); frame.setVisible(true); - - test(); } - void test() { + static void test() { robot.waitForIdle(); if (!text.isFocusOwner()) { robot.mouseMove(text.getLocationOnScreen().x + 5, text.getLocationOnScreen().y + 5); robot.delay(100); - robot.mousePress(MouseEvent.BUTTON1_MASK); + robot.mousePress(MouseEvent.BUTTON1_DOWN_MASK); robot.delay(100); - robot.mouseRelease(MouseEvent.BUTTON1_MASK); + robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); int iter = 10; while (!text.isFocusOwner() && iter-- > 0) { @@ -146,7 +160,7 @@ robot.waitForIdle(); - System.err.println("Test: chracter typed with VK_A: " + text.getText()); + System.err.println("Test: character typed with VK_A: " + text.getText()); if (!charA.equals(text.getText())) { throw new RuntimeException("Test failed!"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,19 +21,6 @@ * questions. */ -/* - @test - @key headful - @bug 6380743 8158380 8198624 - @summary Submenu should be shown by mnemonic key press. - @author anton.tarasov@...: area=awt.focus - @library ../../../regtesthelpers - @library /test/lib - @build Util - @build jdk.test.lib.Platform - @run main SubMenuShowTest -*/ - import java.awt.Robot; import java.awt.BorderLayout; import java.awt.event.KeyEvent; @@ -48,6 +35,17 @@ import jdk.test.lib.Platform; import test.java.awt.regtesthelpers.Util; +/* + @test + @key headful + @bug 6380743 8158380 8198624 + @summary Submenu should be shown by mnemonic key press. + @library /java/awt/regtesthelpers + @library /test/lib + @build Util + @build jdk.test.lib.Platform + @run main SubMenuShowTest +*/ public class SubMenuShowTest { private static Robot robot; private static JFrame frame; @@ -116,6 +114,8 @@ } public static void doTest() { + robot.waitForIdle(); + robot.delay(1000); boolean isMacOSX = Platform.isOSX(); if (isMacOSX) { robot.keyPress(KeyEvent.VK_CONTROL); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/LightweightComponent/LightweightCliprect.java openjdk-17-17.0.14+7/test/jdk/java/awt/LightweightComponent/LightweightCliprect.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/LightweightComponent/LightweightCliprect.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/LightweightComponent/LightweightCliprect.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,7 +25,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.Dimension; -import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.Graphics; @@ -49,32 +48,28 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("LightweightCliprect Instructions Frame") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(10) .columns(45) - .build(); - - EventQueue.invokeAndWait(() -> { - Frame frame = new Frame("DefaultSize"); - - Container panel = new MyContainer(); - MyComponent c = new MyComponent(); - panel.add(c); + .testUI(LightweightCliprect::createUI) + .build() + .awaitAndCheck(); + } - frame.add(panel); - frame.setSize(400, 300); + private static Frame createUI() { + Frame frame = new Frame("DefaultSize"); - PassFailJFrame.addTestWindow(frame); - PassFailJFrame - .positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); + Container panel = new MyContainer(); + MyComponent c = new MyComponent(); + panel.add(c); - frame.setVisible(true); - }); + frame.add(panel); + frame.setSize(400, 300); - passFailJFrame.awaitAndCheck(); + return frame; } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/List/ActionEventTest/ActionEventTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/List/ActionEventTest/ActionEventTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/List/ActionEventTest/ActionEventTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/List/ActionEventTest/ActionEventTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -29,59 +29,55 @@ * @run main ActionEventTest */ -import java.awt.AWTException; +import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.List; import java.awt.Robot; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.KeyEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; -public class ActionEventTest extends Frame { - List list; - Robot robot; - public ActionEventTest() { - try { - robot = new Robot(); - robot.setAutoDelay(100); - robot.setAutoWaitForIdle(true); - } catch(AWTException e) { - throw new RuntimeException(e.getMessage()); - } +public class ActionEventTest { + + static List list; + static Frame frame; + static Robot robot; + static final CountDownLatch countDownLatch = new CountDownLatch(1); + static volatile boolean failed; + + static void initAndShowGui() { list = new List(1, false); list.add("0"); - add(list); - setSize(400,400); - setLayout(new FlowLayout()); - setLocationRelativeTo(null); - pack(); - setVisible(true); - } - void performTest() { - list.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent ae) { - int md = ae.getModifiers(); - int expectedMask = ActionEvent.ALT_MASK | ActionEvent.CTRL_MASK - | ActionEvent.SHIFT_MASK; - - if ((md & expectedMask) != expectedMask) { - - robot.keyRelease(KeyEvent.VK_CONTROL); - robot.keyRelease(KeyEvent.VK_SHIFT); - robot.keyRelease(KeyEvent.VK_ALT); - dispose(); - throw new RuntimeException("Action Event modifiers are not" - + " set correctly."); - } + list.addActionListener(ae -> { + int md = ae.getModifiers(); + int expectedMask = ActionEvent.ALT_MASK | ActionEvent.CTRL_MASK + | ActionEvent.SHIFT_MASK; + + if ((md & expectedMask) != expectedMask) { + failed = true; } + countDownLatch.countDown(); }); + frame = new Frame("ActionEventTest"); + frame.add(list); + frame.setSize(400, 400); + frame.setLayout(new FlowLayout()); + frame.setLocationRelativeTo(null); + frame.pack(); + frame.setVisible(true); list.select(0); + } + + static void performTest() { + robot.waitForIdle(); + robot.delay(500); + robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_SHIFT); robot.keyPress(KeyEvent.VK_CONTROL); @@ -93,9 +89,29 @@ robot.keyRelease(KeyEvent.VK_ALT); } - public static void main(String args[]) { - ActionEventTest test = new ActionEventTest(); - test.performTest(); - test.dispose(); + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + + try { + EventQueue.invokeAndWait(ActionEventTest::initAndShowGui); + performTest(); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + + if (!countDownLatch.await(10, TimeUnit.SECONDS)) { + throw new RuntimeException("Action Listener is not triggered"); + } + + if (failed) { + throw new RuntimeException("Action Event modifiers are not" + + " set correctly."); + } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,33 +32,87 @@ @run main KeyEventsTest */ -import java.awt.*; -import java.awt.event.*; -import java.lang.reflect.*; +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.KeyboardFocusManager; +import java.awt.Frame; +import java.awt.List; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import jdk.test.lib.Platform; -public class KeyEventsTest extends Frame implements ItemListener, FocusListener, KeyListener -{ +public class KeyEventsTest { TestState currentState; final Object LOCK = new Object(); final int ACTION_TIMEOUT = 500; - List single = new List(3, false); - List multiple = new List(3, true); + List single; + List multiple; - Panel p1 = new Panel (); - Panel p2 = new Panel (); + KeyFrame keyFrame; - public static void main(final String[] args) { + static Robot r; + + public static void main(final String[] args) throws Exception { + r = new Robot(); KeyEventsTest app = new KeyEventsTest(); - app.init(); - app.start(); + try { + EventQueue.invokeAndWait(app::initAndShowGui); + r.waitForIdle(); + r.delay(500); + app.doTest(); + } finally { + EventQueue.invokeAndWait(() -> { + if (app.keyFrame != null) { + app.keyFrame.dispose(); + } + }); + } } - public void init() - { - setLayout (new BorderLayout ()); + class KeyFrame extends Frame implements ItemListener, FocusListener, KeyListener { + public void itemStateChanged(ItemEvent ie) { + System.out.println("itemStateChanged-" + ie); + currentState.setAction(true); + } + + public void focusGained(FocusEvent e) { + synchronized (LOCK) { + LOCK.notifyAll(); + } + } + + public void focusLost(FocusEvent e) { + } + + public void keyPressed(KeyEvent e) { + System.out.println("keyPressed-" + e); + } + + public void keyReleased(KeyEvent e) { + System.out.println("keyReleased-" + e); + } + + public void keyTyped(KeyEvent e) { + System.out.println("keyTyped-" + e); + } + } + + public void initAndShowGui() { + keyFrame = new KeyFrame(); + keyFrame.setLayout(new BorderLayout ()); + + single = new List(3, false); + multiple = new List(3, true); single.add("0"); single.add("1"); @@ -80,161 +134,105 @@ multiple.add("7"); multiple.add("8"); - single.addKeyListener(this); - single.addItemListener(this); - single.addFocusListener(this); + single.addKeyListener(keyFrame); + single.addItemListener(keyFrame); + single.addFocusListener(keyFrame); + Panel p1 = new Panel(); p1.add(single); - add("North", p1); + keyFrame.add("North", p1); - multiple.addKeyListener(this); - multiple.addItemListener(this); - multiple.addFocusListener(this); + multiple.addKeyListener(keyFrame); + multiple.addItemListener(keyFrame); + multiple.addFocusListener(keyFrame); + Panel p2 = new Panel(); p2.add(multiple); - add("South", p2); - - }//End init() - - public void start () - { - - try{ - setSize (200,200); - validate(); - setUndecorated(true); - setLocationRelativeTo(null); - setVisible(true); - - doTest(); - System.out.println("Test passed."); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("The test failed."); - } - - }// start() - - public void itemStateChanged (ItemEvent ie) { - System.out.println("itemStateChanged-"+ie); - this.currentState.setAction(true); - } - - public void focusGained(FocusEvent e){ - - synchronized (LOCK) { - LOCK.notifyAll(); - } - - } - - public void focusLost(FocusEvent e){ - } - - public void keyPressed(KeyEvent e){ - System.out.println("keyPressed-"+e); - } - - public void keyReleased(KeyEvent e){ - System.out.println("keyReleased-"+e); - } + keyFrame.add("South", p2); - public void keyTyped(KeyEvent e){ - System.out.println("keyTyped-"+e); + keyFrame.setSize(200, 200); + keyFrame.validate(); + keyFrame.setUndecorated(true); + keyFrame.setLocationRelativeTo(null); + keyFrame.setVisible(true); } - private void test(TestState currentState) - throws InterruptedException, InvocationTargetException { - + private void test(TestState currentState) throws Exception { synchronized (LOCK) { - this.currentState = currentState; System.out.println(this.currentState); List list; - if (currentState.getMultiple()){ + if (currentState.getMultiple()) { list = multiple; - }else{ + } else { list = single; } - Robot r; - try { - r = new Robot(); - } catch(AWTException e) { - throw new RuntimeException(e.getMessage()); - } - r.delay(10); - Point loc = this.getLocationOnScreen(); + Point loc = keyFrame.getLocationOnScreen(); - r.mouseMove(loc.x+10, loc.y+10); - r.mousePress(InputEvent.BUTTON1_MASK); + r.mouseMove(loc.x + 10, loc.y + 10); + r.mousePress(InputEvent.BUTTON1_DOWN_MASK); r.delay(10); - r.mouseRelease(InputEvent.BUTTON1_MASK); + r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); r.delay(10); list.requestFocusInWindow(); LOCK.wait(ACTION_TIMEOUT); + r.waitForIdle(); + if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != list){ throw new RuntimeException("Test failed - list isn't focus owner."); } - list.deselect(0); - list.deselect(1); - list.deselect(2); - list.deselect(3); - list.deselect(4); - list.deselect(5); - list.deselect(6); - list.deselect(7); - list.deselect(8); - - int selectIndex = 0; - int visibleIndex = 0; - - if (currentState.getScrollMoved()){ - - if (currentState.getKeyID() == KeyEvent.VK_PAGE_UP || - currentState.getKeyID() == KeyEvent.VK_HOME){ - selectIndex = 8; - visibleIndex = 8; - }else if (currentState.getKeyID() == KeyEvent.VK_PAGE_DOWN || - currentState.getKeyID() == KeyEvent.VK_END){ - selectIndex = 0; - visibleIndex = 0; - } - - }else{ - - if (currentState.getKeyID() == KeyEvent.VK_PAGE_UP || - currentState.getKeyID() == KeyEvent.VK_HOME){ - - if (currentState.getSelectedMoved()){ - selectIndex = 1; - visibleIndex = 0; - }else{ + EventQueue.invokeAndWait(() -> { + list.deselect(0); + list.deselect(1); + list.deselect(2); + list.deselect(3); + list.deselect(4); + list.deselect(5); + list.deselect(6); + list.deselect(7); + list.deselect(8); + + int selectIndex = 0; + int visibleIndex = 0; + + if (currentState.getScrollMoved()) { + if (currentState.getKeyID() == KeyEvent.VK_PAGE_UP || + currentState.getKeyID() == KeyEvent.VK_HOME) { + selectIndex = 8; + visibleIndex = 8; + } else if (currentState.getKeyID() == KeyEvent.VK_PAGE_DOWN || + currentState.getKeyID() == KeyEvent.VK_END) { selectIndex = 0; visibleIndex = 0; } - - }else if (currentState.getKeyID() == KeyEvent.VK_PAGE_DOWN || - currentState.getKeyID() == KeyEvent.VK_END){ - - if (currentState.getSelectedMoved()){ - selectIndex = 7; - visibleIndex = 8; - }else{ - selectIndex = 8; + } else { + if (currentState.getKeyID() == KeyEvent.VK_PAGE_UP || + currentState.getKeyID() == KeyEvent.VK_HOME) { + if (currentState.getSelectedMoved()) { + selectIndex = 1; + } else { + selectIndex = 0; + } + visibleIndex = 0; + } else if (currentState.getKeyID() == KeyEvent.VK_PAGE_DOWN || + currentState.getKeyID() == KeyEvent.VK_END) { + if (currentState.getSelectedMoved()) { + selectIndex = 7; + } else { + selectIndex = 8; + } visibleIndex = 8; } - } - - } - - list.select(selectIndex); - list.makeVisible(visibleIndex); + list.select(selectIndex); + list.makeVisible(visibleIndex); + }); r.delay(10); + r.waitForIdle(); if (currentState.getKeyID() == KeyEvent.VK_HOME || currentState.getKeyID() == KeyEvent.VK_END){ @@ -259,11 +257,9 @@ throw new RuntimeException("Test failed."); } - } - private void doTest() - throws InterruptedException, InvocationTargetException { + private void doTest() throws Exception { boolean isWin = false; if (Platform.isWindows()) { @@ -310,9 +306,9 @@ } }// class KeyEventsTest -class TestState{ +class TestState { - private boolean multiple; + private final boolean multiple; // after key pressing selected item moved private final boolean selectedMoved; // after key pressing scroll moved diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest/SetFontTest.html openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.html --- openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest/SetFontTest.html 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ - - - - - - SetFontTest - - - -

    SetFontTest
    Bug ID: 5010944

    - -

    See the dialog box (usually in upper left corner) for instructions

    - - - - diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest/SetFontTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest/SetFontTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest/SetFontTest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2005, 2007, 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 5010944 6248072 - @summary List's rows overlap one another - @author Dmitry Cherepanov area=awt-list - @run applet/manual=yesno SetFontTest.html -*/ - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; - -public class SetFontTest extends Applet -{ - List list = new List(8, false); - Button button1 = new Button("Enlarge font"); - Button button2 = new Button("Change mode"); - - public void init() - { - list.add("111"); - list.add("222"); - list.add("333"); - list.add("444"); - this.add(list); - - this.add(button1); - this.add(button2); - - button1.addActionListener( - new ActionListener(){ - public void actionPerformed(ActionEvent ae){ - list.setFont( new Font( "SansSerif", Font.PLAIN, 30 ) ); - list.repaint(); - } - }); - - button2.addActionListener( - new ActionListener(){ - public void actionPerformed(ActionEvent ae){ - list.setMultipleMode(true); - } - }); - - this.setLayout (new FlowLayout ()); - - String[] instructions = - { - "1) Click on the 'Enlarge font' button to enlarge font of the list.", - "2) If you see that the rows of the list overlap one another "+ - "then the test failed. Otherwise, goto to the step 3.", - "3) Click on the 'Change mode' button to set multiple-selection mode.", - "4) If you see that the rows of the list overlap one another "+ - "then the test failed. Otherwise, the test passed." - }; - Sysout.createDialogWithInstructions( instructions ); - - }//End init() - - public void start () - { - - setSize (200,200); - setVisible(true); - validate(); - - }// start() -} - -/* Place other classes related to the test after this line */ - - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/List/SetFontTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/List/SetFontTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2005, 2024, 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 5010944 6248072 + @summary List's rows overlap one another + @library /java/awt/regtesthelpers + @run main/manual SetFontTest +*/ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.List; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class SetFontTest { + + static final String INSTRUCTIONS = """ + 1) Click on the 'Enlarge font' button to enlarge font of the list. + 2) If you see that the rows of the list overlap one another + then the test failed. Otherwise, go to step 3. + 3) Click on the 'Change mode' button to set multiple-selection mode. + 4) If you see that the rows of the list overlap one another + then the test failed. Otherwise, the test passed. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("AWT List Font Test") + .instructions(INSTRUCTIONS) + .rows(10) + .columns(40) + .testUI(SetFontTest::createFontTest) + .build() + .awaitAndCheck(); + } + + static Frame createFontTest() { + + Frame frame = new Frame("List Font Test"); + List list = new List(8, false); + Button button1 = new Button("Enlarge font"); + Button button2 = new Button("Change mode"); + + list.add("111"); + list.add("222"); + list.add("333"); + list.add("444"); + + button1.addActionListener( + new ActionListener(){ + public void actionPerformed(ActionEvent ae) { + list.setFont(new Font("SansSerif", Font.PLAIN, 30)); + list.repaint(); + } + }); + + button2.addActionListener( + new ActionListener(){ + public void actionPerformed(ActionEvent ae){ + list.setMultipleMode(true); + } + }); + + frame.setLayout(new FlowLayout()); + frame.add(list); + frame.add(button1); + frame.add(button2); + frame.setSize(200, 250); + return frame; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,6 @@ import java.awt.MenuBar; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.SwingUtilities; /* * @test @@ -58,25 +57,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("AddRemoveMenuBarTest_1 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(18) .columns(45) - .build(); - - SwingUtilities.invokeAndWait(() -> { - AddRemoveMenuBar_1 frame = new AddRemoveMenuBar_1(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(AddRemoveMenuBar_1::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,6 @@ import java.awt.MenuBar; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.SwingUtilities; /* * @test @@ -54,25 +53,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("AddRemoveMenuBarTest_2 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(15) .columns(45) - .build(); - - SwingUtilities.invokeAndWait(() -> { - AddRemoveMenuBar_2 frame = new AddRemoveMenuBar_2(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(AddRemoveMenuBar_2::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,6 @@ import java.awt.event.ActionListener; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; -import javax.swing.SwingUtilities; /* * @test @@ -76,25 +75,15 @@ Upon test completion, click Pass or Fail appropriately. """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("AddRemoveMenuBarTest_3 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(30) .columns(38) - .build(); - - SwingUtilities.invokeAndWait(() -> { - AddRemoveMenuBar_3 frame = new AddRemoveMenuBar_3(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(null, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(AddRemoveMenuBar_3::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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,7 +27,6 @@ import java.awt.Menu; import java.awt.MenuBar; import java.awt.MenuItem; -import javax.swing.SwingUtilities; /* * @test @@ -61,25 +60,15 @@ """; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("AddRemoveMenuBarTest_4 Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(18) .columns(45) - .build(); - - SwingUtilities.invokeAndWait(() -> { - AddRemoveMenuBar_4 frame = new AddRemoveMenuBar_4(); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(AddRemoveMenuBar_4::new) + .build() + .awaitAndCheck(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -29,6 +29,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; /* * @test @@ -51,6 +53,7 @@ static class Listener implements ActionListener { public void actionPerformed(ActionEvent e) { SeparatorsNavigation.pressed = true; + latch.countDown(); } } @@ -61,7 +64,8 @@ static Menu m3; static MenuItem i31; static Listener l = new Listener(); - static boolean pressed = false; + static volatile boolean pressed = false; + static final CountDownLatch latch = new CountDownLatch(1); public static void main(String args[]) { f = new Frame(); @@ -83,27 +87,23 @@ f.setVisible(true); try { Robot r = new Robot(); + r.setAutoDelay(20); r.delay(1000); r.keyPress(KeyEvent.VK_F10); - r.delay(10); r.keyRelease(KeyEvent.VK_F10); r.delay(1000); r.keyPress(KeyEvent.VK_DOWN); - r.delay(10); r.keyRelease(KeyEvent.VK_DOWN); r.delay(1000); r.keyPress(KeyEvent.VK_RIGHT); - r.delay(10); r.keyRelease(KeyEvent.VK_RIGHT); r.delay(1000); r.keyPress(KeyEvent.VK_RIGHT); - r.delay(10); r.keyRelease(KeyEvent.VK_RIGHT); r.delay(1000); r.keyPress(KeyEvent.VK_ENTER); - r.delay(10); r.keyRelease(KeyEvent.VK_ENTER); - r.delay(10000); + latch.await(5, TimeUnit.SECONDS); } catch (Exception ex) { throw new RuntimeException("Execution interrupted by an " + "exception " + ex.getLocalizedMessage()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -150,7 +150,7 @@ private Process execute() { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( TestNoScreenMenuBar.class.getSimpleName(), "mark"); return ProcessTools.startProcess("Other frame", pb); } catch (IOException ex) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Paint/ListRepaint.java openjdk-17-17.0.14+7/test/jdk/java/awt/Paint/ListRepaint.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Paint/ListRepaint.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Paint/ListRepaint.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,22 +34,23 @@ */ public final class ListRepaint extends List { - public static void main(final String[] args) { + static ListRepaint listRepaint; + static Frame frame; + + public static void main(final String[] args) throws Exception { for (int i = 0; i < 10; ++i) { - final Frame frame = new Frame(); - frame.setSize(300, 300); - frame.setLocationRelativeTo(null); - ListRepaint list = new ListRepaint(); - list.add("1"); - list.add("2"); - list.add("3"); - list.add("4"); - list.select(0); - frame.add(list); - frame.setVisible(true); - sleep(); - list.test(); - frame.dispose(); + try { + EventQueue.invokeLater(ListRepaint::createAndShowGUI); + sleep(); + EventQueue.invokeAndWait(listRepaint::test); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + frame = null; + } + }); + } } } @@ -60,6 +61,22 @@ } } + static void createAndShowGUI() { + frame = new Frame(); + frame.setSize(300, 300); + frame.setLocationRelativeTo(null); + + listRepaint = new ListRepaint(); + listRepaint.add("1"); + listRepaint.add("2"); + listRepaint.add("3"); + listRepaint.add("4"); + listRepaint.select(0); + + frame.add(listRepaint); + frame.setVisible(true); + } + @Override public void paint(final Graphics g) { super.paint(g); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022, 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,90 +27,89 @@ @key printer @summary verify that child components can draw only inside their visible bounds - @author das@sparc.spb.su area=awt.print - @run main/manual=yesno ConstrainedPrintingTest + @library /test/lib + @library /javax/accessibility/manual + @build lib.ManualTestFrame + @build lib.TestResult + @build jtreg.SkippedException + @run main/manual ConstrainedPrintingTest */ -// Note there is no @ in front of test above. This is so that the -// harness will not mistake this file as a test file. It should -// only see the html file as a test file. (the harness runs all -// valid test files, so it would run this test twice if this file -// were valid as well as the html file.) -// Also, note the area= after Your Name in the author tag. Here, you -// should put which functional area the test falls in. See the -// AWT-core home page -> test areas and/or -> AWT team for a list of -// areas. -// There are several places where ManualYesNoTest appear. It is -// recommended that these be changed by a global search and replace, -// such as ESC-% in xemacs. - - - -/** - * ConstrainedPrintingTest.java - * - * summary: verify that child components can draw only inside their - * visible bounds - * - */ +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.JobAttributes; +import java.awt.PageAttributes; +import java.awt.Panel; +import java.awt.PrintJob; +import java.awt.Rectangle; +import java.awt.print.PrinterJob; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.function.Consumer; +import java.util.function.Supplier; +import javax.swing.JEditorPane; +import jtreg.SkippedException; +import lib.ManualTestFrame; +import lib.TestResult; + +public class ConstrainedPrintingTest { + + public static void createTestUI() { + Frame frame = new Frame("PrintTest"); + Button button = new Button("Print"); + Panel panel = new Panel(); + Component testComponent = new Component() { + public void paint(Graphics g) { + ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.green); + } + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } + }; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - - -//Manual tests should run as applet tests if possible because they -// get their environments cleaned up, including AWT threads, any -// test created threads, and any system resources used by the test -// such as file descriptors. (This is normally not a problem as -// main tests usually run in a separate VM, however on some platforms -// such as the Mac, separate VMs are not possible and non-applet -// tests will cause problems). Also, you don't have to worry about -// synchronisation stuff in Applet tests the way you do in main -// tests... - - -public class ConstrainedPrintingTest implements ActionListener - { - //Declare things used in the test, like buttons and labels here - final Frame frame = new Frame("PrintTest"); - final Button button = new Button("Print"); - final Panel panel = new Panel(); - final Component testComponent = new Component() { - public void paint(Graphics g) { - ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.green); - } - public Dimension getPreferredSize() { - return new Dimension(100, 100); - } - }; - final Canvas testCanvas = new Canvas() { - public void paint(Graphics g) { - ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.red); - // The frame is sized so that only the upper part of - // the canvas is visible. We draw on the lower part, - // so that we can verify that the output is clipped - // by the parent container bounds. - Dimension panelSize = panel.getSize(); - Rectangle b = getBounds(); - g.setColor(Color.red); - g.setClip(null); - for (int i = panelSize.height - b.y; i < b.height; i+= 10) { - g.drawLine(0, i, b.width, i); + Canvas testCanvas = new Canvas() { + public void paint(Graphics g) { + ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.red); + // The frame is sized so that only the upper part of + // the canvas is visible. We draw on the lower part, + // so that we can verify that the output is clipped + // by the parent container bounds. + Dimension panelSize = panel.getSize(); + Rectangle b = getBounds(); + g.setColor(Color.red); + g.setClip(null); + for (int i = panelSize.height - b.y; i < b.height; i+= 10) { + g.drawLine(0, i, b.width, i); + } } - } - public Dimension getPreferredSize() { - return new Dimension(100, 100); - } - }; + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } + }; - public void init() - { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - button.addActionListener(this); + button.addActionListener((actionEvent) -> { + PageAttributes pa = new PageAttributes(); + pa.setPrinterResolution(36); + PrintJob pjob = frame.getToolkit().getPrintJob(frame, "NewTest", + new JobAttributes(), pa); + if (pjob != null) { + Graphics pg = pjob.getGraphics(); + if (pg != null) { + pg.translate(20, 20); + frame.printAll(pg); + pg.dispose(); + } + pjob.end(); + } + }); panel.setBackground(Color.white); panel.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 20)); @@ -123,63 +122,8 @@ frame.setSize(200, 250); frame.validate(); frame.setResizable(false); - - String[] instructions = - { - "1.Look at the frame titled \"PrintTest\". If you see green or", - " red lines on the white area below the \"Print\" button, the", - " test fails. Otherwise go to step 2.", - "2.Press \"Print\" button. The print dialog will appear. Select", - " a printer and proceed. Look at the output. If you see multiple", - " lines outside of the frame bounds or in the white area below", - " the image of the \"Print\" button, the test fails. Otherwise", - " the test passes." - }; - Sysout.createDialogWithInstructions( instructions ); - - }//End init() - - public void start () - { - //Get things going. Request focus, set size, et cetera - + frame.setLocationRelativeTo(null); frame.setVisible(true); - - //What would normally go into main() will probably go here. - //Use System.out.println for diagnostic messages that you want - // to read after the test is done. - //Use Sysout.println for messages you want the tester to read. - - }// start() - - //The rest of this class is the actions which perform the test... - - //Use Sysout.println to communicate with the user NOT System.out!! - //Sysout.println ("Something Happened!"); - - public void stop() { - frame.setVisible(false); - } - - public void destroy() { - frame.dispose(); - } - - public void actionPerformed(ActionEvent e) { - PageAttributes pa = new PageAttributes(); - pa.setPrinterResolution(36); - PrintJob pjob = frame.getToolkit().getPrintJob(frame, "NewTest", - new JobAttributes(), - pa); - if (pjob != null) { - Graphics pg = pjob.getGraphics(); - if (pg != null) { - pg.translate(20, 20); - frame.printAll(pg); - pg.dispose(); - } - pjob.end(); - } } public static void paintOutsideBounds(Component comp, @@ -204,153 +148,37 @@ } } - public static void main(String[] args) { - ConstrainedPrintingTest c = new ConstrainedPrintingTest(); - - c.init(); - c.start(); - } - - }// class ConstrainedPrintingTest - -/* Place other classes related to the test after this line */ - - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, IOException { -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); + if (PrinterJob.lookupPrintServices().length == 0) { + throw new SkippedException("Printer not configured or available." + + " Test cannot continue."); + } + + String instruction = """ + 1.Look at the frame titled "PrintTest". If you see green or, + red lines on the white area below the "Print" button, the, + test fails. Otherwise go to step 2., + 2.Press "Print" button. The print dialog will appear. + Select, a printer and proceed. Look at the output. + If you see multiple, lines outside of the frame bounds + or in the white area below, the image of the "Print" + button, the test fails. Otherwise,the test passes. + """; + Consumer testInstProvider = e -> { + e.setContentType("text/plain"); + e.setText(instruction); + }; + + Supplier resultSupplier = ManualTestFrame.showUI( + "Tests ConstrainedPrintingTest", + "Wait until the Test UI is seen", testInstProvider); + EventQueue.invokeAndWait(ConstrainedPrintingTest::createTestUI); + + //this will block until user decision to pass or fail the test + TestResult testResult = resultSupplier.get(); + ManualTestFrame.handleResult(testResult,"ConstrainedPrintingTest"); } +} - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,7 +88,7 @@ String os = System.getProperty("os.name").toLowerCase(); - if (os.contains("os x")) + if (os.contains("os x") || os.contains("linux")) textKeys[1] = KeyEvent.VK_K; else textKeys[1] = KeyEvent.VK_I; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Robot/NonEmptyErrorStream.java openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/NonEmptyErrorStream.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Robot/NonEmptyErrorStream.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Robot/NonEmptyErrorStream.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { if (args.length == 0) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( NonEmptyErrorStream.class.getSimpleName(),"run"); Process p = pb.start(); OutputAnalyzer output = new OutputAnalyzer(p); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java openjdk-17-17.0.14+7/test/jdk/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,6 +98,7 @@ } }); robot.waitForIdle(); + robot.delay(500); SwingUtilities.invokeAndWait(new Runnable() { @Override diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.sh openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.sh --- openjdk-17-17.0.13+11/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.sh 2025-01-04 20:25:18.000000000 +0000 @@ -28,20 +28,6 @@ case "$OS" in Linux* ) - GNOMESID=`pgrep gnome-session | head -n1` - - printf "\n/* gnome-session environ\n" - cat "/proc/$GNOMESID/environ" | tr '\0' '\n' - printf "\n*/\n\n" - - DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS /proc/$GNOMESID/environ | cut -d= -f2-` - export DBUS_SESSION_BUS_ADDRESS - - DISPLAY=`grep -z DISPLAY /proc/$GNOMESID/environ | cut -d= -f2-` - export DISPLAY - - XDG_CURRENT_DESKTOP=`grep -z XDG_CURRENT_DESKTOP /proc/$GNOMESID/environ | cut -d= -f2-` - export XDG_CURRENT_DESKTOP ;; * ) echo "This Feature is not to be tested on $OS" diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -102,7 +102,7 @@ private static void runProcess(String dpi, int screen, Insets insets) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.java2d.uiScale=" + dpi, ScreenInsetsDPIVariation.class.getSimpleName(), String.valueOf(screen), String.valueOf(insets.left), diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -79,7 +79,10 @@ public ActionEventTest() throws Exception { robot = new Robot(); + robot.setAutoDelay(25); EventQueue.invokeAndWait(this::initializeGUI); + robot.waitForIdle(); + robot.delay(500); } private void initializeGUI() { @@ -117,10 +120,6 @@ } void doTest() throws Exception { - robot.keyPress(KeyEvent.VK_ALT); - robot.keyPress(KeyEvent.VK_SHIFT); - robot.keyPress(KeyEvent.VK_CONTROL); - Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon); if (iconPosition == null) { throw new RuntimeException("Unable to find the icon location!"); @@ -129,6 +128,10 @@ robot.mouseMove(iconPosition.x, iconPosition.y); robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT); + robot.keyPress(KeyEvent.VK_SHIFT); + robot.keyPress(KeyEvent.VK_CONTROL); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.delay(100); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ boolean actionPerformed = false; Object actionLock = new Object(); - static final int ATTEMPTS = 50; + static final int ATTEMPTS = 10; PopupMenu popup; Dialog window; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -85,28 +85,27 @@ System.out.println("SystemTray is not supported"); return; } - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() - .title("TrayIcon Test Instructions") - .instructions(INSTRUCTIONS) - .testTimeOut(8) - .rows(25) - .columns(70) - .screenCapture() - .build(); - - createAndShowGUI(); - // does not have a test window, - // hence only the instruction frame is positioned - PassFailJFrame.positionTestWindow(null, - PassFailJFrame.Position.HORIZONTAL); + + createAndShowTrayIcon(); + try { - passFailJFrame.awaitAndCheck(); + PassFailJFrame.builder() + .title("TrayIcon Test Instructions") + .instructions(INSTRUCTIONS) + .testTimeOut(8) + .rows(25) + .columns(70) + .screenCapture() + .build() + .awaitAndCheck(); } finally { - tray.remove(icon); + if (tray != null) { + tray.remove(icon); + } } } - private static void createAndShowGUI() { + private static void createAndShowTrayIcon() { ArrayList imageList = new ArrayList<>(); for (int size = 16; size <= 48; size += 4) { imageList.add(createIcon(size)); @@ -120,7 +119,7 @@ try { tray.add(icon); } catch (AWTException e) { - throw new RuntimeException("Error while adding icon to system tray"); + throw new RuntimeException("Error while adding icon to system tray", e); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -151,7 +151,7 @@ private Process execute() { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( TestMainKeyWindow.class.getSimpleName(), "mark"); return ProcessTools.startProcess("Other frame", pb); } catch (IOException ex) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -110,7 +110,7 @@ private static void runProcess(String dpi, String comp, int w, int h) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.java2d.uiScale=" + dpi, MinimumSizeDPIVariation.class.getSimpleName(), comp, String.valueOf(w), String.valueOf(h), dpi); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -51,6 +51,7 @@ frame2.setLocationByPlatform(true); frame2.setVisible(true); Util.waitForIdle(r); + r.delay(500); Point point1 = frame1.getLocationOnScreen(); Point point2 = frame2.getLocationOnScreen(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java openjdk-17-17.0.14+7/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DragSourceSerializationTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragSourceSerializationTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DragSourceSerializationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragSourceSerializationTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2001, 2023, 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.dnd.DragSource; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +/* + @test + @bug 4407057 + @summary tests that deserialized DragSource has a non-null flavor map + @key headful + @run main DragSourceSerializationTest +*/ + +public class DragSourceSerializationTest { + + public static void main(String[] args) throws Exception { + try { + final DragSource dragSource = DragSource.getDefaultDragSource(); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(dragSource); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + + final DragSource copy = (DragSource)ois.readObject(); + if (copy.getFlavorMap() == null) { + throw new RuntimeException("getFlavorMap() returns null"); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DragTriggerEventTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragTriggerEventTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DragTriggerEventTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DragTriggerEventTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.awt.GridLayout; +import java.awt.Robot; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Dimension; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JList; + +/* + @test + @bug 4388802 + @summary tests that a drag can be initiated with MOUSE_MOVED event + @key headful + @run main DragTriggerEventTest +*/ + +public class DragTriggerEventTest { + + volatile JFrame frame; + volatile JList list; + volatile DropTargetPanel panel; + volatile Point srcPoint; + volatile Rectangle cellBounds; + volatile Point dstPoint; + volatile Dimension d; + static final int FRAME_ACTIVATION_TIMEOUT = 3000; + volatile boolean mouse1Pressed = false; + volatile boolean ctrlPressed = false; + + public static void main(String[] args) throws Exception { + DragTriggerEventTest test = new DragTriggerEventTest(); + EventQueue.invokeAndWait(test::init); + try { + test.start(); + } finally { + EventQueue.invokeAndWait(() -> { + if (test.frame != null) { + test.frame.dispose(); + } + }); + } + } + + public void init() { + list = new JList(new String[] {"one", "two", "three", "four"}); + list.setDragEnabled(true); + panel = new DropTargetPanel(); + + frame = new JFrame(); + frame.setTitle("DragTriggerEventTest"); + frame.setLocation(200, 200); + frame.getContentPane().setLayout(new GridLayout(2, 1)); + frame.getContentPane().add(list); + frame.getContentPane().add(panel); + + frame.pack(); + frame.setVisible(true); + } + + public void start() throws Exception { + Robot robot; + robot = new Robot(); + + EventQueue.invokeAndWait(() -> { + srcPoint = list.getLocationOnScreen(); + cellBounds = list.getCellBounds(0, 0); + }); + + srcPoint.translate(cellBounds.x + cellBounds.width / 2, + cellBounds.y + cellBounds.height / 2); + + EventQueue.invokeAndWait(() -> { + dstPoint = panel.getLocationOnScreen(); + d = panel.getSize(); + }); + dstPoint.translate(d.width / 2, d.height / 2); + + for (int delay = 32; delay < 10000 && !panel.getResult(); delay *= 2) { + System.err.println("attempt to drag with delay " + delay); + robot.mouseMove(srcPoint.x, srcPoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + mouse1Pressed = true; + robot.mouseRelease(InputEvent.BUTTON1_MASK); + mouse1Pressed = false; + + robot.keyPress(KeyEvent.VK_CONTROL); + ctrlPressed = true; + robot.mousePress(InputEvent.BUTTON1_MASK); + mouse1Pressed = true; + + Point p = new Point(srcPoint); + while (!p.equals(dstPoint)) { + p.translate(sign(dstPoint.x - p.x), + sign(dstPoint.y - p.y)); + robot.mouseMove(p.x, p.y); + robot.delay(delay); + } + } + if (mouse1Pressed) { + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } + if (ctrlPressed) { + robot.keyRelease(KeyEvent.VK_CONTROL); + } + + EventQueue.invokeAndWait(() -> { + if (!panel.getResult()) { + throw new RuntimeException("The test failed."); + } + }); + } + + public static int sign(int n) { + return n < 0 ? -1 : n == 0 ? 0 : 1; + } +} + +class DropTargetPanel extends JPanel implements DropTargetListener { + + private boolean passed = false; + final Dimension preferredDimension = new Dimension(200, 100); + + public DropTargetPanel() { + setDropTarget(new DropTarget(this, this)); + } + + public Dimension getPreferredSize() { + return preferredDimension; + } + + public void dragEnter(DropTargetDragEvent dtde) { + passed = true; + } + + public void dragExit(DropTargetEvent dte) { + passed = true; + } + + public void dragOver(DropTargetDragEvent dtde) { + passed = true; + } + + public void dropActionChanged(DropTargetDragEvent dtde) { + passed = true; + } + + public void drop(DropTargetDropEvent dtde) { + passed = true; + dtde.rejectDrop(); + } + + public boolean getResult() { + return passed; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropActionChangeTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropActionChangeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2003, 2023, 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.swing.JFrame; +import java.awt.AWTEvent; +import java.awt.Component; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; +import java.awt.datatransfer.StringSelection; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceAdapter; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceListener; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetAdapter; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.event.AWTEventListener; +import java.awt.event.MouseEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +/* + @test + @bug 4896462 + @summary tests that drop action is computed correctly + @key headful + @run main DropActionChangeTest +*/ + +public class DropActionChangeTest extends JFrame implements AWTEventListener { + Robot robot; + Frame frame; + Panel panel; + private volatile boolean failed; + private volatile boolean dropEnd; + private volatile Component clickedComponent; + private final Object LOCK = new Object(); + static final int FRAME_ACTIVATION_TIMEOUT = 3000; + static final int DROP_COMPLETION_TIMEOUT = 5000; + static final int MOUSE_RELEASE_TIMEOUT = 2000; + + public static void main(String[] args) throws Exception { + DropActionChangeTest test = new DropActionChangeTest(); + EventQueue.invokeAndWait(test::init); + try { + test.start(); + } finally { + EventQueue.invokeAndWait(() -> { + if (test.frame != null) { + test.frame.dispose(); + } + }); + } + } + + public void init() { + getToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK); + + setSize (200,200); + setTitle("DropActionChangeTest"); + setVisible(true); + validate(); + + frame = new Frame("Empty Frame with Panel"); + panel = new Panel(); + frame.add(panel); + frame.setBounds(300, 300, 300, 300); + failed = false; + + final DragSourceListener dsl = new DragSourceAdapter() { + public void dragDropEnd(DragSourceDropEvent e) { + System.err.println("DragSourseListener.dragDropEnd(): " + + "drop action=" + e.getDropAction()); + if (e.getDropAction() != DnDConstants.ACTION_MOVE) { + System.err.println("FAILURE: wrong drop action:" + e.getDropAction()); + failed = true; + } + synchronized (LOCK) { + dropEnd = true; + LOCK.notifyAll(); + } + } + }; + + DragGestureListener dgl = new DragGestureListener() { + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, new StringSelection("test"), dsl); + } + }; + + new DragSource().createDefaultDragGestureRecognizer(panel, + DnDConstants.ACTION_COPY_OR_MOVE, dgl); + + DropTargetListener dtl = new DropTargetAdapter() { + public void dragEnter(DropTargetDragEvent e) { + System.err.println("DropTargetListener.dragEnter(): " + + "user drop action=" + e.getDropAction()); + e.acceptDrag(e.getDropAction()); + } + + public void dragOver(DropTargetDragEvent e) { + e.acceptDrag(e.getDropAction()); + } + public void drop(DropTargetDropEvent e) { + System.err.println("DropTargetListener.drop(): " + + "user drop action=" + e.getDropAction()); + e.acceptDrop(e.getDropAction()); + e.dropComplete(true); + } + }; + + new DropTarget(panel, dtl); + + frame.setVisible(true); + } + + public void start() { + try { + robot = new Robot(); + + Point startPoint = panel.getLocationOnScreen(); + startPoint.translate(50, 50); + + if (!pointInComponent(robot, startPoint, panel)) { + System.err.println("WARNING: Couldn't locate source panel"); + return; + } + + + Point medPoint = new Point(startPoint.x + (DragSource.getDragThreshold()+10)*2, + startPoint.y); + Point endPoint = new Point(startPoint.x + (DragSource.getDragThreshold()+10)*4, + startPoint.y); + + synchronized (LOCK) { + robot.keyPress(KeyEvent.VK_CONTROL); + robot.mouseMove(startPoint.x, startPoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + Util.doDrag(robot, startPoint, medPoint); + robot.keyRelease(KeyEvent.VK_CONTROL); + Util.doDrag(robot, medPoint, endPoint); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + LOCK.wait(DROP_COMPLETION_TIMEOUT); + } + if (!dropEnd) { + System.err.println("DragSourseListener.dragDropEnd() was not called, returning"); + return; + } + } catch (Throwable e) { + e.printStackTrace(); + } + + if (failed) { + throw new RuntimeException("wrong drop action!"); + } + + System.err.println("test passed!"); + } + + public void reset() { + clickedComponent = null; + } + + public void eventDispatched(AWTEvent e) { + if (e.getID() == MouseEvent.MOUSE_RELEASED) { + clickedComponent = (Component)e.getSource(); + synchronized (LOCK) { + LOCK.notifyAll(); + } + } + } + + boolean pointInComponent(Robot robot, Point p, Component comp) + throws InterruptedException { + robot.waitForIdle(); + reset(); + robot.mouseMove(p.x, p.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + synchronized (LOCK) { + robot.mouseRelease(InputEvent.BUTTON1_MASK); + LOCK.wait(MOUSE_RELEASE_TIMEOUT); + } + + Component c = clickedComponent; + + while (c != null && c != comp) { + c = c.getParent(); + } + + return c == comp; + } +} + + +class Util { + + public static int sign(int n) { + return n < 0 ? -1 : n == 0 ? 0 : 1; + } + + public static void doDrag(Robot robot, Point startPoint, Point endPoint) { + for (Point p = new Point(startPoint); !p.equals(endPoint); + p.translate(Util.sign(endPoint.x - p.x), + Util.sign(endPoint.y - p.y))) { + robot.mouseMove(p.x, p.y); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropActionChangedTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangedTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropActionChangedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropActionChangedTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.Robot; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetContext; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.event.InputEvent; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +/* + @test + @bug 4357930 + @summary tests that dropActionChanged() is not invoked if the drop gesture + is not modified. + @key headful + @run main DropActionChangedTest +*/ + +public class DropActionChangedTest { + + volatile Frame frame; + volatile DragSourcePanel dragSourcePanel; + volatile DropTargetPanel dropTargetPanel; + + public static void main(String[] args) throws Exception { + DropActionChangedTest test = new DropActionChangedTest(); + EventQueue.invokeAndWait(test::init); + try { + test.start(); + } finally { + EventQueue.invokeAndWait(() -> { + if (test.frame != null) { + test.frame.dispose(); + } + }); + } + } + + public void init() { + dragSourcePanel = new DragSourcePanel(); + dropTargetPanel = new DropTargetPanel(); + + frame = new Frame(); + frame.setTitle("DropTargetAddNotifyNPETest"); + frame.setLocation(200, 200); + frame.setLayout(new GridLayout(2, 1)); + frame.add(dragSourcePanel); + frame.add(dropTargetPanel); + + frame.pack(); + frame.setVisible(true); + } + + public void start() throws Exception { + Robot robot = new Robot(); + robot.delay(2000); + robot.mouseMove(250, 250); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(1000); + for (int y = 250; y < 350; y+=5) { + robot.mouseMove(250, y); + robot.delay(100); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + if (dropTargetPanel.isDropActionChangedTriggered()) { + throw new RuntimeException("The test failed."); + } + } +} + +class DragSourceButton extends Button implements Serializable, + Transferable, + DragGestureListener, + DragSourceListener { + private final DataFlavor dataflavor = + new DataFlavor(Button.class, "DragSourceButton"); + + public DragSourceButton() { + this("DragSourceButton"); + } + + public DragSourceButton(String str) { + super(str); + + DragSource ds = DragSource.getDefaultDragSource(); + ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, + this); + } + + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, this, this); + } + + public void dragEnter(DragSourceDragEvent dsde) {} + + public void dragExit(DragSourceEvent dse) {} + + public void dragOver(DragSourceDragEvent dsde) {} + + public void dragDropEnd(DragSourceDropEvent dsde) {} + + public void dropActionChanged(DragSourceDragEvent dsde) {} + + public Object getTransferData(DataFlavor flavor) + throws UnsupportedFlavorException, IOException { + + if (!isDataFlavorSupported(flavor)) { + throw new UnsupportedFlavorException(flavor); + } + + Object retObj = null; + + ByteArrayOutputStream baoStream = new ByteArrayOutputStream(); + ObjectOutputStream ooStream = new ObjectOutputStream(baoStream); + ooStream.writeObject(this); + + ByteArrayInputStream baiStream = new ByteArrayInputStream(baoStream.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(baiStream); + try { + retObj = ois.readObject(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + throw new RuntimeException(e.toString()); + } + + return retObj; + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[] { dataflavor }; + } + + public boolean isDataFlavorSupported(DataFlavor dflavor) { + return dataflavor.equals(dflavor); + } +} + +class DragSourcePanel extends Panel { + + final Dimension preferredDimension = new Dimension(200, 100); + + public DragSourcePanel() { + setLayout(new GridLayout(1, 1)); + add(new DragSourceButton()); + } + + public Dimension getPreferredSize() { + return preferredDimension; + } +} + +class DropTargetPanel extends Panel implements DropTargetListener { + + final Dimension preferredDimension = new Dimension(200, 100); + private boolean dropActionChangedTriggered = false; + + public DropTargetPanel() { + setDropTarget(new DropTarget(this, this)); + } + + public Dimension getPreferredSize() { + return preferredDimension; + } + + public void dragEnter(DropTargetDragEvent dtde) {} + + public void dragExit(DropTargetEvent dte) {} + + public void dragOver(DropTargetDragEvent dtde) {} + + public void drop(DropTargetDropEvent dtde) { + DropTargetContext dtc = dtde.getDropTargetContext(); + + if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) { + dtde.acceptDrop(DnDConstants.ACTION_COPY); + } else { + dtde.rejectDrop(); + } + + DataFlavor[] dfs = dtde.getCurrentDataFlavors(); + Component comp = null; + + if (dfs != null && dfs.length >= 1) { + Transferable transfer = dtde.getTransferable(); + + try { + comp = (Component)transfer.getTransferData(dfs[0]); + } catch (Throwable e) { + e.printStackTrace(); + dtc.dropComplete(false); + } + } + dtc.dropComplete(true); + + add(comp); + } + + public void dropActionChanged(DropTargetDragEvent dtde) { + dropActionChangedTriggered = true; + throw new RuntimeException("dropActionChanged triggered"); + } + + public boolean isDropActionChangedTriggered() { + return dropActionChangedTriggered; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropPerformanceTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropPerformanceTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropPerformanceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropPerformanceTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2001, 2023, 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.swing.JButton; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetContext; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.event.InputEvent; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +/* + @test + @bug 4484996 + @summary Tests that drop doesn't take too much time on Win 95/98. + @key headful + @run main DropPerformanceTest +*/ + +public class DropPerformanceTest { + + public static final int CODE_NOT_RETURNED = -1; + public static final int CODE_OK = 0; + public static final int CODE_FAILURE = 1; + public static final int FRAME_ACTIVATION_TIMEOUT = 2000; + public static final int DROP_COMPLETION_TIMEOUT = 4000; + public static final int TIME_THRESHOLD = 40000; + + private int returnCode = CODE_NOT_RETURNED; + + final Frame frame = new Frame(); + Robot robot = null; + DropTargetPanel dtpanel = null; + DragSourcePanel dspanel = null; + + public static void main(String[] args) throws Exception { + DropPerformanceTest test = new DropPerformanceTest(); + if (args.length > 0) { + test.run(args); + } else { + EventQueue.invokeAndWait(test::init); + try { + test.start(); + } finally { + EventQueue.invokeAndWait(() -> { + if (test.frame != null) { + test.frame.dispose(); + } + }); + } + } + } + + public void run(String[] args) { + try { + if (args.length != 4) { + throw new RuntimeException("Incorrect command line arguments."); + } + + int x = Integer.parseInt(args[0]); + int y = Integer.parseInt(args[1]); + int w = Integer.parseInt(args[2]); + int h = Integer.parseInt(args[3]); + + dspanel = new DragSourcePanel(); + + frame.setTitle("DropPerformanceTest Drop Source Frame"); + frame.setLocation(100, 200); + frame.add(dspanel); + frame.pack(); + frame.setVisible(true); + + Thread.sleep(FRAME_ACTIVATION_TIMEOUT); + + Point sourcePoint = dspanel.getLocationOnScreen(); + Dimension d = dspanel.getSize(); + sourcePoint.translate(d.width / 2, d.height / 2); + + Point targetPoint = new Point(x + w / 2, y + h / 2); + + robot = new Robot(); + robot.mouseMove(sourcePoint.x, sourcePoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + for (; !sourcePoint.equals(targetPoint); + sourcePoint.translate(sign(targetPoint.x - sourcePoint.x), + sign(targetPoint.y - sourcePoint.y))) { + robot.mouseMove(sourcePoint.x, sourcePoint.y); + Thread.sleep(10); + } + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + Thread.sleep(DROP_COMPLETION_TIMEOUT); + + } catch (Throwable e) { + e.printStackTrace(); + System.exit(DropPerformanceTest.CODE_FAILURE); + } + + System.exit(DropPerformanceTest.CODE_OK); + } // run() + + public static int sign(int n) { + return n < 0 ? -1 : n == 0 ? 0 : 1; + } + + public void init() { + dtpanel = new DropTargetPanel(); + + frame.setTitle("Drop Target Frame"); + frame.setLocation(250, 200); + frame.add(dtpanel); + + frame.pack(); + frame.setVisible(true); + } + + private void launchChildVM() { + try { + Thread.sleep(FRAME_ACTIVATION_TIMEOUT); + + Point p = dtpanel.getLocationOnScreen(); + Dimension d = dtpanel.getSize(); + + String javaPath = System.getProperty("java.home", ""); + String command = javaPath + File.separator + "bin" + + File.separator + "java -cp " + System.getProperty("test.classes", ".") + + " DropPerformanceTest " + + p.x + " " + p.y + " " + d.width + " " + d.height; + Process process = Runtime.getRuntime().exec(command); + returnCode = process.waitFor(); + InputStream errorStream = process.getErrorStream(); + int count = errorStream.available(); + if (count > 0) { + byte[] b = new byte[count]; + errorStream.read(b); + System.err.println("========= Child VM System.err ========"); + System.err.print(new String(b)); + System.err.println("======================================"); + } + + } catch (Throwable e) { + e.printStackTrace(); + } + switch (returnCode) { + case CODE_NOT_RETURNED: + System.err.println("Child VM: failed to start"); + break; + case CODE_OK: + System.err.println("Child VM: normal termination"); + break; + case CODE_FAILURE: + System.err.println("Child VM: abnormal termination"); + break; + } + if (returnCode != CODE_OK) { + throw new RuntimeException("The test failed."); + } + } + + public void start() { + launchChildVM(); + System.err.println("Drop consumed " + dtpanel.getDropTime() + " milliseconds"); + if (dtpanel.getDropTime() > TIME_THRESHOLD) { + throw new RuntimeException("The test failed: drop took too much time"); + } + } +} + +class DragSourceButton extends JButton + implements Transferable, Serializable, + DragGestureListener, DragSourceListener { + + public DataFlavor dataflavor = new DataFlavor(DragSourceButton.class, "Source"); + + DragSourceButton(String str) { + super(str); + DragSource ds = DragSource.getDefaultDragSource(); + ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); + } + + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, this, this); + } + + public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { + Object ret = null; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(this); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + try { + ret = (DragSourceButton)ois.readObject(); + } catch (ClassNotFoundException cannotHappen) { + return null; + } + return ret; + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[] { dataflavor }; + } + + public boolean isDataFlavorSupported(DataFlavor dflavor) { + return dataflavor.equals(dflavor); + } + + public void dragEnter(DragSourceDragEvent dsde) {} + + public void dragExit(DragSourceEvent dse) {} + + public void dragOver(DragSourceDragEvent dsde) {} + + public void dragDropEnd(DragSourceDropEvent dsde) {} + + public void dropActionChanged(DragSourceDragEvent dsde) {} +} + +class DragSourcePanel extends Panel { + + final Dimension preferredDimension = new Dimension(100, 50); + + public DragSourcePanel() { + setLayout(new GridLayout(1, 1)); + add(new DragSourceButton("Drag me")); + } + + public Dimension getPreferredSize() { + return preferredDimension; + } +} + +class DropTargetPanel extends Panel implements DropTargetListener { + + final Dimension preferredDimension = new Dimension(100, 50); + private long dropTime = 0; + + public DropTargetPanel() { + setBackground(Color.green); + setDropTarget(new DropTarget(this, this)); + } + + public long getDropTime() { + return dropTime; + } + + public Dimension getPreferredSize() { + return preferredDimension; + } + + public void dragEnter(DropTargetDragEvent dtde) { + dtde.acceptDrag(DnDConstants.ACTION_COPY); + } + + public void dragExit(DropTargetEvent dte) {} + + public void dragOver(DropTargetDragEvent dtde) { + dtde.acceptDrag(DnDConstants.ACTION_COPY); + } + + public void drop(DropTargetDropEvent dtde) { + DropTargetContext dtc = dtde.getDropTargetContext(); + + if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) { + dtde.acceptDrop(DnDConstants.ACTION_COPY); + } else { + dtde.rejectDrop(); + return; + } + + Transferable t = dtde.getTransferable(); + DataFlavor[] dfs = t.getTransferDataFlavors(); + + long before = System.currentTimeMillis(); + + if (dfs != null && dfs.length >= 1) { + Object obj = null; + try { + obj = t.getTransferData(dfs[0]); + } catch (IOException ioe) { + dtc.dropComplete(false); + return; + } catch (UnsupportedFlavorException ufe) { + dtc.dropComplete(false); + return; + } + + if (obj != null) { + Component comp = (Component)obj; + add(comp); + } + } + + long after = System.currentTimeMillis(); + dropTime = after - before; + + synchronized (this) { + notifyAll(); + } + + dtc.dropComplete(true); + validate(); + } + + public void dropActionChanged(DropTargetDragEvent dtde) {} + +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2001, 2023, 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.Component; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetAdapter; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetListener; + +/* + @test + @bug 4462285 + @summary tests that DropTarget.addNotify doesn't throw NPE if peer hierarchy + is incomplete + @key headful + @run main DropTargetAddNotifyNPETest +*/ + +public class DropTargetAddNotifyNPETest { + + volatile Component component1; + volatile Component component2; + volatile Frame frame; + volatile DropTargetListener dtListener; + volatile DropTarget dropTarget1; + volatile DropTarget dropTarget2; + + public static void main(String[] args) throws Exception { + DropTargetAddNotifyNPETest test = new DropTargetAddNotifyNPETest(); + EventQueue.invokeAndWait(() -> { + test.init(); + if (test.frame != null) { + test.frame.dispose(); + } + }); + } + + public void init() { + component1 = new LWComponent(); + component2 = new LWComponent(); + frame = new Frame("DropTargetAddNotifyNPETest"); + dtListener = new DropTargetAdapter() { + public void drop(DropTargetDropEvent dtde) { + dtde.rejectDrop(); + } + }; + dropTarget1 = new DropTarget(component1, dtListener); + dropTarget2 = new DropTarget(component2, dtListener); + + frame.add(component2); + component1.addNotify(); + component2.addNotify(); + } +} + +class LWComponent extends Component {} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002, 2023, 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.datatransfer.SystemFlavorMap; +import java.awt.dnd.DropTarget; + +/* + @test + @bug 4785476 + @summary tests that DropTarget.setFlavorMap(null) works properly + @key headful + @run main DropTargetNullFlavorMapTest +*/ +public class DropTargetNullFlavorMapTest { + + public static void main(String[] args) { + DropTargetNullFlavorMapTest test = new DropTargetNullFlavorMapTest(); + test.init(); + } + + public void init() { + final DropTarget dropTarget = new DropTarget(); + + if (!SystemFlavorMap.getDefaultFlavorMap().equals(dropTarget.getFlavorMap())) { + System.err.println("Default flavor map: " + SystemFlavorMap.getDefaultFlavorMap()); + System.err.println("DropTarget's flavor map: " + dropTarget.getFlavorMap()); + throw new RuntimeException("Incorrect flavor map."); + } + + Thread.currentThread().setContextClassLoader(new ClassLoader() {}); + + dropTarget.setFlavorMap(null); + + if (!SystemFlavorMap.getDefaultFlavorMap().equals(dropTarget.getFlavorMap())) { + System.err.println("Default flavor map: " + SystemFlavorMap.getDefaultFlavorMap()); + System.err.println("DropTarget's flavor map: " + dropTarget.getFlavorMap()); + throw new RuntimeException("Incorrect flavor map."); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - - - - - DnD of URL across JVM - - - -

    URLDragTest
    Bug ID: 8031964

    - -

    This is an AUTOMATIC test, simply wait for completion

    - - - - diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/dnd/URLDragTest/URLDragTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,20 +21,8 @@ * questions. */ -/* - test - @bug 8031964 - @summary Dragging images from the browser does not work - @author Petr Pchelko : area=dnd - @library ../../regtesthelpers - @build Sysout - @run applet/manual=yesno URLDragTest.html -*/ - -import test.java.awt.regtesthelpers.Sysout; - -import java.applet.Applet; -import java.awt.*; +import java.awt.Color; +import java.awt.Frame; import java.awt.datatransfer.DataFlavor; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; @@ -42,13 +30,41 @@ import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; -public class URLDragTest extends Applet { +/* + * @test + * @bug 8031964 + * @summary Dragging images from the browser does not work. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual URLDragTest +*/ +public class URLDragTest { + private static final String INSTRUCTIONS = """ + 1) When the test starts, open any browser. + 2) Drag any image from the browser page onto the RED window. + 3) When the image is dropped you should see the list of available + DataFlavors in the log area below the instruction window. + 4) If you see application/x-java-url and text/uri-list flavors in + the logs then please press PASS, else FAIL. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .logArea(8) + .testUI(URLDragTest::createUI) + .build() + .awaitAndCheck(); + } - @Override - public void init() { - setBackground(Color.red); - setDropTarget(new DropTarget(this, + private static Frame createUI() { + Frame frame = new Frame("Browser Image DnD Test"); + frame.setBackground(Color.RED); + frame.setDropTarget(new DropTarget(frame, DnDConstants.ACTION_COPY, new DropTargetAdapter() { @Override @@ -67,22 +83,12 @@ dtde.getCurrentDataFlavorsAsList() .stream() .map(DataFlavor::toString) - .forEach(Sysout::println); + .forEach(PassFailJFrame::log); } })); - String[] instructions = { - "1) Open the browser.", - "2) Drag any image from the browser page to the red square", - "3) When the image is dropped you should se the list of available DataFlavors", - "4) If you see application/x-java-url and text/uri-list flavors - test PASSED", - "5) Otherwise the test is FAILED"}; - Sysout.createDialogWithInstructions(instructions); - } - - @Override - public void start() { - setSize(200, 200); - setVisible(true); + frame.setSize(400, 200); + frame.setAlwaysOnTop(true); + return frame; } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,18 @@ import java.awt.Robot; import java.awt.TextArea; import java.awt.event.KeyEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; + +import static java.awt.Event.KEY_ACTION; +import static java.awt.Event.KEY_ACTION_RELEASE; +import static java.util.concurrent.TimeUnit.SECONDS; /* * @test @@ -39,35 +51,38 @@ * @key headful */ -public class FunctionKeyTest { - private static FunctionKeyTester frame; +public final class FunctionKeyTest { + private static Frame frame; private static Robot robot; - static volatile boolean keyPressReceived; - static volatile boolean keyReleaseReceived; + private static final CyclicBarrier keyPress = new CyclicBarrier(2); + private static final CyclicBarrier keyRelease = new CyclicBarrier(2); - static final StringBuilder failures = new StringBuilder(); + private static final CountDownLatch frameActivated = new CountDownLatch(1); - private static void testKey(int keyCode, String keyText) { - keyPressReceived = false; - keyReleaseReceived = false; + private static final List failures = new ArrayList<>(4); + private static final AtomicReference edtException = new AtomicReference<>(); + private static void testKey(int keyCode, String keyText) throws Exception { robot.keyPress(keyCode); - - if (!keyPressReceived) { - failures.append(keyText).append(" key press is not received\n"); + try { + keyPress.await(2, SECONDS); + } catch (TimeoutException e) { + keyPress.reset(); + failures.add(new Error(keyText + " key press is not received", e)); } robot.keyRelease(keyCode); - - if (!keyReleaseReceived) { - failures.append(keyText).append(" key release is not received\n"); + try { + keyRelease.await(2, SECONDS); + } catch (TimeoutException e) { + keyRelease.reset(); + failures.add(new Error(keyText + " key release is not received", e)); } } public static void main(String[] args) throws Exception { robot = new Robot(); - robot.setAutoWaitForIdle(true); robot.setAutoDelay(150); try { @@ -75,11 +90,20 @@ frame = new FunctionKeyTester(); frame.setSize(200, 200); frame.setLocationRelativeTo(null); + frame.addWindowListener(new WindowAdapter() { + @Override + public void windowActivated(WindowEvent e) { + System.out.println("frame.windowActivated"); + frameActivated.countDown(); + } + }); frame.setVisible(true); }); - robot.waitForIdle(); - robot.delay(1000); + if (!frameActivated.await(2, SECONDS)) { + throw new Error("Frame wasn't activated"); + } + robot.delay(100); testKey(KeyEvent.VK_F11, "F11"); testKey(KeyEvent.VK_F12, "F12"); @@ -91,46 +115,69 @@ }); } - if (failures.isEmpty()) { - System.out.println("Passed"); - } else { - throw new RuntimeException(failures.toString()); + if (!failures.isEmpty()) { + System.err.println("Failures detected:"); + failures.forEach(System.err::println); + if (edtException.get() != null) { + System.err.println("\nException on EDT:"); + edtException.get().printStackTrace(); + } + System.err.println(); + throw new RuntimeException("Test failed: " + failures.get(0).getMessage(), + failures.get(0)); } - } -} -class FunctionKeyTester extends Frame { - Label l = new Label ("NULL"); - Button b = new Button(); - TextArea log = new TextArea(); - - FunctionKeyTester() { - super("Function Key Test"); - this.setLayout(new BorderLayout()); - this.add(BorderLayout.NORTH, l); - this.add(BorderLayout.SOUTH, b); - this.add(BorderLayout.CENTER, log); - log.setFocusable(false); - log.setEditable(false); - l.setBackground(Color.red); - setSize(200, 200); + if (edtException.get() != null) { + throw new RuntimeException("Test failed because of exception on EDT", + edtException.get()); + } } - public boolean handleEvent(Event e) { - String message = "e.id=" + e.id + "\n"; - System.out.print(message); - log.append(message); - - switch (e.id) { - case 403 -> FunctionKeyTest.keyPressReceived = true; - case 404 -> FunctionKeyTest.keyReleaseReceived = true; + private static final class FunctionKeyTester extends Frame { + Label l = new Label ("NULL"); + Button b = new Button("button"); + TextArea log = new TextArea(); + + FunctionKeyTester() { + super("Function Key Test"); + this.setLayout(new BorderLayout()); + this.add(BorderLayout.NORTH, l); + this.add(BorderLayout.SOUTH, b); + this.add(BorderLayout.CENTER, log); + log.setFocusable(false); + log.setEditable(false); + l.setBackground(Color.red); + setSize(200, 200); } - return super.handleEvent(e); - } + @Override + @SuppressWarnings("deprecation") + public boolean handleEvent(Event e) { + String message = "e.id=" + e.id + "\n"; + System.out.print(message); + log.append(message); + + try { + switch (e.id) { + case KEY_ACTION + -> keyPress.await(); + case KEY_ACTION_RELEASE + -> keyRelease.await(); + } + } catch (Exception ex) { + if (!edtException.compareAndSet(null, ex)) { + edtException.get().addSuppressed(ex); + } + } - public boolean keyDown(Event e, int key) { - l.setText("e.key=" + Integer.valueOf(e.key).toString()); - return false; + return super.handleEvent(e); + } + + @Override + @SuppressWarnings("deprecation") + public boolean keyDown(Event e, int key) { + l.setText("e.key=" + e.key); + return false; + } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2002, 2024, 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.Frame; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.Toolkit; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.util.concurrent.CountDownLatch; + +import jdk.test.lib.Platform; + +import static java.util.concurrent.TimeUnit.SECONDS; + +/* + * @test + * @bug 4724007 + * @key headful + * @summary Tests that KeyTyped events are fired for the Numpad1 key + * @library /test/lib + * @build jdk.test.lib.Platform + * @run main Numpad1KeyTyped + */ +public final class Numpad1KeyTyped extends FocusAdapter implements KeyListener { + + private static final String ORIGINAL = "0123456789"; + private static final String EXPECTED = "10123456789"; + + private final CountDownLatch typedNum1 = new CountDownLatch(1); + private final CountDownLatch focusGained = new CountDownLatch(1); + + public static void main(String[] args) throws Exception { + Numpad1KeyTyped test = new Numpad1KeyTyped(); + test.start(); + } + + private void start() throws Exception { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Boolean oldState = null; + + Robot robot = new Robot(); + robot.setAutoDelay(100); + + Frame frame = new Frame("Numpad1KeyTyped"); + TextField tf = new TextField(ORIGINAL, 20); + frame.add(tf); + tf.addKeyListener(this); + + tf.addFocusListener(this); + + frame.setSize(300, 100); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + tf.requestFocusInWindow(); + + if (!focusGained.await(2, SECONDS)) { + throw new RuntimeException("TextField didn't receive focus"); + } + robot.waitForIdle(); + + try { + // Move cursor to start of TextField + robot.keyPress(KeyEvent.VK_HOME); + robot.keyRelease(KeyEvent.VK_HOME); + robot.waitForIdle(); + + if (Platform.isLinux()) { + // Press but don't release NumLock + robot.keyPress(KeyEvent.VK_NUM_LOCK); + } + if (Platform.isWindows()) { + oldState = toolkit.getLockingKeyState(KeyEvent.VK_NUM_LOCK); + toolkit.setLockingKeyState(KeyEvent.VK_NUM_LOCK, true); + } + + // Press and release Numpad-1 + robot.keyPress(KeyEvent.VK_NUMPAD1); + robot.keyRelease(KeyEvent.VK_NUMPAD1); + + if (!typedNum1.await(2, SECONDS)) { + throw new RuntimeException("TextField didn't receive keyTyped('1') - too slow"); + } + + final String text = tf.getText(); + if (!text.equals(EXPECTED)) { + throw new RuntimeException("Test FAILED: wrong string '" + + text + "' vs " + + "expected '" + EXPECTED + "'"); + } + System.out.println("Test PASSED"); + } finally { + if (Platform.isLinux()) { + // "release" + "press and release" NumLock to disable numlock + robot.keyRelease(KeyEvent.VK_NUM_LOCK); + robot.keyPress(KeyEvent.VK_NUM_LOCK); + robot.keyRelease(KeyEvent.VK_NUM_LOCK); + } + if (oldState != null) { + toolkit.setLockingKeyState(KeyEvent.VK_NUM_LOCK, oldState); + } + + frame.dispose(); + } + } + + @Override + public void focusGained(FocusEvent e) { + System.out.println("tf.focusGained"); + focusGained.countDown(); + } + + @Override + public void keyPressed(KeyEvent evt) { + printKey(evt); + } + + @Override + public void keyTyped(KeyEvent evt) { + printKey(evt); + + int keychar = evt.getKeyChar(); + if (keychar == '1') { + typedNum1.countDown(); + } + } + + @Override + public void keyReleased(KeyEvent evt) { + printKey(evt); + System.out.println(); + } + + private static void printKey(KeyEvent evt) { + int id = evt.getID(); + if (id != KeyEvent.KEY_TYPED + && id != KeyEvent.KEY_PRESSED + && id != KeyEvent.KEY_RELEASED) { + + System.out.println("Other Event"); + return; + } + + System.out.println("params= " + evt.paramString() + " \n" + + "KeyChar: " + evt.getKeyChar() + " = " + (int) evt.getKeyChar() + + " KeyCode: " + evt.getKeyCode() + + " Modifiers: " + evt.getModifiersEx()); + + if (evt.isActionKey()) { + System.out.println(" Action Key"); + } + + System.out.println("keyText= " + KeyEvent.getKeyText(evt.getKeyCode()) + "\n"); + } + +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,20 +21,6 @@ * questions. */ -/* - @test - @key headful - @bug 7154072 7161320 - @summary Tests that key events with modifiers are not swallowed. - @author anton.tarasov: area=awt.focus - @library ../../../regtesthelpers - @library /test/lib - @modules java.desktop/sun.awt - @build jdk.test.lib.Platform - @build Util - @run main SwallowKeyEvents -*/ - import jdk.test.lib.Platform; import java.awt.AWTException; import java.awt.Frame; @@ -44,6 +30,20 @@ import java.awt.event.KeyEvent; import test.java.awt.regtesthelpers.Util; +/* + @test + @key headful + @bug 7154072 7161320 + @summary Tests that key events with modifiers are not swallowed. + @requires (os.family != "windows") + @library /java/awt/regtesthelpers + @library /test/lib + @modules java.desktop/sun.awt + @build jdk.test.lib.Platform + @build Util + @run main SwallowKeyEvents +*/ + public class SwallowKeyEvents { static final int PRESS_COUNT = 10; @@ -83,6 +83,8 @@ }); test(); + r.waitForIdle(); + r.delay(500); System.out.println("key_pressed count: " + keyPressedCount); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/geom/HitTest/PathHitTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/geom/HitTest/PathHitTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/geom/HitTest/PathHitTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/geom/HitTest/PathHitTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -372,7 +372,7 @@ } public static void doManual() throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame passFailJFrame = PassFailJFrame.builder() .title("PathHitTestManual Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PageFormat/CustomPaper.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PageFormat/CustomPaper.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PageFormat/CustomPaper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PageFormat/CustomPaper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,224 +21,162 @@ * questions. */ +import java.awt.BasicStroke; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; +import java.awt.print.PageFormat; +import java.awt.print.Pageable; +import java.awt.print.Paper; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +import jtreg.SkippedException; + /* * @test * @bug 4355514 - * @bug 4385157 * @key printer * @summary Prints a rectangle to show the imageable area of a * 12in x 14in custom paper size. - * @run main/manual CustomPaper + * @library /java/awt/regtesthelpers + * @library /test/lib + * @build PassFailJFrame + * @build jtreg.SkippedException + * @run main/manual CustomPaper 4355514 */ -import java.awt.*; -import java.awt.print.*; -import java.awt.geom.*; - -public class CustomPaper implements Pageable, Printable{ - - private static double PIXELS_PER_INCH = 72.0; - - private PrinterJob printerJob; - private PageFormat pageFormat; - - CustomPaper(){ - printerJob = PrinterJob.getPrinterJob(); - createPageFormat(); - } - - private void createPageFormat(){ - pageFormat = new PageFormat(); - Paper p = new Paper(); - double width = 12.0*PIXELS_PER_INCH; - double height = 14.0*PIXELS_PER_INCH; - double ix = PIXELS_PER_INCH; - double iy = PIXELS_PER_INCH; - double iwidth = width - 2.0*PIXELS_PER_INCH; - double iheight = height - 2.0*PIXELS_PER_INCH; - p.setSize(width, height); - p.setImageableArea(ix, iy, iwidth, iheight); - pageFormat.setPaper(p); - } - - public Printable getPrintable(int index){ - return this; - } - - public PageFormat getPageFormat(int index){ - return pageFormat; - } - - public int getNumberOfPages(){ - return 1; - } - - public void print(){ - if(printerJob.printDialog()) - { - try{ - printerJob.setPageable(this); - printerJob.print(); - }catch(Exception e){e.printStackTrace();} - } - - } - - public int print(Graphics g, PageFormat pf, int pageIndex){ - if(pageIndex == 0){ - Graphics2D g2 = (Graphics2D)g; - Rectangle2D r = new Rectangle2D.Double(pf.getImageableX(), - pf.getImageableY(), - pf.getImageableWidth(), - pf.getImageableHeight()); - g2.setStroke(new BasicStroke(3.0f)); - g2.draw(r); - return PAGE_EXISTS; - }else{ - return NO_SUCH_PAGE; - } - } - - public static void main(String[] args){ - - String[] instructions = - { - "You must have a printer that supports custom paper size of ", - "at least 12 x 14 inches to perform this test. It requires", - "user interaction and you must have a 12 x 14 inch paper available.", - " ", - "To test bug ID 4385157, click OK on print dialog box to print.", - " ", - "To test bug ID 4355514, select the printer in the Print Setup dialog and add a ", - "custom paper size under Printer properties' Paper selection menu. ", - "Set the dimension to width=12 inches and height=14 inches.", - "Select this custom paper size before proceeding to print.", - " ", - "Visual inspection of the one-page printout is needed. A passing", - "test will print a rectangle of the imageable area which is approximately", - "10 x 12 inches.", - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - CustomPaper pt = new CustomPaper(); - pt.print(); - //System.exit (0); - } - -} - - -class Sysout { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } +/* + * @test + * @bug 4385157 + * @key printer + * @summary Prints a rectangle to show the imageable area of a + * 12in x 14in custom paper size. + * @library /java/awt/regtesthelpers + * @library /test/lib + * @build PassFailJFrame + * @build jtreg.SkippedException + * @run main/manual CustomPaper 4385157 + */ +public class CustomPaper implements Pageable, Printable { - instructionsText.append( printStr + "\n" ); + private static final double PIXELS_PER_INCH = 72.0; - }// while + private final PrinterJob printerJob; + private PageFormat pageFormat; - }// for + CustomPaper() { + printerJob = PrinterJob.getPrinterJob(); + createPageFormat(); + } + + private void createPageFormat() { + pageFormat = new PageFormat(); + Paper p = new Paper(); + double width = 12.0 * PIXELS_PER_INCH; + double height = 14.0 * PIXELS_PER_INCH; + double iwidth = width - 2.0 * PIXELS_PER_INCH; + double iheight = height - 2.0 * PIXELS_PER_INCH; + p.setSize(width, height); + p.setImageableArea(PIXELS_PER_INCH, PIXELS_PER_INCH, iwidth, iheight); + pageFormat.setPaper(p); + } + + @Override + public Printable getPrintable(int index) { + return this; + } + + @Override + public PageFormat getPageFormat(int index) { + return pageFormat; + } + + @Override + public int getNumberOfPages() { + return 1; + } + + private void print() throws PrinterException { + if (printerJob.printDialog()) { + printerJob.setPageable(this); + printerJob.print(); + } else { + PassFailJFrame.forceFail("Printing canceled by user"); + } + } + + @Override + public int print(Graphics g, PageFormat pf, int pageIndex) { + if (pageIndex == 0) { + Graphics2D g2 = (Graphics2D) g; + Rectangle2D r = new Rectangle2D.Double(pf.getImageableX(), + pf.getImageableY(), + pf.getImageableWidth(), + pf.getImageableHeight()); + g2.setStroke(new BasicStroke(3.0f)); + g2.draw(r); + return PAGE_EXISTS; + } else { + return NO_SUCH_PAGE; + } + } + + private static final String TOP = """ + You must have a printer that supports custom paper size of + at least 12 x 14 inches to perform this test. It requires + user interaction and you must have a 12 x 14 inch paper available. + + """; + + private static final String BOTTOM = """ + + Visual inspection of the one-page printout is needed. A passing + test will print a rectangle of the imageable area which is + approximately 10 x 12 inches. + """; + + private static final String INSTRUCTIONS_4355514 = """ + Select the printer in the Print Setup dialog and add a custom + paper size under 'Printer properties' Paper selection menu. + Set the dimension to width=12 inches and height=14 inches. + Select this custom paper size before proceeding to print. + """; + + private static final String INSTRUCTIONS_4385157 = """ + Click OK on print dialog box to print. + """; + + public static void main(String[] args) throws Exception { + String instructions; + + if (PrinterJob.lookupPrintServices().length == 0) { + throw new SkippedException("Printer not configured or available." + + " Test cannot continue."); + } + + if (args.length != 1) { + throw new RuntimeException("Select a test by passing 4355514 or 4385157"); + } + + instructions = switch (args[0]) { + case "4355514" -> TOP + INSTRUCTIONS_4355514 + BOTTOM; + case "4385157" -> TOP + INSTRUCTIONS_4385157 + BOTTOM; + default -> throw new RuntimeException("Unknown bugid " + args[0] + "." + + "Valid values: 4355514 or 4385157"); + }; - }//printInstructions() + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("CustomPaper Test Instructions") + .instructions(instructions) + .testTimeOut(5) + .rows((int) instructions.lines().count() + 1) + .columns(45) + .build(); - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); + CustomPaper pt = new CustomPaper(); + pt.print(); + passFailJFrame.awaitAndCheck(); } - - }// TestDialog class +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PageDlgPrnButton.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PageDlgPrnButton.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PageDlgPrnButton.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PageDlgPrnButton.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,209 +21,93 @@ * questions. */ -/** - * @test - * @bug 4956397 - * @key printer - * @run main/manual PageDlgPrnButton - */ - -import java.awt.print.PrinterJob; -import java.awt.print.PageFormat; -import java.awt.print.Printable; -import java.awt.print.PrinterException; - import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; -import java.awt.* ; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; -public class PageDlgPrnButton implements Printable -{ - public static void main ( String args[] ) { - - String[] instructions = - {"For non-windows OS, this test PASSes.", - "You must have at least 2 printers available to perform this test.", - "This test brings up a native Windows page dialog.", - "Click on the Printer... button and change the selected printer. ", - "Test passes if the printout comes from the new selected printer.", - }; +import jtreg.SkippedException; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); +/* + * @test + * @bug 4956397 + * @key printer + * @requires os.family=="windows" + * @library /test/lib /java/awt/regtesthelpers + * @build PassFailJFrame jtreg.SkippedException + * @run main/manual PageDlgPrnButton + */ +public class PageDlgPrnButton implements Printable { + private static final String INSTRUCTIONS = + "This test brings up a native Windows page dialog.\n" + + "Click on the Printer... button and change the selected printer. \n" + + "Test passes if the printout comes from the new selected printer."; + + public static void main(String[] args) throws Exception { + final int serviceCount = PrinterJob.lookupPrintServices().length; + if (serviceCount == 0) { + throw new RuntimeException("Printer not configured or available."); + } + if (serviceCount < 2) { + throw new SkippedException("The test requires at least 2 printers."); + } - PageDlgPrnButton pdpb = new PageDlgPrnButton() ; - } + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build(); - public PageDlgPrnButton() - { - try - { - pageDialogExample(); - } - catch(Exception e) - {e.printStackTrace(System.err);} + pageDialogExample(); + passFailJFrame.awaitAndCheck(); } - // This example just displays the page dialog - you cannot change // the printer (press the "Printer..." button and choose one if you like). - public void pageDialogExample() throws PrinterException - { + public static void pageDialogExample() throws PrinterException { PrinterJob job = PrinterJob.getPrinterJob(); PageFormat originalPageFormat = job.defaultPage(); PageFormat pageFormat = job.pageDialog(originalPageFormat); - if(originalPageFormat == pageFormat) return; - - job.setPrintable(this,pageFormat); - job.print(); + job.setPrintable(new PageDlgPrnButton(), pageFormat); + if (job.printDialog()) { + job.print(); + } } - - - public int print(Graphics g, PageFormat pageFormat, int pageIndex) - { + @Override + public int print(Graphics g, PageFormat pageFormat, int pageIndex) { final int boxWidth = 100; final int boxHeight = 100; - final Rectangle rect = new Rectangle(0,0,boxWidth,boxHeight); + final Rectangle rect = new Rectangle(0, 0, boxWidth, boxHeight); final double pageH = pageFormat.getImageableHeight(); final double pageW = pageFormat.getImageableWidth(); + final Graphics2D g2d = (Graphics2D) g; - if (pageIndex > 0) return (NO_SUCH_PAGE); - - final Graphics2D g2d = (Graphics2D)g; + if (pageIndex > 0) { + return NO_SUCH_PAGE; + } // Move the (x,y) origin to account for the left-hand and top margins g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); // Draw the page bounding box - g2d.drawRect(0,0,(int)pageW,(int)pageH); + g2d.drawRect(0, 0, (int) pageW, (int) pageH); // Select the smaller scaling factor so that the figure // fits on the page in both dimensions - final double scale = Math.min( (pageW/boxWidth), (pageH/boxHeight) ); + final double scale = Math.min((pageW / boxWidth), (pageH / boxHeight)); - if(scale < 1.0) g2d.scale(scale, scale); + if (scale < 1.0) { + g2d.scale(scale, scale); + } // Paint the scaled component on the printer g2d.fillRect(rect.x, rect.y, rect.width, rect.height); - return(PAGE_EXISTS); + return PAGE_EXISTS; } } - -class Sysout { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintCompoundString.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintCompoundString.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintCompoundString.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintCompoundString.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,226 +21,87 @@ * questions. */ -/** +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JOptionPane; + +/* * @test * @bug 4396835 * @summary Compound font string not printing. * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @run main/manual PrintCompoundString */ +public class PrintCompoundString implements Printable { + private static final String STR = "Test string compound printing \u2203\u2200\u2211"; - -import java.awt.*; -import java.awt.event.*; -import java.awt.print.*; -import java.text.*; - -public class PrintCompoundString extends Frame implements ActionListener { - - private TextCanvas c; - - public static void main(String args[]) { - - String[] instructions = - { - "You must have a printer available to perform this test", - "This test should print a page which contains the same", - "text message as in the test window on the screen", - "You should also monitor the command line to see if any exceptions", - "were thrown", - "If an exception is thrown, or the page doesn't print properly", - "then the test fails", - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - PrintCompoundString f = new PrintCompoundString(); - f.show(); - } - - public PrintCompoundString() { - super("JDK 1.2 drawString Printing"); - - c = new TextCanvas(); - add("Center", c); - - Button printButton = new Button("Print"); - printButton.addActionListener(this); - add("South", printButton); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); + private static final String INSTRUCTIONS = + "This test should print following text\n\n" + + STR +"\n\n" + + "If an exception is thrown, or the page doesn't print properly\n" + + "then the test fails"; + + public static void main(String[] args) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .splitUI(PrintCompoundString::createTestUI) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build() + .awaitAndCheck(); + } + + private static JComponent createTestUI() { + JButton b = new JButton("Print"); + b.addActionListener((ae) -> { + try { + PrinterJob job = PrinterJob.getPrinterJob(); + job.setPrintable(new PrintCompoundString()); + if (job.printDialog()) { + job.print(); + } + } catch (PrinterException ex) { + ex.printStackTrace(); + String msg = "PrinterException: " + ex.getMessage(); + JOptionPane.showMessageDialog(b, msg, "Error occurred", + JOptionPane.ERROR_MESSAGE); + PassFailJFrame.forceFail(msg); } - }); - - pack(); - } - - public void actionPerformed(ActionEvent e) { - - PrinterJob pj = PrinterJob.getPrinterJob(); - - if (pj != null && pj.printDialog()) { - - pj.setPrintable(c); - try { - pj.print(); - } catch (PrinterException pe) { - } finally { - System.err.println("PRINT RETURNED"); - } - } - } - - class TextCanvas extends Panel implements Printable { - - String nullStr = null; - String emptyStr = new String(); - AttributedString nullAttStr = null; - AttributedString emptyAttStr = new AttributedString(emptyStr); - AttributedCharacterIterator nullIterator = null; - AttributedCharacterIterator emptyIterator = emptyAttStr.getIterator(); - - public int print(Graphics g, PageFormat pgFmt, int pgIndex) { - - if (pgIndex > 0) - return Printable.NO_SUCH_PAGE; - - Graphics2D g2d = (Graphics2D)g; - g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); - - paint(g); + }); - return Printable.PAGE_EXISTS; + Box main = Box.createHorizontalBox(); + main.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + main.add(Box.createHorizontalGlue()); + main.add(b); + main.add(Box.createHorizontalGlue()); + return main; } - public void paint(Graphics g1) { - Graphics2D g = (Graphics2D)g1; - - String str = "Test string compound printing \u2203\u2200\u2211"; - g.drawString(str, 20, 40); - - } + @Override + public int print(Graphics g, PageFormat pgFmt, int pgIndex) { + if (pgIndex > 0) { + return Printable.NO_SUCH_PAGE; + } + + Graphics2D g2d = (Graphics2D) g; + g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); + g2d.drawString(STR, 20, 40); - public Dimension getPreferredSize() { - return new Dimension(450, 250); + return Printable.PAGE_EXISTS; } - } - } - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintImage.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintImage.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintImage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintImage.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,276 +21,152 @@ * questions. */ -/** - * @test %I %W +import java.awt.BorderLayout; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +/* + * @test * @bug 4298489 * @summary Confirm that output is same as screen. * @key printer + * @requires os.family=="windows" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @run main/manual PrintImage */ -import java.awt.*; -import java.awt.print.*; -import java.awt.event.*; - public class PrintImage extends Frame implements ActionListener { + private final PrintImageCanvas printImageCanvas = new PrintImageCanvas(); + private final MenuItem print1Menu = new MenuItem("PrintTest1"); + private final MenuItem print2Menu = new MenuItem("PrintTest2"); + private static final String INSTRUCTIONS = + "Select PrintTest1 in the File menu.\n" + + "Print Dialog will appear.\n" + + "Click OK to start the first print job.\n" + + "\n" + + "Select PrintTest2 in the File menu.\n" + + "Page Setup Dialog will appear.\n" + + "Click OK.\n" + + "Print Dialog will appear.\n" + + "Click OK to start the second print job.\n" + + "\n" + + "The text in the printouts for PrintTest1 and PrintTest2 should be\n" + + "same as that on the screen.\n" + + "Press Pass if they are, otherwise press Fail."; + + public static void main(String[] argv) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .testUI(PrintImage::new) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build() + .awaitAndCheck(); + } - private PrintImageCanvas printImageCanvas; - - private MenuItem print1Menu = new MenuItem("PrintTest1"); - private MenuItem print2Menu = new MenuItem("PrintTest2"); - private MenuItem exitMenu = new MenuItem("Exit"); - - public static void main(String[] argv) { - String[] instructions = - { "You must have a printer available to perform this test,", - "prefererably Canon LaserShot A309GII.", - "Printing must be done in Win 98 Japanese 2nd Edition.", - "", - "Passing test : Output of text image for PrintTest1 and PrintTest2 should be same as that on the screen.", - }; - - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - new PrintImage(); - } - - public PrintImage() { - super("PrintImage"); - initPrintImage(); - } - - public void initPrintImage() { - - printImageCanvas = new PrintImageCanvas(this); - - initMenu(); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent ev) { - dispose(); - } - public void windowClosed(WindowEvent ev) { - System.exit(0); - } - }); - - setLayout(new BorderLayout()); - add(printImageCanvas, BorderLayout.CENTER); - pack(); - - setSize(500,500); - setVisible(true); - } - - private void initMenu() { - MenuBar mb = new MenuBar(); - Menu me = new Menu("File"); - me.add(print1Menu); - me.add(print2Menu); - me.add("-"); - me.add(exitMenu); - mb.add(me); - this.setMenuBar(mb); - - print1Menu.addActionListener(this); - print2Menu.addActionListener(this); - exitMenu.addActionListener(this); - } - - public void actionPerformed(ActionEvent e) { - Object target = e.getSource(); - if( target.equals(print1Menu) ) { - printMain1(); - } - else if( target.equals(print2Menu) ) { - printMain2(); - } - else if( target.equals(exitMenu) ) { - dispose(); - } - } + public PrintImage() { + super("PrintImage"); + initPrintImage(); + } - private void printMain1(){ + public void initPrintImage() { + initMenu(); + setLayout(new BorderLayout()); + add(printImageCanvas, BorderLayout.CENTER); + setSize(500, 300); + } - PrinterJob printerJob = PrinterJob.getPrinterJob(); - PageFormat pageFormat = printerJob.defaultPage(); + private void initMenu() { + MenuBar mb = new MenuBar(); + Menu me = new Menu("File"); + me.add(print1Menu); + me.add(print2Menu); + mb.add(me); + setMenuBar(mb); - printerJob.setPrintable((Printable)printImageCanvas, pageFormat); + print1Menu.addActionListener(this); + print2Menu.addActionListener(this); + } - if(printerJob.printDialog()){ - try { - printerJob.print(); - } - catch(PrinterException p){ - } - } - else - printerJob.cancel(); + public void actionPerformed(ActionEvent e) { + Object target = e.getSource(); + if (target.equals(print1Menu)) { + printMain1(); + } else if (target.equals(print2Menu)) { + printMain2(); } + } - private void printMain2(){ - - PrinterJob printerJob = PrinterJob.getPrinterJob(); - PageFormat pageFormat = printerJob.pageDialog(printerJob.defaultPage()); - - printerJob.setPrintable((Printable)printImageCanvas, pageFormat); - - if(printerJob.printDialog()){ - try { - printerJob.print(); - } - catch(PrinterException p){ - } - } - else - printerJob.cancel(); + private void printMain1() { + PrinterJob printerJob = PrinterJob.getPrinterJob(); + PageFormat pageFormat = printerJob.defaultPage(); + + printerJob.setPrintable(printImageCanvas, pageFormat); + + if (printerJob.printDialog()) { + try { + printerJob.print(); + } catch (PrinterException e) { + PassFailJFrame.forceFail("Print Failed"); + e.printStackTrace(); + } + } else { + printerJob.cancel(); } + } -} - -class PrintImageCanvas extends Canvas implements Printable { - - private PrintImage pdsFrame; - - public PrintImageCanvas(PrintImage pds) { - pdsFrame = pds; + private void printMain2() { + PrinterJob printerJob = PrinterJob.getPrinterJob(); + PageFormat pageFormat = printerJob.pageDialog(printerJob.defaultPage()); + + printerJob.setPrintable(printImageCanvas, pageFormat); + + if (printerJob.printDialog()) { + try { + printerJob.print(); + } catch (PrinterException e) { + PassFailJFrame.forceFail("Print Failed"); + e.printStackTrace(); + } + } else { + printerJob.cancel(); } + } + private static class PrintImageCanvas extends Canvas implements Printable { + @Override public void paint(Graphics g) { - Font drawFont = new Font("MS Mincho",Font.ITALIC,50); - g.setFont(drawFont); - g.drawString("PrintSample!",100,150); + Font drawFont = new Font("MS Mincho", Font.ITALIC, 50); + g.setFont(drawFont); + g.setColor(new Color(0, 0, 0, 200)); + g.drawString("PrintSample!", 100, 150); } + @Override public int print(Graphics g, PageFormat pf, int pi) throws PrinterException { - - if(pi>=1) - return NO_SUCH_PAGE; - else{ - Graphics2D g2 = (Graphics2D)g; - g.setColor(new Color(0,0,0,200)); - - Font drawFont = new Font("MS Mincho",Font.ITALIC,50); - g.setFont(drawFont); - g.drawString("PrintSample!",100,150); - return PAGE_EXISTS; - } + if (pi > 0) { + return NO_SUCH_PAGE; + } + paint(g); + return PAGE_EXISTS; } -} - - -class Sysout { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); } +} - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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,7 +31,6 @@ * @run main/manual PrintLatinCJKTest */ -import java.awt.BorderLayout; import java.awt.Font; import java.awt.Graphics; import java.awt.print.PageFormat; @@ -39,51 +38,57 @@ import java.awt.print.PrinterException; import java.awt.print.PrinterJob; import java.lang.reflect.InvocationTargetException; -import javax.swing.JButton; -import javax.swing.JFrame; -import static javax.swing.SwingUtilities.invokeAndWait; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JOptionPane; public class PrintLatinCJKTest implements Printable { - private static PrintLatinCJKTest testInstance = new PrintLatinCJKTest(); - private static JFrame frame; - private static final String info = """ - You need a printer for this test. If you have none, let - the test pass. If there is a printer, press Print, send - the output to the printer, and examine it. It should have - text looking like this : \u4e00\u4e01\u4e02\u4e03\u4e04English + private static final String TEXT = "\u4e00\u4e01\u4e02\u4e03\u4e04English"; + + private static final String INFO = """ + Press Print, send the output to the printer and examine it. + The printout should have text looking like this: + + """ + + TEXT + """ + + + Press Pass if the text is printed correctly. + If Japanese and English text overlap, press Fail. + To test 8022536, if a remote printer is the system default, it should show in the dialog as the selected printer. """; - public static void showFrame() throws InterruptedException, InvocationTargetException { - invokeAndWait( () -> { - frame = new JFrame("Test Frame"); - JButton b = new JButton("Print"); - b.addActionListener((ae) -> { - try { - PrinterJob job = PrinterJob.getPrinterJob(); - job.setPrintable(testInstance); - if (job.printDialog()) { - job.print(); - } - } catch (PrinterException ex) { - ex.printStackTrace(); + private static JComponent createTestUI() { + JButton b = new JButton("Print"); + b.addActionListener((ae) -> { + try { + PrinterJob job = PrinterJob.getPrinterJob(); + job.setPrintable(new PrintLatinCJKTest()); + if (job.printDialog()) { + job.print(); } - }); - frame.getContentPane().add(b, BorderLayout.SOUTH); - frame.pack(); - - // add the test frame to dispose - PassFailJFrame.addTestWindow(frame); - - // Arrange the test instruction frame and test frame side by side - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - frame.setVisible(true); + } catch (PrinterException ex) { + ex.printStackTrace(); + String msg = "PrinterException: " + ex.getMessage(); + JOptionPane.showMessageDialog(b, msg, "Error occurred", + JOptionPane.ERROR_MESSAGE); + PassFailJFrame.forceFail(msg); + } }); + + Box main = Box.createHorizontalBox(); + main.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + main.add(Box.createHorizontalGlue()); + main.add(b); + main.add(Box.createHorizontalGlue()); + return main; } @Override @@ -93,22 +98,24 @@ return Printable.NO_SUCH_PAGE; } g.translate((int) pf.getImageableX(), (int) pf.getImageableY()); - g.setFont(new Font("Dialog", Font.PLAIN, 36)); - g.drawString("\u4e00\u4e01\u4e02\u4e03\u4e04English", 20, 100); + g.setFont(new Font(Font.DIALOG, Font.PLAIN, 36)); + g.drawString(TEXT, 20, 100); return Printable.PAGE_EXISTS; } public static void main(String[] args) throws InterruptedException, InvocationTargetException { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() - .title("Test Instructions Frame") - .instructions(info) - .testTimeOut(10) - .rows(10) - .columns(45) - .build(); - showFrame(); - passFailJFrame.awaitAndCheck(); + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .title("Print Latin CJK Test") + .instructions(INFO) + .testTimeOut(10) + .rows(12) + .columns(30) + .splitUI(PrintLatinCJKTest::createTestUI) + .build() + .awaitAndCheck(); } } - - diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintNullString.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintNullString.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintNullString.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintNullString.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,308 +21,164 @@ * questions. */ -/** +import java.awt.Button; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; +import java.text.AttributedCharacterIterator; +import java.text.AttributedString; + +import javax.swing.JOptionPane; + +/* * @test * @bug 4223328 * @summary Printer graphics must behave the same as screen graphics * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @run main/manual PrintNullString */ - - -import java.awt.*; -import java.awt.event.*; -import java.awt.print.*; -import java.text.*; - -public class PrintNullString extends Frame implements ActionListener { - - private TextCanvas c; - - public static void main(String args[]) { - - String[] instructions = - { - "You must have a printer available to perform this test", - "This test should print a page which contains the same", - "text messages as in the test window on the screen", - "The messages should contain only 'OK' and 'expected' messages", - "There should be no FAILURE messages.", - "You should also monitor the command line to see if any exceptions", - "were thrown", - "If the page fails to print, but there were no exceptions", - "then the problem is likely elsewhere (ie your printer)" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - PrintNullString f = new PrintNullString(); - f.show(); - } - - public PrintNullString() { - super("JDK 1.2 drawString Printing"); - - c = new TextCanvas(); - add("Center", c); - - Button printButton = new Button("Print"); - printButton.addActionListener(this); - add("South", printButton); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); +public class PrintNullString extends Frame { + private static final String INSTRUCTIONS = + "This test should print a page which contains the same\n" + + "text messages as in the test window on the screen.\n" + + "\n" + + "The messages should contain only 'OK' and 'expected' messages.\n" + + "Press Pass if it's the case; otherwise press Fail.\n" + + "\n" + + "If the page fails to print, but there were no exceptions\n" + + "then the problem is likely elsewhere (i.e. your printer)"; + + public static void main(String[] args) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .testUI(PrintNullString::new) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build() + .awaitAndCheck(); + } + + public PrintNullString() { + super("PrintNullString"); + + TextCanvas c = new TextCanvas(); + add("Center", c); + + Button b = new Button("Print"); + add("South", b); + b.addActionListener(e -> { + PrinterJob pj = PrinterJob.getPrinterJob(); + if (pj.printDialog()) { + pj.setPrintable(c); + try { + pj.print(); + } catch (PrinterException ex) { + ex.printStackTrace(); + String msg = "PrinterException: " + ex.getMessage(); + JOptionPane.showMessageDialog(b, msg, "Error occurred", + JOptionPane.ERROR_MESSAGE); + PassFailJFrame.forceFail(msg); + } } - }); - - pack(); - } - - public void actionPerformed(ActionEvent e) { - - PrinterJob pj = PrinterJob.getPrinterJob(); - - if (pj != null && pj.printDialog()) { - - pj.setPrintable(c); - try { - pj.print(); - } catch (PrinterException pe) { - } finally { - System.err.println("PRINT RETURNED"); - } - } - } - - class TextCanvas extends Panel implements Printable { - - String nullStr = null; - String emptyStr = new String(); - AttributedString nullAttStr = null; - AttributedString emptyAttStr = new AttributedString(emptyStr); - AttributedCharacterIterator nullIterator = null; - AttributedCharacterIterator emptyIterator = emptyAttStr.getIterator(); - - public int print(Graphics g, PageFormat pgFmt, int pgIndex) { - - if (pgIndex > 0) - return Printable.NO_SUCH_PAGE; - - Graphics2D g2d = (Graphics2D)g; - g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); - - paint(g); - - return Printable.PAGE_EXISTS; + }); + pack(); } - public void paint(Graphics g1) { - Graphics2D g = (Graphics2D)g1; - - // API 1: null & empty drawString(String, int, int); - try { - g.drawString(nullStr, 20, 40); - g.drawString("FAILURE: No NPE for null String, int", 20, 40); - } catch (NullPointerException e) { - g.drawString("caught expected NPE for null String, int", 20, 40); - }/* catch (Exception e) { - g.drawString("FAILURE: unexpected exception for null String, int", - 20, 40); - }*/ - - //try { - g.drawString(emptyStr, 20, 60); - g.drawString("OK for empty String, int", 20, 60); - /*} catch (Exception e) { - g.drawString("FAILURE: unexpected exception for empty String, int", - 20, 60); - }*/ - - - // API 2: null & empty drawString(String, float, float); - try { - g.drawString(nullStr, 20.0f, 80.0f); - g.drawString("FAILURE: No NPE for null String, float", 20, 80); - } catch (NullPointerException e) { - g.drawString("caught expected NPE for null String, float", 20, 80); - } /*catch (Exception e) { - g.drawString("FAILURE: unexpected exception for null String, float", - 20, 80); - }*/ - //try { - g.drawString(emptyStr, 20.0f, 100.0f); - g.drawString("OK for empty String, float", 20.0f, 100.f); - /* } catch (Exception e) { - g.drawString("FAILURE: unexpected exception for empty String, float", - 20, 100); - }*/ - - // API 3: null & empty drawString(Iterator, int, int); - try { - g.drawString(nullIterator, 20, 120); - g.drawString("FAILURE: No NPE for null iterator, float", 20, 120); - } catch (NullPointerException e) { - g.drawString("caught expected NPE for null iterator, int", 20, 120); - } /*catch (Exception e) { - g.drawString("FAILURE: unexpected exception for null iterator, int", - 20, 120); - } */ - try { - g.drawString(emptyIterator, 20, 140); - g.drawString("FAILURE: No IAE for empty iterator, int", - 20, 140); - } catch (IllegalArgumentException e) { - g.drawString("caught expected IAE for empty iterator, int", - 20, 140); - } /*catch (Exception e) { - g.drawString("FAILURE: unexpected exception for empty iterator, int", - 20, 140); - } */ - - - // API 4: null & empty drawString(Iterator, float, int); - try { - g.drawString(nullIterator, 20.0f, 160.0f); - g.drawString("FAILURE: No NPE for null iterator, float", 20, 160); - } catch (NullPointerException e) { - g.drawString("caught expected NPE for null iterator, float", 20, 160); - } /*catch (Exception e) { - g.drawString("FAILURE: unexpected exception for null iterator, float", - 20, 160); - } */ - - try { - g.drawString(emptyIterator, 20, 180); - g.drawString("FAILURE: No IAE for empty iterator, float", - 20, 180); - } catch (IllegalArgumentException e) { - g.drawString("caught expected IAE for empty iterator, float", - 20, 180); - } /*catch (Exception e) { - g.drawString("FAILURE: unexpected exception for empty iterator, float", - 20, 180); - } */ - } - - public Dimension getPreferredSize() { - return new Dimension(450, 250); - } - } + private static class TextCanvas extends Panel implements Printable { + private final String nullStr = null; + private final String emptyStr = ""; + private final AttributedString emptyAttStr = new AttributedString(emptyStr); + private final AttributedCharacterIterator nullIterator = null; + private final AttributedCharacterIterator emptyIterator = emptyAttStr.getIterator(); + + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + paint(g2d); + } + + @Override + public int print(Graphics g, PageFormat pgFmt, int pgIndex) { + if (pgIndex > 0) { + return NO_SUCH_PAGE; + } -} + Graphics2D g2d = (Graphics2D) g; + g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); + paint(g2d); + + return PAGE_EXISTS; + } + + private void paint(Graphics2D g2d) { + // API 1: null & empty drawString(String, int, int); + try { + g2d.drawString(nullStr, 20, 40); + g2d.drawString("FAILURE: No NPE for null String, int", 20, 40); + } catch (NullPointerException e) { + g2d.drawString("caught expected NPE for null String, int", 20, 40); + } -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } + g2d.drawString(emptyStr, 20, 60); + g2d.drawString("OK for empty String, int", 20, 60); - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } + // API 2: null & empty drawString(String, float, float); + try { + g2d.drawString(nullStr, 20.0f, 80.0f); + g2d.drawString("FAILURE: No NPE for null String, float", 20, 80); + } catch (NullPointerException e) { + g2d.drawString("caught expected NPE for null String, float", 20, 80); + } + g2d.drawString(emptyStr, 20.0f, 100.0f); + g2d.drawString("OK for empty String, float", 20.0f, 100.f); - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } + // API 3: null & empty drawString(Iterator, int, int); + try { + g2d.drawString(nullIterator, 20, 120); + g2d.drawString("FAILURE: No NPE for null iterator, float", 20, 120); + } catch (NullPointerException e) { + g2d.drawString("caught expected NPE for null iterator, int", 20, 120); + } + try { + g2d.drawString(emptyIterator, 20, 140); + g2d.drawString("FAILURE: No IAE for empty iterator, int", 20, 140); + } catch (IllegalArgumentException e) { + g2d.drawString("caught expected IAE for empty iterator, int", 20, 140); + } - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } + // API 4: null & empty drawString(Iterator, float, int); + try { + g2d.drawString(nullIterator, 20.0f, 160.0f); + g2d.drawString("FAILURE: No NPE for null iterator, float", 20, 160); + } catch (NullPointerException e) { + g2d.drawString("caught expected NPE for null iterator, float", 20, 160); + } - }// Sysout class + try { + g2d.drawString(emptyIterator, 20, 180); + g2d.drawString("FAILURE: No IAE for empty iterator, float", 20, 180); + } catch (IllegalArgumentException e) { + g2d.drawString("caught expected IAE for empty iterator, float", 20, 180); + } + } -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); + @Override + public Dimension getPreferredSize() { + return new Dimension(450, 250); + } } - - }// TestDialog class +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintParenString.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintParenString.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintParenString.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintParenString.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,226 +21,87 @@ * questions. */ -/** +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JOptionPane; + +/* * @test * @bug 4399442 * @summary Brackets should be quoted in Postscript output * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @run main/manual PrintParenString */ +public class PrintParenString implements Printable { + private static final String STR = "String containing unclosed parenthesis (."; - -import java.awt.*; -import java.awt.event.*; -import java.awt.print.*; -import java.text.*; - -public class PrintParenString extends Frame implements ActionListener { - - private TextCanvas c; - - public static void main(String args[]) { - - String[] instructions = - { - "You must have a printer available to perform this test", - "This test should print a page which contains the same", - "text message as in the test window on the screen", - "You should also monitor the command line to see if any exceptions", - "were thrown", - "If an exception is thrown, or the page doesn't print properly", - "then the test fails", - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - PrintParenString f = new PrintParenString(); - f.show(); - } - - public PrintParenString() { - super("JDK 1.2 drawString Printing"); - - c = new TextCanvas(); - add("Center", c); - - Button printButton = new Button("Print"); - printButton.addActionListener(this); - add("South", printButton); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); + private static final String INSTRUCTIONS = + "This test should print a page with following text\n\n" + + STR + "\n\n" + + "If an exception is thrown, or the page doesn't print properly\n" + + "then the test fails"; + + public static void main(String[] args) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .splitUI(PrintParenString::createTestUI) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build() + .awaitAndCheck(); + } + + private static JComponent createTestUI() { + JButton b = new JButton("Print"); + b.addActionListener((ae) -> { + try { + PrinterJob job = PrinterJob.getPrinterJob(); + job.setPrintable(new PrintParenString()); + if (job.printDialog()) { + job.print(); + } + } catch (PrinterException ex) { + ex.printStackTrace(); + String msg = "PrinterException: " + ex.getMessage(); + JOptionPane.showMessageDialog(b, msg, "Error occurred", + JOptionPane.ERROR_MESSAGE); + PassFailJFrame.forceFail(msg); } - }); - - pack(); - } - - public void actionPerformed(ActionEvent e) { - - PrinterJob pj = PrinterJob.getPrinterJob(); - - if (pj != null && pj.printDialog()) { - - pj.setPrintable(c); - try { - pj.print(); - } catch (PrinterException pe) { - } finally { - System.err.println("PRINT RETURNED"); - } - } - } - - class TextCanvas extends Panel implements Printable { - - String nullStr = null; - String emptyStr = new String(); - AttributedString nullAttStr = null; - AttributedString emptyAttStr = new AttributedString(emptyStr); - AttributedCharacterIterator nullIterator = null; - AttributedCharacterIterator emptyIterator = emptyAttStr.getIterator(); - - public int print(Graphics g, PageFormat pgFmt, int pgIndex) { - - if (pgIndex > 0) - return Printable.NO_SUCH_PAGE; - - Graphics2D g2d = (Graphics2D)g; - g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); - - paint(g); + }); - return Printable.PAGE_EXISTS; + Box main = Box.createHorizontalBox(); + main.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + main.add(Box.createHorizontalGlue()); + main.add(b); + main.add(Box.createHorizontalGlue()); + return main; } - public void paint(Graphics g1) { - Graphics2D g = (Graphics2D)g1; - - String str = "String containing unclosed parenthesis (."; - g.drawString(str, 20, 40); - - } + @Override + public int print(Graphics g, PageFormat pgFmt, int pgIndex) { + if (pgIndex > 0) { + return Printable.NO_SUCH_PAGE; + } + + Graphics2D g2d = (Graphics2D) g; + g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); + g2d.drawString(STR, 20, 40); - public Dimension getPreferredSize() { - return new Dimension(450, 250); + return Printable.PAGE_EXISTS; } - } - } - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintTranslatedFont.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintTranslatedFont.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/PrintTranslatedFont.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/PrintTranslatedFont.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,237 +21,126 @@ * questions. */ -/** +import java.awt.Button; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.geom.AffineTransform; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +import javax.swing.JOptionPane; + +/* * @test * @bug 6359734 * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @summary Test that fonts with a translation print where they should. * @run main/manual PrintTranslatedFont */ - - -import java.awt.*; -import java.awt.event.*; -import java.awt.geom.*; -import java.awt.print.*; -import java.text.*; - -public class PrintTranslatedFont extends Frame implements ActionListener { - - private TextCanvas c; - - public static void main(String args[]) { - - String[] instructions = - { - "You must have a printer available to perform this test", - "This test should print a page which contains the same", - "content as the test window on the screen, in particular the lines", - "should be immediately under the text", - "You should also monitor the command line to see if any exceptions", - "were thrown", - "If an exception is thrown, or the page doesn't print properly", - "then the test fails", - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - PrintTranslatedFont f = new PrintTranslatedFont(); - f.show(); - } - - public PrintTranslatedFont() { - super("JDK 1.2 drawString Printing"); - - c = new TextCanvas(); - add("Center", c); - - Button printButton = new Button("Print"); - printButton.addActionListener(this); - add("South", printButton); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); +public class PrintTranslatedFont extends Frame { + private static final String INSTRUCTIONS = + "This test should print a page which contains the same\n" + + "content as the test window on the screen, in particular the lines\n" + + "should be immediately under the text\n\n" + + "If an exception is thrown, or the page doesn't print properly\n" + + "then the test fails"; + + public static void main(String[] args) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .testUI(PrintTranslatedFont::new) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build() + .awaitAndCheck(); + } + + public PrintTranslatedFont() { + super("PrintTranslatedFont"); + + TextCanvas c = new TextCanvas(); + add("Center", c); + + Button b = new Button("Print"); + add("South", b); + b.addActionListener(e -> { + PrinterJob pj = PrinterJob.getPrinterJob(); + if (pj.printDialog()) { + pj.setPrintable(c); + try { + pj.print(); + } catch (PrinterException ex) { + ex.printStackTrace(); + String msg = "PrinterException: " + ex.getMessage(); + JOptionPane.showMessageDialog(b, msg, "Error occurred", + JOptionPane.ERROR_MESSAGE); + PassFailJFrame.forceFail(msg); + } } - }); - - pack(); - } - - public void actionPerformed(ActionEvent e) { - - PrinterJob pj = PrinterJob.getPrinterJob(); - - if (pj != null && pj.printDialog()) { + }); - pj.setPrintable(c); - try { - pj.print(); - } catch (PrinterException pe) { - } finally { - System.err.println("PRINT RETURNED"); - } - } - } - - class TextCanvas extends Panel implements Printable { - - public int print(Graphics g, PageFormat pgFmt, int pgIndex) { - - if (pgIndex > 0) - return Printable.NO_SUCH_PAGE; - - Graphics2D g2d = (Graphics2D)g; - g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); - - paint(g); - - return Printable.PAGE_EXISTS; + pack(); } - public void paint(Graphics g1) { - Graphics2D g = (Graphics2D)g1; - - Font f = new Font("Dialog", Font.PLAIN, 20); - int tx = 20; - int ty = 20; - AffineTransform at = AffineTransform.getTranslateInstance(tx, ty); - f = f.deriveFont(at); - g.setFont(f); - - FontMetrics fm = g.getFontMetrics(); - String str = "Basic ascii string"; - int sw = fm.stringWidth(str); - int posx = 20, posy = 40; - g.drawString(str, posx, posy); - g.drawLine(posx+tx, posy+ty+2, posx+tx+sw, posy+ty+2); - - posx = 20; posy = 70; - str = "Test string compound printing \u2203\u2200"; - sw = fm.stringWidth(str); - g.drawString(str, posx, posy); - g.drawLine(posx+tx, posy+ty+2, posx+tx+sw, posy+ty+2); - } + private static class TextCanvas extends Panel implements Printable { + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + paint(g2d); + } + + @Override + public int print(Graphics g, PageFormat pgFmt, int pgIndex) { + if (pgIndex > 0) { + return Printable.NO_SUCH_PAGE; + } - public Dimension getPreferredSize() { - return new Dimension(450, 250); + Graphics2D g2d = (Graphics2D) g; + g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); + paint(g2d); + return Printable.PAGE_EXISTS; + } + + private void paint(Graphics2D g2d) { + Font f = new Font("Dialog", Font.PLAIN, 20); + int tx = 20; + int ty = 20; + AffineTransform at = AffineTransform.getTranslateInstance(tx, ty); + f = f.deriveFont(at); + g2d.setFont(f); + + FontMetrics fm = g2d.getFontMetrics(); + String str = "Basic ascii string"; + int sw = fm.stringWidth(str); + int posx = 20; + int posy = 40; + g2d.drawString(str, posx, posy); + g2d.drawLine(posx + tx, posy + ty + 2, posx + tx + sw, posy + ty + 2); + + posx = 20; + posy = 70; + str = "Test string compound printing \u2203\u2200"; + sw = fm.stringWidth(str); + g2d.drawString(str, posx, posy); + g2d.drawLine(posx + tx, posy + ty + 2, posx + tx + sw, posy + ty + 2); + } + + @Override + public Dimension getPreferredSize() { + return new Dimension(450, 250); + } } - } - } - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/SecurityDialogTest.java openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/SecurityDialogTest.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/print/PrinterJob/SecurityDialogTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/print/PrinterJob/SecurityDialogTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,210 +21,110 @@ * questions. */ -/** +import java.awt.Frame; +import java.awt.print.PageFormat; +import java.awt.print.PrinterJob; +import java.lang.reflect.InvocationTargetException; + +import javax.print.PrintService; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.PrintRequestAttributeSet; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +/* * @test * @bug 4937672 5100706 6252456 * @key printer - * @run main/othervm/manual -Djava.security.manager=allow SecurityDialogTest + * @summary Verifies "Print to file" option is disable if reading/writing files + * is not allowed by Security Manager. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual/othervm -Djava.security.manager=allow SecurityDialogTest */ - -import java.awt.* ; -import java.awt.print.* ; -import java.io.*; -import java.security.*; -import javax.print.*; -import javax.print.attribute.*; - public class SecurityDialogTest { + private static final String INSTRUCTIONS = + "This test brings up a native and cross-platform page and print dialogs.\n" + + "\n" + + "If the dialog has an option to save to file, the option ought " + + "to be disabled.\n" + + "\n" + + "Press the Pass button if the \"Print to file\" option was disabled in\n" + + "all the dialogs where it was present.\n" + + "Otherwise, press the Fail button.\n" + + "\n" + + "The dialogs should be displayed even when \n" + + "there is no queuePrintJob permission."; + + private static JLabel dialogType; + + public static void main(String[] args) throws Exception { + if (PrinterJob.lookupPrintServices().length == 0) { + throw new RuntimeException("Printer not configured or available."); + } + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .splitUIBottom(SecurityDialogTest::createTestUI) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(45) + .build(); - public static void main ( String args[] ) { - - String[] instructions = - { - "You must have a printer available to perform this test.", - "This test brings up a native and cross-platform page and", - "print dialogs.", - "The dialogs should be displayed even when ", - "there is no queuePrintJob permission.", - "If the dialog has an option to save to file, the option ought", - "to be disabled if there is no read/write file permission.", - "You should test this by trying different policy files." - }; - - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); + displayDialogs(); - SecurityDialogTest pjc = new SecurityDialogTest() ; + passFailJFrame.awaitAndCheck(); } + private static JComponent createTestUI() { + dialogType = new JLabel(" "); - public SecurityDialogTest() { - - PrinterJob pj = PrinterJob.getPrinterJob() ; + Box main = Box.createVerticalBox(); + main.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + main.add(new JLabel("Current Dialog:")); + main.add(Box.createVerticalStrut(4)); + main.add(dialogType); + return main; + } - // Install a security manager which does not allow reading and - // writing of files. - //PrintTestSecurityManager ptsm = new PrintTestSecurityManager(); - SecurityManager ptsm = new SecurityManager(); - - try { - System.setSecurityManager(ptsm); - } catch (SecurityException e) { - System.out.println("Could not run test - security exception"); - } - - try { - PrintJob pjob = Toolkit.getDefaultToolkit().getPrintJob(new Frame(), "Printing", null, null); - Sysout.println("If the value of pjob is null, the test fails.\n"); - Sysout.println(" pjob = "+pjob); - } catch (SecurityException e) { - } - - PrintService[] services = PrinterJob.lookupPrintServices(); - for (int i=0; i 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); + private static void setDialogType(String type) + throws InterruptedException, InvocationTargetException { + SwingUtilities.invokeAndWait(() -> dialogType.setText(type)); } - - }// TestDialog class +} \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,6 +24,8 @@ import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; @@ -43,16 +45,19 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.Locale; import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.imageio.ImageIO; +import javax.swing.Box; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; @@ -66,24 +71,88 @@ import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.Timer; +import javax.swing.border.Border; import javax.swing.text.JTextComponent; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.StyleSheet; import static java.util.Collections.unmodifiableList; +import static javax.swing.BorderFactory.createEmptyBorder; import static javax.swing.SwingUtilities.invokeAndWait; import static javax.swing.SwingUtilities.isEventDispatchThread; /** - * Provides a framework for manual tests to display test instructions and - * Pass/Fail buttons. + * A framework for manual tests to display test instructions and + * Pass / Fail buttons. The framework automatically + * creates a frame to display the instructions, provides buttons + * to select the test result, and handles test timeout. + * + *

    + * The instruction UI frame displays a timer at the top which indicates + * how much time is left. The timer can be paused using the Pause + * button to the right of the time; the title of the button changes to + * Resume. To resume the timer, use the Resume button. + * + *

    + * In the center, the instruction UI frame displays instructions for the + * tester. The instructions can be either plain text or HTML. If the + * text of the instructions starts with {@code ""}, the + * instructions are displayed as HTML, as supported by Swing, which + * provides richer formatting options. + *

    + * The instructions are displayed in a text component with word-wrapping + * so that there's no horizontal scroll bar. If the text doesn't fit, a + * vertical scroll bar is shown. Use {@code rows} and {@code columns} + * parameters to change the size of this text component. + * If possible, choose the number of rows and columns so that + * the instructions fit and no scroll bars are shown. + * + *

    + * At the bottom, the instruction UI frame displays the + * Pass and Fail buttons. The tester clicks either Pass + * or Fail button to finish the test. When the tester clicks the + * Fail button, the framework displays a dialog box prompting for + * a reason why the test fails. The tester enters the reason and clicks + * OK to close the dialog and fail the test, + * or simply closes the dialog to fail the test without providing any reason. + * + *

    + * If you enable the screenshot feature, a Screenshot button is + * added to the right of the Fail button. The tester can choose either + * Capture Full Screen (default) or Capture Frames and click the + * Screenshot button to take a screenshot. + * If there are multiple screens, screenshots of each screen are created. + * If the tester selects the Capture Frames mode, screenshots of all + * the windows or frames registered in the {@code PassFailJFrame} framework + * are created. + * + *

    + * If you enable a log area, the instruction UI frame adds a text component + * to display log messages below the buttons. + * Use {@link #log(String) log}, {@link #logSet(String) logSet} + * and {@link #logClear() logClear} static methods of {@code PassFailJFrame} + * to add or clear messages from the log area. + * + *

    + * After you create an instance of {@code PassFailJFrame}, call the + * {@link #awaitAndCheck() awaitAndCheck} method to stop the current thread + * (usually the main thread) and wait until the tester clicks + * either Pass or Fail button, + * or until the test times out. *

    - * Instructions for the user can be either plain text or HTML as supported - * by Swing. If the instructions start with {@code }, the - * instructions are displayed as HTML. + * The call to the {@code awaitAndCheck} method is usually the last + * statement in the {@code main} method of your test. + * If the test fails, an exception is thrown to signal the failure to jtreg. + * The test fails if the tester clicks the Fail button, + * if the timeout occurs, + * or if any window or frame is closed. *

    + * Before returning from {@code awaitAndCheck}, the framework disposes of + * all the windows and frames. + * + *

    Sample Manual Test

    * A simple test would look like this: - *
    {@code
    + * {@snippet id='sampleManualTestCode' lang='java':
      * public class SampleManualTest {
      *     private static final String INSTRUCTIONS =
      *             "Click Pass, or click Fail if the test failed.";
    @@ -91,7 +160,7 @@
      *     public static void main(String[] args) throws Exception {
      *         PassFailJFrame.builder()
      *                       .instructions(INSTRUCTIONS)
    - *                       .testUI(() -> createTestUI())
    + *                       .testUI(SampleManualTest::createTestUI)
      *                       .build()
      *                       .awaitAndCheck();
      *     }
    @@ -102,39 +171,87 @@
      *         return testUI;
      *     }
      * }
    - * }
    + * } *

    - * The above example uses the {@link Builder Builder} to set the parameters of - * the instruction frame. It is the recommended way. + * The above example uses the {@link Builder Builder} class to set + * the parameters of the instruction frame. + * It is the recommended way. + * *

    - * The framework will create instruction UI, it will call - * the provided {@code createTestUI} on the Event Dispatch Thread (EDT), - * and it will automatically position the test UI and make it visible. + * The framework will create an instruction UI frame, it will call + * the provided {@code createTestUI} on the Event Dispatch Thread (EDT), + * and it will automatically position the test UI frame and make it visible. + * + *

    + * Add the following jtreg tags before the test class declaration + * {@snippet : + * /* + * * @test + * * @summary Sample manual test + * * @library /java/awt/regtesthelpers + * * @build PassFailJFrame + * * @run main/manual SampleManualTest + * } + * and the closing comment tag */. *

    + * The {@code @library} tag points to the location of the + * {@code PassFailJFrame} class in the source code; + * the {@code @build} tag makes jtreg compile the {@code PassFailJFrame} class, + * and finally the {@code @run} tag specifies it is a manual + * test and the class to run. + * + *

    Using {@code Builder}

    + * Use methods of the {@link Builder Builder} class to set or change + * parameters of {@code PassFailJFrame} and its instruction UI: + *
      + *
    • {@link Builder#title(String) title} sets + * the title of the instruction UI + * (the default is {@value #TITLE});
    • + *
    • {@link Builder#testTimeOut(long) testTimeOut} sets + * the timeout of the test + * (the default is {@value #TEST_TIMEOUT});
    • + *
    • {@link Builder#rows(int) rows} and + * {@link Builder#columns(int) columns} control the size + * the text component which displays the instructions + * (the default number of rows is the number of lines in the text + * of the instructions, + * the default number of columns is {@value #COLUMNS});
    • + *
    • {@link Builder#logArea() logArea} adds a log area;
    • + *
    • {@link Builder#screenCapture() screenCapture} + * enables screenshots.
    • + *
    + * + *

    Using {@code testUI} and {@code splitUI}

    * The {@code Builder.testUI} methods accept interfaces which create one window * or a list of windows if the test needs multiple windows, * or directly a single window, an array of windows or a list of windows. *

    - * For simple test UI, use {@code Builder.splitUI}, or explicitly - * {@code Builder.splitUIRight} or {@code Builder.splitUIBottom} with - * a {@code PanelCreator}. The framework will call the provided - * {@code createUIPanel} to create the component with test UI and + * For simple test UI, use {@link Builder#splitUI(PanelCreator) splitUI}, + * or explicitly + * {@link Builder#splitUIRight(PanelCreator) splitUIRight} or + * {@link Builder#splitUIBottom(PanelCreator) splitUIBottom} with + * a {@link PanelCreator PanelCreator}. + * The framework will call the provided + * {@code createUIPanel} method to create the component with test UI and * will place it as the right or bottom component in a split pane * along with instruction UI. *

    + * Note: support for multiple windows is incomplete. + * + *

    Obsolete Sample Test

    * Alternatively, use one of the {@code PassFailJFrame} constructors to * create an object, then create secondary test UI, register it * with {@code PassFailJFrame}, position it and make it visible. * The following sample demonstrates it: - *
    {@code
    - * public class SampleOldManualTest {
    + * {@snippet id='obsoleteSampleTestCode' lang='java':
    + * public class ObsoleteManualTest {
      *     private static final String INSTRUCTIONS =
      *             "Click Pass, or click Fail if the test failed.";
      *
      *     public static void main(String[] args) throws Exception {
      *         PassFailJFrame passFail = new PassFailJFrame(INSTRUCTIONS);
      *
    - *         SwingUtilities.invokeAndWait(() -> createTestUI());
    + *         SwingUtilities.invokeAndWait(ObsoleteManualTest::createTestUI);
      *
      *         passFail.awaitAndCheck();
      *     }
    @@ -147,30 +264,54 @@
      *         testUI.setVisible(true);
      *     }
      * }
    - * }
    + * } *

    - * Use methods of the {@code Builder} class or constructors of the - * {@code PassFailJFrame} class to control other parameters: - *

      - *
    • the title of the instruction UI,
    • - *
    • the timeout of the test,
    • - *
    • the size of the instruction UI via rows and columns, and
    • - *
    • to enable screenshots.
    • - *
    + * This sample uses {@link #PassFailJFrame(String) a constructor} of + * {@code PassFailJFrame} to create its instance, + * there are several overloads provided which allow changing other parameters. + *

    + * When you use the constructors, you have to explicitly create + * your test UI window on EDT. After you create the window, + * you need to register it with the framework using + * {@link #addTestWindow(Window) addTestWindow} + * to ensure the window is disposed of when the test completes. + * Before showing the window, you have to call + * {@link #positionTestWindow(Window, Position) positionTestWindow} + * to position the test window near the instruction UI frame provided + * by the framework. And finally you have to explicitly show the test UI + * window by calling {@code setVisible(true)}. + *

    + * To avoid the complexity, use the {@link Builder Builder} class + * which provides a streamlined way to configure and create an + * instance of {@code PassFailJFrame}. + *

    + * Consider updating tests which use {@code PassFailJFrame} constructors to + * use the builder pattern. */ public final class PassFailJFrame { - private static final String TITLE = "Test Instruction Frame"; + /** A default title for the instruction frame. */ + private static final String TITLE = "Test Instructions"; + + /** A default test timeout. */ private static final long TEST_TIMEOUT = 5; + + /** A default number of rows for displaying the test instructions. */ private static final int ROWS = 10; + /** A default number of columns for displaying the test instructions. */ private static final int COLUMNS = 40; /** + * A gap between windows. + */ + public static final int WINDOW_GAP = 8; + + /** * Prefix for the user-provided failure reason. */ private static final String FAILURE_REASON = "Failure Reason:\n"; /** - * The failure reason message when the user didn't provide one. + * The failure reason message when the user doesn't provide one. */ private static final String EMPTY_REASON = "(no reason provided)"; @@ -186,7 +327,7 @@ private static final CountDownLatch latch = new CountDownLatch(1); - private static TimeoutHandler timeoutHandler; + private static TimeoutHandlerPanel timeoutHandlerPanel; /** * The description of why the test fails. @@ -204,92 +345,176 @@ private static Robot robot; + private static JTextArea logArea; + public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER} - public PassFailJFrame(String instructions) throws InterruptedException, - InvocationTargetException { + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons with the given instructions, and + * the default timeout of {@value #TEST_TIMEOUT} minutes, + * the default title of {@value #TITLE} and + * the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + *

    + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param instructions the instructions for the tester + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ + public PassFailJFrame(String instructions) + throws InterruptedException, InvocationTargetException { this(instructions, TEST_TIMEOUT); } - public PassFailJFrame(String instructions, long testTimeOut) throws - InterruptedException, InvocationTargetException { + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given instructions and timeout as well as + * the default title of {@value #TITLE} + * and the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + *

    + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ + public PassFailJFrame(String instructions, long testTimeOut) + throws InterruptedException, InvocationTargetException { this(TITLE, instructions, testTimeOut); } + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given title, instructions and timeout as well as + * the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + * The screenshot feature is not enabled, if you use this constructor. + *

    + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ public PassFailJFrame(String title, String instructions, - long testTimeOut) throws InterruptedException, - InvocationTargetException { + long testTimeOut) + throws InterruptedException, InvocationTargetException { this(title, instructions, testTimeOut, ROWS, COLUMNS); } /** - * Constructs a JFrame with a given title & serves as test instructional - * frame where the user follows the specified test instruction in order - * to test the test case & mark the test pass or fail. If the expected - * result is seen then the user click on the 'Pass' button else click - * on the 'Fail' button and the reason for the failure should be - * specified in the JDialog JTextArea. - * - * @param title title of the Frame. - * @param instructions the instruction for the tester on how to test - * and what is expected (pass) and what is not - * expected (fail). - * @param testTimeOut test timeout where time is specified in minutes. - * @param rows number of visible rows of the JTextArea where the - * instruction is show. - * @param columns Number of columns of the instructional - * JTextArea - * @throws InterruptedException exception thrown when thread is - * interrupted + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given title, instructions, timeout, number of rows and columns. + * The screenshot feature is not enabled, if you use this constructor. + *

    + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * @param rows the number of rows for the text component + * which displays test instructions + * @param columns the number of columns for the text component + * which displays test instructions + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components * @throws InvocationTargetException if an exception is thrown while - * creating the test instruction frame on - * EDT + * creating UI components on EDT */ - public PassFailJFrame(String title, String instructions, long testTimeOut, - int rows, int columns) throws InterruptedException, - InvocationTargetException { + public PassFailJFrame(String title, String instructions, + long testTimeOut, + int rows, int columns) + throws InterruptedException, InvocationTargetException { this(title, instructions, testTimeOut, rows, columns, false); } /** - * Constructs a JFrame with a given title & serves as test instructional - * frame where the user follows the specified test instruction in order - * to test the test case & mark the test pass or fail. If the expected - * result is seen then the user click on the 'Pass' button else click - * on the 'Fail' button and the reason for the failure should be - * specified in the JDialog JTextArea. + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * as well as supporting UI components with the given title, instructions, + * timeout, number of rows and columns, + * and screen capture functionality. + * All the UI components are created on the EDT, so it is safe to call + * the constructor on the main thread. *

    - * The test instruction frame also provides a way for the tester to take - * a screenshot (full screen or individual frame) if this feature - * is enabled by passing {@code true} as {@code enableScreenCapture} - * parameter. - * - * @param title title of the Frame. - * @param instructions the instruction for the tester on how to test - * and what is expected (pass) and what is not - * expected (fail). - * @param testTimeOut test timeout where time is specified in minutes. - * @param rows number of visible rows of the JTextArea where the - * instruction is show. - * @param columns Number of columns of the instructional - * JTextArea - * @param enableScreenCapture if set to true, 'Capture Screen' button & its - * associated UIs are added to test instruction - * frame - * @throws InterruptedException exception thrown when thread is - * interrupted + * After you create a test UI window, register the window using + * {@link #addTestWindow(Window) addTestWindow} for disposal, and + * position it close to the instruction frame using + * {@link #positionTestWindow(Window, Position) positionTestWindow}. + * As the last step, make your test UI window visible. + *

    + * Call the {@link #awaitAndCheck() awaitAndCheck} method on the instance + * of {@code PassFailJFrame} when you set up the testing environment. + *

    + * If the tester clicks the Fail button, a dialog prompting for + * a description of the problem is displayed, and then an exception + * is thrown which fails the test. + * If the tester clicks the Pass button, the test completes + * successfully. + * If the timeout occurs or the instruction frame is closed, + * the test fails. + *

    + * The {@code rows} and {@code columns} parameters control + * the size of a text component which displays the instructions. + * The preferred size of the instructions is calculated by + * creating {@code new JTextArea(rows, columns)}. + *

    + * If you enable screenshots by setting the {@code screenCapture} + * parameter to {@code true}, a Screenshot button is added. + * Clicking the Screenshot button takes screenshots of + * all the monitors or all the windows registered with + * {@code PassFailJFrame}. + * + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * @param rows the number of rows for the text component + * which displays test instructions + * @param columns the number of columns for the text component + * which displays test instructions + * @param screenCapture if set to {@code true}, enables screen capture + * functionality + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components * @throws InvocationTargetException if an exception is thrown while - * creating the test instruction frame on - * EDT + * creating UI components on EDT + * + * @see JTextArea#JTextArea(int,int) JTextArea(int rows, int columns) + * @see Builder Builder */ - public PassFailJFrame(String title, String instructions, long testTimeOut, + public PassFailJFrame(String title, String instructions, + long testTimeOut, int rows, int columns, - boolean enableScreenCapture) + boolean screenCapture) throws InterruptedException, InvocationTargetException { invokeOnEDT(() -> createUI(title, instructions, testTimeOut, rows, columns, - enableScreenCapture)); + screenCapture)); } /** @@ -342,11 +567,9 @@ builder.positionWindows .positionTestWindows(unmodifiableList(builder.testWindows), builder.instructionUIHandler)); - } else if (builder.testWindows.size() == 1) { + } else { Window window = builder.testWindows.get(0); positionTestWindow(window, builder.position); - } else { - positionTestWindow(null, builder.position); } } showAllWindows(); @@ -373,6 +596,20 @@ } } + /** + * Does the same as {@link #invokeOnEDT(Runnable)}, but does not throw + * any checked exceptions. + * + * @param doRun an operation to run on EDT + */ + private static void invokeOnEDTUncheckedException(Runnable doRun) { + try { + invokeOnEDT(doRun); + } catch (InterruptedException | InvocationTargetException e) { + throw new RuntimeException(e); + } + } + private static void createUI(String title, String instructions, long testTimeOut, int rows, int columns, boolean enableScreenCapture) { @@ -384,7 +621,8 @@ frame.add(createInstructionUIPanel(instructions, testTimeOut, rows, columns, - enableScreenCapture), + enableScreenCapture, + false, 0), BorderLayout.CENTER); frame.pack(); frame.setLocationRelativeTo(null); @@ -401,8 +639,9 @@ createInstructionUIPanel(builder.instructions, builder.testTimeOut, builder.rows, builder.columns, - builder.screenCapture); - + builder.screenCapture, + builder.addLogArea, + builder.logAreaRows); if (builder.splitUI) { JSplitPane splitPane = new JSplitPane( builder.splitUIOrientation, @@ -421,33 +660,40 @@ private static JComponent createInstructionUIPanel(String instructions, long testTimeOut, int rows, int columns, - boolean enableScreenCapture) { + boolean enableScreenCapture, + boolean addLogArea, + int logAreaRows) { JPanel main = new JPanel(new BorderLayout()); + main.setBorder(createFrameBorder()); - JLabel testTimeoutLabel = new JLabel("", JLabel.CENTER); - timeoutHandler = new TimeoutHandler(testTimeoutLabel, testTimeOut); - main.add(testTimeoutLabel, BorderLayout.NORTH); + timeoutHandlerPanel = new TimeoutHandlerPanel(testTimeOut); + main.add(timeoutHandlerPanel, BorderLayout.NORTH); JTextComponent text = instructions.startsWith("") ? configureHTML(instructions, rows, columns) : configurePlainText(instructions, rows, columns); text.setEditable(false); - main.add(new JScrollPane(text), BorderLayout.CENTER); + JPanel textPanel = new JPanel(new BorderLayout()); + textPanel.setBorder(createEmptyBorder(GAP, 0, GAP, 0)); + textPanel.add(new JScrollPane(text), BorderLayout.CENTER); + + main.add(textPanel, BorderLayout.CENTER); JButton btnPass = new JButton("Pass"); btnPass.addActionListener((e) -> { latch.countDown(); - timeoutHandler.stop(); + timeoutHandlerPanel.stop(); }); JButton btnFail = new JButton("Fail"); btnFail.addActionListener((e) -> { requestFailureReason(); - timeoutHandler.stop(); + timeoutHandlerPanel.stop(); }); - JPanel buttonsPanel = new JPanel(); + JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, + GAP, 0)); buttonsPanel.add(btnPass); buttonsPanel.add(btnFail); @@ -455,7 +701,22 @@ buttonsPanel.add(createCapturePanel()); } - main.add(buttonsPanel, BorderLayout.SOUTH); + if (addLogArea) { + logArea = new JTextArea(logAreaRows, columns); + logArea.setEditable(false); + logArea.setBorder(createTextBorder()); + + Box buttonsLogPanel = Box.createVerticalBox(); + + buttonsLogPanel.add(buttonsPanel); + buttonsLogPanel.add(Box.createVerticalStrut(GAP)); + buttonsLogPanel.add(new JScrollPane(logArea)); + + main.add(buttonsLogPanel, BorderLayout.SOUTH); + } else { + main.add(buttonsPanel, BorderLayout.SOUTH); + } + main.setMinimumSize(main.getPreferredSize()); return main; @@ -466,6 +727,7 @@ JTextArea text = new JTextArea(instructions, rows, columns); text.setLineWrap(true); text.setWrapStyleWord(true); + text.setBorder(createTextBorder()); return text; } @@ -487,6 +749,29 @@ return text; } + /** A default gap between components. */ + private static final int GAP = 4; + + /** + * Creates a default border for frames or dialogs. + * It uses the default gap of {@value GAP}. + * + * @return the border for frames and dialogs + */ + private static Border createFrameBorder() { + return createEmptyBorder(GAP, GAP, GAP, GAP); + } + + /** + * Creates a border set to text area. + * It uses the default gap of {@value GAP}. + * + * @return the border for text area + */ + private static Border createTextBorder() { + return createEmptyBorder(GAP, GAP, GAP, GAP); + } + /** * Creates a test UI window. @@ -552,7 +837,7 @@ * @param testWindows the list of test windows * @param instructionUI information about the instruction frame */ - void positionTestWindows(List testWindows, + void positionTestWindows(List testWindows, InstructionUI instructionUI); } @@ -602,17 +887,35 @@ } - private static final class TimeoutHandler implements ActionListener { - private final long endTime; + private static final class TimeoutHandlerPanel + extends JPanel + implements ActionListener { + + private static final String PAUSE_BUTTON_LABEL = "Pause"; + private static final String RESUME_BUTTON_LABEL = "Resume"; + + private long endTime; + private long pauseTimeLeft; private final Timer timer; private final JLabel label; + private final JButton button; - public TimeoutHandler(final JLabel label, final long testTimeOut) { - endTime = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(testTimeOut); - - this.label = label; + public TimeoutHandlerPanel(final long testTimeOut) { + endTime = System.currentTimeMillis() + + TimeUnit.MINUTES.toMillis(testTimeOut); + + label = new JLabel("", JLabel.CENTER); + button = new JButton(PAUSE_BUTTON_LABEL); + + button.setFocusPainted(false); + button.setFont(new Font(Font.DIALOG, Font.BOLD, 10)); + button.addActionListener(e -> pauseToggle()); + + setLayout(new BorderLayout()); + add(label, BorderLayout.CENTER); + add(button, BorderLayout.EAST); timer = new Timer(1000, this); timer.start(); @@ -639,10 +942,27 @@ long hours = leftTime / 3_600_000; long minutes = (leftTime - hours * 3_600_000) / 60_000; long seconds = (leftTime - hours * 3_600_000 - minutes * 60_000) / 1_000; - label.setText(String.format("Test timeout: %02d:%02d:%02d", + label.setText(String.format(Locale.ENGLISH, + "Test timeout: %02d:%02d:%02d", hours, minutes, seconds)); } + + private void pauseToggle() { + if (timer.isRunning()) { + pauseTimeLeft = endTime - System.currentTimeMillis(); + timer.stop(); + label.setEnabled(false); + button.setText(RESUME_BUTTON_LABEL); + } else { + endTime = System.currentTimeMillis() + pauseTimeLeft; + updateTime(pauseTimeLeft); + timer.start(); + label.setEnabled(true); + button.setText(PAUSE_BUTTON_LABEL); + } + } + public void stop() { timer.stop(); } @@ -665,7 +985,7 @@ private static JComponent createCapturePanel() { JComboBox screenShortType = new JComboBox<>(CaptureType.values()); - JButton capture = new JButton("ScreenShot"); + JButton capture = new JButton("Screenshot"); capture.addActionListener((e) -> captureScreen((CaptureType) screenShortType.getSelectedItem())); @@ -677,7 +997,7 @@ private enum CaptureType { FULL_SCREEN("Capture Full Screen"), - WINDOWS("Capture Individual Frame"); + WINDOWS("Capture Frames"); private final String type; CaptureType(String type) { @@ -803,26 +1123,30 @@ * Requests the description of the test failure reason from the tester. */ private static void requestFailureReason() { - final JDialog dialog = new JDialog(frame, "Test Failure ", true); - dialog.setTitle("Failure reason"); - JPanel jPanel = new JPanel(new BorderLayout()); - JTextArea jTextArea = new JTextArea(5, 20); + final JDialog dialog = new JDialog(frame, "Failure reason", true); + + JTextArea reason = new JTextArea(5, 20); + reason.setBorder(createTextBorder()); JButton okButton = new JButton("OK"); okButton.addActionListener((ae) -> { - String text = jTextArea.getText(); + String text = reason.getText(); setFailureReason(FAILURE_REASON + (!text.isEmpty() ? text : EMPTY_REASON)); dialog.setVisible(false); }); - jPanel.add(new JScrollPane(jTextArea), BorderLayout.CENTER); - - JPanel okayBtnPanel = new JPanel(); + JPanel okayBtnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, + GAP, 0)); + okayBtnPanel.setBorder(createEmptyBorder(GAP, 0, 0, 0)); okayBtnPanel.add(okButton); - jPanel.add(okayBtnPanel, BorderLayout.SOUTH); - dialog.add(jPanel); + JPanel main = new JPanel(new BorderLayout()); + main.setBorder(createFrameBorder()); + main.add(new JScrollPane(reason), BorderLayout.CENTER); + main.add(okayBtnPanel, BorderLayout.SOUTH); + + dialog.add(main); dialog.setLocationRelativeTo(frame); dialog.pack(); dialog.setVisible(true); @@ -855,13 +1179,13 @@ switch (position) { case HORIZONTAL: - int newX = ((screenSize.width / 2) - frame.getWidth()); + int newX = (((screenSize.width + WINDOW_GAP) / 2) - frame.getWidth()); frame.setLocation((newX + screenInsets.left), (frame.getY() + screenInsets.top)); break; case VERTICAL: - int newY = ((screenSize.height / 2) - frame.getHeight()); + int newY = (((screenSize.height + WINDOW_GAP) / 2) - frame.getHeight()); frame.setLocation((frame.getX() + screenInsets.left), (newY + screenInsets.top)); break; @@ -909,13 +1233,13 @@ switch (position) { case HORIZONTAL: case TOP_LEFT_CORNER: - testWindow.setLocation((frame.getX() + frame.getWidth() + 5), + testWindow.setLocation((frame.getX() + frame.getWidth() + WINDOW_GAP), frame.getY()); break; case VERTICAL: testWindow.setLocation(frame.getX(), - (frame.getY() + frame.getHeight() + 5)); + (frame.getY() + frame.getHeight() + WINDOW_GAP)); break; } } @@ -1039,6 +1363,40 @@ latch.countDown(); } + /** + * Adds a {@code message} to the log area, if enabled by + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. + * + * @param message the message to log + */ + public static void log(String message) { + System.out.println("PassFailJFrame: " + message); + invokeOnEDTUncheckedException(() -> logArea.append(message + "\n")); + } + + /** + * Clears the log area, if enabled by + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. + */ + public static void logClear() { + System.out.println("\nPassFailJFrame: log cleared\n"); + invokeOnEDTUncheckedException(() -> logArea.setText("")); + } + + /** + * Replaces the log area content with provided {@code text}, if enabled by + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. + * + * @param text new text for the log area + */ + public static void logSet(String text) { + System.out.println("\nPassFailJFrame: log set to:\n" + text + "\n"); + invokeOnEDTUncheckedException(() -> logArea.setText(text)); + } + public static final class Builder { private String title; private String instructions; @@ -1046,6 +1404,8 @@ private int rows; private int columns; private boolean screenCapture; + private boolean addLogArea; + private int logAreaRows = 10; private List testWindows; private WindowListCreator windowListCreator; @@ -1057,6 +1417,14 @@ private Position position; + /** + * A private constructor for the builder, + * it should not be created directly. + * Use {@code PassFailJFrame.builder()} method instead. + */ + private Builder() { + } + public Builder title(String title) { this.title = title; return this; @@ -1072,11 +1440,45 @@ return this; } + /** + * Sets the number of rows for displaying the instruction text. + * The default value is the number of lines in the text plus 1: + * {@code ((int) instructions.lines().count() + 1)}. + * + * @param rows the number of rows for instruction text + * @return this builder + */ public Builder rows(int rows) { this.rows = rows; return this; } + private int getDefaultRows() { + return (int) instructions.lines().count() + 1; + } + + /** + * Adds a certain number of rows for displaying the instruction text. + * + * @param rowsAdd the number of rows to add to the number of rows + * @return this builder + * @see #rows + */ + public Builder rowsAdd(int rowsAdd) { + if (rows == 0) { + rows = getDefaultRows(); + } + rows += rowsAdd; + + return this; + } + + /** + * Sets the number of columns for displaying the instruction text. + * + * @param columns the number of columns for instruction text + * @return this builder + */ public Builder columns(int columns) { this.columns = columns; return this; @@ -1088,6 +1490,37 @@ } /** + * Adds a log area below the "Pass", "Fail" buttons. + *

    + * The log area can be controlled by {@link #log(String)}, + * {@link #logClear()} and {@link #logSet(String)}. + * + * @return this builder + */ + public Builder logArea() { + this.addLogArea = true; + return this; + } + + /** + * Adds a log area below the "Pass", "Fail" buttons. + *

    + * The log area can be controlled by {@link #log(String)}, + * {@link #logClear()} and {@link #logSet(String)}. + *

    + * The number of columns is taken from the number of + * columns in the instructional JTextArea. + * + * @param rows of the log area + * @return this builder + */ + public Builder logArea(int rows) { + this.addLogArea = true; + this.logAreaRows = rows; + return this; + } + + /** * Adds a {@code WindowCreator} which the framework will use * to create the test UI window. * @@ -1109,6 +1542,101 @@ return this; } + + /** + * Adds an implementation of {@link PositionWindows PositionWindows} + * which the framework will use to position multiple test UI windows. + * + * @param positionWindows an implementation of {@code PositionWindows} + * to position multiple test UI windows + * @return this builder + * @throws IllegalArgumentException if the {@code positionWindows} + * parameter is {@code null} + * @throws IllegalStateException if the {@code positionWindows} field + * is already set + */ + public Builder positionTestUI(PositionWindows positionWindows) { + if (positionWindows == null) { + throw new IllegalArgumentException("positionWindows parameter can't be null"); + } + if (this.positionWindows != null) { + throw new IllegalStateException("PositionWindows is already set"); + } + this.positionWindows = positionWindows; + return this; + } + + /** + * Positions the test UI windows in a row to the right of + * the instruction frame. The top of the windows is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIRightRow() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneRow); + } + + /** + * Positions the test UI windows in a column to the right of + * the instruction frame. The top of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIRightColumn() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneColumn); + } + + /** + * Positions the test UI windows in a column to the right of + * the instruction frame centering the stack of the windows. + * + * @return this builder + */ + public Builder positionTestUIRightColumnCentered() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneColumnCentered); + } + + /** + * Positions the test UI windows in a row to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIBottomRow() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneRow); + } + + /** + * Positions the test UI windows in a row to the bottom of + * the instruction frame centering the row of the windows. + * + * @return this builder + */ + public Builder positionTestUIBottomRowCentered() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneRowCentered); + } + + /** + * Positions the test UI windows in a column to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIBottomColumn() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneColumn); + } + + /** * Adds a {@code WindowListCreator} which the framework will use * to create a list of test UI windows. @@ -1211,6 +1739,7 @@ return this; } + /** * Adds a {@code PanelCreator} which the framework will use * to create a component with test UI and display it in a split pane. @@ -1302,9 +1831,41 @@ return new PassFailJFrame(this); } + /** + * Returns the file name of the test, if the {@code test.file} property + * is defined, concatenated with {@code " - "} which serves as a prefix + * to the default instruction frame title; + * or an empty string if the {@code test.file} property is not defined. + * + * @return the prefix to the default title: + * either the file name of the test or an empty string + * + * @see jtreg + * test-specific system properties and environment variables + */ + private static String getTestFileNamePrefix() { + String testFile = System.getProperty("test.file"); + if (testFile == null) { + return ""; + } + + return Paths.get(testFile).getFileName().toString() + + " - "; + } + + /** + * Validates the state of the builder and + * expands parameters that have no assigned values + * to their default values. + * + * @throws IllegalStateException if no instructions are provided, + * or if {@code PositionWindows} implementation is + * provided but neither window creator nor + * test window list are set + */ private void validate() { if (title == null) { - title = TITLE; + title = getTestFileNamePrefix() + TITLE; } if (instructions == null || instructions.isEmpty()) { @@ -1317,7 +1878,7 @@ } if (rows == 0) { - rows = ROWS; + rows = getDefaultRows(); } if (columns == 0) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/awt/regtesthelpers/WindowLayouts.java openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/WindowLayouts.java --- openjdk-17-17.0.13+11/test/jdk/java/awt/regtesthelpers/WindowLayouts.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/awt/regtesthelpers/WindowLayouts.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2023, 2024, 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.Component; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Window; +import java.util.List; + +import static java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment; +import static java.awt.Toolkit.getDefaultToolkit; + +/** + * A utility class which provides standard window layouts for multi-window + * manual tests using the {@link PassFailJFrame} framework. + * The layout methods {@code right-} and {@code bottom-} implement the + * {@link PassFailJFrame.PositionWindows PositionWindows} interface and + * can be used directly or via builder methods. + *

    + * There are several helper methods, such as + * {@link #getScreenCenter() getScreenCenter}, which could help you + * implement customized windows layouts. + */ +public final class WindowLayouts { + + /** Private constructor to prevent instantiating the utility class. */ + private WindowLayouts() { + } + + /** A gap between windows. (Local copy makes expressions shorter.) */ + private static final int WINDOW_GAP = PassFailJFrame.WINDOW_GAP; + + /** + * Lays out the window list in one row to the right of + * the instruction frame. The top of the windows is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneRow(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + instructionUI.getLocation().y, + windows); + } + + /** + * Lays out the window list in one column to the right of + * the instruction frame. The top of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneColumn(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + instructionUI.getLocation().y, + windows); + } + + /** + * Lays out the window list in one column to the right of + * the instruction frame centering the stack of the windows. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneColumnCentered(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + getScreenCenter().y + - getWindowListHeight(windows) / 2, + windows); + } + + + /** + * Lays out the window list in one row to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneRow(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(instructionUI.getLocation().x, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + /** + * Lays out the window list in one row to the bottom of + * the instruction frame centering the row of the windows. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneRowCentered(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(getScreenCenter().x + - getWindowListWidth(windows) / 2, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + /** + * Lays out the window list in one column to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneColumn(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + + /** + * Lays out the window list in one row starting at + * ({@code x0}, {@code y}). + * + * @param x0 the starting x coordinate of the windows + * @param y the y coordinate of the windows + * @param windows the list of windows to lay out + */ + public static void layoutRow(final int x0, + final int y, + final List windows) { + int x = x0; + for (Window w : windows) { + w.setLocation(x, y); + x += w.getWidth() + WINDOW_GAP; + } + } + + /** + * Lays out the window list in one column starting at + * ({@code x}, {@code y0}). + * + * @param x the x coordinate of the windows + * @param y0 the starting y coordinate of the windows + * @param windows the list of windows to lay out + */ + public static void layoutColumn(final int x, + final int y0, + final List windows) { + int y = y0; + for (Window w : windows) { + w.setLocation(x, y); + y += w.getHeight() + WINDOW_GAP; + } + } + + + /** + * {@return the center point of the main screen} + */ + public static Point getScreenCenter() { + GraphicsConfiguration gc = getLocalGraphicsEnvironment() + .getDefaultScreenDevice() + .getDefaultConfiguration(); + Dimension size = gc.getBounds() + .getSize(); + Insets insets = getDefaultToolkit() + .getScreenInsets(gc); + + return new Point((size.width - insets.left - insets.right) / 2, + (size.height - insets.top - insets.bottom) / 2); + } + + /** + * {@return width of the windows in the list, taking into account + * the gap between windows} + * + * @param windows the list of windows to get the width of + */ + public static int getWindowListWidth(final List windows) { + return windows.stream() + .mapToInt(Component::getWidth) + .sum() + + WINDOW_GAP * (windows.size() - 1); + } + + /** + * {@return height of the windows in the list, taking into account + * the gap between windows} + * + * @param windows the list of windows to get the height of + */ + public static int getWindowListHeight(final List windows) { + return windows.stream() + .mapToInt(Component::getHeight) + .sum() + + WINDOW_GAP * (windows.size() - 1); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java openjdk-17-17.0.14+7/test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java --- openjdk-17-17.0.13+11/test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2023, 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 8071693 + * @summary Verify that the Introspector finds default methods inherited + * from interfaces + */ + +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Method; +import java.util.Collection; +import java.util.HashSet; +import java.util.NavigableSet; +import java.util.Set; +import java.util.stream.Collectors; + +public class DefaultMethodBeanPropertyTest { + +////////////////////////////////////// +// // +// SCENARIO 1 // +// // +////////////////////////////////////// + + public interface A1 { + default int getValue() { + return 0; + } + default Object getObj() { + return null; + } + + public static int getStaticValue() { + return 0; + } + } + + public interface B1 extends A1 { + } + + public interface C1 extends A1 { + Number getFoo(); + } + + public class D1 implements C1 { + @Override + public Integer getFoo() { + return null; + } + @Override + public Float getObj() { + return null; + } + } + + public static void testScenario1() { + verifyProperties(D1.class, + "getClass", // inherited method + "getValue", // inherited default method + "getFoo", // overridden interface method + "getObj" // overridden default method + ); + } + +////////////////////////////////////// +// // +// SCENARIO 2 // +// // +////////////////////////////////////// + + public interface A2 { + default Object getFoo() { + return null; + } + } + + public interface B2 extends A2 { + } + + public interface C2 extends A2 { + } + + public class D2 implements B2, C2 { + } + + public static void testScenario2() { + verifyProperties(D2.class, + "getClass", + "getFoo" + ); + } + +////////////////////////////////////// +// // +// SCENARIO 3 // +// // +////////////////////////////////////// + + public interface A3 { + default Object getFoo() { + return null; + } + } + + public interface B3 extends A3 { + @Override + Set getFoo(); + } + + public interface C3 extends A3 { + @Override + Collection getFoo(); + } + + public class D3 implements B3, C3 { + @Override + public NavigableSet getFoo() { + return null; + } + } + + public static void testScenario3() { + verifyProperties(D3.class, + "getClass", + "getFoo" + ); + } + +// Helper methods + + public static void verifyProperties(Class type, String... getterNames) { + + // Gather expected properties + final HashSet expected = new HashSet<>(); + for (String methodName : getterNames) { + final String suffix = methodName.substring(3); + final String propName = Introspector.decapitalize(suffix); + final Method getter; + try { + getter = type.getMethod(methodName); + } catch (NoSuchMethodException e) { + throw new Error("unexpected error", e); + } + final PropertyDescriptor propDesc; + try { + propDesc = new PropertyDescriptor(propName, getter, null); + } catch (IntrospectionException e) { + throw new Error("unexpected error", e); + } + expected.add(propDesc); + } + + // Verify properties can be found directly + expected.stream() + .map(PropertyDescriptor::getName) + .filter(name -> BeanUtils.getPropertyDescriptor(type, name) == null) + .findFirst() + .ifPresent(name -> { + throw new Error("property \"" + name + "\" not found in " + type); + }); + + // Gather actual properties + final Set actual = + Set.of(BeanUtils.getPropertyDescriptors(type)); + + // Verify the two sets are the same + if (!actual.equals(expected)) { + throw new Error("mismatch: " + type + + "\nACTUAL:\n " + + actual.stream() + .map(Object::toString) + .collect(Collectors.joining("\n ")) + + "\nEXPECTED:\n " + + expected.stream() + .map(Object::toString) + .collect(Collectors.joining("\n "))); + } + } + +// Main method + + public static void main(String[] args) throws Exception { + testScenario1(); + testScenario2(); + testScenario3(); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/File/CheckPermission.java openjdk-17-17.0.14+7/test/jdk/java/io/File/CheckPermission.java --- openjdk-17-17.0.13+11/test/jdk/java/io/File/CheckPermission.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/File/CheckPermission.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -362,13 +362,13 @@ "getFileSystemAttributes"); prepare(); - File tmpFile = File.createTempFile(CHECK_PERMISSION_TEST, null); + File tmpFile = File.createTempFile(CHECK_PERMISSION_TEST, null, new File(".")); assertOnlyCheckOperation(tmpFile, EnumSet.of(FileOperation.WRITE)); tmpFile.delete(); assertCheckOperation(tmpFile, EnumSet.of(FileOperation.DELETE)); prepare(); - tmpFile = File.createTempFile(CHECK_PERMISSION_TEST, null, null); + tmpFile = File.createTempFile(CHECK_PERMISSION_TEST, null, new File(".")); assertOnlyCheckOperation(tmpFile, EnumSet.of(FileOperation.WRITE)); tmpFile.delete(); assertCheckOperation(tmpFile, EnumSet.of(FileOperation.DELETE)); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/File/MacPath.java openjdk-17-17.0.14+7/test/jdk/java/io/File/MacPath.java --- openjdk-17-17.0.13+11/test/jdk/java/io/File/MacPath.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/File/MacPath.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class MacPath { public static void main(String args[]) throws Exception { final ProcessBuilder pb = - ProcessTools.createTestJvm(MacPathTest.class.getName()); + ProcessTools.createTestJavaProcessBuilder(MacPathTest.class.getName()); final Map env = pb.environment(); env.put("LC_ALL", "en_US.UTF-8"); Process p = ProcessTools.startProcess("Mac Path Test", pb); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/FileInputStream/NegativeAvailable.java openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/NegativeAvailable.java --- openjdk-17-17.0.13+11/test/jdk/java/io/FileInputStream/NegativeAvailable.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/NegativeAvailable.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,28 +46,31 @@ // Create a temporary file with size of 10 bytes. Path tmp = Files.createTempFile(null, null); - try (BufferedWriter writer = - Files.newBufferedWriter(tmp, Charset.defaultCharset())) { - for (int i = 0; i < SIZE; i++) { - writer.write('1'); + try { + try (BufferedWriter writer = + Files.newBufferedWriter(tmp, Charset.defaultCharset())) { + for (int i = 0; i < SIZE; i++) { + writer.write('1'); + } } - } - File tempFile = tmp.toFile(); - try (FileInputStream fis = new FileInputStream(tempFile)) { - if (tempFile.length() != SIZE) { - throw new RuntimeException("unexpected file size = " - + tempFile.length()); + File tempFile = tmp.toFile(); + try (FileInputStream fis = new FileInputStream(tempFile)) { + if (tempFile.length() != SIZE) { + throw new RuntimeException("unexpected file size = " + + tempFile.length()); + } + long space = skipBytes(fis, SKIP, SIZE); + space = skipBytes(fis, NEGATIVE_SKIP, space); + space = skipBytes(fis, SKIP, space); + space = skipBytes(fis, SKIP, space); + space = skipBytes(fis, SKIP, space); + space = skipBytes(fis, NEGATIVE_SKIP, space); + space = skipBytes(fis, NEGATIVE_SKIP, space); } - long space = skipBytes(fis, SKIP, SIZE); - space = skipBytes(fis, NEGATIVE_SKIP, space); - space = skipBytes(fis, SKIP, space); - space = skipBytes(fis, SKIP, space); - space = skipBytes(fis, SKIP, space); - space = skipBytes(fis, NEGATIVE_SKIP, space); - space = skipBytes(fis, NEGATIVE_SKIP, space); + } finally { + Files.deleteIfExists(tmp); } - Files.deleteIfExists(tmp); } /** diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/FileInputStream/ReadXBytes.java openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/ReadXBytes.java --- openjdk-17-17.0.13+11/test/jdk/java/io/FileInputStream/ReadXBytes.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/FileInputStream/ReadXBytes.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ private static final Random RND = RandomFactory.getRandom(); public static void main(String args[]) throws IOException { - File dir = new File(System.getProperty("test.src", ".")); + File dir = new File("."); dir.deleteOnExit(); File empty = File.createTempFile("foo", "bar", dir); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/InputStreamReader/ReadCharBuffer.java openjdk-17-17.0.14+7/test/jdk/java/io/InputStreamReader/ReadCharBuffer.java --- openjdk-17-17.0.13+11/test/jdk/java/io/InputStreamReader/ReadCharBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/InputStreamReader/ReadCharBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2022, 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 4926314 + * @bug 4926314 8287003 * @summary Test for InputStreamReader#read(CharBuffer). * @run testng ReadCharBuffer */ @@ -38,9 +38,11 @@ import java.io.Reader; import java.nio.ByteBuffer; import java.nio.CharBuffer; +import java.nio.charset.CodingErrorAction; import java.util.Arrays; import static java.nio.charset.StandardCharsets.US_ASCII; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.testng.Assert.assertEquals; public class ReadCharBuffer { @@ -56,6 +58,13 @@ }; } + private void fillBuffer(CharBuffer buffer) { + char[] filler = new char[BUFFER_SIZE]; + Arrays.fill(filler, 'x'); + buffer.put(filler); + buffer.clear(); + } + @Test(dataProvider = "buffers") public void read(CharBuffer buffer) throws IOException { fillBuffer(buffer); @@ -78,11 +87,19 @@ assertEquals(buffer.toString(), "xABCDEFxGHIJKLMNxxxxxxxx"); } - private void fillBuffer(CharBuffer buffer) { - char[] filler = new char[BUFFER_SIZE]; - Arrays.fill(filler, 'x'); - buffer.put(filler); - buffer.clear(); + @Test + public void readLeftover() throws IOException { + byte[] b = new byte[] {'a', 'b', (byte) 0xC2}; + ByteArrayInputStream bais = new ByteArrayInputStream(b); + InputStreamReader r = new InputStreamReader(bais, + UTF_8.newDecoder().onMalformedInput(CodingErrorAction.IGNORE)); + int n = r.read(); + assertEquals((char)n, 'a'); + char[] c = new char[3]; + n = r.read(c, 0, 3); + assertEquals(n, 1); + assertEquals((char)c[0], 'b'); + n = r.read(); + assertEquals(n, -1); } - } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/Serializable/class/NonSerializableTest.java openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/class/NonSerializableTest.java --- openjdk-17-17.0.13+11/test/jdk/java/io/Serializable/class/NonSerializableTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/class/NonSerializableTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -102,7 +102,7 @@ Paths.get(System.getProperty("user.dir"))); assertTrue(b, "Compilation failed"); String params[] = Arrays.copyOfRange(args, 1, args.length); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(params); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(params); Process p = ProcessTools.startProcess("Serializable Test", pb); int exitValue = p.waitFor(); assertEquals(exitValue, 0, "Test failed"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java --- openjdk-17-17.0.13+11/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -81,7 +81,7 @@ } private static void runTestSerialDriver() throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-classpath", SHARE.toString() + File.pathSeparator @@ -93,7 +93,7 @@ } private static void runInstallSerialDriver() throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-classpath", SHARE.toString() + File.pathSeparator diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,8 +24,9 @@ import java.io.FilePermission; import java.io.IOException; import java.io.UncheckedIOException; +import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.AccessibleObject; +import java.lang.module.ModuleReference; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.lang.reflect.InaccessibleObjectException; @@ -43,22 +44,25 @@ import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; +import java.util.Deque; import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.PropertyPermission; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; -import java.util.stream.Stream; import jdk.internal.module.Modules; /** * @test - * @bug 8065552 + * @bug 8065552 8309532 * @summary test that all public fields returned by getDeclaredFields() can * be set accessible if the right permission is granted; this test * loads all classes and get their declared fields @@ -283,18 +287,64 @@ } /* - * Filter deployment modules + * Filter JVMCI module and its transitive dependences */ static Set systemModules() { - Set mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws", - // All JVMCI packages other than jdk.vm.ci.services are dynamically - // exported to jdk.internal.vm.compiler - "jdk.internal.vm.compiler" + // Build module graph and inverse dependences + Set modules = new HashSet<>(); + Map> moduleToDeps = new HashMap<>(); + Map> inverseDeps = new HashMap<>(); + for (ModuleReference mref : ModuleFinder.ofSystem().findAll()) { + var md = mref.descriptor(); + modules.add(md.name()); + Set deps = md.requires().stream().map(ModuleDescriptor.Requires::name) + .collect(Collectors.toSet()); + moduleToDeps.put(md.name(), deps); + inverseDeps.put(md.name(), new HashSet<>()); + } + + // reverse edges + moduleToDeps.keySet().forEach(u -> { + moduleToDeps.get(u) + .forEach(v -> inverseDeps.get(v) + .add(u)); + }); + + Set mods = Set.of( + // All JVMCI packages other than jdk.vm.ci.services are dynamically + // exported to jdk.internal.vm.compiler + "jdk.internal.vm.compiler", "jdk.internal.vm.compiler.management" ); - return ModuleFinder.ofSystem().findAll().stream() - .map(mref -> mref.descriptor().name()) - .filter(mn -> !mods.contains(mn)) - .collect(Collectors.toSet()); + // Filters all modules that directly or indirectly require jdk.internal.vm.compiler + // and jdk.internal.vm.compiler.management, as these are upgradeable and + // also provide APIs to add qualified exports dynamically + Set filters = mods.stream().flatMap(mn -> findDeps(mn, inverseDeps).stream()) + .collect(Collectors.toSet()); + System.out.println("Filtered modules: " + filters); + return modules.stream() + .filter(mn -> !filters.contains(mn)) + .collect(Collectors.toSet()); + } + + /* + * Traverse the graph to find all the dependences from the given name. + */ + static Set findDeps(String name, Map> graph) { + Set visited = new HashSet<>(); + Deque deque = new LinkedList<>(); + deque.add(name); + String node; + while (!deque.isEmpty()) { + node = deque.pop(); + if (visited.contains(node)) + continue; + + visited.add(node); + Set deps = graph.get(node); + if (deps != null) + deque.addAll(deps); + } + return visited; } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ClassLoader/GetSystemPackage.java openjdk-17-17.0.14+7/test/jdk/java/lang/ClassLoader/GetSystemPackage.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ClassLoader/GetSystemPackage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ClassLoader/GetSystemPackage.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -118,7 +118,7 @@ private static void runSubProcess(String messageOnError, String ... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); int res = pb.directory(tmpFolder).inheritIO().start().waitFor(); if (res != 0) { throw new RuntimeException(messageOnError); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/Basic.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/Basic.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/Basic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/Basic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ * @summary Basic tests for Process and Environment Variable code * @modules java.base/java.lang:open * @requires !vm.musl + * @requires vm.flagless * @library /test/lib * @run main/othervm/native/timeout=300 -Djava.security.manager=allow Basic * @run main/othervm/native/timeout=300 -Djava.security.manager=allow -Djdk.lang.Process.launchMechanism=fork Basic diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 * @bug 8023130 8166026 * @summary Unit test for java.lang.ProcessBuilder inheritance of standard output and standard error streams + * @requires vm.flagless * @library /test/lib * @build jdk.test.lib.process.* * @run testng InheritIOTest @@ -54,7 +55,7 @@ @Test(dataProvider = "testCases") public void testInheritWithoutRedirect(List arguments) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(0); assertEquals(outputAnalyzer.getStdout(), EXPECTED_RESULT_STDOUT); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java 2025-01-04 20:25:18.000000000 +0000 @@ -27,6 +27,7 @@ * @bug 8307990 * @requires (os.family == "linux") | (os.family == "aix") | (os.family == "mac") * @requires vm.debug + * @requires vm.flagless * @library /test/lib * @run main/othervm/timeout=300 JspawnhelperProtocol */ @@ -78,9 +79,9 @@ private static void normalExec() throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "normalExec"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "normalExec"); pb.inheritIO(); Process p = pb.start(); if (!p.waitFor(TIMEOUT, TimeUnit.SECONDS)) { @@ -93,9 +94,9 @@ private static void simulateCrashInChild(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateCrashInChild" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateCrashInChild" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); @@ -126,9 +127,9 @@ private static void simulateCrashInParent(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateCrashInParent" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateCrashInParent" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); @@ -172,9 +173,9 @@ private static void simulateTruncatedWriteInParent(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateTruncatedWriteInParent" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateTruncatedWriteInParent" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,7 @@ /* * @test + * @requires vm.flagless * @library /test/lib * @build jdk.test.lib.process.ProcessTools jdk.test.lib.hexdump.HexPrinter * @run testng ReaderWriterTest @@ -82,7 +83,7 @@ Charset cs = Charset.forName(nativeEncoding); System.out.println("Native.encoding Charset: " + cs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); writeTestChars(p.outputWriter()); checkReader(p.inputReader(), cs, "Out"); @@ -121,7 +122,7 @@ // 2: redirectErrorStream(true); no redirect of errorOutput // 3: redirectErrorStream(true); redirect of errorOutput to a file - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); pb.redirectInput(inPath.toFile()); pb.redirectOutput(outPath.toFile()); if (errType == 1 || errType == 3) { @@ -191,7 +192,7 @@ } String cleanCSName = cleanCharsetName(cs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.stdout.encoding=" + cleanCSName, // Encode in the child using the charset "-Dsun.stderr.encoding=" + cleanCSName, "ReaderWriterTest$ChildWithCharset"); @@ -217,7 +218,7 @@ @Test void testNullCharsets() throws IOException { // Launch a child; its behavior is not interesting and is ignored - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); @@ -263,7 +264,7 @@ : StandardCharsets.UTF_8; // Launch a child; its behavior is not interesting and is ignored - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/SkipTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/SkipTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessBuilder/SkipTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessBuilder/SkipTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +24,7 @@ /* * @test * @bug 8155808 + * @requires vm.flagless * @run main SkipTest * @summary verify skip method of Process Input Stream */ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessHandle/OnExitTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/OnExitTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessHandle/OnExitTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/OnExitTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ /* * @test + * @requires vm.flagless * @library /test/lib * @modules jdk.management * @build jdk.test.lib.Utils @@ -95,6 +96,24 @@ */ @Test public static void test2() { + + // Please note (JDK-8284282): + // + // On Unix, this test relies on the ability of the system to adopt orphaned processes and + // reap them in a timely fashion. In other words, the ability to prevent orphans from becoming + // zombies. + // + // Therefore, on misconfigured or broken systems, this test may fail. These failures will manifest + // as timeouts. The failures depend on timing: they may not happen at all, be intermittent or + // constant. + // + // That will rarely be a problem on bare-metal systems but may be more common when running in + // Docker. Misconfigured Docker instances may run with an initial process unable to reap. One + // infamous example would be running jtreg tests inside a Docker via Jenkins CI. + // + // This is quite difficult - and inefficient - to fix inside this test, and rather easy to + // avoid. For a detailed analysis, as well as proposed workarounds, please see JDK-8284282. + // ProcessHandle procHandle = null; try { ConcurrentHashMap processes = new ConcurrentHashMap<>(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessHandle/TreeTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/TreeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/ProcessHandle/TreeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/ProcessHandle/TreeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -44,6 +44,7 @@ /* * @test + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.management diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ArgWithSpaceAndFinalBackslash.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ArgWithSpaceAndFinalBackslash.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ArgWithSpaceAndFinalBackslash.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ArgWithSpaceAndFinalBackslash.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ * @bug 4794652 * @summary Ensure that a command argument that contains a space and a final * backslash is handled correctly + * @requires vm.flagless */ import java.io.*; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/Duped.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/Duped.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/Duped.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/Duped.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, 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,6 +24,7 @@ /* @test @bug 4180429 @summary Lossage in dup2 if System.in is closed. + @requires vm.flagless @run main/othervm Duped */ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ExecWithLotsOfArgs.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExecWithLotsOfArgs.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ExecWithLotsOfArgs.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExecWithLotsOfArgs.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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 @@ @bug 4033560 @summary 4033560 limited args of exec to 198 on Solaris. We check that we can actually exec more args than that. + @requires vm.flagless @author Anand Palaniswamy @run main/othervm ExecWithLotsOfArgs */ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ExitValue.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExitValue.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/ExitValue.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/ExitValue.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, 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 * @bug 4680945 4873419 * @summary Check process exit code + * @requires vm.flagless * @author kladko, Martin Buchholz */ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, 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,7 +27,7 @@ * @summary Basic functional test for * Runtime.exec(String[] command, String[] env, File path) and * Runtime.exec(String command, String[] env, File path). - * + * @requires vm.flagless * @library /test/lib * @run testng/othervm SetCwd */ diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,14 +31,14 @@ */ import jdk.test.lib.process.OutputAnalyzer; -import static jdk.test.lib.process.ProcessTools.createTestJvm; +import static jdk.test.lib.process.ProcessTools.createTestJavaProcessBuilder; import static jdk.test.lib.process.ProcessTools.executeProcess; public class ShutdownInterruptedMain { public static void main(String[] args) throws Exception { if (args.length > 0) { - ProcessBuilder pb = createTestJvm("ShutdownInterruptedMain"); + ProcessBuilder pb = createTestJavaProcessBuilder("ShutdownInterruptedMain"); OutputAnalyzer output = executeProcess(pb); output.shouldContain("Shutdown Hook"); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -64,7 +64,7 @@ @Test(dataProvider = "testCases") public void testProvider(List args) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/StackWalker/CallerFromMain.java openjdk-17-17.0.14+7/test/jdk/java/lang/StackWalker/CallerFromMain.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/StackWalker/CallerFromMain.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/StackWalker/CallerFromMain.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -37,7 +37,7 @@ private static final StackWalker sw = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); public static void main(String[] args) throws Exception { if (args.length > 0) { - ProcessBuilder pb = ProcessTools.createTestJvm("CallerFromMain"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("CallerFromMain"); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java openjdk-17-17.0.14+7/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ final String locale = args[2]; System.out.println("Running test for locale: " + locale); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( ExpectedEncoding.class.getName(), args[0], args[1]); Map env = pb.environment(); env.put("LANG", locale); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -65,7 +65,7 @@ @Test(dataProvider = "testCases") public void test(String className, int exitValue, String stdOutMatch, String stdErrMatch) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(String.format("UncaughtExitSimulator$%s",className)); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(String.format("UncaughtExitSimulator$%s",className)); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(exitValue); outputAnalyzer.stderrShouldMatch(stdErrMatch); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/annotation/LoaderLeakTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/annotation/LoaderLeakTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/annotation/LoaderLeakTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/annotation/LoaderLeakTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -55,7 +55,7 @@ } private void runJavaProcessExpectSuccessExitCode(String ... command) throws Throwable { - var processBuilder = ProcessTools.createJavaProcessBuilder(command) + var processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(command) .directory(Paths.get(Utils.TEST_CLASSES).toFile()); ProcessTools.executeCommand(processBuilder).shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2014 Goldman Sachs. - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -29,7 +29,7 @@ public class TestDaemonThreadLauncher { public static void main(String args[]) throws Exception { for(int i=0; i<50; i++) { - ProcessBuilder pb = ProcessTools.createTestJvm("-javaagent:DummyAgent.jar", "TestDaemonThread", "."); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-javaagent:DummyAgent.jar", "TestDaemonThread", "."); OutputAnalyzer analyzer = ProcessTools.executeProcess(pb); analyzer.shouldNotContain("ASSERTION FAILED"); analyzer.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/NegativeAgentRunner.java openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/NegativeAgentRunner.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/NegativeAgentRunner.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/NegativeAgentRunner.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ } String agentClassName = argv[0]; String excepClassName = argv[1]; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentClassName + ".jar", "-Xmx128m", "-XX:-CreateCoredumpOnCrash", agentClassName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,7 +44,7 @@ System.getProperty("test.src"), System.getProperty("test.classes", ".")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( Utils.addTestJavaOpts(testArgs.split("\\s+"))); System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb)); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -46,7 +46,7 @@ public static void main(String... args) throws Throwable { String modulepath = System.getProperty("test.module.path"); - // can't use ProcessTools.createJavaProcessBuilder as it always adds -cp + // can't use ProcessTools.createLimitedTestJavaProcessBuilder as it always adds -cp ProcessBuilder pb = new ProcessBuilder( JDKToolFinder.getTestJDKTool("java"), "-javaagent:Agent.jar", diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024, 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.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; +import java.util.ArrayList; + +/** + * @test + * @bug 8340812 + * @summary Verify that LambdaForm customization via MethodHandle::updateForm is thread safe. + * @run main TestLambdaFormCustomization + * @run main/othervm -Djava.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD=0 TestLambdaFormCustomization + */ +public class TestLambdaFormCustomization { + + String str = "test"; + static final String value = "test" + 42; + + // Trigger concurrent LambdaForm customization for VarHandle invokers + void test() throws NoSuchFieldException, IllegalAccessException { + VarHandle varHandle = MethodHandles.lookup().in(getClass()).findVarHandle(getClass(), "str", String.class); + + ArrayList threads = new ArrayList<>(); + for (int threadIdx = 0; threadIdx < 10; threadIdx++) { + threads.add(new Thread(() -> { + for (int i = 0; i < 1000; i++) { + varHandle.compareAndExchange(this, value, value); + varHandle.compareAndExchange(this, value, value); + varHandle.compareAndExchange(this, value, value); + } + })); + } + threads.forEach(Thread::start); + threads.forEach(t -> { + try { + t.join(); + } catch (Throwable e) { + throw new IllegalStateException(e); + } + }); + } + + public static void main(String[] args) throws Exception { + TestLambdaFormCustomization t = new TestLambdaFormCustomization(); + for (int i = 0; i < 4000; ++i) { + t.test(); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java --- openjdk-17-17.0.13+11/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -44,7 +44,7 @@ */ public class CondyNestedResolutionTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("CondyNestedResolution"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyNestedResolution"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("StackOverflowError"); oa.shouldContain("bsm1arg"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/InetAddress/ptr/Lookup.java openjdk-17-17.0.14+7/test/jdk/java/net/InetAddress/ptr/Lookup.java --- openjdk-17-17.0.13+11/test/jdk/java/net/InetAddress/ptr/Lookup.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/InetAddress/ptr/Lookup.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,18 +41,15 @@ import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; -import java.util.List; import java.util.stream.Stream; import java.util.stream.Collectors; -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class Lookup { private static final String HOST = "icann.org"; private static final String SKIP = "SKIP"; - private static final String CLASS_PATH = System.getProperty( - "test.class.path"); public static void main(String args[]) throws IOException { String addr = null; @@ -117,6 +114,9 @@ // Now check that a reverse lookup will succeed with the dual stack. InetAddress ia = InetAddress.getByName(addr); String name = ia.getHostName(); + // output details of dual stack lookup by address + System.out.println("dual stack lookup for addr " + addr + " returned IP address " + ia); + System.out.println(" with hostname " + name); System.out.println("(default) " + addr + "--> " + name + " (reversed IPv4: " + ipv4Reversed + ")"); @@ -135,20 +135,16 @@ } static String lookupWithIPv4Prefer() throws IOException { - String java = JDKToolFinder.getTestJDKTool("java"); String testClz = Lookup.class.getName(); - List cmd = List.of(java, "-Djava.net.preferIPv4Stack=true", - "-cp", CLASS_PATH, testClz); - System.out.println("Executing: " + cmd); - return new OutputAnalyzer(new ProcessBuilder(cmd).start()).getOutput(); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-Djava.net.preferIPv4Stack=true", testClz); + return new OutputAnalyzer(pb.start()).getOutput(); } static String reverseWithIPv4Prefer(String addr) throws IOException { - String java = JDKToolFinder.getTestJDKTool("java"); String testClz = Lookup.class.getName(); - List cmd = List.of(java, "-Djava.net.preferIPv4Stack=true", - "-cp", CLASS_PATH, testClz, "reverse", addr); - System.out.println("Executing: " + cmd); - return new OutputAnalyzer(new ProcessBuilder(cmd).start()).getOutput(); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-Djava.net.preferIPv4Stack=true", testClz, "reverse", addr); + return new OutputAnalyzer(pb.start()).getOutput(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java --- openjdk-17-17.0.13+11/test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, 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,7 +31,8 @@ * can cause fd leak. * This test may fail intermittently if foreign processes will * try to establish connection to the test server socket. - * @requires (os.family != "windows") + * @requires os.family != "windows" + * @requires vm.flagless * @library /test/lib * @build jdk.test.lib.Utils * jdk.test.lib.Asserts diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/ServerSocket/AcceptInheritHandle.java openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptInheritHandle.java --- openjdk-17-17.0.13+11/test/jdk/java/net/ServerSocket/AcceptInheritHandle.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/ServerSocket/AcceptInheritHandle.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,12 @@ import java.nio.channels.ServerSocketChannel; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import jdk.test.lib.net.IPSupport; +import jdk.test.lib.process.ProcessTools; public class AcceptInheritHandle { @@ -95,16 +97,12 @@ System.out.println("\nStarting test for " + ssp.name()); List commands = new ArrayList<>(); - commands.add(JAVA); - for (String arg : jvmArgs) - commands.add(arg); - commands.add("-cp"); - commands.add(CLASSPATH); + Collections.addAll(commands, jvmArgs); commands.add("AcceptInheritHandle"); commands.add(ssp.name()); System.out.println("Executing: "+ commands); - ProcessBuilder pb = new ProcessBuilder(commands); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(commands); pb.redirectError(ProcessBuilder.Redirect.INHERIT); Process serverProcess = pb.start(); DataInputStream dis = new DataInputStream(serverProcess.getInputStream()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java --- openjdk-17-17.0.13+11/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ } latch.countDown(); int n = in.read(); - failed("Socket.getInputStream().read() returned unexpectedly!!"); + failed("Socket.getInputStream().read() returned unexpectedly, n=" + n); } catch (SocketException se) { if (latch.getCount() != 1) { closed(); @@ -77,20 +77,22 @@ public AsyncCloseTest go() { try { InetAddress lh = InetAddress.getLocalHost(); - ServerSocket ss = new ServerSocket(0, 0, lh); - s.connect( new InetSocketAddress(lh, ss.getLocalPort()) ); - Socket s2 = ss.accept(); - Thread thr = new Thread(this); - thr.start(); - latch.await(); - Thread.sleep(5000); //sleep, so Socket.getInputStream().read() can block - s.close(); - thr.join(); - - if (isClosed()) { - return passed(); - } else { - return failed("Socket.getInputStream().read() wasn't preempted"); + try (ServerSocket ss = new ServerSocket(0, 0, lh)) { + s.connect(new InetSocketAddress(lh, ss.getLocalPort())); + try (Socket s2 = ss.accept()) { + Thread thr = new Thread(this); + thr.start(); + latch.await(); + Thread.sleep(5000); //sleep, so Socket.getInputStream().read() can block + s.close(); + thr.join(); + } + + if (isClosed()) { + return passed(); + } else { + return failed("Socket.getInputStream().read() wasn't preempted"); + } } } catch (Exception x) { failed(x.getMessage()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java --- openjdk-17-17.0.13+11/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -66,20 +66,22 @@ public AsyncCloseTest go() { try { InetAddress lh = InetAddress.getLocalHost(); - ServerSocket ss = new ServerSocket(0, 0, lh); - s.connect( new InetSocketAddress(lh, ss.getLocalPort()) ); - Socket s2 = ss.accept(); - Thread thr = new Thread(this); - thr.start(); - latch.await(); - Thread.sleep(1000); - s.close(); - thr.join(); - - if (isClosed()) { - return passed(); - } else { - return failed("Socket.getOutputStream().write() wasn't preempted"); + try (ServerSocket ss = new ServerSocket(0, 0, lh)) { + s.connect(new InetSocketAddress(lh, ss.getLocalPort())); + try (Socket s2 = ss.accept()) { + Thread thr = new Thread(this); + thr.start(); + latch.await(); + Thread.sleep(1000); + s.close(); + thr.join(); + } + + if (isClosed()) { + return passed(); + } else { + return failed("Socket.getOutputStream().write() wasn't preempted"); + } } } catch (Exception x) { failed(x.getMessage()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java --- openjdk-17-17.0.13+11/test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -36,7 +36,6 @@ * @run main/othervm TestDriver */ -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.ProcessTools; import java.io.IOException; @@ -53,33 +52,33 @@ throws Throwable { Path userDir = Paths.get(System.getProperty("user.dir")); - String java = JDKToolFinder.getTestJDKTool("java"); String basename = userDir.getFileName().toString(); setup(userDir); ProcessBuilder[] tests = new ProcessBuilder[]{ - new ProcessBuilder( - java, TEST_NAME, "./" + ARCHIVE_NAME + ProcessTools.createTestJavaProcessBuilder( + TEST_NAME, + "./" + ARCHIVE_NAME ), - new ProcessBuilder( - java, "-cp", ".", + ProcessTools.createTestJavaProcessBuilder( + "-cp", ".", "-Djava.security.policy=file:./policy", "-Djava.security.manager", TEST_NAME, "./" + ARCHIVE_NAME ), - new ProcessBuilder( - java, "-cp", ".", + ProcessTools.createTestJavaProcessBuilder( + "-cp", ".", "-Djava.security.policy=file:./policy", "-Djava.security.manager", TEST_NAME, "./" + ARCHIVE_NAME ), - new ProcessBuilder( - java, "-cp", "..", + ProcessTools.createTestJavaProcessBuilder( + "-cp", "..", "-Djava.security.policy=file:../policy", "-Djava.security.manager", TEST_NAME, "../" + ARCHIVE_NAME ).directory(userDir.resolve("tmp").toFile()), - new ProcessBuilder( - java, "-cp", basename, + ProcessTools.createTestJavaProcessBuilder( + "-cp", basename, "-Djava.security.policy=file:" + basename + "/policy", "-Djava.security.manager", TEST_NAME, basename + "/" + ARCHIVE_NAME diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/URLClassLoader/sealing/CheckSealedTest.java openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/sealing/CheckSealedTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/URLClassLoader/sealing/CheckSealedTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/URLClassLoader/sealing/CheckSealedTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,8 @@ import java.util.List; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +import static jdk.test.lib.process.ProcessTools.createTestJavaProcessBuilder; +import static jdk.test.lib.process.ProcessTools.executeCommand; public class CheckSealedTest { private static final String ARCHIVE_NAME = "b.jar"; @@ -55,31 +57,30 @@ String baseDir = System.getProperty("user.dir") + File.separator; String javac = JDKToolFinder.getTestJDKTool("javac"); - String java = JDKToolFinder.getTestJDKTool("java"); setup(baseDir); String srcDir = System.getProperty("test.src"); String cp = srcDir + File.separator + "a" + File.pathSeparator + srcDir + File.separator + "b.jar" + File.pathSeparator + "."; + + // Compile + ProcessTools.executeCommand(javac, "-cp", cp, "-d", ".", + srcDir + File.separator + TEST_NAME + ".java"); + List allCMDs = List.of( - // Compile command - new String[]{ - javac, "-cp", cp, "-d", ".", - srcDir + File.separator + TEST_NAME + ".java" - }, // Run test the first time new String[]{ - java, "-cp", cp, TEST_NAME, "1" + "-cp", cp, TEST_NAME, "1" }, // Run test the second time new String[]{ - java, "-cp", cp, TEST_NAME, "2" + "-cp", cp, TEST_NAME, "2" } ); for (String[] cmd : allCMDs) { - ProcessTools.executeCommand(cmd) + executeCommand(createTestJavaProcessBuilder(cmd)) .outputTo(System.out) .errorTo(System.out) .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/URLConnection/6212146/TestDriver.java openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/6212146/TestDriver.java --- openjdk-17-17.0.13+11/test/jdk/java/net/URLConnection/6212146/TestDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/6212146/TestDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary URLConnection.connect() fails on JAR Entry it creates * file handler leak * @library /test/lib + * @requires vm.flagless * @build jdk.test.lib.Utils * jdk.test.lib.Asserts * jdk.test.lib.JDKToolFinder diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/URLConnection/ContentHandlers/ContentHandlersTest.java openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/ContentHandlers/ContentHandlersTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/URLConnection/ContentHandlers/ContentHandlersTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/URLConnection/ContentHandlers/ContentHandlersTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,6 +21,8 @@ * questions. */ +import jdk.test.lib.process.ProcessTools; + import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -56,6 +58,7 @@ /* * @test * @bug 8064925 + * @library /test/lib * @summary Basic test for ContentHandler. Ensures discovery paths for content * handlers follow a particular order. */ @@ -268,14 +271,10 @@ Collection classpath, String classname, String... args) { - String java = getJDKTool("java"); - - List commands = new ArrayList<>(); - commands.add(java); - commands.addAll(properties.entrySet() + List commands = properties.entrySet() .stream() .map(e -> "-D" + e.getKey() + "=" + e.getValue()) - .collect(Collectors.toList())); + .collect(Collectors.toList()); String cp = classpath.stream() .map(Path::toString) @@ -285,7 +284,7 @@ commands.add(classname); commands.addAll(Arrays.asList(args)); - return run(new ProcessBuilder(commands)); + return run(ProcessTools.createTestJavaProcessBuilder(commands)); } private static Result run(ProcessBuilder b) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/AsFileDownloadTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AsFileDownloadTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/AsFileDownloadTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AsFileDownloadTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,7 +24,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.io.IOException; import java.io.InputStream; @@ -51,6 +50,7 @@ import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.util.FileUtils; import jdk.httpclient.test.lib.common.HttpServerAdapters; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; @@ -73,6 +73,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform jdk.test.lib.util.FileUtils + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm AsFileDownloadTest * @run testng/othervm/java.security.policy=AsFileDownloadTest.policy AsFileDownloadTest */ @@ -299,7 +300,7 @@ httpURI = "http://" + serverAuthority(httpTestServer) + "/http1/afdt"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/afdt", new Http1FileDispoHandler()); httpsURI = "https://" + serverAuthority(httpsTestServer) + "/https1/afdt"; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/AuthFilterCacheTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AuthFilterCacheTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/AuthFilterCacheTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/AuthFilterCacheTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -37,6 +37,7 @@ import com.sun.net.httpserver.HttpServer; import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; @@ -53,7 +54,7 @@ * @summary AuthenticationFilter.Cache::remove may throw ConcurrentModificationException * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext - * DigestEchoServer + * DigestEchoServer jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=false @@ -131,7 +132,7 @@ // HTTPS/1.1 HttpsServer sserver1 = HttpsServer.create(sa, 100); sserver1.setExecutor(executor); - sserver1.setHttpsConfigurator(new HttpsConfigurator(context)); + sserver1.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), context)); https1Server = HttpTestServer.of(sserver1); https1Server.addHandler(new TestHandler(), "/AuthFilterCacheTest/https1/"); https1Server.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ConcurrentResponses.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ConcurrentResponses.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ConcurrentResponses.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ConcurrentResponses.java 2025-01-04 20:25:18.000000000 +0000 @@ -28,6 +28,7 @@ * unprocessed HTTP data * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel * ConcurrentResponses @@ -51,7 +52,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -60,6 +60,8 @@ import java.net.http.HttpResponse.BodyHandlers; import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.BodySubscribers; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; @@ -267,7 +269,7 @@ httpChunkedURI = "http://" + serverAuthority(httpTestServer) + "/http1/chunked"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/fixed", new Http1FixedHandler()); httpsFixedURI = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed"; httpsTestServer.createContext("/https1/chunked", new Http1ChunkedHandler()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/CustomResponseSubscriber.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/CustomResponseSubscriber.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/CustomResponseSubscriber.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/CustomResponseSubscriber.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @summary Tests response body subscribers's onComplete is not invoked before onSubscribe * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm CustomResponseSubscriber */ @@ -43,7 +44,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -52,6 +52,8 @@ import java.net.http.HttpResponse.BodyHandler; import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.BodySubscribers; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; @@ -200,7 +202,7 @@ httpURI_chunk = "http://" + serverAuthority(httpTestServer) + "/http1/chunk"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/fixed", h1_fixedLengthHandler); httpsTestServer.createContext("/https1/chunk", h1_chunkHandler); httpsURI_fixed = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed"; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ExpectContinue.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ExpectContinue.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ExpectContinue.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ExpectContinue.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,17 +24,16 @@ /* * @test * @summary Basic test for Expect 100-Continue ( HTTP/1.1 only ) - * @modules java.net.http + * @library /test/lib /test/jdk/java/net/httpclient/lib + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator + * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver - * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext * @run testng/othervm ExpectContinue */ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.io.IOException; import java.io.InputStream; @@ -49,6 +48,8 @@ import java.net.http.HttpResponse.BodyHandlers; import java.util.List; import javax.net.ssl.SSLContext; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; @@ -148,7 +149,7 @@ httpURI = "http://" + serverAuthority(httpTestServer) + "/http1/ec"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/ec", new Http1ExpectContinueHandler()); httpsURI = "https://" + serverAuthority(httpsTestServer) + "/https1/ec"; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/HttpRedirectTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpRedirectTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/HttpRedirectTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpRedirectTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -20,9 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import org.testng.annotations.BeforeClass; import org.testng.annotations.AfterClass; @@ -60,7 +59,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; /** * @test @@ -69,6 +67,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer HttpRedirectTest * jdk.httpclient.test.lib.common.HttpServerAdapters + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=false @@ -175,7 +174,7 @@ // HTTPS/1.1 HttpsServer sserver1 = HttpsServer.create(sa, 100); sserver1.setExecutor(executor); - sserver1.setHttpsConfigurator(new HttpsConfigurator(context)); + sserver1.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), context)); https1Server = HttpTestServer.of(sserver1); https1Server.addHandler(new HttpTestRedirectHandler("https", https1Server), "/HttpRedirectTest/https1/"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/HttpSlowServerTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpSlowServerTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/HttpSlowServerTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/HttpSlowServerTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -20,9 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import javax.net.ssl.SSLContext; @@ -51,7 +50,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -62,6 +60,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DigestEchoServer HttpSlowServerTest + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run main/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=false @@ -138,7 +137,7 @@ // HTTPS/1.1 HttpsServer sserver1 = HttpsServer.create(sa, 100); sserver1.setExecutor(executor); - sserver1.setHttpsConfigurator(new HttpsConfigurator(context)); + sserver1.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), context)); https1Server = HttpTestServer.of(sserver1); https1Server.addHandler(new HttpTestSlowHandler(), "/HttpSlowServerTest/https1/"); https1Server.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ImmutableFlowItems.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ImmutableFlowItems.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/ImmutableFlowItems.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/ImmutableFlowItems.java 2025-01-04 20:25:18.000000000 +0000 @@ -27,6 +27,7 @@ * and that the buffers are read-only * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm ImmutableFlowItems */ @@ -43,7 +44,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -53,6 +53,8 @@ import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.BodySubscribers; import javax.net.ssl.SSLContext; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; @@ -189,7 +191,7 @@ httpURI_chunk = "http://" + serverAuthority(httpTestServer) + "/http1/chunk"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/fixed", h1_fixedLengthHandler); httpsTestServer.createContext("/https1/chunk", h1_chunkHandler); httpsURI_fixed = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed"; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LargeHandshakeTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeHandshakeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LargeHandshakeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeHandshakeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -20,8 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import javax.net.ssl.KeyManagerFactory; @@ -61,7 +59,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -82,6 +80,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DigestEchoServer + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run main/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=true @@ -1011,7 +1010,7 @@ // HTTPS/1.1 HttpsServer sserver1 = HttpsServer.create(sa, 100); sserver1.setExecutor(executor); - sserver1.setHttpsConfigurator(new HttpsConfigurator(context)); + sserver1.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), context)); https1Server = HttpTestServer.of(sserver1); https1Server.addHandler(new HttpTestLargeHandler(), "/LargeHandshakeTest/https1/"); https1Server.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LargeResponseTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeResponseTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LargeResponseTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LargeResponseTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -20,9 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import javax.net.ssl.SSLContext; @@ -38,7 +37,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; -import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.List; import java.util.Set; @@ -51,7 +49,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -64,6 +61,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext DigestEchoServer + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run main/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=true @@ -136,7 +134,7 @@ // HTTPS/1.1 HttpsServer sserver1 = HttpsServer.create(sa, 100); sserver1.setExecutor(executor); - sserver1.setHttpsConfigurator(new HttpsConfigurator(context)); + sserver1.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), context)); https1Server = HttpTestServer.of(sserver1); https1Server.addHandler(new HttpTestLargeHandler(), "/LargeResponseTest/https1/"); https1Server.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LightWeightHttpServer.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LightWeightHttpServer.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/LightWeightHttpServer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/LightWeightHttpServer.java 2025-01-04 20:25:18.000000000 +0000 @@ -33,7 +33,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.io.IOException; import java.io.InputStream; @@ -50,6 +49,8 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.SSLContext; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; public class LightWeightHttpServer { @@ -111,7 +112,7 @@ httpServer.setExecutor(executor); httpsServer.setExecutor(executor); ctx = new SimpleSSLContext().get(); - httpsServer.setHttpsConfigurator(new HttpsConfigurator(ctx)); + httpsServer.setHttpsConfigurator(new TestServerConfigurator(addr.getAddress(), ctx)); httpServer.start(); httpsServer.start(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/MappingResponseSubscriber.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/MappingResponseSubscriber.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/MappingResponseSubscriber.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/MappingResponseSubscriber.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @summary Tests mapped response subscriber * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer + * jdk.httpclient.test.lib.common.TestServerConfigurator * @run testng/othervm * -Djdk.internal.httpclient.debug=true * MappingResponseSubscriber @@ -46,7 +47,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -58,6 +58,8 @@ import java.net.http.HttpResponse.BodySubscriber; import java.util.function.Function; import javax.net.ssl.SSLContext; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; @@ -207,7 +209,7 @@ httpURI_chunk = "http://" + serverAuthority(httpTestServer) + "/http1/chunk"; httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsTestServer.createContext("/https1/fixed", h1_fixedLengthHandler); httpsTestServer.createContext("/https1/chunk", h1_chunkHandler); httpsURI_fixed = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed"; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/RequestBodyTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/RequestBodyTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -59,14 +59,14 @@ /* * @test * @bug 8087112 - * @modules java.net.http + * @modules java.net.http/jdk.internal.net.http.common * java.logging * jdk.httpserver - * @library /test/lib + * @library /test/lib /test/jdk/java/net/httpclient/lib * @compile ../../../com/sun/net/httpserver/LogFilter.java * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java - * @build jdk.test.lib.net.SimpleSSLContext + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator * @build LightWeightHttpServer * @build jdk.test.lib.Platform * @build jdk.test.lib.util.FileUtils diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/RequestBodyTest.policy openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.policy --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/RequestBodyTest.policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/RequestBodyTest.policy 2025-01-04 20:25:18.000000000 +0000 @@ -33,6 +33,11 @@ permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read"; }; +// for jdk/httpclient/test/lib/* classes +grant codeBase "file:${test.classes}/../../../../test/jdk/java/net/httpclient/lib/-" { + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common"; +}; + grant codeBase "file:${test.classes}/*" { permission java.io.FilePermission "${test.src}${/}docs${/}files${/}smallfile.txt", "read"; permission java.io.FilePermission "${test.src}${/}docs${/}files${/}notsobigfile.txt", "read"; @@ -52,4 +57,6 @@ permission java.util.PropertyPermission "*", "read"; permission java.lang.RuntimePermission "modifyThread"; + + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common"; }; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java 2025-01-04 20:25:18.000000000 +0000 @@ -30,7 +30,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.httpclient.test.lib.http2.Http2TestExchange; @@ -806,14 +805,14 @@ return HttpTestServer.of(underlying); } case HTTP_1_1 -> { - InetSocketAddress sa = new InetSocketAddress( - InetAddress.getLoopbackAddress(), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress sa = new InetSocketAddress(loopback, 0); HttpServer underlying; if (sslContext == null) { underlying = HttpServer.create(sa, 0); // HTTP } else { HttpsServer https = HttpsServer.create(sa, 0); // HTTPS - https.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + https.setHttpsConfigurator(new TestServerConfigurator(loopback, sslContext)); underlying = https; } if (executor != null) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/ServerNameMatcher.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/ServerNameMatcher.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/ServerNameMatcher.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/ServerNameMatcher.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023, 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.httpclient.test.lib.common; + +import java.io.IOException; +import java.net.InetAddress; +import java.util.Objects; +import java.util.Set; + +import javax.net.ssl.SNIHostName; +import javax.net.ssl.SNIMatcher; +import javax.net.ssl.SNIServerName; +import javax.net.ssl.StandardConstants; + +import jdk.internal.net.http.common.Logger; +import jdk.internal.net.http.common.Utils; + +/** + * A (server side) SNI host name matcher. Implementation is based on the expectations set in + * section 3 of RFC-6066. + * A server can be configured with an instance of this class. + *

    + * The RFC states: + * {@code + * Currently, the only server names supported are DNS hostnames; however, this does not imply + * any dependency of TLS on DNS, + * .... + * TLS MAY treat provided server names as opaque data and pass the names and types to the application. + * } + *

    + * The implementation in this class doesn't mandate the configured/recognized SNI host name as DNS + * resolvable. However, the {@code ServerNameMatcher} can be configured to treat the SNI host name + * as DNS resolvable by passing {@code true} to the {@code attemptDNSResolution} parameter of + * the {@link #ServerNameMatcher(boolean, String) constructor} + */ +public class ServerNameMatcher extends SNIMatcher { + + private final Logger debug; + private final boolean attemptDNSResolution; + private final Set recognizedSNINames; + + /** + * Creates a ServerNameMatcher which recognizes the passed {@code recognizedSNIName} + * + * @param recognizedSNIName The SNI host name + */ + public ServerNameMatcher(final String recognizedSNIName) { + this(false, recognizedSNIName); + } + + /** + * Creates a ServerNameMatcher which recognizes the passed SNI host name + * If {@code attemptDNSResolution} is {@code true}, then when + * {@link #matches(SNIServerName) matching} a client requested SNI name against the server + * recognized SNI name, the implementation will, as a last resort do a DNS resolution of the + * client requested SNI name and the server recognized SNI name and compare them to + * try and find a match. If {@code attemptDNSResolution} is false, then no DNS resolution is + * attempted and instead the SNI names are literally compared. + * + * @param attemptDNSResolution If true then a DNS resolution will be attempted during + * {@link #matches(SNIServerName) SNI matching} + * @param recognizedSNIName SNI host name + */ + public ServerNameMatcher(final boolean attemptDNSResolution, + final String recognizedSNIName) { + super(StandardConstants.SNI_HOST_NAME); + Objects.requireNonNull(recognizedSNIName); + this.debug = Utils.getDebugLogger(() -> "SNIMatcher"); + this.recognizedSNINames = Set.of(recognizedSNIName); + this.attemptDNSResolution = attemptDNSResolution; + } + + /** + * @param clientRequestedSNI the SNI name requested by the client + * {@return true if the {@code clientRequestedSNI} is recognized by + * the server. false otherwise} + */ + @Override + public boolean matches(final SNIServerName clientRequestedSNI) { + Objects.requireNonNull(clientRequestedSNI); + if (!SNIHostName.class.isInstance(clientRequestedSNI)) { + if (debug.on()) { + debug.log("SNI match (against " + recognizedSNINames + ")" + + " failed - not a SNIHostName: " + clientRequestedSNI); + } + // we only support SNIHostName type + return false; + } + final String requestedName = ((SNIHostName) clientRequestedSNI).getAsciiName(); + if (recognizedSNINames.contains(requestedName)) { + if (debug.on()) { + debug.log("SNI match (against " + recognizedSNINames + ") passed: " + + clientRequestedSNI); + } + return true; + } + if (attemptDNSResolution) { + final boolean res = matchesAfterDNSResolution(requestedName); + if (debug.on()) { + debug.log("SNI match (against " + recognizedSNINames + ") " + + (res ? "passed" : "failed") + ": " + clientRequestedSNI); + } + return res; + } + if (debug.on()) { + debug.log("SNI match (against " + recognizedSNINames + ") failed: " + clientRequestedSNI); + } + return false; + } + + private boolean matchesAfterDNSResolution(final String clientRequestedSNI) { + final InetAddress clientRequestedAddr; + try { + clientRequestedAddr = InetAddress.getByName(clientRequestedSNI); + } catch (IOException e) { + return false; + } + for (final String recognizedSNIName : recognizedSNINames) { + final InetAddress serverRecognizedAddr; + try { + serverRecognizedAddr = InetAddress.getByName(recognizedSNIName); + } catch (IOException e) { + // try next + continue; + } + if (serverRecognizedAddr.equals(clientRequestedAddr)) { + return true; + } + } + return false; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/TestServerConfigurator.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/TestServerConfigurator.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/TestServerConfigurator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/TestServerConfigurator.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023, 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.httpclient.test.lib.common; + +import java.net.InetAddress; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.List; + +import javax.net.ssl.SNIMatcher; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLParameters; + +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsParameters; + +/** + * A {@link HttpsConfigurator} that can be used with the HTTP1 test server over HTTPS. + * This configurator {@link #configure(HttpsParameters) configures} the server's + * {@link HttpsParameters} with the necessary {@link SSLParameters} including a + * {@link SNIMatcher} + */ +public final class TestServerConfigurator extends HttpsConfigurator { + + private final InetAddress serverAddr; + + /** + * Creates a Https configuration, with the given {@link SSLContext}. + * + * @param serverAddr the address to which the server is bound + * @param context the {@code SSLContext} to use for this configurator + * @throws NullPointerException if no {@code SSLContext} supplied + */ + public TestServerConfigurator(final InetAddress serverAddr, final SSLContext context) { + super(context); + this.serverAddr = serverAddr; + } + + @Override + public void configure(final HttpsParameters params) { + final SSLParameters sslParams = getSSLContext().getDefaultSSLParameters(); + @SuppressWarnings("removal") final SecurityManager sm = System.getSecurityManager(); + final String hostname; + if (sm == null) { + hostname = serverAddr.getHostName(); + } else { + final PrivilegedAction action = () -> serverAddr.getHostName(); + hostname = AccessController.doPrivileged(action); + } + final List sniMatchers = List.of(new ServerNameMatcher(hostname)); + sslParams.setSNIMatchers(sniMatchers); + // configure the server with these custom SSLParameters + params.setSSLParameters(sslParams); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/security/Driver.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/security/Driver.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/security/Driver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/security/Driver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -56,6 +56,7 @@ import java.util.List; import java.util.stream.Collectors; import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; /** * Driver for tests @@ -126,12 +127,10 @@ String testClassPath = System.getProperty("test.class.path", "?"); String testClasses = System.getProperty("test.classes", "?"); String sep = System.getProperty("file.separator", "?"); - String javaCmd = testJdk + sep + "bin" + sep + "java"; int retval = 10; // 10 is special exit code denoting a bind error // in which case, we retry while (retval == 10) { List cmd = new ArrayList<>(); - cmd.add(javaCmd); cmd.add("-ea"); cmd.add("-esa"); cmd.add("-Dtest.jdk=" + testJdk); @@ -150,7 +149,7 @@ cmd.add("Security"); cmd.add(testnum); - ProcessBuilder processBuilder = new ProcessBuilder(cmd) + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(cmd) .redirectOutput(ProcessBuilder.Redirect.PIPE) .redirectErrorStream(true); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,18 +25,18 @@ * @test * @bug 8245245 * @summary Test for Websocket URI encoding during HandShake - * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext - * @modules java.net.http + * @library /test/lib /test/jdk/java/net/httpclient/lib + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator + * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver * @run testng/othervm -Djdk.internal.httpclient.debug=true HandshakeUrlEncodingTest */ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import com.sun.net.httpserver.HttpExchange; +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; import org.testng.annotations.AfterTest; @@ -154,7 +154,7 @@ httpTestServer.createContext("/", new UrlHandler()); httpsTestServer = HttpsServer.create(sa, 10); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsURI = URIBuilder.newBuilder() .scheme("wss") .host("localhost") diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java --- openjdk-17-17.0.13+11/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,16 +25,15 @@ * @test * @bug 8240666 * @summary Basic test for WebSocketHandshakeException - * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext - * @modules java.net.http + * @library /test/lib /test/jdk/java/net/httpclient/lib + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator + * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver * @run testng/othervm -Djdk.internal.httpclient.debug=true WSHandshakeExceptionTest */ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import com.sun.net.httpserver.HttpExchange; @@ -47,6 +46,8 @@ import java.net.http.HttpClient; import java.net.http.WebSocket; import java.net.http.WebSocketHandshakeException; + +import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; @@ -172,7 +173,7 @@ httpTestServer.createContext("/nonutf8body", new BodyHandler()); httpsTestServer = HttpsServer.create(sa, 0); - httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext)); httpsURI = "wss://localhost:" + httpsTestServer.getAddress().getPort() + "/"; httpsNonUtf8URI = "wss://localhost:" + httpsTestServer.getAddress().getPort() + "/nonutf8body"; httpsTestServer.createContext("/nonutf8body", new BodyHandler()); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/ipv6tests/Tests.java openjdk-17-17.0.14+7/test/jdk/java/net/ipv6tests/Tests.java --- openjdk-17-17.0.13+11/test/jdk/java/net/ipv6tests/Tests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/ipv6tests/Tests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -123,7 +123,8 @@ } dprintln ("dest2 = " + dest2); - + dprintln ("sender endpoint = " + s1.getLocalSocketAddress()); + dprintln ("echo endpoint = " + s2.getLocalSocketAddress()); DatagramPacket r1 = new DatagramPacket (new byte[256], 256); DatagramPacket r2 = new DatagramPacket (new byte[256], 256); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java openjdk-17-17.0.14+7/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java --- openjdk-17-17.0.13+11/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,8 @@ import javax.tools.StandardJavaFileManager; import javax.tools.StandardLocation; import javax.tools.ToolProvider; + +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.FileUtils; import jdk.test.lib.JDKToolFinder; import static java.lang.String.format; @@ -234,12 +236,8 @@ static Result java(List sysProps, Collection classpath, String classname, String arg) { - String java = getJDKTool("java"); - List commands = new ArrayList<>(); - commands.add(java); - for (String prop : sysProps) - commands.add(prop); + List commands = new ArrayList<>(sysProps); String cp = classpath.stream() .map(Path::toString) @@ -249,7 +247,7 @@ commands.add(classname); commands.add(arg); - return run(new ProcessBuilder(commands)); + return run(ProcessTools.createTestJavaProcessBuilder(commands)); } static Result run(ProcessBuilder pb) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/MappedByteBuffer/ForceException.java openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceException.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/MappedByteBuffer/ForceException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceException.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ int numberOfBlocks = 200; int fileLength = numberOfBlocks * blockSize; - File file = new File(System.getProperty("test.src", "."), "test.dat"); + File file = new File(".", "test.dat"); file.deleteOnExit(); try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { raf.setLength(fileLength); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/MappedByteBuffer/ForceViews.java openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceViews.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/MappedByteBuffer/ForceViews.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/MappedByteBuffer/ForceViews.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -51,7 +51,7 @@ @BeforeTest(alwaysRun=true) public void openChannel() throws IOException { - Path file = Path.of(System.getProperty("test.src", "."), "junk"); + Path file = Path.of(".", "junk"); fc = FileChannel.open(file, CREATE_NEW, READ, WRITE, DELETE_ON_CLOSE); ByteBuffer buf = ByteBuffer.wrap(new byte[1024]); fc.write(buf); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/DatagramChannel/Disconnect.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/DatagramChannel/Disconnect.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/DatagramChannel/Disconnect.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/DatagramChannel/Disconnect.java 2025-01-04 20:25:18.000000000 +0000 @@ -52,7 +52,7 @@ if (IPSupport.hasIPv4()) { // test with IPv4 only try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) { - InetAddress lo4 = InetAddress.ofLiteral("127.0.0.1"); + InetAddress lo4 = InetAddress.getByName("127.0.0.1"); System.out.println("Testing with INET family and " + lo4); test(dc, lo4); test(dc, lo4); @@ -62,7 +62,7 @@ if (IPSupport.hasIPv6()) { // test with IPv6 only try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET6)) { - InetAddress lo6 = InetAddress.ofLiteral("::1"); + InetAddress lo6 = InetAddress.getByName("::1"); System.out.println("Testing with INET6 family and " + lo6); test(dc, lo6); test(dc, lo6); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ private static final String ULIMIT_SET_CMD = "ulimit -n 2048"; private static final String JAVA_CMD = ProcessTools.getCommandLine( - ProcessTools.createJavaProcessBuilder(LotsOfUpdates.class.getName())); + ProcessTools.createLimitedTestJavaProcessBuilder(LotsOfUpdates.class.getName())); public static void main(String[] args) throws Throwable { ProcessTools.executeCommand("sh", "-c", ULIMIT_SET_CMD + " && " + JAVA_CMD) diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -308,11 +308,10 @@ Pipe.SinkChannel sink = p.sink(); source.configureBlocking(false); source.register(sel, SelectionKey.OP_READ); - long start = System.currentTimeMillis(); + long start = millisTime(); int n = sel.select(k -> assertTrue(false), 1000L); - long duration = System.currentTimeMillis() - start; + expectDuration(start, 500, Long.MAX_VALUE); assertTrue(n == 0); - assertTrue(duration > 500, "select took " + duration + " ms"); } finally { closePipe(p); } @@ -332,11 +331,10 @@ // select(Consumer, timeout) try (Selector sel = Selector.open()) { sel.wakeup(); - long start = System.currentTimeMillis(); + long start = millisTime(); int n = sel.select(k -> assertTrue(false), 60*1000); - long duration = System.currentTimeMillis() - start; + expectDuration(start, 0, 20_000); assertTrue(n == 0); - assertTrue(duration < 5000, "select took " + duration + " ms"); } } @@ -354,12 +352,10 @@ // select(Consumer, timeout) try (Selector sel = Selector.open()) { scheduleWakeup(sel, 1, SECONDS); - long start = System.currentTimeMillis(); + long start = millisTime(); int n = sel.select(k -> assertTrue(false), 60*1000); - long duration = System.currentTimeMillis() - start; + expectDuration(start, 0, 20_000); assertTrue(n == 0); - assertTrue(duration > 500 && duration < 10*1000, - "select took " + duration + " ms"); } } @@ -381,11 +377,10 @@ // select(Consumer, timeout) try (Selector sel = Selector.open()) { Thread.currentThread().interrupt(); - long start = System.currentTimeMillis(); + long start = millisTime(); int n = sel.select(k -> assertTrue(false), 60*1000); - long duration = System.currentTimeMillis() - start; + expectDuration(start, 0, 20_000); assertTrue(n == 0); - assertTrue(duration < 5000, "select took " + duration + " ms"); assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { @@ -764,4 +759,32 @@ throw new RuntimeException(e); } } + + /** + * Returns the current time in milliseconds. + */ + private static long millisTime() { + long now = System.nanoTime(); + return TimeUnit.MILLISECONDS.convert(now, TimeUnit.NANOSECONDS); + } + + /** + * Check the duration of a task. The method will fail with an + * AssertionError if the millisecond duration does not satisfy: + * + * duration >= min && duration <= max + * + * Note that the inequalities are not strict, i.e., are inclusive. + * + * @param start start time, in milliseconds + * @param min minimum expected duration, in milliseconds + * @param max maximum expected duration, in milliseconds + */ + private static void expectDuration(long start, long min, long max) { + long duration = millisTime() - start; + assertTrue(duration >= min, + "Duration " + duration + "ms, expected >= " + min + "ms"); + assertTrue(duration <= max, + "Duration " + duration + "ms, expected <= " + max + "ms"); + } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -158,7 +158,7 @@ withConnection((sc, peer) -> { peer.getOutputStream().write(99); Socket s = sc.socket(); - s.setSoTimeout(1000); + s.setSoTimeout(60_000); int n = s.getInputStream().read(); assertEquals(n, 99); }); @@ -171,7 +171,7 @@ withConnection((sc, peer) -> { scheduleWrite(peer.getOutputStream(), 99, 1000); Socket s = sc.socket(); - s.setSoTimeout(5000); + s.setSoTimeout(60_000); int n = s.getInputStream().read(); assertEquals(n, 99); }); @@ -183,7 +183,7 @@ public void testTimedRead3() throws Exception { withConnection((sc, peer) -> { Socket s = sc.socket(); - s.setSoTimeout(1000); + s.setSoTimeout(500); InputStream in = s.getInputStream(); expectThrows(SocketTimeoutException.class, () -> in.read()); }); @@ -196,7 +196,7 @@ withConnection((sc, peer) -> { scheduleClose(sc, 2000); Socket s = sc.socket(); - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); InputStream in = s.getInputStream(); expectThrows(IOException.class, () -> in.read()); }); @@ -210,7 +210,7 @@ Socket s = sc.socket(); Thread.currentThread().interrupt(); try { - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); InputStream in = s.getInputStream(); expectThrows(IOException.class, () -> in.read()); } finally { @@ -228,7 +228,7 @@ Future interrupter = scheduleInterrupt(Thread.currentThread(), 2000); Socket s = sc.socket(); try { - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); InputStream in = s.getInputStream(); expectThrows(IOException.class, () -> in.read()); assertTrue(s.isClosed()); @@ -396,7 +396,7 @@ // test read when bytes are available peer.getOutputStream().write(99); - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); int n = s.getInputStream().read(); assertEquals(n, 99); }); @@ -421,7 +421,7 @@ // test read blocking until bytes are available scheduleWrite(peer.getOutputStream(), 99, 500); - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); int n = s.getInputStream().read(); assertEquals(n, 99); }); @@ -436,7 +436,7 @@ // block thread in read execute(() -> { - s.setSoTimeout(60*1000); + s.setSoTimeout(60_000); s.getInputStream().read(); }); Thread.sleep(100); // give reader time to block diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/unixdomain/Bind.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/Bind.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/unixdomain/Bind.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/Bind.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -159,13 +159,17 @@ }); // address with space should work checkNormal(() -> { - server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); - UnixDomainSocketAddress usa = UnixDomainSocketAddress.of("with space"); // relative to CWD + UnixDomainSocketAddress usa = UnixDomainSocketAddress.of("with space"); Files.deleteIfExists(usa.getPath()); - server.bind(usa); - client = SocketChannel.open(usa); - Files.delete(usa.getPath()); - assertAddress(client.getRemoteAddress(), usa, "address"); + try { + server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); + // relative to CWD + server.bind(usa); + client = SocketChannel.open(usa); + assertAddress(client.getRemoteAddress(), usa, "address"); + } finally { + Files.deleteIfExists(usa.getPath()); + } }); // client bind to null: allowed checkNormal(() -> { @@ -185,12 +189,19 @@ }); // server bind to null: should bind to a local address checkNormal(() -> { - server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); - server.bind(null); - UnixDomainSocketAddress usa = (UnixDomainSocketAddress)server.getLocalAddress(); - if (usa.getPath().toString().isEmpty()) - throw new RuntimeException("expected non zero address length"); - System.out.println("Null server address: " + server.getLocalAddress()); + UnixDomainSocketAddress usa = null; + try { + server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); + server.bind(null); + usa = (UnixDomainSocketAddress) server.getLocalAddress(); + if (usa.getPath().toString().isEmpty()) + throw new RuntimeException("expected non zero address length"); + System.out.println("Null server address: " + server.getLocalAddress()); + } finally { + if (usa != null) { + Files.deleteIfExists(usa.getPath()); + } + } }); // server no bind : not allowed checkException( @@ -307,23 +318,32 @@ Arrays.fill(chars, 'x'); String name = new String(chars); UnixDomainSocketAddress address = UnixDomainSocketAddress.of(name); - ServerSocketChannel server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); - server.bind(address); - SocketChannel client = SocketChannel.open(address); - assertAddress(server.getLocalAddress(), address, "server"); - assertAddress(client.getRemoteAddress(), address, "client"); - Files.delete(address.getPath()); + try { + ServerSocketChannel server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); + server.bind(address); + SocketChannel client = SocketChannel.open(address); + assertAddress(server.getLocalAddress(), address, "server"); + assertAddress(client.getRemoteAddress(), address, "client"); + } finally { + Files.deleteIfExists(address.getPath()); + } }); // implicit server bind checkNormal(() -> { - server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); - server.bind(null); - UnixDomainSocketAddress usa = (UnixDomainSocketAddress)server.getLocalAddress(); - client = SocketChannel.open(usa); - accept1 = server.accept(); - assertAddress(client.getRemoteAddress(), usa, "server"); - Files.delete(usa.getPath()); + UnixDomainSocketAddress usa = null; + try { + server = ServerSocketChannel.open(StandardProtocolFamily.UNIX); + server.bind(null); + usa = (UnixDomainSocketAddress) server.getLocalAddress(); + client = SocketChannel.open(usa); + accept1 = server.accept(); + assertAddress(client.getRemoteAddress(), usa, "server"); + } finally { + if (usa != null) { + Files.deleteIfExists(usa.getPath()); + } + } }); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/channels/unixdomain/NonBlockingAccept.java openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/NonBlockingAccept.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/channels/unixdomain/NonBlockingAccept.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/channels/unixdomain/NonBlockingAccept.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -29,8 +29,11 @@ */ import java.net.StandardProtocolFamily; +import java.net.UnixDomainSocketAddress; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; +import java.nio.file.Files; + import jtreg.SkippedException; public class NonBlockingAccept { @@ -48,17 +51,23 @@ public static void main(String[] args) throws Exception { checkSupported(); + UnixDomainSocketAddress addr = null; try (ServerSocketChannel serverSocketChannel = ServerSocketChannel.open(StandardProtocolFamily.UNIX)) { //non blocking mode serverSocketChannel.configureBlocking(false); serverSocketChannel.bind(null); + addr = (UnixDomainSocketAddress) serverSocketChannel.getLocalAddress(); SocketChannel socketChannel = serverSocketChannel.accept(); System.out.println("The socketChannel is : expected Null " + socketChannel); if (socketChannel != null) throw new RuntimeException("expected null"); // or exception could be thrown otherwise + } finally { + if (addr != null) { + Files.deleteIfExists(addr.getPath()); + } } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/charset/Charset/AliasesCopy.java openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/AliasesCopy.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/charset/Charset/AliasesCopy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/AliasesCopy.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023, 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 8319817 + * @summary Check that aliases cannot be mutated + * @run junit AliasesCopy + */ + +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; +import java.util.Set; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertIterableEquals; + +public class AliasesCopy { + private static final Set ALIASES_SET = Set.of("foo-alias"); + private static final String[] ALIASES_ARRAY = ALIASES_SET.toArray(String[]::new); + + @Test + public void aliasesCopy() { + final FooCharset cs = new FooCharset(ALIASES_ARRAY); + ALIASES_ARRAY[0] = "bar-alias"; + assertIterableEquals(ALIASES_SET, cs.aliases()); + } + + private static final class FooCharset extends Charset { + private FooCharset(String[] aliases) { + super("foo", aliases); + } + + @Override + public CharsetEncoder newEncoder() { + throw new RuntimeException("not implemented"); + } + + @Override + public CharsetDecoder newDecoder() { + throw new RuntimeException("not implemented"); + } + + @Override + public boolean contains(Charset cs) { + throw new RuntimeException("not implemented"); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class DefaultCharsetTest { private static final ProcessBuilder pb - = ProcessTools.createTestJvm(Default.class.getName()); + = ProcessTools.createTestJavaProcessBuilder(Default.class.getName()); private static final Map env = pb.environment(); private static String UNSUPPORTED = null; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/file/Files/CreateDirectories.java openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/CreateDirectories.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/file/Files/CreateDirectories.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/CreateDirectories.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022, 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.IOException; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.testng.Assert.*; +import org.testng.SkipException; +import org.testng.annotations.Test; + +/* + * @test + * @bug 8032220 8293792 + * @summary Test java.nio.file.Files.createDirectories method + * @library .. + * @run testng CreateDirectories + */ +public class CreateDirectories { + + /** + * Test Files.createDirectories symbolic file with an existing directory. + */ + @Test + public void testSymlinkDir() throws Exception { + // create a temp dir as the "root" in which we will run our tests. + final Path top = TestUtil.createTemporaryDirectory(); + if (!TestUtil.supportsLinks(top)) { + System.out.println("Skipping tests since symbolic links isn't " + + "supported under directory "+ top); + throw new SkipException("Symbolic links not supported"); + } + System.out.println("Running tests under directory " + top.toAbsolutePath()); + final Path fooDir = Files.createDirectory(top.resolve("foo")); + assertTrue(Files.isDirectory(fooDir), + fooDir + " was expected to be a directory but wasn't"); + + // now create a symlink to the "foo" dir + final Path symlink = Files.createSymbolicLink(top.resolve("symlinkToFoo"), + fooDir.toAbsolutePath()); + assertTrue(Files.isSymbolicLink(symlink), + symlink + " was expected to be a symlink but wasn't"); + assertTrue(Files.isDirectory(symlink), + symlink + " was expected to be a directory but wasn't"); + + // now create a directory under the symlink (which effectively creates a directory under + // "foo") + final Path barDir = Files.createDirectory(symlink.resolve("bar")); + assertTrue(Files.isDirectory(barDir), + barDir + " was expected to be a directory but wasn't"); + // ultimately, we now have this directory structure: + // + // |--- foo + // | |--- bar + // | + // |--- symlinkToFoo -> (links to) /foo + + + // now call Files.createDirectories on each of these existing directory/symlink paths + // and expect each one to succeed + Files.createDirectories(fooDir); // .//foo + Files.createDirectories(symlink); // .//symlinkToFoo + Files.createDirectories(barDir); // .//symlinkToFoo/bar + } + + /** + * Tests Files.createDirectories + */ + @Test + public void testCreateDirectories() throws IOException { + final Path tmpdir = TestUtil.createTemporaryDirectory(); + // a no-op + Files.createDirectories(tmpdir); + + // create one directory + Path subdir = tmpdir.resolve("a"); + Files.createDirectories(subdir); + assertTrue(Files.isDirectory(subdir), subdir + " was expected to be a directory," + + " but wasn't"); + + // create parents + subdir = subdir.resolve("b/c/d"); + Files.createDirectories(subdir); + assertTrue(Files.isDirectory(subdir), subdir + " was expected to be a directory," + + " but wasn't"); + + // existing file is not a directory + Path file = Files.createFile(tmpdir.resolve("x")); + try { + Files.createDirectories(file); + throw new RuntimeException("failure expected"); + } catch (FileAlreadyExistsException x) { } + try { + Files.createDirectories(file.resolve("y")); + throw new RuntimeException("failure expected"); + } catch (IOException x) { } + + // the root directory always exists + Path root = Path.of("/"); + Files.createDirectories(root); + Files.createDirectories(root.toAbsolutePath()); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/file/Files/Misc.java openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/Misc.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/file/Files/Misc.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/file/Files/Misc.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2022, 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,24 +22,35 @@ */ /* @test - * @bug 4313887 6838333 8005566 8032220 8215467 8255576 - * @summary Unit test for miscellenous methods in java.nio.file.Files - * @library .. + * @bug 4313887 6838333 8005566 8215467 8255576 8286160 + * @summary Unit test for miscellaneous methods in java.nio.file.Files + * @library .. /test/lib + * @build jdk.test.lib.Platform + * @run main Misc */ -import java.nio.file.*; +import java.io.IOException; +import java.io.File; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.AclEntry; +import java.nio.file.attribute.AclEntryPermission; +import java.nio.file.attribute.AclEntryType; +import java.nio.file.attribute.AclFileAttributeView; +import java.nio.file.attribute.DosFileAttributeView; +import java.nio.file.attribute.UserPrincipal; +import java.util.List; +import jdk.test.lib.Platform; + import static java.nio.file.Files.*; import static java.nio.file.LinkOption.*; -import java.nio.file.attribute.*; -import java.io.IOException; -import java.util.*; public class Misc { public static void main(String[] args) throws IOException { Path dir = TestUtil.createTemporaryDirectory(); try { - testCreateDirectories(dir); testIsHidden(dir); testIsSameFile(dir); testFileTypeMethods(dir); @@ -49,39 +60,6 @@ } } - /** - * Tests createDirectories - */ - static void testCreateDirectories(Path tmpdir) throws IOException { - // a no-op - createDirectories(tmpdir); - - // create one directory - Path subdir = tmpdir.resolve("a"); - createDirectories(subdir); - assertTrue(exists(subdir)); - - // create parents - subdir = subdir.resolve("b/c/d"); - createDirectories(subdir); - assertTrue(exists(subdir)); - - // existing file is not a directory - Path file = createFile(tmpdir.resolve("x")); - try { - createDirectories(file); - throw new RuntimeException("failure expected"); - } catch (FileAlreadyExistsException x) { } - try { - createDirectories(file.resolve("y")); - throw new RuntimeException("failure expected"); - } catch (IOException x) { } - - // the root directory always exists - Path root = Paths.get("/"); - Files.createDirectories(root); - Files.createDirectories(root.toAbsolutePath()); - } /** * Tests isHidden @@ -93,7 +71,7 @@ assertTrue(!isHidden(tmpdir)); Path file = tmpdir.resolve(".foo"); - if (System.getProperty("os.name").startsWith("Windows")) { + if (Platform.isWindows()) { createFile(file); try { setAttribute(file, "dos:hidden", true); @@ -286,6 +264,13 @@ assertTrue(exists(tmpdir)); assertTrue(!notExists(tmpdir)); + if (Platform.isWindows()) { + Path pageFile = Path.of("C:\\pagefile.sys"); + if (pageFile.toFile().exists()) { + System.out.printf("Check page file %s%n", pageFile); + assertTrue(exists(pageFile)); + } + } // sym link exists if (TestUtil.supportsLinks(tmpdir)) { @@ -351,7 +336,7 @@ /** * Test: Windows DOS read-only attribute */ - if (System.getProperty("os.name").startsWith("Windows")) { + if (Platform.isWindows()) { setAttribute(file, "dos:readonly", true); try { assertTrue(!isWritable(file)); @@ -381,10 +366,10 @@ } private static boolean isRoot() { - if (System.getProperty("os.name").startsWith("Windows")) + if (Platform.isWindows()) return false; - Path passwd = Paths.get("/etc/passwd"); + Path passwd = Path.of("/etc/passwd"); return Files.isWritable(passwd); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/nio/file/Path/MacPathTest.java openjdk-17-17.0.14+7/test/jdk/java/nio/file/Path/MacPathTest.java --- openjdk-17-17.0.13+11/test/jdk/java/nio/file/Path/MacPathTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/nio/file/Path/MacPathTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class MacPathTest { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm(MacPath.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(MacPath.class.getName()); pb.environment().put("LC_ALL", "en_US.UTF-8"); ProcessTools.executeProcess(pb) .outputTo(System.out) diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -51,7 +51,7 @@ String kaAlgo = args[0]; String kpgAlgo = args[1]; - String provider = args[2]; + String provider = System.getProperty("test.provider.name", args[2]); System.out.println("Testing " + kaAlgo); AlgoSpec aSpec = AlgoSpec.valueOf(AlgoSpec.class, kaAlgo); List specs = aSpec.getAlgorithmParameterSpecs(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeySizeTest.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySizeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeySizeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySizeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -64,7 +64,7 @@ public static void main(String[] args) throws Exception { String kaAlgo = args[0]; - String provider = args[1]; + String provider = System.getProperty("test.provider.name", args[1]); String kpgAlgo = args[2]; int keySize = Integer.parseInt(args[3]); testKeyAgreement(provider, kaAlgo, kpgAlgo, keySize); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeySpecTest.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySpecTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/KeySpecTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/KeySpecTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,6 +24,7 @@ /* * @test * @bug 8184359 + * @library /test/lib * @summary Standard tests on KeySpec, KeyFactory, KeyPairs and Keys. * Arguments order * @run main KeySpecTest DiffieHellman SunJCE DiffieHellman @@ -55,13 +56,14 @@ import javax.crypto.KeyAgreement; import javax.crypto.spec.DHPrivateKeySpec; import javax.crypto.spec.DHPublicKeySpec; +import jdk.test.lib.security.SecurityUtils; public class KeySpecTest { public static void main(String[] args) throws Exception { String kaAlgo = args[0]; - String provider = args[1]; + String provider = System.getProperty("test.provider.name", args[1]); String kpgAlgo = args[2]; KeyPair kp = genKeyPair(provider, kpgAlgo, (args.length > 3) ? args[3] : kpgAlgo); @@ -78,7 +80,7 @@ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider); switch (kpgInit) { case "DiffieHellman": - kpg.initialize(512); + kpg.initialize(SecurityUtils.getTestKeySize(kpgInit)); break; case "EC": kpg.initialize(256); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/MultiThreadTest.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/MultiThreadTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/MultiThreadTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/MultiThreadTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,6 +24,7 @@ /* * @test * @bug 8184359 + * @library /test/lib * @summary KeyPairGenerator Test with multiple threads. * Arguments order * @run main MultiThreadTest DiffieHellman SunJCE DiffieHellman @@ -39,6 +40,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import javax.crypto.KeyAgreement; +import jdk.test.lib.security.SecurityUtils; /** * This test targets KeyPairGenerator API related issue in a multi threaded @@ -52,7 +54,7 @@ public static void main(String[] args) throws Exception { String kaAlgo = args[0]; - String provider = args[1]; + String provider = System.getProperty("test.provider.name", args[1]); String kpgAlgo = args[2]; KeyPairGenerator kpg = genKeyGenerator(provider, kpgAlgo, (args.length > 3) ? args[3] : kpgAlgo); @@ -68,7 +70,7 @@ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider); switch (kpgInit) { case "DiffieHellman": - kpg.initialize(512); + kpg.initialize(SecurityUtils.getTestKeySize(kpgInit)); break; case "EC": kpg.initialize(256); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/NegativeTest.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/NegativeTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyAgreement/NegativeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyAgreement/NegativeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ * Arguments order * * @library /test/lib - * @run main NegativeTest DiffieHellman SunJCE DiffieHellman 1024 + * @run main NegativeTest DiffieHellman SunJCE DiffieHellman 2048 * @run main NegativeTest ECDH SunEC EC 256 * @run main NegativeTest XDH SunEC XDH 255 X25519 * @run main NegativeTest XDH SunEC XDH 448 X448 @@ -59,13 +59,14 @@ import java.util.Arrays; import java.util.HexFormat; import javax.crypto.KeyAgreement; +import jdk.test.lib.security.SecurityUtils; public class NegativeTest { public static void main(String[] args) throws Exception { String kaAlgo = args[0]; - String provider = args[1]; + String provider = System.getProperty("test.provider.name", args[1]); String kpgAlgo = args[2]; int keySize = Integer.parseInt(args[3]); String kpgInit = (args.length > 4) ? args[4] : args[2]; @@ -93,7 +94,7 @@ Security.getProvider(provider)); switch (kpgInit) { case "DiffieHellman": - kpg.initialize(512); + kpg.initialize(SecurityUtils.getTestKeySize(kpgInit)); break; case "EC": kpg.initialize(256); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/Failover.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/Failover.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/Failover.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/Failover.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /** * @test * @bug 4894125 7054918 8130181 - * @library ../testlibrary + * @library ../testlibrary /test/lib * @summary test that failover for KeyFactory works * @author Andreas Sterbenz */ @@ -34,6 +34,7 @@ import java.security.*; import java.security.interfaces.*; import java.security.spec.*; +import jdk.test.lib.security.SecurityUtils; public class Failover { @@ -72,8 +73,9 @@ // somewhat more real tests using DSA System.out.println("DSA tests..."); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA"); - kpg.initialize(512); + String kpgAlgorithm = "DSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); kf = KeyFactory.getInstance("DSA"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -51,7 +51,8 @@ new BigInteger(1, coeff)); // Create an RSA private key from the CRT specification - KeyFactory kf = KeyFactory.getInstance("RSA", "SunRsaSign"); + KeyFactory kf = KeyFactory.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); RSAPrivateCrtKey rsaPriKey = (RSAPrivateCrtKey) kf.generatePrivate(rsaCrtSpec); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java 2025-01-04 20:25:18.000000000 +0000 @@ -69,7 +69,8 @@ } public static void main(String[] args) throws Exception { - KeyPairGenerator kg = KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator kg = KeyPairGenerator.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); kg.initialize(2048); KeyPair pair = kg.generateKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,18 +24,21 @@ /* * @test * @bug 4221800 + * @library /test/lib * @summary Test restored generateKeyPair method */ import java.security.KeyPairGenerator; import java.security.KeyPair; +import jdk.test.lib.security.SecurityUtils; public class GenerateKeypair { public static void main(String[] args) throws Exception { - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA"); - kpg.initialize(512); + String kpgAlgorithm = "DSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); // test generateKeyPair KeyPair kpair = kpg.generateKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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,6 +24,7 @@ /* * @test * @bug 4297026 + * @library /test/lib * @summary Make sure that RSA Keypair generation using * java.security.spec.RSAKeyGenParameterSpec passes */ @@ -31,14 +32,18 @@ import java.security.KeyPairGenerator; import java.security.KeyPair; import java.security.spec.RSAKeyGenParameterSpec; +import jdk.test.lib.security.SecurityUtils; public class GenerateRSAKeyPair { public static void main(String[] args) throws Exception { + String kpgAlgorithm = "RSA"; RSAKeyGenParameterSpec rsaSpec = - new RSAKeyGenParameterSpec (1024, RSAKeyGenParameterSpec.F4); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + new RSAKeyGenParameterSpec (SecurityUtils.getTestKeySize(kpgAlgorithm), + RSAKeyGenParameterSpec.F4); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, + System.getProperty("test.provider.name", "SunRsaSign")); kpg.initialize(rsaSpec); // test generateKeyPair diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyRep/Serial.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyRep/Serial.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +24,7 @@ /* * @test * @bug 4532506 4999599 + * @library /test/lib * @summary Serializing KeyPair on one VM (Sun), * and Deserializing on another (IBM) fails * @run main/othervm/java.security.policy=Serial.policy Serial @@ -34,19 +35,22 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; public class Serial { // providers - private static final String SUN = "SUN"; - private static final String RSA = "SunRsaSign"; - private static final String JCE = "SunJCE"; + private static final String SUN = System.getProperty("test.provider.name", "SUN"); + private static final String RSA = System.getProperty("test.provider.name", "SunRsaSign"); + private static final String JCE = System.getProperty("test.provider.name", "SunJCE"); public static void main(String[] args) throws Exception { // generate DSA key pair - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", SUN); - kpg.initialize(512); + String kpgAlgorithmDsa = "DSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithmDsa, SUN); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmDsa)); KeyPair dsaKp = kpg.genKeyPair(); // serialize DSA key pair @@ -67,8 +71,9 @@ } // generate RSA key pair - kpg = KeyPairGenerator.getInstance("RSA", RSA); - kpg.initialize(512); + String kpgAlgorithmRsa = "RSA"; + kpg = KeyPairGenerator.getInstance(kpgAlgorithmRsa, RSA); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmRsa)); KeyPair rsaKp = kpg.genKeyPair(); // serialize RSA key pair @@ -89,8 +94,9 @@ } // generate DH key pair + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); kpg = KeyPairGenerator.getInstance("DiffieHellman", JCE); - kpg.initialize(new DHParameterSpec(skip1024Modulus, skip1024Base)); + kpg.initialize(new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase())); KeyPair dhKp = kpg.genKeyPair(); // serialize DH key pair @@ -197,47 +203,4 @@ throw new SecurityException(algorithm + " test failed"); } } - - // The 1024 bit Diffie-Hellman modulus values used by SKIP - private static final byte skip1024ModulusBytes[] = { - (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58, - (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD, - (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4, - (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B, - (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D, - (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C, - (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C, - (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6, - (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0, - (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B, - (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB, - (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D, - (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD, - (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43, - (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C, - (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C, - (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C, - (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40, - (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C, - (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72, - (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03, - (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29, - (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C, - (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB, - (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B, - (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08, - (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D, - (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C, - (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22, - (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB, - (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55, - (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7 - }; - - // The SKIP 1024 bit modulus - private static final BigInteger skip1024Modulus - = new BigInteger(1, skip1024ModulusBytes); - - // The base used with the SKIP 1024 bit modulus - private static final BigInteger skip1024Base = BigInteger.valueOf(2); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyRep/Serial.policy openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.policy --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyRep/Serial.policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyRep/Serial.policy 2025-01-04 20:25:18.000000000 +0000 @@ -1,3 +1,4 @@ grant { + permission java.util.PropertyPermission "test.provider.name", "read"; // XXX note package access is *not* granted to the 'sun' package }; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java openjdk-17-17.0.14+7/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java --- openjdk-17-17.0.13+11/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -47,7 +47,7 @@ private static final char[] PASSWDF = new String("guardian Angel") .toCharArray(); private static final String[] KS_ALGOS = { - "DES", "DESede", "Blowfish" + "DES", "DESede", "Blowfish", "AES" }; private static final int NUM_ALGOS = KS_ALGOS.length; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/MessageDigest/ByteBuffers.java openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/ByteBuffers.java --- openjdk-17-17.0.13+11/test/jdk/java/security/MessageDigest/ByteBuffers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/ByteBuffers.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ * @summary Test the MessageDigest.update(ByteBuffer) method * @author Andreas Sterbenz * @key randomness + * @run main ByteBuffers MD5 + * @run main ByteBuffers SHA-1 */ import java.util.*; @@ -37,13 +39,14 @@ public class ByteBuffers { public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SUN"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SUN")); Random random = new Random(); int n = 10 * 1024; byte[] t = new byte[n]; random.nextBytes(t); - MessageDigest md = MessageDigest.getInstance("MD5", p); + String digestAlgo = args[0]; + MessageDigest md = MessageDigest.getInstance(digestAlgo, p); byte[] d1 = md.digest(t); // test 1: ByteBuffer with an accessible backing array diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/MessageDigest/TestCloneable.java openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/TestCloneable.java --- openjdk-17-17.0.13+11/test/jdk/java/security/MessageDigest/TestCloneable.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/MessageDigest/TestCloneable.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,12 +23,16 @@ /* * @test - * @bug 8246077 + * @bug 8246077 8300416 * @summary Make sure that digest spi and the resulting digest impl are - * consistent in the impl of Cloneable interface + * consistent in the impl of Cloneable interface, and that clones do not + * share memory. * @run testng TestCloneable */ +import java.nio.ByteBuffer; import java.security.*; +import java.util.Arrays; +import java.util.Random; import java.util.Objects; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -39,21 +43,23 @@ private static final Class CNSE = CloneNotSupportedException.class; + private static String providerName = System.getProperty("test.provider.name", "SUN"); + @DataProvider public Object[][] testData() { return new Object[][] { - { "MD2", "SUN" }, { "MD5", "SUN" }, { "SHA-1", "SUN" }, - { "SHA-224", "SUN" }, { "SHA-256", "SUN" }, - { "SHA-384", "SUN" }, { "SHA-512", "SUN" }, - { "SHA3-224", "SUN" }, { "SHA3-256", "SUN" }, - { "SHA3-384", "SUN" }, { "SHA3-512", "SUN" } + { "MD2", providerName }, { "MD5", providerName }, { "SHA-1", providerName }, + { "SHA-224", providerName }, { "SHA-256", providerName }, + { "SHA-384", providerName }, { "SHA-512", providerName }, + { "SHA3-224", providerName }, { "SHA3-256", providerName }, + { "SHA3-384", providerName }, { "SHA3-512", providerName } }; } @Test(dataProvider = "testData") public void test(String algo, String provName) throws NoSuchProviderException, NoSuchAlgorithmException, - CloneNotSupportedException { + CloneNotSupportedException, InterruptedException { System.out.print("Testing " + algo + " impl from " + provName); Provider p = Security.getProvider(provName); Provider.Service s = p.getService("MessageDigest", algo); @@ -71,6 +77,52 @@ System.out.println(": NOT Cloneable"); Assert.assertThrows(CNSE, ()->md.clone()); } + + System.out.print("Testing " + algo + " impl from " + provName); + final var d1 = MessageDigest.getInstance(algo, provName); + final var buffer = ByteBuffer.allocateDirect(1024); + final var r = new Random(1024); + + fillBuffer(r, buffer); + d1.update(buffer); // this statement triggers tempArray allocation + final var d2 = (MessageDigest) d1.clone(); + assert Arrays.equals(d1.digest(), d2.digest()); + + final var t1 = updateThread(d1); + final var t2 = updateThread(d2); + t1.join(); + t2.join(); + + System.out.println(": Shared data check"); + // Random is producing the same sequence of bytes for each thread, + // and thus each MessageDigest should be equal. When the memory is + // shared, they inevitably overwrite each other's tempArray and + // you get different results. + if (!Arrays.equals(d1.digest(), d2.digest())) { + throw new AssertionError("digests differ"); + } + System.out.println("Test Passed"); } + + private static void fillBuffer(final Random r, final ByteBuffer buffer) { + final byte[] bytes = new byte[buffer.capacity()]; + r.nextBytes(bytes); + buffer.clear(); + buffer.put(bytes); + buffer.flip(); + } + + public static Thread updateThread(final MessageDigest d) { + final var t = new Thread(() -> { + final var r = new Random(1024); + final ByteBuffer buffer = ByteBuffer.allocateDirect(1024); + for (int i = 0; i < 1024; i++) { + fillBuffer(r, buffer); + d.update(buffer); + } + }); + t.start(); + return t; + } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/Provider/SupportsParameter.java openjdk-17-17.0.14+7/test/jdk/java/security/Provider/SupportsParameter.java --- openjdk-17-17.0.13+11/test/jdk/java/security/Provider/SupportsParameter.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/Provider/SupportsParameter.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +24,7 @@ /** * @test * @bug 4911081 8130181 + * @library /test/lib * @summary verify that Provider.Service.supportsParameter() works * @author Andreas Sterbenz */ @@ -33,12 +34,14 @@ import javax.crypto.*; import javax.crypto.spec.SecretKeySpec; +import jdk.test.lib.security.SecurityUtils; public class SupportsParameter { public static void main(String[] args) throws Exception { - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA"); - kpg.initialize(512); + String kpgAlgorithm = "DSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); PublicKey dsaPublicKey = kp.getPublic(); PrivateKey dsaPrivateKey = kp.getPrivate(); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/DefaultAlgo.java openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultAlgo.java --- openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/DefaultAlgo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultAlgo.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -87,8 +87,9 @@ p.remove("SecureRandom." + s); out.println("removed " + s); } - validate(new SecureRandom(), "SUN", - SunEntries.DEF_SECURE_RANDOM_ALGO); + validate(new SecureRandom(), System.getProperty("test.provider.name", "SUN"), + System.getProperty("test.default.secure.random.algorithm.name", + SunEntries.DEF_SECURE_RANDOM_ALGO)); } else { validate(new SecureRandom(), pName, algos[0]); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/DefaultProvider.java openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultProvider.java --- openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/DefaultProvider.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/DefaultProvider.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ out.println("TEST: Default provider with constructor"); SecureRandom secureRandom = new SecureRandom(); String provider = secureRandom.getProvider().getName(); - if (!provider.equals("SUN")) { + if (!provider.equals(System.getProperty("test.provider.name", "SUN"))) { throw new RuntimeException("Unexpected provider name: " + provider); } @@ -51,7 +51,7 @@ /* Test default provider with getInstance(String algorithm) */ out.println("TEST: SHA1PRNG supported on all platforms by SUN provider"); String algorithm = "SHA1PRNG"; - provider = "SUN"; + provider = System.getProperty("test.provider.name", "SUN"); SecureRandom instance = SecureRandom.getInstance(algorithm); assertInstance(instance, algorithm, provider); @@ -61,7 +61,7 @@ out.println("TEST: NativePRNG supported on all platforms" + "(except Windows), by SUN provider"); algorithm = "NativePRNG"; - provider = "SUN"; + provider = System.getProperty("test.provider.name", "SUN"); } else { out.println( "TEST: Windows-PRNG supported on windows by SunMSCAPI provider"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/GetInstanceTest.java openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/GetInstanceTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/SecureRandom/GetInstanceTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/SecureRandom/GetInstanceTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -75,7 +75,8 @@ + "'securerandom.strongAlgorithms'."); } try { - Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:SUN"); + Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:" + + System.getProperty("test.provider.name", SUN_PROVIDER)); sr = matchExc(() -> SecureRandom.getInstanceStrong(), PASS, NoSuchAlgorithmException.class, "PASS - Undefined security Property " @@ -123,7 +124,8 @@ // Test for getInstance(algorithm, provider) method. checkAttributes( matchExc(() -> SecureRandom.getInstance(srAlgo, - Security.getProvider(SUN_PROVIDER)), + Security.getProvider( + System.getProperty("test.provider.name", SUN_PROVIDER))), !(nsa(mech)), NoSuchAlgorithmException.class, String.format("PASS - It is expected to fail for" @@ -132,7 +134,8 @@ mech); // Test for getInstance(algorithm, providerName) method. checkAttributes( - matchExc(() -> SecureRandom.getInstance(srAlgo, SUN_PROVIDER), + matchExc(() -> SecureRandom.getInstance(srAlgo, + System.getProperty("test.provider.name", SUN_PROVIDER)), !(nsa(mech)), NoSuchAlgorithmException.class, String.format("PASS - It is expected to fail for " + "getInstance(algorithm, providerName) when " @@ -175,7 +178,8 @@ // Test for getInstance(algorithm, params, provider) method. checkAttributes( matchExc(() -> SecureRandom.getInstance(srAlgo, param, - Security.getProvider(SUN_PROVIDER)), + Security.getProvider(System.getProperty( + "test.provider.name", SUN_PROVIDER))), (isDRBG(mech)) && (isValidDRBGParam(param)), getExcType(mech, param), String.format("PASS - It is expected to fail " @@ -186,7 +190,7 @@ // Test for getInstance(algorithm, params, providerName) method. checkAttributes( matchExc(() -> SecureRandom.getInstance(srAlgo, param, - SUN_PROVIDER), + System.getProperty("test.provider.name", SUN_PROVIDER)), (isDRBG(mech)) && (isValidDRBGParam(param)), getExcType(mech, param), String.format("PASS - It is expected to fail " @@ -306,7 +310,8 @@ return; } Asserts.assertEquals(sr.getAlgorithm(), (isDRBG(mech) ? "DRBG" : mech)); - Asserts.assertEquals(sr.getProvider().getName(), SUN_PROVIDER); + String expectedProviderName = System.getProperty("test.provider.name", SUN_PROVIDER); + Asserts.assertEquals(sr.getProvider().getName(), expectedProviderName); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java openjdk-17-17.0.14+7/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java --- openjdk-17-17.0.13+11/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,10 +41,14 @@ md = MessageDigest.getInstance("shA1"); // MessageDigest with provider - md = MessageDigest.getInstance("SHA", "SUN"); - md = MessageDigest.getInstance("sha", "SUN"); - md = MessageDigest.getInstance("Sha-1", "SUN"); - md = MessageDigest.getInstance("shA1", "SUN"); + md = MessageDigest.getInstance("SHA", + System.getProperty("test.provider.name", "SUN")); + md = MessageDigest.getInstance("sha", + System.getProperty("test.provider.name", "SUN")); + md = MessageDigest.getInstance("Sha-1", + System.getProperty("test.provider.name", "SUN")); + md = MessageDigest.getInstance("shA1", + System.getProperty("test.provider.name", "SUN")); // KeyPairGenerator without provider KeyPairGenerator kGen = KeyPairGenerator.getInstance("DSA"); @@ -54,11 +58,15 @@ kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1"); // KeyPairGenerator with provider - kGen = KeyPairGenerator.getInstance("DSA", "SUN"); - kGen = KeyPairGenerator.getInstance("dsa", "SUN"); - kGen = KeyPairGenerator.getInstance("dSA", "SUN"); + kGen = KeyPairGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); + kGen = KeyPairGenerator.getInstance("dsa", + System.getProperty("test.provider.name", "SUN")); + kGen = KeyPairGenerator.getInstance("dSA", + System.getProperty("test.provider.name", "SUN")); kGen = KeyPairGenerator.getInstance("OId.1.2.840.10040.4.1", - "SUN"); - kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1", "SUN"); + System.getProperty("test.provider.name", "SUN")); + kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1", + System.getProperty("test.provider.name", "SUN")); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh --- openjdk-17-17.0.13+11/test/jdk/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ ${TESTSRC}${FILESEP}provider${FILESEP}HashProvider.java # run the test -${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \ +${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" \ -Djava.awt.headless=true \ ClassLoaderDeadlock diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/Security/ClassLoaderDeadlock/Deadlock.sh openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/Deadlock.sh --- openjdk-17-17.0.13+11/test/jdk/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2024, 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 @@ -62,5 +62,5 @@ JAVA="${TESTJAVA}${FILESEP}bin${FILESEP}java" -${JAVA} ${TESTVMOPTS} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock +${JAVA} ${TESTVMOPTS} ${TESTJAVAOPTS} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/Security/SynchronizedAccess.java openjdk-17-17.0.14+7/test/jdk/java/security/Security/SynchronizedAccess.java --- openjdk-17-17.0.13+11/test/jdk/java/security/Security/SynchronizedAccess.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/Security/SynchronizedAccess.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,13 +23,15 @@ /* * @test - * @bug 4162583 7054918 8130181 - * @library ../testlibrary + * @bug 4162583 7054918 8130181 8028127 + * @library /test/lib ../testlibrary * @summary Make sure Provider api implementations are synchronized properly */ import java.security.*; +import jdk.test.lib.Asserts; + public class SynchronizedAccess { public static void main(String[] args) throws Exception { @@ -42,52 +44,105 @@ } public static void main0(String[] args) throws Exception { + var providersCountBefore = Security.getProviders().length; AccessorThread[] acc = new AccessorThread[200]; - for (int i=0; i < acc.length; i++) - acc[i] = new AccessorThread("thread"+i); - for (int i=0; i < acc.length; i++) + for (int i = 0; i < acc.length; i++) { + acc[i] = new AccessorThread("thread" + i); + } + for (int i = 0; i < acc.length; i++) { acc[i].start(); - for (int i=0; i < acc.length; i++) + } + for (int i = 0; i < acc.length; i++) { acc[i].join(); + } + var providersCountAfter = Security.getProviders().length; + Asserts.assertEquals(providersCountBefore, providersCountAfter); } -} -class AccessorThread extends Thread { + static class AccessorThread extends Thread { - public AccessorThread(String str) { - super(str); - } + public AccessorThread(String str) { + super(str); + } + + public void run() { + Provider[] provs = new Provider[10]; + for (int i = 0; i < provs.length; i++) { + provs[i] = new MyProvider("name" + i, "1", "test"); + } - public void run() { - Provider[] provs = new Provider[10]; - for (int i=0; i < provs.length; i++) - provs[i] = new MyProvider("name"+i, "1", "test"); - - int rounds = 20; - while (rounds-- > 0) { - try { - for (int i=0; i 0) { + for (int i = 0; i < provs.length; i++) { + // Might install (>=0) or not (-1) if already installed Security.addProvider(provs[i]); + Thread.yield(); } - Signature sig = Signature.getInstance("sigalg"); - for (int i=0; i mdAlgs = SigTestUtil.getDigestAlgorithms (SignatureType.RSASSA_PSS, keysize).iterator(); while (mdAlgs.hasNext()) { - result &= runTest(new Test(pss, KeyAlg.RSA, Provider.SunRsaSign, + result &= runTest(new Test(pss, KeyAlg.RSA, Provider.TestProvider_or_SunRsaSign, keysize, SigTestUtil.generateDefaultParameter (SignatureType.RSASSA_PSS, mdAlgs.next()))); } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/SignedObject/Copy.java openjdk-17-17.0.14+7/test/jdk/java/security/SignedObject/Copy.java --- openjdk-17-17.0.13+11/test/jdk/java/security/SignedObject/Copy.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/SignedObject/Copy.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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,31 +31,35 @@ * @test * @bug 8050374 * @summary Checks if a signed object is a copy of an original object + * @run main Copy DSA 512 + * @run main Copy SHA256withDSA 2048 */ public class Copy { private static final String DSA = "DSA"; - private static final int KEY_SIZE = 512; private static final int MAGIC = 123; public static void main(String args[]) throws Exception { + int keySize = Integer.parseInt(args[1]); KeyPairGenerator kg = KeyPairGenerator.getInstance(DSA); - kg.initialize(KEY_SIZE); + kg.initialize(keySize); KeyPair kp = kg.genKeyPair(); - Signature signature = Signature.getInstance(DSA); + String signAlgo = args[0]; + Signature signature = Signature.getInstance(signAlgo); Test original = new Test(); SignedObject so = new SignedObject(original, kp.getPrivate(), signature); System.out.println("Signature algorithm: " + so.getAlgorithm()); - signature = Signature.getInstance(DSA, "SUN"); + signature = Signature.getInstance(signAlgo, + System.getProperty("test.provider.name", "SUN")); if (!so.verify(kp.getPublic(), signature)) { throw new RuntimeException("Verification failed"); } kg = KeyPairGenerator.getInstance(DSA); - kg.initialize(KEY_SIZE); + kg.initialize(keySize); kp = kg.genKeyPair(); if (so.verify(kp.getPublic(), signature)) { diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/cert/CertificateFactory/slowstream.sh openjdk-17-17.0.14+7/test/jdk/java/security/cert/CertificateFactory/slowstream.sh --- openjdk-17-17.0.13+11/test/jdk/java/security/cert/CertificateFactory/slowstream.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/cert/CertificateFactory/slowstream.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -50,5 +50,5 @@ ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \ ${TESTSRC}${FS}SlowStream.java -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=${TESTSRC} SlowStreamWriter | \ - ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} SlowStreamReader +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -Dtest.src=${TESTSRC} SlowStreamWriter | \ + ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} SlowStreamReader diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/cert/X509CertSelectorTest.java openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509CertSelectorTest.java --- openjdk-17-17.0.13+11/test/jdk/java/security/cert/X509CertSelectorTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509CertSelectorTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, 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 @@ -64,10 +64,11 @@ import sun.security.x509.PrivateKeyUsageExtension; import sun.security.x509.SubjectAlternativeNameExtension; import sun.security.x509.X500Name; +import sun.security.util.Debug; /* * @test - * @bug 8074931 + * @bug 8074931 8296787 * @summary This class tests the X509CertSelector. The tests check particular criteria * by setting them to a value that should match our test certificate and * ensuring that they do match, then setting them to a value that should not @@ -195,6 +196,14 @@ // good match selector.setSerialNumber(cert.getSerialNumber()); checkMatch(selector, cert, true); + + // check serial number format + String serialNum = Debug.toString(selector.getSerialNumber()); + String expected = "38:df:82:b8"; + if (!serialNum.equals(expected)) { + throw new RuntimeException("Serial number toString format is incorrect. Got: " + + serialNum + " Expected: " + expected); + } } // Tests matching on the issuer name contained in the certificate. diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java --- openjdk-17-17.0.13+11/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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,14 @@ /* * @test * @bug 8259428 + * @library /test/lib * @summary Verify X509Certificate.getSigAlgParams() returns new array each * time it is called * @modules java.base/sun.security.tools.keytool java.base/sun.security.x509 */ import java.security.cert.X509Certificate; +import jdk.test.lib.security.SecurityUtils; import sun.security.tools.keytool.CertAndKeyGen; import sun.security.x509.X500Name; @@ -38,7 +40,7 @@ public static void main(String[] args) throws Exception { CertAndKeyGen cakg = new CertAndKeyGen("RSASSA-PSS", "RSASSA-PSS"); - cakg.generate(1024); + cakg.generate(SecurityUtils.getTestKeySize("RSA")); X509Certificate c = cakg.getSelfCertificate(new X500Name("CN=Me"), 100); if (c.getSigAlgParams() == c.getSigAlgParams()) { throw new Exception("Encoded params are the same byte array"); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/misc/GetInstanceNullsEmpties.java openjdk-17-17.0.14+7/test/jdk/java/security/misc/GetInstanceNullsEmpties.java --- openjdk-17-17.0.13+11/test/jdk/java/security/misc/GetInstanceNullsEmpties.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/misc/GetInstanceNullsEmpties.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -44,7 +44,8 @@ */ public class GetInstanceNullsEmpties { - private static final Provider SUN = Security.getProvider("SUN"); + private static final String providerName = System.getProperty("test.provider.name", "SUN"); + private static final Provider provider = Security.getProvider(providerName); /* * See if there are more than "expected" number of getInstance() methods, @@ -168,14 +169,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -190,14 +191,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -212,14 +213,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -234,14 +235,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -257,14 +258,14 @@ run(m, NoSuchAlgorithmException.class, "", csp); m = getInstance(clazz, STRING, CertStoreParameters.class, STRING); - run(m, NullPointerException.class, null, csp, "SUN"); - run(m, NoSuchAlgorithmException.class, "", csp, "SUN"); + run(m, NullPointerException.class, null, csp, providerName); + run(m, NoSuchAlgorithmException.class, "", csp, providerName); run(m, IllegalArgumentException.class, "FOO", csp, null); run(m, IllegalArgumentException.class, "FOO", csp, ""); m = getInstance(clazz, STRING, CertStoreParameters.class, PROVIDER); - run(m, NullPointerException.class, null, csp, SUN); - run(m, NoSuchAlgorithmException.class, "", csp, SUN); + run(m, NullPointerException.class, null, csp, provider); + run(m, NoSuchAlgorithmException.class, "", csp, provider); run(m, IllegalArgumentException.class, "FOO", csp, null); } @@ -279,14 +280,14 @@ run(m, CertificateException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, CertificateException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, CertificateException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, CertificateException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, CertificateException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -305,14 +306,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NoSuchAlgorithmException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NoSuchAlgorithmException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NoSuchAlgorithmException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NoSuchAlgorithmException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -329,15 +330,15 @@ run(m, NoSuchAlgorithmException.class, "", cp); m = getInstance(clazz, STRING, Configuration.Parameters.class, STRING); - run(m, NullPointerException.class, null, cp, "SUN"); - run(m, NoSuchAlgorithmException.class, "", cp, "SUN"); + run(m, NullPointerException.class, null, cp, providerName); + run(m, NoSuchAlgorithmException.class, "", cp, providerName); run(m, IllegalArgumentException.class, "FOO", cp, null); run(m, IllegalArgumentException.class, "FOO", cp, ""); m = getInstance(clazz, STRING, Configuration.Parameters.class, PROVIDER); - run(m, NullPointerException.class, null, cp, SUN); - run(m, NoSuchAlgorithmException.class, "", cp, SUN); + run(m, NullPointerException.class, null, cp, provider); + run(m, NoSuchAlgorithmException.class, "", cp, provider); run(m, IllegalArgumentException.class, "FOO", cp, null); } @@ -352,14 +353,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -374,14 +375,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -396,14 +397,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -418,14 +419,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -440,14 +441,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -462,14 +463,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -488,14 +489,14 @@ run(m, KeyStoreException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, KeyStoreException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, KeyStoreException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, KeyStoreException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, KeyStoreException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -510,14 +511,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -532,14 +533,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -556,14 +557,14 @@ run(m, NoSuchAlgorithmException.class, "", pp); m = getInstance(clazz, STRING, Policy.Parameters.class, STRING); - run(m, NullPointerException.class, null, pp, "SUN"); - run(m, NoSuchAlgorithmException.class, "", pp, "SUN"); + run(m, NullPointerException.class, null, pp, providerName); + run(m, NoSuchAlgorithmException.class, "", pp, providerName); run(m, IllegalArgumentException.class, "FOO", pp, null); run(m, IllegalArgumentException.class, "FOO", pp, ""); m = getInstance(clazz, STRING, Policy.Parameters.class, PROVIDER); - run(m, NullPointerException.class, null, pp, SUN); - run(m, NoSuchAlgorithmException.class, "", pp, SUN); + run(m, NullPointerException.class, null, pp, provider); + run(m, NoSuchAlgorithmException.class, "", pp, provider); run(m, IllegalArgumentException.class, "FOO", pp, null); } @@ -578,14 +579,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -600,14 +601,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -624,14 +625,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); m = getInstance(clazz, STRING, SecureRandomParameters.class); @@ -639,14 +640,14 @@ run(m, NoSuchAlgorithmException.class, "", srp); m = getInstance(clazz, STRING, SecureRandomParameters.class, STRING); - run(m, NullPointerException.class, null, srp, "SUN"); - run(m, NoSuchAlgorithmException.class, "", srp, "SUN"); + run(m, NullPointerException.class, null, srp, providerName); + run(m, NoSuchAlgorithmException.class, "", srp, providerName); run(m, IllegalArgumentException.class, "FOO", srp, null); run(m, IllegalArgumentException.class, "FOO", srp, ""); m = getInstance(clazz, STRING, SecureRandomParameters.class, PROVIDER); - run(m, NullPointerException.class, null, srp, SUN); - run(m, NoSuchAlgorithmException.class, "", srp, SUN); + run(m, NullPointerException.class, null, srp, provider); + run(m, NoSuchAlgorithmException.class, "", srp, provider); run(m, IllegalArgumentException.class, "FOO", srp, null); } @@ -661,14 +662,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } @@ -683,14 +684,14 @@ run(m, NoSuchAlgorithmException.class, ""); m = getInstance(clazz, STRING, STRING); - run(m, NullPointerException.class, null, "SUN"); - run(m, NoSuchAlgorithmException.class, "", "SUN"); + run(m, NullPointerException.class, null, providerName); + run(m, NoSuchAlgorithmException.class, "", providerName); run(m, IllegalArgumentException.class, "FOO", null); run(m, IllegalArgumentException.class, "FOO", ""); m = getInstance(clazz, STRING, PROVIDER); - run(m, NullPointerException.class, null, SUN); - run(m, NoSuchAlgorithmException.class, "", SUN); + run(m, NullPointerException.class, null, provider); + run(m, NoSuchAlgorithmException.class, "", provider); run(m, IllegalArgumentException.class, "FOO", null); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/security/testlibrary/HumanInputStream.java openjdk-17-17.0.14+7/test/jdk/java/security/testlibrary/HumanInputStream.java --- openjdk-17-17.0.13+11/test/jdk/java/security/testlibrary/HumanInputStream.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/security/testlibrary/HumanInputStream.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +/** + * HumanInputStream tries to act like a human sitting in front of a computer + * terminal typing on the keyboard while a program is running. + *

    + * The program may call InputStream.read() and BufferedReader.readLine() in + * various places. a call to B.readLine() will try to buffer as much input as + * possible. Thus, a trivial InputStream will find it impossible to feed + * anything to I.read() after a B.readLine() call. + *

    + * This is why HumanInputStream was created, which will only send a single line + * to B.readLine(), no more, no less, and the next I.read() can have a chance + * to read the exact character right after "\n". + * + */ + +public class HumanInputStream extends InputStream { + byte[] src; + int pos; + int length; + boolean inLine; + int stopIt; + + public HumanInputStream(String input) { + src = input.getBytes(); + pos = 0; + length = src.length; + stopIt = 0; + inLine = false; + } + + // the trick: when called through read(byte[], int, int), + // return -1 twice after "\n" + + @Override public int read() throws IOException { + int re; + if(pos < length) { + re = src[pos]; + if(inLine) { + if(stopIt > 0) { + stopIt--; + re = -1; + } else { + if(re == '\n') { + stopIt = 2; + } + pos++; + } + } else { + pos++; + } + } else { + re = -1; //throws new IOException("NO MORE TO READ"); + } + return re; + } + @Override public int read(byte[] buffer, int offset, int len) { + inLine = true; + try { + return super.read(buffer, offset, len); + } catch(Exception e) { + throw new RuntimeException("HumanInputStream error"); + } finally { + inLine = false; + } + } + @Override public int available() { + if (pos < length) return 1; + return 0; + } + + // test part + static void assertTrue(boolean bool) { + if (!bool) + throw new RuntimeException(); + } + + public static void test() throws Exception { + class Tester { + HumanInputStream is; + BufferedReader reader; + Tester(String s) { + is = new HumanInputStream(s); + reader = new BufferedReader(new InputStreamReader(is)); + } + + // three kinds of test method + // 1. read byte by byte from InputStream + void testStreamReadOnce(int expection) throws Exception { + assertTrue(is.read() == expection); + } + void testStreamReadMany(String expectation) throws Exception { + char[] keys = expectation.toCharArray(); + for (char key : keys) { + assertTrue(is.read() == key); + } + } + // 2. read a line with a newly created Reader + void testReaderReadline(String expectation) throws Exception { + String s = new BufferedReader(new InputStreamReader(is)).readLine(); + if(s == null) assertTrue(expectation == null); + else assertTrue(s.equals(expectation)); + } + // 3. read a line with the old Reader + void testReaderReadline2(String expectation) throws Exception { + String s = reader.readLine(); + if(s == null) assertTrue(expectation == null); + else assertTrue(s.equals(expectation)); + } + } + + Tester test; + + test = new Tester("111\n222\n\n444\n\n"); + test.testReaderReadline("111"); + test.testReaderReadline("222"); + test.testReaderReadline(""); + test.testReaderReadline("444"); + test.testReaderReadline(""); + test.testReaderReadline(null); + + test = new Tester("111\n222\n\n444\n\n"); + test.testReaderReadline2("111"); + test.testReaderReadline2("222"); + test.testReaderReadline2(""); + test.testReaderReadline2("444"); + test.testReaderReadline2(""); + test.testReaderReadline2(null); + + test = new Tester("111\n222\n\n444\n\n"); + test.testReaderReadline2("111"); + test.testReaderReadline("222"); + test.testReaderReadline2(""); + test.testReaderReadline2("444"); + test.testReaderReadline(""); + test.testReaderReadline2(null); + + test = new Tester("1\n2"); + test.testStreamReadMany("1\n2"); + test.testStreamReadOnce(-1); + + test = new Tester("12\n234"); + test.testStreamReadOnce('1'); + test.testReaderReadline("2"); + test.testStreamReadOnce('2'); + test.testReaderReadline2("34"); + test.testReaderReadline2(null); + + test = new Tester("changeit\n"); + test.testStreamReadMany("changeit\n"); + test.testReaderReadline(null); + + test = new Tester("changeit\nName\nCountry\nYes\n"); + test.testStreamReadMany("changeit\n"); + test.testReaderReadline("Name"); + test.testReaderReadline("Country"); + test.testReaderReadline("Yes"); + test.testReaderReadline(null); + + test = new Tester("Me\nHere\n"); + test.testReaderReadline2("Me"); + test.testReaderReadline2("Here"); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java openjdk-17-17.0.14+7/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java --- openjdk-17-17.0.13+11/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -62,15 +62,19 @@ import static java.time.temporal.ChronoField.AMPM_OF_DAY; import static java.time.temporal.ChronoField.EPOCH_DAY; import static java.time.temporal.ChronoField.HOUR_OF_AMPM; +import static java.time.temporal.ChronoField.HOUR_OF_DAY; import static java.time.temporal.ChronoField.INSTANT_SECONDS; import static java.time.temporal.ChronoField.MICRO_OF_SECOND; import static java.time.temporal.ChronoField.MILLI_OF_SECOND; +import static java.time.temporal.ChronoField.MINUTE_OF_HOUR; import static java.time.temporal.ChronoField.NANO_OF_SECOND; import static java.time.temporal.ChronoField.OFFSET_SECONDS; import static java.time.temporal.ChronoField.SECOND_OF_DAY; import static java.util.Locale.US; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; +import java.text.ParsePosition; import java.time.DateTimeException; import java.time.Instant; import java.time.LocalDateTime; @@ -80,7 +84,9 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.format.DateTimeParseException; +import java.time.format.SignStyle; import java.time.temporal.TemporalAccessor; +import java.util.Locale; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -88,7 +94,7 @@ /** * @test * @summary Test parsing of edge cases. - * @bug 8223773 8272473 + * @bug 8223773 8272473 8319640 */ public class TestDateTimeParsing { @@ -237,4 +243,30 @@ } } } + + // Checks ::toFormat().parseObject(text, pos) do not throw DateTimeException + @Test + public void test_toFormat_2arg_null_return_on_DateTimeException() { + var f = new DateTimeFormatterBuilder() + .appendValue(HOUR_OF_DAY, 2, 2, SignStyle.NOT_NEGATIVE) + .optionalStart() + .appendLiteral(':') + .appendValue(MINUTE_OF_HOUR, 2, 2, SignStyle.NOT_NEGATIVE) + .optionalEnd() + .optionalStart() + .appendOffset("+HHmm", "Z") + .optionalEnd() + .toFormatter(Locale.ROOT) + .toFormat(); + assertNull(f.parseObject("17-30", new ParsePosition(0))); + } + + // Checks ::toFormat().parseObject(text, pos) do not throw IOOBE + @Test + public void test_toFormat_2arg_null_return_on_IOOBE() { + var date = "2023-11-13"; + assertNull(DateTimeFormatter.ISO_LOCAL_DATE + .toFormat() + .parseObject(date, new ParsePosition(date.length() + 1))); + } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/Basic.java openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.java --- openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/Basic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,18 +21,6 @@ * questions. */ -/* @test - * @summary Unit test for formatter - * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937 - * 5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122 - * 6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168 - * 8059175 8204229 - * - * @run shell/timeout=240 Basic.sh - */ - -import static java.lang.System.out; - public class Basic { private static int fail = 0; @@ -45,18 +33,20 @@ } static void fail(String fs, Class ex) { - String s = "'" + fs + "': " + ex.getName() + " not thrown"; - if (first == null) - setFirst(s); - System.err.println("FAILED: " + s); + String message = "'%s': %s not thrown".formatted(fs, ex.getName()); + if (first == null) { + setFirst(message); + } + System.err.printf("FAILED: %s%n", message); fail++; } static void fail(String fs, String exp, String got) { - String s = "'" + fs + "': Expected '" + exp + "', got '" + got + "'"; - if (first == null) - setFirst(s); - System.err.println("FAILED: " + s); + String message = "'%s': Expected '%s', got '%s'".formatted(fs, exp, got); + if (first == null) { + setFirst(message); + } + System.err.printf("FAILED: %s%n", message); fail++; } @@ -69,10 +59,11 @@ } static void ck(String fs, String exp, String got) { - if (!exp.equals(got)) + if (!exp.equals(got)) { fail(fs, exp, got); - else + } else { pass(); + } } public static void main(String[] args) { @@ -94,13 +85,15 @@ BasicDouble.test(); BasicDoubleObject.test(); BasicBigDecimal.test(); - BasicDateTime.test(); - if (fail != 0) - throw new RuntimeException((fail + pass) + " tests: " - + fail + " failure(s), first", first); - else - out.println("all " + (fail + pass) + " tests passed"); + if (fail != 0) { + var tests_message = "%d tests: %d failure(s)%n".formatted(fail + pass, fail); + var trace_message = "Traceback of the first error located"; + var message = "%s %s".formatted(tests_message, trace_message); + throw new RuntimeException(message, first); + } else { + System.out.printf("All %d tests passed", pass); + } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/Basic.sh openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.sh --- openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/Basic.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/Basic.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -# -# Copyright (c) 2004, 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. -# - -# - -EXTRAOPTS="--add-exports java.base/jdk.internal.math=ALL-UNNAMED" -LOCALEOPTS="-Djava.locale.providers=CLDR" -${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -cp ${TESTSRC} -d . \ - ${TESTSRC}/Basic.java - -expectPass() { - if [ $1 -eq 0 ] - then echo "--- passed as expected" - else - echo "--- failed" - exit $1 - fi -} - -runTest() { - echo "Testing:" ${1} - TZ="${1}"; export TZ - echo " " $TZ - ${TESTJAVA}/bin/java ${TESTVMOPTS} ${EXTRAOPTS} ${LOCALEOPTS} Basic - expectPass $? -} - -runTest US/Pacific -runTest Asia/Novosibirsk - diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/BasicTestLauncher.java openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/BasicTestLauncher.java --- openjdk-17-17.0.13+11/test/jdk/java/util/Formatter/BasicTestLauncher.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/Formatter/BasicTestLauncher.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2022, 2023, 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.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import java.io.IOException; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +/* @test + * @summary Unit tests for formatter + * @library /test/lib + * @compile Basic.java + * @compile BasicBoolean.java + * @compile BasicBooleanObject.java + * @compile BasicByte.java + * @compile BasicByteObject.java + * @compile BasicChar.java + * @compile BasicCharObject.java + * @compile BasicShort.java + * @compile BasicShortObject.java + * @compile BasicInt.java + * @compile BasicIntObject.java + * @compile BasicLong.java + * @compile BasicLongObject.java + * @compile BasicBigInteger.java + * @compile BasicFloat.java + * @compile BasicFloatObject.java + * @compile BasicDouble.java + * @compile BasicDoubleObject.java + * @compile BasicBigDecimal.java + * @compile BasicDateTime.java + * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937 + * 5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122 + * 6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168 + * 8059175 8204229 + * + * @run junit BasicTestLauncher + */ +public class BasicTestLauncher { + // Locale flag for testJVM + private static final String JAVA_OPTS = "-Djava.locale.providers=CLDR"; + // Test class + private static final String TEST_CLASS = "Basic"; + + /** + * Executes Formatter Basic tests + * @param timeZone the time zone to run tests against + */ + @ParameterizedTest + @ValueSource(strings = { "US/Pacific", "Asia/Novosibirsk" }) + void testTimeZone(String timeZone) throws IOException{ + System.out.printf("$$$ Testing against %s!%n", timeZone); + OutputAnalyzer output = RunTest(timeZone); + CheckTest(output); + System.out.printf("$$$ %s passed as expected!%n", timeZone); + } + + /** + * Creates and runs the testJVM process using Basic class + * @param timeZone the time zone to be set in the testJVM environment + */ + private static OutputAnalyzer RunTest(String timeZone) throws IOException{ + // Build and run Basic class with correct configuration + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(JAVA_OPTS, TEST_CLASS); + pb.environment().put("TZ", timeZone); + Process process = pb.start(); + return new OutputAnalyzer(process); + } + + /** + * Validates if the testJVM process passed all tests + * @param output is an Output Analyzer for the testJVM + * @throws RuntimeException for all testJVM failures + */ + private static void CheckTest(OutputAnalyzer output){ + output.shouldHaveExitValue(0) + .reportDiagnosticSummary(); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java --- openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ private static String CUSTOM_TZ2 = "MEZ-1MESZ,M10.5.0,M3.5.0/3"; public static void main(String args[]) throws Throwable { if (args.length == 0) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(List.of("CustomTzIDCheckDST", "runTZTest")); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(List.of("CustomTzIDCheckDST", "runTZTest")); pb.environment().put("TZ", CUSTOM_TZ); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/TimeZoneData/VERSION openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/VERSION --- openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/TimeZoneData/VERSION 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/VERSION 2025-01-04 20:25:18.000000000 +0000 @@ -1 +1 @@ -tzdata2024a +tzdata2024b diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt --- openjdk-17-17.0.13+11/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt 2025-01-04 20:25:18.000000000 +0000 @@ -53,6 +53,7 @@ Link America/Mazatlan Mexico/BajaSur Link America/Mexico_City Mexico/General Link Pacific/Auckland NZ +Link Asia/Ulaanbaatar Asia/Choibalsan Link Pacific/Chatham NZ-CHAT Link America/Denver Navajo #= America/Shiprock Link Asia/Shanghai PRC diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java --- openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023, 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 8303742 + * @summary CompletableFuture.orTimeout can leak memory if completed exceptionally + * @modules java.base/java.util.concurrent:open + * @run junit/othervm -Xmx128m CompletableFutureOrTimeoutExceptionallyTest + */ + +import java.time.Duration; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class CompletableFutureOrTimeoutExceptionallyTest { + static final BlockingQueue delayerQueue; + static { + try { + var delayerClass = Class.forName("java.util.concurrent.CompletableFuture$Delayer", + true, + CompletableFuture.class.getClassLoader()); + var delayerField = delayerClass.getDeclaredField("delayer"); + delayerField.setAccessible(true); + delayerQueue = ((ScheduledThreadPoolExecutor)delayerField.get(null)).getQueue(); + } catch (Throwable t) { + throw new ExceptionInInitializerError(t); + } + } + + /** + * Test that orTimeout task is cancelled if the CompletableFuture is completed Exceptionally + */ + @Test + void testOrTimeoutWithCompleteExceptionallyDoesNotLeak() throws InterruptedException { + assertTrue(delayerQueue.peek() == null); + var future = new CompletableFuture<>().orTimeout(12, TimeUnit.HOURS); + assertTrue(delayerQueue.peek() != null); + future.completeExceptionally(new RuntimeException("This is fine")); + while (delayerQueue.peek() != null) { + Thread.sleep(100); + }; + } + + /** + * Test that the completeOnTimeout task is cancelled if the CompletableFuture is completed Exceptionally + */ + @Test + void testCompleteOnTimeoutWithCompleteExceptionallyDoesNotLeak() throws InterruptedException { + assertTrue(delayerQueue.peek() == null); + var future = new CompletableFuture<>().completeOnTimeout(null, 12, TimeUnit.HOURS); + assertTrue(delayerQueue.peek() != null); + future.completeExceptionally(new RuntimeException("This is fine")); + while (delayerQueue.peek() != null) { + Thread.sleep(100); + }; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/tck/JSR166TestCase.java openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java --- openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/tck/JSR166TestCase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java 2025-01-04 20:25:18.000000000 +0000 @@ -592,7 +592,6 @@ ScheduledExecutorSubclassTest.suite(), SemaphoreTest.suite(), SynchronousQueueTest.suite(), - SystemTest.suite(), ThreadLocalTest.suite(), ThreadPoolExecutorTest.suite(), ThreadPoolExecutorSubclassTest.suite(), diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/tck/SystemTest.java openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/SystemTest.java --- openjdk-17-17.0.13+11/test/jdk/java/util/concurrent/tck/SystemTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/concurrent/tck/SystemTest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * This file is available under and governed by the GNU General Public - * License version 2 only, as published by the Free Software Foundation. - * However, the following notice accompanied the original version of this - * file: - * - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - * Other contributors include Andrew Wright, Jeffrey Hayes, - * Pat Fisher, Mike Judd. - */ - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class SystemTest extends JSR166TestCase { - public static void main(String[] args) { - main(suite(), args); - } - - public static Test suite() { - return new TestSuite(SystemTest.class); - } - - /** - * Worst case rounding for millisecs; set for 60 cycle millis clock. - * This value might need to be changed on JVMs with coarser - * System.currentTimeMillis clocks. - */ - static final long MILLIS_ROUND = 17; - - /** - * Nanos between readings of millis is no longer than millis (plus - * possible rounding), and vice versa. - * This shows only that nano timing not (much) worse than milli. - */ - public void testNanoTime() throws InterruptedException { - long m0 = System.currentTimeMillis(); - long n0 = System.nanoTime(); - Thread.sleep(1); - long m1 = System.currentTimeMillis(); - long n1 = System.nanoTime(); - Thread.sleep(50); // avoid possibly scaled SHORT_DELAY_MS - long m2 = System.currentTimeMillis(); - long n2 = System.nanoTime(); - Thread.sleep(1); - long m3 = System.currentTimeMillis(); - long n3 = System.nanoTime(); - assertTrue((n2 - n1) / 1_000_000 <= m3 - m0 + MILLIS_ROUND); - assertTrue(m2 - m1 <= (n3 - n0) / 1_000_000 + MILLIS_ROUND); - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/CopyZipFile.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/CopyZipFile.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/CopyZipFile.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/CopyZipFile.java 2025-01-04 20:25:18.000000000 +0000 @@ -23,99 +23,120 @@ /** * @test + * @bug 8253952 * @summary Test behaviour when copying ZipEntries between zip files. - * @run main/othervm CopyZipFile + * @run junit CopyZipFile */ -import java.io.File; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Enumeration; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.zip.CRC32; -import java.util.zip.Deflater; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; +import java.util.zip.*; -public class CopyZipFile { - private static final String ZIP_FILE = "first.zip"; - private static final String TEST_STRING = "TestTestTest"; +import static org.junit.jupiter.api.Assertions.*; - private static void createZip(String zipFile) throws Exception { - File f = new File(zipFile); - f.deleteOnExit(); - try (OutputStream os = new FileOutputStream(f); +public class CopyZipFile { + // ZIP file created in this test + private Path zip = Path.of("first.zip"); + // The content to put in each entry + private static final byte[] TEST_STRING = "TestTestTest".getBytes(StandardCharsets.UTF_8); + + /** + * Create the sample ZIP file used in this test, including a STORED entry + * and DEFLATE entries with various compression levels. + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void createZip() throws IOException { + // By default, ZipOutputStream creates zip files with Local File Headers + // without size, compressed size and crc values and an extra Data + // Descriptor (see https://en.wikipedia.org/wiki/Zip_(file_format) + // after the data belonging to that entry with these values if in the + // corresponding ZipEntry one of the size, compressedSize or crc fields is + // equal to '-1' (which is the default for newly created ZipEntries). + try (OutputStream os = Files.newOutputStream(zip) ; ZipOutputStream zos = new ZipOutputStream(os)) { // First file will be compressed with DEFAULT_COMPRESSION (i.e. -1 or 6) - zos.putNextEntry(new ZipEntry("test1.txt")); - zos.write(TEST_STRING.getBytes()); - zos.closeEntry(); + zos.setLevel(Deflater.DEFAULT_COMPRESSION); + zos.putNextEntry(new ZipEntry("DEFAULT_COMPRESSION.txt")); + zos.write(TEST_STRING); + // Second file won't be compressed at all (i.e. STORED) zos.setMethod(ZipOutputStream.STORED); - ZipEntry ze = new ZipEntry("test2.txt"); - int length = TEST_STRING.length(); - ze.setSize(length); - ze.setCompressedSize(length); + ZipEntry ze = new ZipEntry("STORED.txt"); + ze.setSize(TEST_STRING.length); + ze.setCompressedSize(TEST_STRING.length); CRC32 crc = new CRC32(); - crc.update(TEST_STRING.getBytes("utf8"), 0, length); + crc.update(TEST_STRING); ze.setCrc(crc.getValue()); zos.putNextEntry(ze); - zos.write(TEST_STRING.getBytes()); + zos.write(TEST_STRING); + // Third file will be compressed with NO_COMPRESSION (i.e. 0) zos.setMethod(ZipOutputStream.DEFLATED); zos.setLevel(Deflater.NO_COMPRESSION); - zos.putNextEntry(new ZipEntry("test3.txt")); - zos.write(TEST_STRING.getBytes()); + zos.putNextEntry(new ZipEntry("NO_COMPRESSION.txt")); + zos.write(TEST_STRING); + // Fourth file will be compressed with BEST_SPEED (i.e. 1) zos.setLevel(Deflater.BEST_SPEED); - zos.putNextEntry(new ZipEntry("test4.txt")); - zos.write(TEST_STRING.getBytes()); + zos.putNextEntry(new ZipEntry("BEST_SPEED.txt")); + zos.write(TEST_STRING); + // Fifth file will be compressed with BEST_COMPRESSION (i.e. 9) zos.setLevel(Deflater.BEST_COMPRESSION); - zos.putNextEntry(new ZipEntry("test5.txt")); - zos.write(TEST_STRING.getBytes()); + zos.putNextEntry(new ZipEntry("BEST_COMPRESSION.txt")); + zos.write(TEST_STRING); } } - public static void main(String args[]) throws Exception { - // By default, ZipOutputStream creates zip files with Local File Headers - // without size, compressedSize and crc values and an extra Data - // Descriptor (see https://en.wikipedia.org/wiki/Zip_(file_format) - // after the data belonging to that entry with these values if in the - // corresponding ZipEntry one of the size, compressedSize or crc fields is - // equal to '-1' (which is the default for newly created ZipEntries). - createZip(ZIP_FILE); + /** + * Delete the ZIP file produced by this test + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } - // Now read all the entries of the newly generated zip file with a ZipInputStream - // and copy them to a new zip file with the help of a ZipOutputStream. - // This only works reliably because the generated zip file has no values for the - // size, compressedSize and crc values of a zip entry in the local file header and - // therefore the ZipEntry objects created by ZipOutputStream.getNextEntry() will have - // all these fields set to '-1'. - ZipEntry entry; - byte[] buf = new byte[512]; - try (InputStream is = new FileInputStream(ZIP_FILE); - ZipInputStream zis = new ZipInputStream(is); - OutputStream os = new ByteArrayOutputStream(); - ZipOutputStream zos = new ZipOutputStream(os)) { - while((entry = zis.getNextEntry())!=null) { + /** + * Read all entries using ZipInputStream.getNextEntry and copy them + * to a new zip file using ZipOutputStream.putNextEntry. This only works + * reliably because the input zip file has no values for the size, compressedSize + * and crc values of streamed zip entries in the local file header and + * therefore the ZipEntry objects created by ZipOutputStream.getNextEntry + * will have all these fields set to '-1'. + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void copyFromZipInputStreamToZipOutputStream() throws IOException { + + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(zip)); + ZipOutputStream zos = new ZipOutputStream(OutputStream.nullOutputStream())) { + ZipEntry entry; + while ((entry = zis.getNextEntry()) != null) { // ZipInputStream.getNextEntry() only reads the Local File Header of a zip entry, // so for the zip file we've just generated the ZipEntry fields 'size', 'compressedSize` // and 'crc' for deflated entries should be uninitialized (i.e. '-1'). System.out.println( - String.format("name=%s, clen=%d, len=%d, crc=%d", - entry.getName(), entry.getCompressedSize(), entry.getSize(), entry.getCrc())); - if (entry.getMethod() == ZipEntry.DEFLATED && - (entry.getCompressedSize() != -1 || entry.getSize() != -1 || entry.getCrc() != -1)) { - throw new Exception("'size', 'compressedSize' and 'crc' shouldn't be initialized at this point."); + String.format("name=%s, clen=%d, len=%d, crc=%d", + entry.getName(), entry.getCompressedSize(), entry.getSize(), entry.getCrc())); + if (entry.getMethod() == ZipEntry.DEFLATED) { + // Expect size, compressed size and crc to not be initialized at this point + assertEquals(-1, entry.getCompressedSize()); + assertEquals(-1, entry.getSize()); + assertEquals(-1, entry.getCrc()); } zos.putNextEntry(entry); zis.transferTo(zos); @@ -124,29 +145,37 @@ // Descriptor (if any) after the data and will have updated the 'size', 'compressedSize' and 'crc' // fields of the ZipEntry object. System.out.println( - String.format("name=%s, clen=%d, len=%d, crc=%d\n", - entry.getName(), entry.getCompressedSize(), entry.getSize(), entry.getCrc())); - if (entry.getCompressedSize() == -1 || entry.getSize() == -1) { - throw new Exception("'size' and 'compressedSize' must be initialized at this point."); - } + String.format("name=%s, clen=%d, len=%d, crc=%d\n", + entry.getName(), entry.getCompressedSize(), entry.getSize(), entry.getCrc())); + // Expect size, compressed size and crc to be initialized at this point + assertNotEquals(-1, entry.getCompressedSize()); + assertNotEquals(-1, entry.getSize()); + assertNotEquals(-1, entry.getCrc()); } } + } - // Now we read all the entries of the initially generated zip file with the help - // of the ZipFile class. The ZipFile class reads all the zip entries from the Central - // Directory which must have accurate information for size, compressedSize and crc. - // This means that all ZipEntry objects returned from ZipFile will have correct - // settings for these fields. - // If the compression level was different in the initial zip file (which we can't find - // out any more now because the zip file format doesn't record this information) the - // size of the re-compressed entry we are writing to the ZipOutputStream might differ - // from the original compressed size recorded in the ZipEntry. This would result in an - // "invalid entry compressed size" ZipException if ZipOutputStream wouldn't ignore - // the implicitely set compressed size attribute of ZipEntries read from a ZipFile - // or ZipInputStream. - try (OutputStream os = new ByteArrayOutputStream(); - ZipOutputStream zos = new ZipOutputStream(os); - ZipFile zf = new ZipFile(ZIP_FILE)) { + /** + * Read all entries using the ZipFile class and copy them to a new zip file + * using ZipOutputStream.putNextEntry. + * The ZipFile class reads all the zip entries from the Central + * Directory, which has accurate information for size, compressedSize and crc. + * This means that all ZipEntry objects returned from ZipFile will have correct + * settings for these fields. + * If the compression level was different in the input zip file (which we can't know + * because the zip file format doesn't record this information), the + * size of the re-compressed entry we are writing to the ZipOutputStream might differ + * from the original compressed size recorded in the ZipEntry. This would result in an + * "invalid entry compressed size" ZipException if ZipOutputStream wouldn't ignore + * the implicitely set compressed size attribute of ZipEntries read from a ZipFile + * or ZipInputStream. + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void copyFromZipFileToZipOutputStream() throws IOException { + try (ZipOutputStream zos = new ZipOutputStream(OutputStream.nullOutputStream()); + ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry entry; Enumeration entries = zf.entries(); while (entries.hasMoreElements()) { entry = entries.nextElement(); @@ -154,48 +183,84 @@ String.format("name=%s, clen=%d, len=%d, crc=%d\n", entry.getName(), entry.getCompressedSize(), entry.getSize(), entry.getCrc())); - if (entry.getCompressedSize() == -1 || entry.getSize() == -1) { - throw new Exception("'size' and 'compressedSize' must be initialized at this point."); - } - InputStream is = zf.getInputStream(entry); + // Expect size, compressed size and crc to be initialized at this point + assertNotEquals(-1, entry.getCompressedSize()); + assertNotEquals(-1, entry.getSize()); + assertNotEquals(-1, entry.getCrc()); + zos.putNextEntry(entry); - is.transferTo(zos); + try (InputStream is = zf.getInputStream(entry)) { + is.transferTo(zos); + } zos.closeEntry(); } } + } + + /** + * If the compressed size is set explicitly using ZipEntry.setCompressedSize(), + * then the entry will be restreamed with a data descriptor and the compressed size + * recomputed. If the source compression level was different from the target compression + * level, the compressed sizes may differ and a ZipException will be thrown + * when the entry is closed in ZipOutputStream.closeEntry + * + * @throws IOException if an unexpected IOException is thrown + */ + @Test + public void explicitCompressedSizeWithDifferentCompressionLevels() throws IOException { + try (ZipOutputStream zos = new ZipOutputStream(OutputStream.nullOutputStream()); + ZipFile zf = new ZipFile(zip.toFile())) { + // Be explicit about the default compression level + zos.setLevel(Deflater.DEFAULT_COMPRESSION); - // The compressed size attribute of a ZipEntry shouldn't be ignored if it was set - // explicitely by calling ZipEntry.setCpompressedSize() - try (OutputStream os = new ByteArrayOutputStream(); - ZipOutputStream zos = new ZipOutputStream(os); - ZipFile zf = new ZipFile(ZIP_FILE)) { Enumeration entries = zf.entries(); while (entries.hasMoreElements()) { - try { - entry = entries.nextElement(); - entry.setCompressedSize(entry.getCompressedSize()); - InputStream is = zf.getInputStream(entry); + ZipEntry entry = entries.nextElement(); + + // Explicitly setting the compressed size will disable data descriptors + // and enable validation that the compressed size in the ZipEntry matches the + // actual compressed size written by ZipOutputStream + entry.setCompressedSize(entry.getCompressedSize()); + + try (InputStream is = zf.getInputStream(entry)) { zos.putNextEntry(entry); is.transferTo(zos); - zos.closeEntry(); - if ("test3.txt".equals(entry.getName())) { - throw new Exception( - "Should throw a ZipException if ZipEntry.setCpompressedSize() was called."); - } - } catch (ZipException ze) { - if ("test1.txt".equals(entry.getName()) || "test2.txt".equals(entry.getName())) { - throw new Exception( - "Shouldn't throw a ZipExcpetion for STORED files or files compressed with DEFAULT_COMPRESSION"); + // Some compression levels lead to unexpected recompressed sizes when closing the entry + switch (entry.getName()) { + case "DEFAULT_COMPRESSION.txt" -> { + // DEFAULT_COMPRESSION matches expected size + zos.closeEntry(); + } + case "STORED.txt" -> { + // STORED should not throw + zos.closeEntry(); + } + case "NO_COMPRESSION.txt", "BEST_SPEED.txt" -> { + // NO_COMPRESSION and BEST_SPEED should lead to an unexpected recompressed size + ZipException ze = assertThrows(ZipException.class, () -> { + zos.closeEntry(); + }); + + // Hack to fix and close the offending zip entry with the correct recompressed size. + // The exception message is something like: + // "invalid entry compressed size (expected 12 but got 7 bytes)" + // and we need to extract the second integer. + Pattern cSize = Pattern.compile("\\d+"); + Matcher m = cSize.matcher(ze.getMessage()); + m.find(); + m.find(); + entry.setCompressedSize(Integer.parseInt(m.group())); + zos.closeEntry(); + } + case "BEST_COMPRESSION.txt" -> { + // BEST_COMPRESSION produces the same compressed + // size as DEFAULT_COMPRESSION for sample content + zos.closeEntry(); + } + default -> { + throw new IllegalArgumentException("Unexpected entry " + entry.getName()); + } } - // Hack to fix and close the offending zip entry with the correct compressed size. - // The exception message is something like: - // "invalid entry compressed size (expected 12 but got 7 bytes)" - // and we need to extract the second integer. - Pattern cSize = Pattern.compile("\\d+"); - Matcher m = cSize.matcher(ze.getMessage()); - m.find(); - m.find(); - entry.setCompressedSize(Integer.parseInt(m.group())); } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/DeflaterDictionaryTests.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/DeflaterDictionaryTests.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/DeflaterDictionaryTests.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/DeflaterDictionaryTests.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024 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 @@ -95,9 +95,9 @@ deflater.setInput(input); deflater.finish(); int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH); - System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," + - " compressed length: %s%n", deflater.getTotalOut(), - deflater.getTotalOut(), compressedDataLength); + System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," + + " compressed length: %d%n", deflater.getBytesWritten(), + deflater.getAdler(), compressedDataLength); deflater.finished(); // Decompress the bytes @@ -112,7 +112,7 @@ System.out.println("Did not need to use a Dictionary"); } inflater.finished(); - System.out.printf("Inflater::getAdler:%s, length: %s%n", + System.out.printf("Inflater::getAdler:%d, length: %d%n", inflater.getAdler(), resultLength); Assert.assertEquals(SRC_DATA.length(), resultLength); @@ -143,9 +143,9 @@ deflater.setInput(input); deflater.finish(); int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH); - System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," + - " compressed length: %s%n", deflater.getTotalOut(), - deflater.getTotalOut(), compressedDataLength); + System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," + + " compressed length: %d%n", deflater.getBytesWritten(), + deflater.getAdler(), compressedDataLength); deflater.finished(); // Decompress the bytes @@ -160,7 +160,7 @@ System.out.println("Did not need to use a Dictionary"); } inflater.finished(); - System.out.printf("Inflater::getAdler:%s, length: %s%n", + System.out.printf("Inflater::getAdler:%d, length: %d%n", inflater.getAdler(), resultLength); Assert.assertEquals(SRC_DATA.length(), resultLength); @@ -197,9 +197,9 @@ deflater.setInput(input); deflater.finish(); int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH); - System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," + - " compressed length: %s%n", deflater.getTotalOut(), - deflater.getTotalOut(), compressedDataLength); + System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," + + " compressed length: %d%n", deflater.getBytesWritten(), + deflater.getAdler(), compressedDataLength); deflater.finished(); // Decompress the bytes @@ -214,7 +214,7 @@ System.out.println("Did not need to use a Dictionary"); } inflater.finished(); - System.out.printf("Inflater::getAdler:%s, length: %s%n", + System.out.printf("Inflater::getAdler:%d, length: %d%n", inflater.getAdler(), resultLength); Assert.assertEquals(SRC_DATA.length(), resultLength); diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/Available.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/Available.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/Available.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/Available.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 1999, 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.zip.*; -import java.io.File; - -public class Available -{ - public static void main (String argv[]) throws Exception { - ZipFile zf = new ZipFile(new File(System.getProperty("test.src"), - "input.jar")); - ZipEntry e = zf.getEntry("ReleaseInflater.java"); - if (e.getSize() != zf.getInputStream(e).available()) { - throw new Exception("wrong return value of available"); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2022, 2023, 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 8272746 + * @summary Verify that ZipFile rejects a ZIP with a CEN size which does not fit in a Java byte array + * @run junit CenSizeTooLarge + */ + +import org.junit.Before; +import org.junit.Test; + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class CenSizeTooLarge { + // Maximum allowed CEN size allowed by the ZipFile implementation + static final int MAX_CEN_SIZE = Integer.MAX_VALUE - ZipFile.ENDHDR - 1; + + /** + * From the APPNOTE.txt specification: + * 4.4.10 file name length: (2 bytes) + * 4.4.11 extra field length: (2 bytes) + * 4.4.12 file comment length: (2 bytes) + * + * The length of the file name, extra field, and comment + * fields respectively. The combined length of any + * directory record and these three fields SHOULD NOT + * generally exceed 65,535 bytes. + * + * Since ZipOutputStream does not enforce the 'combined length' clause, + * we simply use 65,535 (0xFFFF) for the purpose of this test. + */ + static final int MAX_EXTRA_FIELD_SIZE = 65_535; + + // Data size (unsigned short) + // Field size minus the leading header 'tag' and 'data size' fields (2 bytes each) + static final short MAX_DATA_SIZE = (short) (MAX_EXTRA_FIELD_SIZE - 2 * Short.BYTES); + + // Tag for the 'unknown' field type, specified in APPNOTE.txt 'Third party mappings' + static final short UNKNOWN_ZIP_TAG = (short) 0x9902; + + // Entry names produced in this test are fixed-length + public static final int NAME_LENGTH = 10; + + // Use a shared LocalDateTime on all entries to save processing time + static final LocalDateTime TIME_LOCAL = LocalDateTime.now(); + + // The size of one CEN header, including the name and the extra field + static final int CEN_HEADER_SIZE = ZipFile.CENHDR + NAME_LENGTH + MAX_EXTRA_FIELD_SIZE; + + // The number of entries needed to exceed the MAX_CEN_SIZE + static final int NUM_ENTRIES = (MAX_CEN_SIZE / CEN_HEADER_SIZE) + 1; + + // Helps SparseOutputStream detect write of the last CEN entry + private static final String LAST_CEN_COMMENT = "LastCEN"; + private static final byte[] LAST_CEN_COMMENT_BYTES = LAST_CEN_COMMENT.getBytes(StandardCharsets.UTF_8); + + // Expected ZipException message when the CEN does not fit in a Java byte array + private static final String CEN_TOO_LARGE_MESSAGE = "invalid END header (central directory size too large)"; + + // Zip file to create for testing + private File hugeZipFile; + + /** + * Create a zip file with a CEN size which does not fit within a Java byte array + */ + @Before + public void setup() throws IOException { + hugeZipFile = new File("cen-too-large.zip"); + hugeZipFile.deleteOnExit(); + + try (OutputStream out = new SparseOutputStream(new FileOutputStream(hugeZipFile)); + ZipOutputStream zip = new ZipOutputStream(out)) { + + // Keep track of entries so we can update extra data before the CEN is written + ZipEntry[] entries = new ZipEntry[NUM_ENTRIES]; + + // Add entries until MAX_CEN_SIZE is reached + for (int i = 0; i < NUM_ENTRIES; i++) { + // Create a fixed-length name for the entry + String name = Integer.toString(i); + name = "0".repeat(NAME_LENGTH - name.length()) + name; + + // Create and track the entry + ZipEntry entry = entries[i] = new ZipEntry(name); + + // Use STORED for faster processing + entry.setMethod(ZipEntry.STORED); + entry.setSize(0); + entry.setCrc(0); + + // Set the time/date field for faster processing + entry.setTimeLocal(TIME_LOCAL); + + if (i == NUM_ENTRIES -1) { + // Help SparseOutputStream detect the last CEN entry write + entry.setComment(LAST_CEN_COMMENT); + } + // Add the entry + zip.putNextEntry(entry); + + + } + // Finish writing the last entry + zip.closeEntry(); + + // Before the CEN headers are written, set the extra data on each entry + byte[] extra = makeLargeExtraField(); + for (ZipEntry entry : entries) { + entry.setExtra(extra); + } + } + } + + /** + * Validates that a ZipException is thrown with the expected message when + * the ZipFile is initialized with a ZIP whose CEN exeeds {@link #MAX_CEN_SIZE} + */ + @Test + public void centralDirectoryTooLargeToFitInByteArray() { + ZipException ex = assertThrows(ZipException.class, () -> new ZipFile(hugeZipFile)); + assertEquals(CEN_TOO_LARGE_MESSAGE, ex.getMessage()); + } + + /** + * We can reduce the number of written CEN headers by making each CEN header maximally large. + * We do this by adding the extra field produced by this method to each CEN header. + *

    + * The structure of an extra field is as follows: + *

    + * Header ID (Two bytes, describes the type of the field, also called 'tag') + * Data Size (Two byte short) + * Data Block (Contents depend on field type) + */ + private byte[] makeLargeExtraField() { + // Make a maximally sized extra field + byte[] extra = new byte[MAX_EXTRA_FIELD_SIZE]; + // Little-endian ByteBuffer for updating the header fields + ByteBuffer buffer = ByteBuffer.wrap(extra).order(ByteOrder.LITTLE_ENDIAN); + + // We use the 'unknown' tag, specified in APPNOTE.TXT, 4.6.1 Third party mappings' + buffer.putShort(UNKNOWN_ZIP_TAG); + + // Size of the actual (empty) data + buffer.putShort(MAX_DATA_SIZE); + return extra; + } + + /** + * By writing sparse 'holes' until the last CEN is detected, we can save disk space + * used by this test from ~2GB to ~4K. Instances of this class should be passed + * directly to the ZipOutputStream constructor, without any buffering. Otherwise, + * writes from ZipOutputStream may not be detected correctly. + */ + private static class SparseOutputStream extends FilterOutputStream { + private final FileChannel channel; + private boolean sparse = true; // True until the last CEN is written + private long position = 0; + + public SparseOutputStream(FileOutputStream fos) { + super(fos); + this.channel = fos.getChannel(); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + position += len; + if (sparse) { + // Until finding the last CEN, we don't actually write anything, + // but instead simply advance the position, creating a sparse file + channel.position(position); + // Check for last CEN record + if (Arrays.equals(LAST_CEN_COMMENT_BYTES, 0, LAST_CEN_COMMENT_BYTES.length, b, off, len)) { + // From here on, write actual bytes + sparse = false; + } + } else { + // Regular write + out.write(b, off, len); + } + } + + @Override + public void write(int b) throws IOException { + position++; + if (sparse) { + channel.position(position); + } else { + out.write(b); + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/CopyJar.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CopyJar.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/CopyJar.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/CopyJar.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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 1.1 99/06/01 - @bug 4239446 - @summary Make sure the ZipEntry fields are correct. - */ - -import java.io.*; -import java.util.zip.*; - -public class CopyJar { - public static void main(String args[]) throws Exception { - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), - "input.jar"))) { - ZipEntry ze = zf.getEntry("ReleaseInflater.java"); - ZipOutputStream zos = new ZipOutputStream(new ByteArrayOutputStream()); - InputStream in = zf.getInputStream(ze); - byte[] b = new byte[128]; - int n; - zos.putNextEntry(ze); - while((n = in.read(b)) != -1) { - zos.write(b, 0, n); - } - zos.close(); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/EnumAfterClose.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumAfterClose.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/EnumAfterClose.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumAfterClose.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2000, 2011, 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 4290060 - @summary Check if the zip file is closed before access any - elements in the Enumeration. - */ - -import java.io.*; -import java.util.zip.*; -import java.util.Enumeration; - -public class EnumAfterClose { - public static void main(String args[]) throws Exception { - Enumeration e; - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), - "input.zip"))) { - e = zf.entries(); - } - // ensure that the ZipFile is closed before checking the Enumeration - try { - if (e.hasMoreElements()) { - ZipEntry ze = (ZipEntry)e.nextElement(); - } - } catch (IllegalStateException ie) { - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/EnumerateAfterClose.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumerateAfterClose.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/EnumerateAfterClose.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/EnumerateAfterClose.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000, 2024, 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 4290060 + @summary Check if the zip file is closed before access any + elements in the Enumeration. + @run junit EnumerateAfterClose + */ + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Enumeration; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class EnumerateAfterClose { + + // ZIP file used in this test + private Path zip = Path.of("enum-after-close.zip"); + + /** + * Create a sample ZIP file for use by this test + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + zo.putNextEntry(new ZipEntry("file.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); + } + } + + /** + * Delete the ZIP file produced by this test + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Attempting to using a ZipEntry Enumeration after its backing + * ZipFile is closed should throw IllegalStateException. + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void enumeratingAfterCloseShouldThrowISE() throws IOException { + // Retain a reference to an enumeration backed by a closed ZipFile + Enumeration e; + try (ZipFile zf = new ZipFile(zip.toFile())) { + e = zf.entries(); + } + // Using the enumeration after the ZipFile is closed should throw ISE + assertThrows(IllegalStateException.class, () -> { + if (e.hasMoreElements()) { + ZipEntry ze = (ZipEntry)e.nextElement(); + } + }); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/FinalizeInflater.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/FinalizeInflater.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/FinalizeInflater.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/FinalizeInflater.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, 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,20 +24,64 @@ /* @test @bug 7003462 @summary Make sure cached Inflater does not get finalized. + @run junit FinalizeInflater */ -import java.io.File; -import java.io.InputStream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; public class FinalizeInflater { - public static void main(String[] args) throws Throwable { - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), "input.zip"))) - { - ZipEntry ze = zf.getEntry("ReadZip.java"); + // ZIP file produced by this test + private Path zip = Path.of("finalize-inflater.zip"); + + /** + * Create the sample ZIP used in this test + * + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + zo.putNextEntry(new ZipEntry("file.txt")); + byte[] hello = "hello".getBytes(StandardCharsets.UTF_8); + for (int i = 0; i < 100; i++) { + zo.write(hello); + } + } + } + + /** + * Delete the ZIP file produced by this test + * + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * A cached Inflater should not be made invalid by finalization + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void shouldNotFinalizeInflaterInPool() throws IOException { + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry ze = zf.getEntry("file.txt"); read(zf.getInputStream(ze)); System.gc(); System.runFinalization(); @@ -51,15 +95,10 @@ throws IOException { Wrapper wrapper = new Wrapper(is); - byte[] buffer = new byte[32]; - try { - while(is.read(buffer)>0){} - } catch (IOException ioe) { - ioe.printStackTrace(); - } + is.readAllBytes(); } - static class Wrapper{ + static class Wrapper { InputStream is; public Wrapper(InputStream is) { this.is = is; diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/GetDirEntry.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/GetDirEntry.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/GetDirEntry.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/GetDirEntry.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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 4206838 - @summary getEntry() will search for a directory - even without an ending '/'. - */ - -import java.io.*; -import java.util.zip.*; - -public class GetDirEntry { - public static void main(String args[]) throws Exception { - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), - "input.jar"))) { - ZipEntry ze = zf.getEntry("META-INF"); - if (ze == null) { - throw new Exception("failed to find a directory entry"); - } - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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,30 +22,107 @@ */ /* @test - @bug 4528128 6846616 - @summary Test if reading InputStream of a closed ZipFile crashes VM - @author kladko - */ + @bug 8340684 + @summary Verify unspecified, but long-standing behavior when reading + from an input stream obtained using ZipFile::getInputStream after + the ZipFile has been closed. + @run junit ReadAfterClose + */ + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.stream.Stream; +import java.util.zip.CRC32; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; -import java.util.zip.*; -import java.io.*; -import java.util.*; +import static org.junit.jupiter.api.Assertions.assertThrows; public class ReadAfterClose { - public static void main(String[] argv) throws Exception { + + // ZIP file used in this test + private Path zip = Path.of("read-after-close.zip"); + + /** + * Create a sample ZIP file for use by this test + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + byte[] content = "hello".repeat(1000).getBytes(StandardCharsets.UTF_8); + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + { + zo.putNextEntry(new ZipEntry("deflated.txt")); + zo.write(content); + } + { + ZipEntry entry = new ZipEntry("stored.txt"); + entry.setMethod(ZipEntry.STORED); + CRC32 crc = new CRC32(); + crc.update(content); + entry.setCrc(crc.getValue()); + entry.setSize(content.length); + zo.putNextEntry(entry); + zo.write(content); + } + } + } + + /** + * Delete the ZIP file produced by this test + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Produce arguments with a variation of stored / deflated entries, + * and read behavior before closing the ZipFile. + * @return + */ + public static Stream arguments() { + return Stream.of( + Arguments.of("stored.txt", true), + Arguments.of("stored.txt", false), + Arguments.of("deflated.txt", true), + Arguments.of("deflated.txt", false) + ); + } + /** + * Attempting to read from an InputStream obtained by ZipFile.getInputStream + * after the backing ZipFile is closed should throw IOException + * + * @throws IOException if an unexpected IOException occurs + */ + @ParameterizedTest + @MethodSource("arguments") + public void readAfterClose(String entryName, boolean readFirst) throws IOException { + // Retain a reference to an input stream backed by a closed ZipFile InputStream in; - try (ZipFile zf = new ZipFile( - new File(System.getProperty("test.src","."),"crash.jar"))) { - ZipEntry zent = zf.getEntry("Test.java"); - in = zf.getInputStream(zent); + try (ZipFile zf = new ZipFile(zip.toFile())) { + in = zf.getInputStream(new ZipEntry(entryName)); + // Optionally consume a single byte from the stream before closing + if (readFirst) { + in.read(); + } } - // ensure zf is closed at this point - try { + + assertThrows(IOException.class, () -> { in.read(); - } catch (IOException e) { - return; - } - throw new Exception("Test failed."); + }); } -} +} \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReadZip.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadZip.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReadZip.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReadZip.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,185 +22,359 @@ */ /* @test - @bug 4241361 4842702 4985614 6646605 5032358 6923692 6233323 8144977 8186464 + @bug 4241361 4842702 4985614 6646605 5032358 6923692 6233323 8144977 8186464 4401122 8322830 @summary Make sure we can read a zip file. - @key randomness @modules jdk.zipfs + @run junit ReadZip */ -import java.io.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.net.URI; -import java.nio.file.Files; -import java.nio.file.FileSystem; -import java.nio.file.FileSystems; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.NoSuchFileException; -import java.nio.file.StandardCopyOption; -import java.nio.file.StandardOpenOption; -import java.util.List; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.util.Collections; +import java.util.HexFormat; import java.util.Map; -import java.util.zip.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; import static java.nio.charset.StandardCharsets.US_ASCII; +import static org.junit.jupiter.api.Assertions.*; public class ReadZip { - private static void unreached (Object o) - throws Exception - { - // Should never get here - throw new Exception ("Expected exception was not thrown"); - } - - public static void main(String args[]) throws Exception { - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), - "input.zip"))) { - // Make sure we throw NPE on null objects - try { unreached (zf.getEntry(null)); } - catch (NullPointerException e) {} - - try { unreached (zf.getInputStream(null)); } - catch (NullPointerException e) {} - - ZipEntry ze = zf.getEntry("ReadZip.java"); - if (ze == null) { - throw new Exception("cannot read from zip file"); - } + + // ZIP file produced during tests + private Path zip = Path.of("read-zip.zip"); + + /** + * Create a sample ZIP file for use by tests + * @param name name of the ZIP file to create + * @return a sample ZIP file + * @throws IOException if an unexpected IOException occurs + */ + private Path createZip(String name) throws IOException { + Path zip = Path.of(name); + + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + zo.putNextEntry(new ZipEntry("file.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); } - // Make sure we can read the zip file that has some garbage - // bytes padded at the end. - File newZip = new File(System.getProperty("test.dir", "."), "input2.zip"); - Files.copy(Paths.get(System.getProperty("test.src", ""), "input.zip"), - newZip.toPath(), StandardCopyOption.REPLACE_EXISTING); + return zip; + } + + /** + * Delete the ZIP file produced after each test method + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Make sure we throw NPE when calling getEntry or getInputStream with null params + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void nullPointerExceptionOnNullParams() throws IOException { + zip = createZip("null-params.zip"); + try (ZipFile zf = new ZipFile(zip.toFile())) { + + assertThrows(NullPointerException.class, () -> zf.getEntry(null)); + assertThrows(NullPointerException.class, () -> zf.getInputStream(null)); + + // Sanity check that we can still read an entry + ZipEntry ze = zf.getEntry("file.txt"); + assertNotNull(ze, "cannot read from zip file"); + } + } + + /** + * Read the zip file that has some garbage bytes padded at the end + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void bytesPaddedAtEnd() throws IOException { - newZip.setWritable(true); + zip = createZip("bytes-padded.zip"); // pad some bytes - try (OutputStream os = Files.newOutputStream(newZip.toPath(), - StandardOpenOption.APPEND)) { - os.write(1); os.write(3); os.write(5); os.write(7); + try (OutputStream os = Files.newOutputStream(zip, + StandardOpenOption.APPEND)) { + os.write(1); + os.write(3); + os.write(5); + os.write(7); } - try (ZipFile zf = new ZipFile(newZip)) { - ZipEntry ze = zf.getEntry("ReadZip.java"); - if (ze == null) { - throw new Exception("cannot read from zip file"); - } - } finally { - newZip.delete(); + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry ze = zf.getEntry("file.txt"); + assertNotNull(ze, "cannot read from zip file"); + } + } + + /** + * Verify that we can read a comment from the ZIP + * file's 'End of Central Directory' header + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void readZipFileComment() throws IOException { + + // Create a zip file with a comment in the 'End of Central Directory' header + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zos = new ZipOutputStream(out)) { + ZipEntry ze = new ZipEntry("ZipEntry"); + zos.putNextEntry(ze); + zos.write(1); + zos.write(2); + zos.write(3); + zos.write(4); + zos.closeEntry(); + zos.setComment("This is the comment for testing"); } // Read zip file comment - try { - try (FileOutputStream fos = new FileOutputStream(newZip); - ZipOutputStream zos = new ZipOutputStream(fos)) - { - ZipEntry ze = new ZipEntry("ZipEntry"); - zos.putNextEntry(ze); - zos.write(1); zos.write(2); zos.write(3); zos.write(4); - zos.closeEntry(); - zos.setComment("This is the comment for testing"); - } + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry ze = zf.getEntry("ZipEntry"); + assertNotNull(ze, "cannot read entry from zip file"); + assertEquals("This is the comment for testing", zf.getComment()); + } + } - try (ZipFile zf = new ZipFile(newZip)) { - ZipEntry ze = zf.getEntry("ZipEntry"); - if (ze == null) - throw new Exception("cannot read entry from zip file"); - if (!"This is the comment for testing".equals(zf.getComment())) - throw new Exception("cannot read comment from zip file"); - } - } finally { - newZip.delete(); + /** + * Verify that a directory entry can be found using the + * name 'directory/' as well as 'directory/' + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void readDirectoryEntries() throws IOException { + + // Create a ZIP containing some directory entries + try (OutputStream fos = Files.newOutputStream(zip); + ZipOutputStream zos = new ZipOutputStream(fos)) { + // Add a META-INF directory with STORED compression type + ZipEntry metaInf = new ZipEntry("META-INF/"); + metaInf.setMethod(ZipEntry.STORED); + metaInf.setSize(0); + metaInf.setCrc(0); + zos.putNextEntry(metaInf); + + // Add a regular directory + ZipEntry dir = new ZipEntry("directory/"); + zos.putNextEntry(dir); + zos.closeEntry(); } - // Read directory entry - try { - try (FileOutputStream fos = new FileOutputStream(newZip); - ZipOutputStream zos = new ZipOutputStream(fos)) - { - ZipEntry ze = new ZipEntry("directory/"); - zos.putNextEntry(ze); - zos.closeEntry(); + // Verify directory lookups + try (ZipFile zf = new ZipFile(zip.toFile())) { + // Look up 'directory/' using the full name + ZipEntry ze = zf.getEntry("directory/"); + assertNotNull(ze, "read entry \"directory/\" failed"); + assertTrue(ze.isDirectory(), "read entry \"directory/\" failed"); + assertEquals("directory/", ze.getName()); + + try (InputStream is = zf.getInputStream(ze)) { + is.available(); + } catch (Exception x) { + x.printStackTrace(); } - try (ZipFile zf = new ZipFile(newZip)) { - ZipEntry ze = zf.getEntry("directory/"); - if (ze == null || !ze.isDirectory()) - throw new RuntimeException("read entry \"directory/\" failed"); - try (InputStream is = zf.getInputStream(ze)) { - is.available(); - } catch (Exception x) { - x.printStackTrace(); - } - - ze = zf.getEntry("directory"); - if (ze == null || !ze.isDirectory()) - throw new RuntimeException("read entry \"directory\" failed"); - try (InputStream is = zf.getInputStream(ze)) { - is.available(); - } catch (Exception x) { - x.printStackTrace(); - } + + // Look up 'directory/' without the trailing slash + ze = zf.getEntry("directory"); + assertNotNull(ze, "read entry \"directory\" failed"); + assertTrue(ze.isDirectory(), "read entry \"directory\" failed"); + assertEquals("directory/", ze.getName()); + + try (InputStream is = zf.getInputStream(ze)) { + is.available(); + } catch (Exception x) { + x.printStackTrace(); } - } finally { - newZip.delete(); + // Sanity check that also META-INF/ can be looked up with or without the trailing slash + assertNotNull(zf.getEntry("META-INF")); + assertNotNull(zf.getEntry("META-INF/")); + assertEquals(zf.getEntry("META-INF").getName(), + zf.getEntry("META-INF/").getName()); } + } - // Throw a FNF exception when read a non-existing zip file - try { unreached (new ZipFile( - new File(System.getProperty("test.src", "."), - "input" - + String.valueOf(new java.util.Random().nextInt()) - + ".zip"))); - } catch (NoSuchFileException nsfe) {} - - // read a zip file with ZIP64 end - Path path = Paths.get(System.getProperty("test.dir", ""), "end64.zip"); - try { - URI uri = URI.create("jar:" + path.toUri()); - Map env = Map.of("create", "true", "forceZIP64End", "true"); - try (FileSystem fs = FileSystems.newFileSystem(uri, env)) { - Files.write(fs.getPath("hello"), "hello".getBytes()); - } - try (ZipFile zf = new ZipFile(path.toFile())) { - if (!"hello".equals(new String(zf.getInputStream(new ZipEntry("hello")) - .readAllBytes(), - US_ASCII))) - throw new RuntimeException("zipfile: read entry failed"); - } catch (IOException x) { - throw new RuntimeException("zipfile: zip64 end failed"); + /** + * Throw a NoSuchFileException exception when reading a non-existing zip file + */ + @Test + public void nonExistingFile() { + File nonExistingFile = new File("non-existing-file-f6804460f.zip"); + assertThrows(NoSuchFileException.class, () -> + new ZipFile(nonExistingFile)); + } + + /** + * Read a Zip file with a 'Zip64 End of Central Directory header' which was created + * using ZipFileSystem with the 'forceZIP64End' option. + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void readZip64EndZipFs() throws IOException { + + // Create zip file with Zip64 end + Map env = Map.of("create", "true", "forceZIP64End", "true"); + try (FileSystem fs = FileSystems.newFileSystem(zip, env)) { + Files.write(fs.getPath("hello"), "hello".getBytes()); + } + // Read using ZipFile + try (ZipFile zf = new ZipFile(zip.toFile())) { + try (InputStream in = zf.getInputStream(zf.getEntry("hello"))) { + assertEquals("hello", new String(in.readAllBytes(), StandardCharsets.US_ASCII)); } - try (FileSystem fs = FileSystems.newFileSystem(uri, Map.of())) { - if (!"hello".equals(new String(Files.readAllBytes(fs.getPath("hello"))))) - throw new RuntimeException("zipfs: read entry failed"); - } catch (IOException x) { - throw new RuntimeException("zipfile: zip64 end failed"); + } + // Read using ZipFileSystem + try (FileSystem fs = FileSystems.newFileSystem(zip, Map.of())) { + assertEquals("hello", new String(Files.readAllBytes(fs.getPath("hello")))); + } + } + + /** + * Read a zip file created via Info-ZIP in streaming mode, + * which includes a 'Zip64 End of Central Directory header'. + * + * @throws IOException if an unexpected IOException occurs + * @throws InterruptedException if an unexpected InterruptedException occurs + */ + @Test + public void readZip64EndInfoZIPStreaming() throws IOException, InterruptedException { + // ZIP created using: "echo -n hello | zip zip64.zip -" + // Hex encoded using: "cat zip64.zip | xxd -ps" + byte[] zipBytes = HexFormat.of().parseHex(""" + 504b03042d0000000000c441295886a61036ffffffffffffffff01001400 + 2d010010000500000000000000050000000000000068656c6c6f504b0102 + 1e032d0000000000c441295886a610360500000005000000010000000000 + 000001000000b011000000002d504b06062c000000000000001e032d0000 + 00000000000000010000000000000001000000000000002f000000000000 + 003800000000000000504b06070000000067000000000000000100000050 + 4b050600000000010001002f000000380000000000 + """.replaceAll("\n","") + ); + + Files.write(zip, zipBytes); + + try (ZipFile zf = new ZipFile(this.zip.toFile())) { + try (InputStream in = zf.getInputStream(zf.getEntry("-"))) { + String contents = new String(in.readAllBytes(), StandardCharsets.US_ASCII); + assertEquals("hello", contents); } - } finally { - Files.deleteIfExists(path); } + } - // read a zip file created via "echo hello | zip dst.zip -", which uses - // ZIP64 end record - if (Files.notExists(Paths.get("/usr/bin/zip"))) - return; - try { - Process zip = new ProcessBuilder("zip", path.toString().toString(), "-").start(); - OutputStream os = zip.getOutputStream(); - os.write("hello".getBytes(US_ASCII)); - os.close(); - zip.waitFor(); - if (zip.exitValue() == 0 && Files.exists(path)) { - try (ZipFile zf = new ZipFile(path.toFile())) { - if (!"hello".equals(new String(zf.getInputStream(new ZipEntry("-")) - .readAllBytes()))) - throw new RuntimeException("zipfile: read entry failed"); - } catch (IOException x) { - throw new RuntimeException("zipfile: zip64 end failed"); - } + /** + * Check that the available() method overriden by the input stream returned by + * ZipFile.getInputStream correctly returns the number of remaining uncompressed bytes + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void availableShouldReturnRemainingUncompressedBytes() throws IOException { + // The number of uncompressed bytes to write to the sample ZIP entry + final int expectedBytes = 512; + + // Create a sample ZIP with deflated entry of a known uncompressed size + try (ZipOutputStream zo = new ZipOutputStream(Files.newOutputStream(zip))) { + zo.putNextEntry(new ZipEntry("file.txt")); + zo.write(new byte[expectedBytes]); + } + + // Verify the behavior of ZipFileInflaterInputStream.available() + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry e = zf.getEntry("file.txt"); + try (InputStream in = zf.getInputStream(e)) { + // Initially, available() should return the full uncompressed size of the entry + assertEquals(expectedBytes, in.available(), + "wrong initial return value of available"); + + // Reading a few bytes should reduce the number of available bytes accordingly + int bytesToRead = 10; + in.read(new byte[bytesToRead]); + assertEquals(expectedBytes - bytesToRead, in.available()); + + // Reading all remaining bytes should reduce the number of available bytes to zero + in.transferTo(OutputStream.nullOutputStream()); + assertEquals(0, in.available()); + + // available on a closed input stream should return zero + in.close(); + assertEquals(0, in.available()); } - } finally { - Files.deleteIfExists(path); } } -} + + /** + * Verify that reading an InputStream from a closed ZipFile + * throws IOException as expected and does not crash the VM. + * See bugs: 4528128 6846616 + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void readAfterClose() throws IOException { + zip = createZip("read-after-close.zip"); + InputStream in; + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry zent = zf.getEntry("file.txt"); + in = zf.getInputStream(zent); + } + + // zf is closed at this point + assertThrows(IOException.class, () -> { + in.read(); + }); + assertThrows(IOException.class, () -> { + in.read(new byte[10]); + }); + assertThrows(IOException.class, () -> { + byte[] buf = new byte[10]; + in.read(buf, 0, buf.length); + }); + assertThrows(IOException.class, () -> { + in.readAllBytes(); + }); + } + + /** + * Verify that ZipFile can open a ZIP file with zero entries + * + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void noEntries() throws IOException { + // Create a ZIP file with no entries + try (ZipOutputStream zo = new ZipOutputStream(Files.newOutputStream(zip))) { + } + + // Open the "empty" ZIP file + try (ZipFile zf = new ZipFile(zip.toFile())) { + // Verify size + assertEquals(0, zf.size()); + + // Verify entry lookup using ZipFile.getEntry() + assertNull(zf.getEntry("file.txt")); + + // Verify iteration using ZipFile.entries() + assertEquals(Collections.emptyList(), Collections.list(zf.entries())); + + // Verify iteration using ZipFile.stream() + assertEquals(Collections.emptyList(), zf.stream().toList()); + } + } +} \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReleaseInflater.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReleaseInflater.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ReleaseInflater.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ReleaseInflater.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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,31 +25,74 @@ * @bug 4214795 * @summary Make sure the same inflater will only be recycled * once. + * @run junit ReleaseInflater */ -import java.io.*; -import java.util.zip.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; public class ReleaseInflater { - public static void main(String[] args) throws Exception { - ZipFile zf = new ZipFile(new File(System.getProperty("test.src"), - "input.jar")); - ZipEntry e = zf.getEntry("ReleaseInflater.java"); - - InputStream in1 = zf.getInputStream(e); - // close the stream, the inflater will be released - in1.close(); - // close the stream again, should be no-op - in1.close(); - - // create two new streams, allocating inflaters - InputStream in2 = zf.getInputStream(e); - InputStream in3 = zf.getInputStream(e); - - // check to see if they influence each other - if (in2.read() != in3.read()) { - throw new Exception("Stream is corrupted!"); + // ZIP file produced in this test + private Path zip = Path.of("release-inflater.zip"); + + /** + * Create a sample ZIP file for use by tests + * @param name name of the ZIP file to create + * @return a sample ZIP file + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + try (ZipOutputStream zo = new ZipOutputStream(Files.newOutputStream(zip))) { + zo.putNextEntry(new ZipEntry("file.txt")); + zo.write("helloworld".getBytes(StandardCharsets.UTF_8)); + } + } + + /** + * Delete the ZIP and JAR files produced after each test method + * @throws IOException if an unexpected IOException occurs + */ + + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Verify that the same Inflater is not recycled across input streams + * @throws IOException if an unexpected IOException occurs + */ + @Test + public void recycleInflaterOnlyOnce() throws IOException { + try (ZipFile zf = new ZipFile(zip.toFile())) { + ZipEntry e = zf.getEntry("file.txt"); + + InputStream in1 = zf.getInputStream(e); + // close the stream, the inflater will be released + in1.close(); + // close the stream again, should be no-op + in1.close(); + + // create two new streams, allocating inflaters + InputStream in2 = zf.getInputStream(e); + InputStream in3 = zf.getInputStream(e); + + // check to see if they influence each other + assertEquals(in2.read(), in3.read(), "Stream is corrupted!"); } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/StreamZipEntriesTest.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/StreamZipEntriesTest.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/StreamZipEntriesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/StreamZipEntriesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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,74 +23,169 @@ /** * @test - * @run testng StreamZipEntriesTest + * @run junit StreamZipEntriesTest * @summary Make sure we can stream entries of a zip file. */ -import java.io.File; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.io.IOException; -import java.lang.Object; -import java.lang.System; -import java.util.jar.JarFile; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; public class StreamZipEntriesTest { + // ZIP file produced in this test + private Path zip = Path.of("stream.zip"); + // JAR file produced in this test + private Path jar = Path.of("stream.jar"); + + /** + * Create sample ZIP and JAR files used in in this test + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + zo.putNextEntry(new ZipEntry("entry1.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); + zo.putNextEntry(new ZipEntry("entry2.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); + } + + try (OutputStream out = Files.newOutputStream(jar); + ZipOutputStream zo = new ZipOutputStream(out)) { + // A JAR file may start with a META-INF/ directory before the manifest + zo.putNextEntry(new ZipEntry("META-INF/")); + // Write the manifest + zo.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF")); + new Manifest().write(zo); + + // Write two regular entries + zo.putNextEntry(new ZipEntry("entry1.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); + zo.putNextEntry(new ZipEntry("entry2.txt")); + zo.write("hello".getBytes(StandardCharsets.UTF_8)); + } + } + + /** + * Delete the ZIP file produced after each test method + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + Files.deleteIfExists(jar); + } + + /** + * Verify that ZipFile.stream() produces the expected entries + * @throws IOException if an unexpected IOException occurs + */ @Test public void testStreamZip() throws IOException { - try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), "input.zip"))) { - zf.stream().forEach(e -> assertTrue(e instanceof ZipEntry)); - zf.stream().forEach(e -> assertEquals(e.toString(), "ReadZip.java")); + Set names = new HashSet<>(Set.of("entry1.txt", "entry2.txt")); + + try (ZipFile zf = new ZipFile(zip.toFile())) { + zf.stream().forEach(e -> { + assertTrue(e instanceof ZipEntry); + String name = e.getName(); + assertNotNull(names.remove(name)); + String toString = e.toString(); + assertEquals(name, toString); + }); + + // Check that all expected names were processed + assertTrue(names.isEmpty()); + // Check that Stream.toArray produces the expected result Object elements[] = zf.stream().toArray(); - assertEquals(1, elements.length); - assertEquals(elements[0].toString(), "ReadZip.java"); + assertEquals(2, elements.length); + assertEquals(elements[0].toString(), "entry1.txt"); + assertEquals(elements[1].toString(), "entry2.txt"); } } + /** + * Verify that JarFile.stream() produces the expected entries + * @throws IOException if an unexpected IOException occurs + */ @Test public void testStreamJar() throws IOException { - try (JarFile jf = new JarFile(new File(System.getProperty("test.src", "."), "input.jar"))) { - jf.stream().forEach(e -> assertTrue(e instanceof JarEntry)); + try (JarFile jf = new JarFile(jar.toFile())) { + Set names = new HashSet<>(Set.of( + "META-INF/", + "META-INF/MANIFEST.MF", + "entry1.txt", + "entry2.txt" + )); + + jf.stream().forEach(e -> { + assertTrue(e instanceof JarEntry); + String name = e.getName(); + assertNotNull(names.remove(name)); + String toString = e.toString(); + assertEquals(name, toString); + } + ); + // Check that all expected names were processed + assertTrue(names.isEmpty(), "Unprocessed entries: " + names); + + + // Check that Stream.toArray produces the expected result Object elements[] = jf.stream().toArray(); - assertEquals(3, elements.length); + assertEquals(4, elements.length); assertEquals(elements[0].toString(), "META-INF/"); assertEquals(elements[1].toString(), "META-INF/MANIFEST.MF"); - assertEquals(elements[2].toString(), "ReleaseInflater.java"); + assertEquals(elements[2].toString(), "entry1.txt"); + assertEquals(elements[3].toString(), "entry2.txt"); } } + /** + * Calling ZipFile.stream() on a closed ZipFile should throw ISE + * @throws IOException if an unexpected IOException occurs + */ @Test public void testClosedZipFile() throws IOException { - ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), "input.zip")); + ZipFile zf = new ZipFile(zip.toFile()); zf.close(); - try { + assertThrows(IllegalStateException.class, () -> { Stream s = zf.stream(); - fail("Should have thrown IllegalStateException"); - } catch (IllegalStateException e) { - // expected; - } + }); } + /** + * Calling JarFile.stream() on a closed JarFile should throw ISE + * @throws IOException if an unexpected IOException occurs + */ @Test public void testClosedJarFile() throws IOException { - JarFile jf = new JarFile(new File(System.getProperty("test.src", "."), "input.jar")); + JarFile jf = new JarFile(jar.toFile()); jf.close(); - try { + assertThrows(IllegalStateException.class, () -> { Stream s = jf.stream(); - fail("Should have thrown IllegalStateException"); - } catch (IllegalStateException e) { - // expected; - } + }); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ZeroDate.java openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ZeroDate.java --- openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/ZeroDate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/ZeroDate.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,41 +40,47 @@ import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; +import jdk.test.lib.Utils; + /* @test * @bug 8184940 8188869 * @summary JDK 9 rejects zip files where the modified day or month is 0 * or otherwise represent an invalid date, such as 1980-02-30 24:60:60 * @author Liam Miller-Cushon + * @library /test/lib */ public class ZeroDate { public static void main(String[] args) throws Exception { // create a zip file, and read it in as a byte array - Path path = Files.createTempFile("bad", ".zip"); - try (OutputStream os = Files.newOutputStream(path); - ZipOutputStream zos = new ZipOutputStream(os)) { - ZipEntry e = new ZipEntry("x"); - zos.putNextEntry(e); - zos.write((int) 'x'); - } - int len = (int) Files.size(path); - byte[] data = new byte[len]; - try (InputStream is = Files.newInputStream(path)) { - is.read(data); + Path path = Utils.createTempFile("bad", ".zip"); + try { + try (OutputStream os = Files.newOutputStream(path); + ZipOutputStream zos = new ZipOutputStream(os)) { + ZipEntry e = new ZipEntry("x"); + zos.putNextEntry(e); + zos.write((int) 'x'); + } + int len = (int) Files.size(path); + byte[] data = new byte[len]; + try (InputStream is = Files.newInputStream(path)) { + is.read(data); + } + + // year, month, day are zero + testDate(data.clone(), 0, LocalDate.of(1979, 11, 30).atStartOfDay()); + // only year is zero + testDate(data.clone(), 0 << 25 | 4 << 21 | 5 << 16, LocalDate.of(1980, 4, 5).atStartOfDay()); + // month is greater than 12 + testDate(data.clone(), 0 << 25 | 13 << 21 | 1 << 16, LocalDate.of(1981, 1, 1).atStartOfDay()); + // 30th of February + testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16, LocalDate.of(1980, 3, 1).atStartOfDay()); + // 30th of February, 24:60:60 + testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16 | 24 << 11 | 60 << 5 | 60 >> 1, + LocalDateTime.of(1980, 3, 2, 1, 1, 0)); + } finally { + Files.delete(path); } - Files.delete(path); - - // year, month, day are zero - testDate(data.clone(), 0, LocalDate.of(1979, 11, 30).atStartOfDay()); - // only year is zero - testDate(data.clone(), 0 << 25 | 4 << 21 | 5 << 16, LocalDate.of(1980, 4, 5).atStartOfDay()); - // month is greater than 12 - testDate(data.clone(), 0 << 25 | 13 << 21 | 1 << 16, LocalDate.of(1981, 1, 1).atStartOfDay()); - // 30th of February - testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16, LocalDate.of(1980, 3, 1).atStartOfDay()); - // 30th of February, 24:60:60 - testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16 | 24 << 11 | 60 << 5 | 60 >> 1, - LocalDateTime.of(1980, 3, 2, 1, 1, 0)); } private static void testDate(byte[] data, int date, LocalDateTime expected) throws IOException { @@ -86,7 +92,7 @@ writeU32(data, locpos + LOCTIM, date); // ensure that the archive is still readable, and the date is 1979-11-30 - Path path = Files.createTempFile("out", ".zip"); + Path path = Utils.createTempFile("out", ".zip"); try (OutputStream os = Files.newOutputStream(path)) { os.write(data); } Binary files /srv/release.debian.org/tmp/uHIlyAU3ag/openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/crash.jar and /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/crash.jar differ Binary files /srv/release.debian.org/tmp/uHIlyAU3ag/openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/input.jar and /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/input.jar differ Binary files /srv/release.debian.org/tmp/uHIlyAU3ag/openjdk-17-17.0.13+11/test/jdk/java/util/zip/ZipFile/input.zip and /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/java/util/zip/ZipFile/input.zip differ diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/accessibility/JComboBox/TestJComboBoxScreenMagnifier.java openjdk-17-17.0.14+7/test/jdk/javax/accessibility/JComboBox/TestJComboBoxScreenMagnifier.java --- openjdk-17-17.0.13+11/test/jdk/javax/accessibility/JComboBox/TestJComboBoxScreenMagnifier.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/accessibility/JComboBox/TestJComboBoxScreenMagnifier.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2023, 2024, 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.BorderLayout; +import java.awt.GridLayout; +import java.lang.reflect.InvocationTargetException; + +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 8283214 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "mac") + * @summary Verifies if item selected in JComboBox magnifies using + * screen magnifier a11y tool + * @run main/manual TestJComboBoxScreenMagnifier + */ + +public class TestJComboBoxScreenMagnifier { + private static JFrame frame; + private static final String INSTRUCTIONS = + "1) Enable Screen magnifier on the Mac\n\n" + + "System Preference -> Accessibility -> Zoom -> " + + "Select \"Enable Hover Text\"\n\n" + + "2) Move the mouse over the combo box and press " + + "\"Command\" button.\n\n" + + "3) If magnified label is visible, press Pass else Fail."; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("JComboBox Screen Magnifier Test Instructions") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(12) + .columns(40) + .screenCapture() + .build(); + + SwingUtilities.invokeAndWait(TestJComboBoxScreenMagnifier::createAndShowUI); + passFailJFrame.awaitAndCheck(); + } + + private static void createAndShowUI() { + frame = new JFrame("JComboBox A11Y Screen Magnifier Test"); + + String[] fruits = new String[] {"Apple", "Orange", + "Mango", "Pineapple", "Banana"}; + JComboBox comboBox = new JComboBox(fruits); + JPanel fruitPanel = new JPanel(new GridLayout(1, 2)); + JLabel fruitLabel = new JLabel("Fruits:", JLabel.CENTER); + fruitLabel.getAccessibleContext().setAccessibleName("Fruits Label"); + fruitPanel.add(fruitLabel); + fruitPanel.add(comboBox); + comboBox.getAccessibleContext().setAccessibleName("Fruit Combo box"); + frame.getContentPane().add(fruitPanel, BorderLayout.CENTER); + + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, + PassFailJFrame.Position.HORIZONTAL); + frame.pack(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setVisible(true); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/ByteBuffers.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/ByteBuffers.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/ByteBuffers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/ByteBuffers.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ * @summary Test the Cipher.update/doFinal(ByteBuffer, ByteBuffer) methods * @author Andreas Sterbenz * @key randomness + * @run main ByteBuffers DES 8 + * @run main ByteBuffers AES 16 */ import java.util.*; @@ -40,17 +42,20 @@ public class ByteBuffers { public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); Random random = new Random(); int n = 10 * 1024; byte[] t = new byte[n]; random.nextBytes(t); - byte[] keyBytes = new byte[8]; + int keyInt = Integer.parseInt(args[1]); + byte[] keyBytes = new byte[keyInt]; random.nextBytes(keyBytes); - SecretKey key = new SecretKeySpec(keyBytes, "DES"); + String algo = args[0]; + SecretKey key = new SecretKeySpec(keyBytes, algo); - Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding"); + Cipher cipher = Cipher.getInstance(algo + "/ECB/NoPadding"); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] outBytes = cipher.doFinal(t); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -357,10 +357,12 @@ static byte[] encryptedText(String mode, byte[] pt) throws Exception{ Cipher c; if (mode.compareTo("GCM") == 0) { - c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + c = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.ENCRYPT_MODE, key, gcmspec); } else if (mode.compareTo("CBC") == 0) { - c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE"); + c = Cipher.getInstance("AES/CBC/PKCS5Padding", + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.ENCRYPT_MODE, key, iv); } else { return null; @@ -380,10 +382,12 @@ Cipher c; if (mode.compareTo("GCM") == 0) { - c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE"); + c = Cipher.getInstance("AES/GCM/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.DECRYPT_MODE, key, gcmspec); } else if (mode.compareTo("CBC") == 0) { - c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE"); + c = Cipher.getInstance("AES/CBC/PKCS5Padding", + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.DECRYPT_MODE, key, iv); } else { return null; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,8 @@ // decide if the installed jurisdiction policy file is the // unlimited version boolean isUnlimited = true; - Cipher c = Cipher.getInstance("AES", "SunJCE"); + Cipher c = Cipher.getInstance("AES", + System.getProperty("test.provider.name", "SunJCE")); try { c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[24], "AES")); } catch (InvalidKeyException ike) { diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/TestCipherMode.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestCipherMode.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/TestCipherMode.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestCipherMode.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,9 @@ public static void main(String[] argv) throws Exception { - TestCipherMode test = new TestCipherMode("SunJCE", TRANSFORMATIONS); + TestCipherMode test = new TestCipherMode( + System.getProperty("test.provider.name", "SunJCE"), + TRANSFORMATIONS); System.out.println("All Tests Passed"); } diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/TestGetInstance.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestGetInstance.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Cipher/TestGetInstance.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Cipher/TestGetInstance.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,10 +26,13 @@ * @bug 4898428 * @summary test that the new getInstance() implementation works correctly * @author Andreas Sterbenz + * @run main TestGetInstance DES PBEWithMD5AndTripleDES + * @run main TestGetInstance AES PBEWithHmacSHA1AndAES_128 */ import java.security.*; import java.security.spec.*; +import java.util.Locale; import javax.crypto.*; @@ -42,56 +45,64 @@ } public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + String algo = args[0]; + String algoLC = algo.toLowerCase(Locale.ROOT); + String pbeAlgo = args[1]; + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunJCE")); Cipher c; - c = Cipher.getInstance("PBEWithMD5AndTripleDES"); + c = Cipher.getInstance(pbeAlgo); same(p, c.getProvider()); - c = Cipher.getInstance("des", "SunJCE"); + c = Cipher.getInstance(algoLC, + System.getProperty("test.provider.name", "SunJCE")); same(p, c.getProvider()); - c = Cipher.getInstance("des/cbc/pkcs5padding", "SunJCE"); + c = Cipher.getInstance(algoLC + "/cbc/pkcs5padding", + System.getProperty("test.provider.name", "SunJCE")); same(p, c.getProvider()); - c = Cipher.getInstance("des", p); + c = Cipher.getInstance(algoLC, p); same(p, c.getProvider()); - c = Cipher.getInstance("des/cbc/pkcs5padding", p); + c = Cipher.getInstance(algoLC + "/cbc/pkcs5padding", p); same(p, c.getProvider()); try { - c = Cipher.getInstance("DES/XYZ/PKCS5Padding"); + c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding"); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - c = Cipher.getInstance("DES/XYZ/PKCS5Padding", "SunJCE"); + c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding", + System.getProperty("test.provider.name", "SunJCE")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - c = Cipher.getInstance("DES/XYZ/PKCS5Padding", p); + c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding", p); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - c = Cipher.getInstance("DES/CBC/XYZPadding"); + c = Cipher.getInstance(algo + "/CBC/XYZPadding"); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - c = Cipher.getInstance("DES/CBC/XYZPadding", "SunJCE"); + c = Cipher.getInstance(algo + "/CBC/XYZPadding", + System.getProperty("test.provider.name", "SunJCE")); throw new AssertionError(); } catch (NoSuchPaddingException e) { System.out.println(e); } try { - c = Cipher.getInstance("DES/CBC/XYZPadding", p); + c = Cipher.getInstance(algo + "/CBC/XYZPadding", p); throw new AssertionError(); } catch (NoSuchPaddingException e) { System.out.println(e); @@ -104,7 +115,8 @@ System.out.println(e); } try { - c = Cipher.getInstance("foo", "SunJCE"); + c = Cipher.getInstance("foo", + System.getProperty("test.provider.name", "SunJCE")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); @@ -117,13 +129,15 @@ } try { - c = Cipher.getInstance("foo", "SUN"); + c = Cipher.getInstance("foo", + System.getProperty("test.provider.name", "SUN")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - c = Cipher.getInstance("foo", Security.getProvider("SUN")); + c = Cipher.getInstance("foo", Security.getProvider( + System.getProperty("test.provider.name", "SUN"))); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ * @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to * process when in.remaining() == 0 * @key randomness + * @run main DirectBBRemaining DES 8 + * @run main DirectBBRemaining AES 16 */ import java.nio.ByteBuffer; @@ -53,11 +55,14 @@ boolean failedOnce = false; Exception failedReason = null; - byte[] keyBytes = new byte[8]; + int keyInt = Integer.parseInt(args[1]); + byte[] keyBytes = new byte[keyInt]; random.nextBytes(keyBytes); - SecretKey key = new SecretKeySpec(keyBytes, "DES"); + String algo = args[0]; + SecretKey key = new SecretKeySpec(keyBytes, algo); - Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE"); + Cipher cipher = Cipher.getInstance(algo + "/CBC/PKCS5Padding", + System.getProperty("test.provider.name", "SunJCE")); cipher.init(Cipher.ENCRYPT_MODE, key); /* diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -29,6 +29,8 @@ * crypto permssion checks failed. * @author Valerie Peng * @key randomness + * @run main AllPermCheck DES + * @run main AllPermCheck AES */ import java.io.*; @@ -84,9 +86,10 @@ } public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); - if (Cipher.getMaxAllowedKeyLength("DES") == Integer.MAX_VALUE) { + String transformation = args[0]; + if (Cipher.getMaxAllowedKeyLength(transformation) == Integer.MAX_VALUE) { // skip this test for unlimited jurisdiction policy files System.out.println("Skip this test due to unlimited version"); return; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,9 +46,9 @@ }; public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); - if (Cipher.getMaxAllowedKeyLength("DES") == Integer.MAX_VALUE) { + if (Cipher.getMaxAllowedKeyLength("AES") == Integer.MAX_VALUE) { // skip this test for unlimited jurisdiction policy files System.out.println("Skip this test due to unlimited version"); return; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -135,7 +135,7 @@ }; public static void main(String[] args) throws Exception { boolean result = true; - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); System.out.println("Testing provider " + p.getName() + "..."); // Test#1: make sure Cipher.getMaxAllowedKeyLength returns the // correct value diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,9 +52,11 @@ String algo = ALGOS[i]; // generate AlgorithmParameters object SecretKeyFactory skf = - SecretKeyFactory.getInstance(algo, "SunJCE"); + SecretKeyFactory.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); SecretKey key = skf.generateSecret(ks); - Cipher c = Cipher.getInstance(algo, "SunJCE"); + Cipher c = Cipher.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); c.init(Cipher.ENCRYPT_MODE, key); c.doFinal(BYTES); // force the parameter generation if not already diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,8 @@ * @bug 4508341 * @summary Test the EncryptedPrivateKeyInfo.getKeySpec(...) methods. * @author Valerie Peng + * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpec + * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpec */ import java.util.*; import java.nio.*; @@ -37,16 +39,17 @@ import javax.crypto.spec.*; public class GetKeySpec { - private static final String cipherAlg = "PBEWithMD5AndDES"; + private static String cipherAlg; private static final char[] passwd = { 'p','a','s','s','w','d' }; private static AlgorithmParameters GOOD_PARAMS; static { try { + cipherAlg = System.getProperty("cipherAlg"); PBEParameterSpec goodParamSpec = new PBEParameterSpec(new byte[8], 1024); GOOD_PARAMS = AlgorithmParameters.getInstance - (cipherAlg, "SunJCE"); + (cipherAlg, System.getProperty("test.provider.name", "SunJCE")); GOOD_PARAMS.init(goodParamSpec); } catch (Exception ex) { // should never happen @@ -55,7 +58,8 @@ } private static String pkcs8Encoded = "30:82:01:53:02:01:00:30:0D:06:09:2A:86:48:86:F7:0D:01:01:01:05:00:04:82:01:3D:30:82:01:39:02:01:00:02:40:6E:A4:13:65:97:A2:C2:47:5E:F2:23:6B:94:D8:D7:25:13:BB:A4:AE:8A:AA:A7:27:A4:9A:04:DC:15:F7:9B:E4:39:18:99:9E:27:EA:92:BB:D0:0E:F3:26:F4:95:89:33:02:65:6D:84:69:2C:CE:B7:FA:68:8E:FE:8D:63:44:6B:02:03:01:00:01:02:40:59:6E:1C:13:98:FE:C1:04:89:75:35:36:27:29:22:B5:E0:7E:62:BD:86:6E:2C:10:7A:16:D8:68:C1:04:D4:A7:10:41:F7:B9:B4:84:05:03:A5:C0:28:73:24:A7:24:F1:1B:C3:4F:BF:05:20:D0:D9:00:08:7F:C3:29:64:1B:29:02:21:00:C4:63:4D:0C:32:51:44:AE:DD:90:A9:B7:B6:C2:6B:11:BE:D2:07:E7:B5:C2:4A:9F:4D:0F:2F:30:5F:E6:1C:6D:02:21:00:90:39:A4:2D:93:0B:08:AF:2F:6F:18:CC:1A:EF:B6:E6:01:E7:21:3A:7F:45:C7:3F:39:12:B8:CC:DF:44:2D:37:02:21:00:B3:9B:61:9E:B2:F2:12:4F:9E:C1:2C:06:A1:B5:A3:38:62:7D:31:CF:9F:32:67:0E:D3:E9:FC:2D:50:B7:61:ED:02:20:5B:FD:77:FB:5D:A3:97:09:6E:1E:D5:59:32:01:1D:CE:7C:FE:38:12:80:A5:38:1D:DA:40:57:C0:CC:D3:46:67:02:20:52:EC:61:05:0D:EC:8A:ED:F7:1E:95:67:D0:7C:8B:D9:AA:A5:33:B8:26:26:2E:8F:D7:A7:18:16:2A:83:63:5C"; - private static String encryptedPKCS8 = "AE:20:81:4F:4D:38:73:C0:51:70:42:DA:C2:EF:61:49:07:E9:B5:D5:55:6D:D1:50:54:B2:0B:41:3E:2F:B6:00:BC:30:89:7B:32:A5:5F:B6:86:92:9E:06:6E:E2:40:8E:3E:E8:0B:CA:97:DB:3E:72:3E:03:22:34:35:EA:5F:B0:71:B2:07:BC:0D:97:94:0A:E6:12:9B:60:7A:77:D4:6C:99:60:2E:68:D6:55:BE:83:B8:A9:0F:19:8A:BE:91:30:D0:FE:52:94:5A:4C:D7:24:07:B3:61:EB:B5:4A:C6:6F:96:8A:C0:20:E9:73:40:FA:A2:56:04:F2:43:35:90:EA:35:C9:8C:08:9D:0B:BC:37:F0:01:D5:DF:BE:E4:4A:57:E0:13:0C:D5:F0:E8:5C:3B:B3:CD:7E:B5:E8:A5:84:63:F6:DA:3E:F2:CF:53:1F:A2:86:44:61:DD:AF:C1:78:70:3A:E6:06:41:77:6C:5B:8D:FA:C4:39:D7:4D:2F:87:D8:31:F4:B6:2B:94:D9:87:17:0E:C8:E3:FA:54:C8:B2:44:56:E0:37:5F:4C:5D:B2:21:DD:15:9E:94:63:89:CF:07:8C:79:F8:65:B2:22:45:D5:F0:2A:70:19:61:16:1D:52:5E:0C:35:3B:20:88:17:7E:FD:05:CC:08:09:2F:05:61:F7:A8:F5:EA:DE:77:DE:5D:55:4E:A0:36:A1:13:FF:2D:57:E8:4E:06:CE:C9:C1:B1:AE:C6:52:A6:EB:35:4C:81:91:DE:71:BA:34:DA:8A:99:1A:47:2E:66:52:AF:E3:2A:E4:0A:27:7F:72:C4:90:7E:8D:8F:64:8D:21:7E:00:DC:1C:62:0F:CC:96:80:C7:E5:5B:70:48:A5:E7:34:27:1A:7C:48:A7:9E:8B:2B:A6:E2"; + private static String sha1EncryptedPKCS8 = "0D:CA:00:8F:64:91:9C:60:36:F5:9B:BD:DD:C5:A9:A2:27:9E:6B:AE:CB:23:0E:2F:DA:76:03:A5:B7:C0:D5:3E:B9:03:60:62:41:2C:D6:51:37:F0:D9:ED:B2:CC:E7:99:28:03:CD:20:5D:EC:56:77:FC:61:57:D7:8C:F3:F6:10:F7:E5:BA:88:04:FE:1A:17:B3:8C:36:BF:70:2D:CD:6F:BF:83:ED:03:41:22:95:68:E3:08:90:76:B5:97:CB:FF:CE:51:27:14:F6:38:00:22:E9:0F:86:9F:64:D2:47:34:F6:50:DA:A9:80:F5:67:BF:C7:51:B3:38:AF:CD:15:96:50:8F:33:F3:8B:43:4C:AF:ED:DD:37:03:EC:B1:CC:57:53:0A:AF:0D:53:CD:D7:2B:A2:20:C5:37:AF:09:78:8E:3F:A0:E4:EC:22:C6:71:EC:D1:42:15:9D:1D:E9:E3:9D:8F:D6:0B:2A:99:C9:C8:90:B1:CD:AB:17:DD:A3:6F:64:43:23:26:25:7B:A5:E0:1F:2E:AF:18:89:C8:D6:97:28:32:A1:01:22:6F:14:B6:6C:4E:8A:83:47:16:99:51:B4:8D:85:9E:AB:00:B5:18:BB:49:97:47:59:F8:A7:A8:64:76:3F:41:5F:71:1A:F3:4A:96:F2:B4:44:38:42:4B:AE:0F:08:83:5C:33:F8:6A:8F:B9:6A:3D:1C:06:02:4E:07:48:46:E0:6D:6D:ED:E8:19:CB:3F:B0:6F:10:68:3A:5E:F5:8F:94:EF:B4:8B:58:5F:50:0A:E5:F2:13:54:59:14:99:C5:74:02:A2:B1:73:16:7F:F2:D4:DE:E0:12:86:55:46:9C:57:D1:7A:5C:8B:46:E1:7E:C3:32:14:31:52:64:07:52:9D:65:04:9D:54:89"; + private static String md5EncryptedPKCS8 = "AE:20:81:4F:4D:38:73:C0:51:70:42:DA:C2:EF:61:49:07:E9:B5:D5:55:6D:D1:50:54:B2:0B:41:3E:2F:B6:00:BC:30:89:7B:32:A5:5F:B6:86:92:9E:06:6E:E2:40:8E:3E:E8:0B:CA:97:DB:3E:72:3E:03:22:34:35:EA:5F:B0:71:B2:07:BC:0D:97:94:0A:E6:12:9B:60:7A:77:D4:6C:99:60:2E:68:D6:55:BE:83:B8:A9:0F:19:8A:BE:91:30:D0:FE:52:94:5A:4C:D7:24:07:B3:61:EB:B5:4A:C6:6F:96:8A:C0:20:E9:73:40:FA:A2:56:04:F2:43:35:90:EA:35:C9:8C:08:9D:0B:BC:37:F0:01:D5:DF:BE:E4:4A:57:E0:13:0C:D5:F0:E8:5C:3B:B3:CD:7E:B5:E8:A5:84:63:F6:DA:3E:F2:CF:53:1F:A2:86:44:61:DD:AF:C1:78:70:3A:E6:06:41:77:6C:5B:8D:FA:C4:39:D7:4D:2F:87:D8:31:F4:B6:2B:94:D9:87:17:0E:C8:E3:FA:54:C8:B2:44:56:E0:37:5F:4C:5D:B2:21:DD:15:9E:94:63:89:CF:07:8C:79:F8:65:B2:22:45:D5:F0:2A:70:19:61:16:1D:52:5E:0C:35:3B:20:88:17:7E:FD:05:CC:08:09:2F:05:61:F7:A8:F5:EA:DE:77:DE:5D:55:4E:A0:36:A1:13:FF:2D:57:E8:4E:06:CE:C9:C1:B1:AE:C6:52:A6:EB:35:4C:81:91:DE:71:BA:34:DA:8A:99:1A:47:2E:66:52:AF:E3:2A:E4:0A:27:7F:72:C4:90:7E:8D:8F:64:8D:21:7E:00:DC:1C:62:0F:CC:96:80:C7:E5:5B:70:48:A5:E7:34:27:1A:7C:48:A7:9E:8B:2B:A6:E2"; private static byte[] parse(String s) { try { @@ -99,10 +103,10 @@ throw new Exception("Static parameter generation failed"); } byte[] encodedKey = parse(pkcs8Encoded); - byte[] encryptedData = parse(encryptedPKCS8); + byte[] encryptedData = parse(cipherAlg.contains("MD5") ? md5EncryptedPKCS8 : sha1EncryptedPKCS8); boolean result = true; - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); // generate encrypted data and EncryptedPrivateKeyInfo object EncryptedPrivateKeyInfo epki = diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +28,8 @@ * @summary Test the error conditions of * EncryptedPrivateKeyInfo.getKeySpec(...) methods. * @author Valerie Peng + * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpecException + * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpecException */ import java.security.*; import java.util.Arrays; @@ -37,7 +39,7 @@ import javax.crypto.spec.*; public class GetKeySpecException { - private static final String cipherAlg = "PBEWithMD5AndDES"; + private static String cipherAlg; private static final char[] passwd = { 'p','a','s','s','w','d' }; private static SecretKey cipherKey; private static Cipher cipher = null; @@ -50,7 +52,8 @@ static { try { - sunjce = Security.getProvider("SunJCE"); + cipherAlg = System.getProperty("cipherAlg"); + sunjce = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); PBEParameterSpec badParamSpec = new PBEParameterSpec(new byte[10], 10); BAD_PARAMS = AlgorithmParameters.getInstance(cipherAlg, sunjce); @@ -61,7 +64,7 @@ GOOD_PARAMS.init(goodParamSpec); PBEKeySpec keySpec = new PBEKeySpec(passwd); SecretKeyFactory skf = - SecretKeyFactory.getInstance(cipherAlg, "SunJCE"); + SecretKeyFactory.getInstance(cipherAlg, System.getProperty("test.provider.name", "SunJCE")); cipherKey = skf.generateSecret(keySpec); } catch (Exception ex) { // should never happen @@ -164,7 +167,7 @@ // TEST#3: getKeySpec(Key, String) System.out.println("Testing getKeySpec(Key, String)..."); try { - pkcs8Spec = epki.getKeySpec(null, "SunJCE"); + pkcs8Spec = epki.getKeySpec(null, System.getProperty("test.provider.name", "SunJCE")); throwException("Should throw NPE for null Key!"); } catch (NullPointerException npe) { System.out.println("Expected NPE thrown"); @@ -176,13 +179,13 @@ System.out.println("Expected NPE thrown"); } try { - pkcs8Spec = epki.getKeySpec(INVALID_KEY, "SunJCE"); + pkcs8Spec = epki.getKeySpec(INVALID_KEY, System.getProperty("test.provider.name", "SunJCE")); throwException("Should throw IKE for invalid Key!"); } catch (InvalidKeyException ikse) { System.out.println("Expected IKE thrown"); } try { - pkcs8Spec = epkiBad.getKeySpec(cipherKey, "SunJCE"); + pkcs8Spec = epkiBad.getKeySpec(cipherKey, System.getProperty("test.provider.name", "SunJCE")); throwException("Should throw IKE for corrupted epki!"); } catch (InvalidKeyException ike) { System.out.println("Expected IKE thrown"); @@ -195,8 +198,9 @@ System.out.println("Expected NSAE thrown"); } try { - Security.removeProvider("SunJCE"); - pkcs8Spec = epki.getKeySpec(cipherKey, "SunJCE"); + Security.removeProvider(System.getProperty("test.provider.name", "SunJCE")); + pkcs8Spec = epki.getKeySpec(cipherKey, + System.getProperty("test.provider.name", "SunJCE")); throwException("Should throw NSPE for unconfigured provider!"); } catch (NoSuchProviderException nspe) { System.out.println("Expected NSPE thrown"); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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,6 +28,8 @@ * with wrong mode with EncryptedPrivateKeyInfo.getKeySpec * (Cipher) method. * @author Valerie Peng + * @run main GetKeySpecException2 PBEWithMD5AndDES + * @run main GetKeySpecException2 PBEWithSHA1AndDESede */ import java.security.*; import java.util.Arrays; @@ -38,11 +40,10 @@ import javax.crypto.spec.*; public class GetKeySpecException2 { - private static final String cipherAlg = "PBEWithMD5AndDES"; private static final char[] passwd = { 'p','a','s','s','w','d' }; - public static void main(String[] argv) throws Exception { - + public static void main(String[] args) throws Exception { + String cipherAlg = args[0]; // use random data byte[] encryptedData = new byte[30]; encryptedData[20] = (byte) 8; @@ -54,7 +55,8 @@ // TEST#1: getKeySpec(Cipher) with Cipher in an illegal state, // i.e. WRAP_MODE, UNWRAP_MODE. System.out.println("Testing getKeySpec(Cipher) with WRAP_MODE..."); - Cipher c = Cipher.getInstance(cipherAlg, "SunJCE"); + Cipher c = Cipher.getInstance(cipherAlg, + System.getProperty("test.provider.name", "SunJCE")); MyPBEKey key = new MyPBEKey(passwd); c.init(Cipher.WRAP_MODE, key); try { diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +28,8 @@ * methods with scenarios where the decrypted bytes are not * encoded correctly per PKCS#8 standard. * @author Valerie Peng + * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpecInvalidEncoding + * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpecInvalidEncoding */ import java.util.*; import java.nio.*; @@ -39,16 +41,17 @@ import javax.crypto.spec.*; public class GetKeySpecInvalidEncoding { - private static final String cipherAlg = "PBEWithMD5AndDES"; + private static String cipherAlg; private static final char[] passwd = { 'p','a','s','s', 'w', 'd' }; private static AlgorithmParameters GOOD_PARAMS; static { try { + cipherAlg = System.getProperty("cipherAlg"); PBEParameterSpec goodParamSpec = new PBEParameterSpec(new byte[8], 6); GOOD_PARAMS = AlgorithmParameters.getInstance - (cipherAlg, "SunJCE"); + (cipherAlg, System.getProperty("test.provider.name", "SunJCE")); GOOD_PARAMS.init(goodParamSpec); } catch (Exception ex) { // should never happen @@ -101,7 +104,7 @@ } byte[] encryptedData = parse(encryptedPKCS8); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); // generate encrypted data and EncryptedPrivateKeyInfo object EncryptedPrivateKeyInfo epki = diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,8 @@ * @bug 4898428 * @summary test that the new getInstance() implementation works correctly * @author Andreas Sterbenz + * @run main TestGetInstance des + * @run main TestGetInstance aes */ import java.security.*; @@ -43,15 +45,17 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); KeyGenerator kg; - kg = KeyGenerator.getInstance("des"); + String algo = args[0]; + kg = KeyGenerator.getInstance(algo); System.out.println("Default: " + kg.getProvider().getName()); - kg = KeyGenerator.getInstance("des", "SunJCE"); + kg = KeyGenerator.getInstance(algo, + System.getProperty("test.provider.name", "SunJCE")); same(p, kg.getProvider()); - kg = KeyGenerator.getInstance("des", p); + kg = KeyGenerator.getInstance(algo, p); same(p, kg.getProvider()); try { @@ -61,7 +65,8 @@ System.out.println(e); } try { - kg = KeyGenerator.getInstance("foo", "SunJCE"); + kg = KeyGenerator.getInstance("foo", + System.getProperty("test.provider.name", "SunJCE")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); @@ -74,13 +79,15 @@ } try { - kg = KeyGenerator.getInstance("foo", "SUN"); + kg = KeyGenerator.getInstance("foo", + System.getProperty("test.provider.name", "SUN")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - kg = KeyGenerator.getInstance("foo", Security.getProvider("SUN")); + kg = KeyGenerator.getInstance("foo", + Security.getProvider(System.getProperty("test.provider.name", "SUN"))); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,8 +54,10 @@ Provider[] providers = Security.getProviders(); for (Provider p : providers) { String prvName = p.getName(); - if (prvName.startsWith("SunJCE") - || prvName.startsWith("SunPKCS11-")) { + if ((System.getProperty("test.provider.name") != null && + prvName.equals(System.getProperty("test.provider.name"))) || + (System.getProperty("test.provider.name") == null && + (prvName.startsWith("SunJCE") || prvName.startsWith("SunPKCS11-")))) { for (String algorithm : ALGORITHM_ARR) { if (!runTest(p, algorithm)) { throw new RuntimeException( diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Mac/ByteBuffers.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/ByteBuffers.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Mac/ByteBuffers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/ByteBuffers.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ * @summary Test the Mac.update(ByteBuffer) method * @author Andreas Sterbenz * @key randomness + * @run main ByteBuffers HmacMD5 + * @run main ByteBuffers HmacSha256 */ import java.util.*; @@ -40,17 +42,18 @@ public class ByteBuffers { public static void main(String[] args) throws Exception { - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); Random random = new Random(); int n = 10 * 1024; byte[] t = new byte[n]; random.nextBytes(t); + String algo = args[0]; byte[] keyBytes = new byte[16]; random.nextBytes(keyBytes); - SecretKey key = new SecretKeySpec(keyBytes, "HmacMD5"); + SecretKey key = new SecretKeySpec(keyBytes, algo); - Mac mac = Mac.getInstance("HmacMD5"); + Mac mac = Mac.getInstance(algo); mac.init(key); byte[] macValue = mac.doFinal(t); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/Mac/TestGetInstance.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/TestGetInstance.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/Mac/TestGetInstance.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/Mac/TestGetInstance.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,8 @@ * @bug 4898428 * @summary test that the new getInstance() implementation works correctly * @author Andreas Sterbenz + * @run main TestGetInstance hmacmd5 + * @run main TestGetInstance hmacsha256 */ import java.security.*; @@ -43,15 +45,16 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SunJCE"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE")); Mac mac; - mac = Mac.getInstance("hmacmd5"); + String algo = args[0]; + mac = Mac.getInstance(algo); System.out.println("Default: " + mac.getProvider().getName()); - mac = Mac.getInstance("hmacmd5", "SunJCE"); + mac = Mac.getInstance(algo, System.getProperty("test.provider.name", "SunJCE")); same(p, mac.getProvider()); - mac = Mac.getInstance("hmacmd5", p); + mac = Mac.getInstance(algo, p); same(p, mac.getProvider()); try { @@ -61,7 +64,7 @@ System.out.println(e); } try { - mac = Mac.getInstance("foo", "SunJCE"); + mac = Mac.getInstance("foo", System.getProperty("test.provider.name", "SunJCE")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); @@ -74,13 +77,14 @@ } try { - mac = Mac.getInstance("foo", "SUN"); + mac = Mac.getInstance("foo", System.getProperty("test.provider.name", "SUN")); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); } try { - mac = Mac.getInstance("foo", Security.getProvider("SUN")); + mac = Mac.getInstance("foo", Security.getProvider( + System.getProperty("test.provider.name", "SUN"))); throw new AssertionError(); } catch (NoSuchAlgorithmException e) { System.out.println(e); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,8 @@ */ public class SecKFTranslateTest { - private static final String SUN_JCE = "SunJCE"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunJCE"); public static void main(String[] args) throws Exception { @@ -77,10 +78,10 @@ Random random = new Random(); // Initialization SecretKeyFactory skf = SecretKeyFactory.getInstance(algo.toString(), - SUN_JCE); + PROVIDER_NAME); random.nextBytes(plainText); - Cipher ci = Cipher.getInstance(algo.toString(), SUN_JCE); + Cipher ci = Cipher.getInstance(algo.toString(), PROVIDER_NAME); // Encryption ci.init(Cipher.ENCRYPT_MODE, key1, aps[0]); byte[] cipherText = new byte[ci.getOutputSize(plainText.length)]; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,11 +42,11 @@ public class SecKeyFacSunJCEPrf { // One of the PBKDF2 HMAC-SHA1 test vectors from RFC 6070 - private static final byte[] SALT = "salt".getBytes(); + private static final byte[] SALT = "16-byte salt val".getBytes(); private static final char[] PASS = "password".toCharArray(); private static final int ITER = 4096; private static final byte[] EXP_OUT = - HexFormat.of().parseHex("4B007901B765489ABEAD49D926F721D065A429C1"); + HexFormat.of().parseHex("D2CACD3F1D44AF293C704F0B1005338D903C688C"); public static void main(String[] args) throws Exception { // Instantiate the Evil Provider and insert it in the @@ -56,7 +56,8 @@ Security.insertProviderAt(evilProv, 1); SecretKeyFactory pbkdf2 = - SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", "SunJCE"); + SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", + System.getProperty("test.provider.name", "SunJCE")); PBEKeySpec pbks = new PBEKeySpec(PASS, SALT, ITER, 160); SecretKey secKey1 = pbkdf2.generateSecret(pbks); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java --- openjdk-17-17.0.13+11/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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,8 @@ private final Mac internalMac; public EvilHmacSHA1() throws GeneralSecurityException { - internalMac = Mac.getInstance("HmacSHA1", "SunJCE"); + internalMac = Mac.getInstance("HmacSHA1", + System.getProperty("test.provider.name", "SunJCE")); } @Override diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java openjdk-17-17.0.14+7/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -203,7 +203,7 @@ pbArgs.addAll(Arrays.asList(args)); pbArgs.add(TEST_APP_NAME); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[pbArgs.size()]) ); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/management/security/HashedPasswordFileTest.java openjdk-17-17.0.14+7/test/jdk/javax/management/security/HashedPasswordFileTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/management/security/HashedPasswordFileTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/management/security/HashedPasswordFileTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -433,7 +433,7 @@ pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[0])); Process process = ProcessTools.startProcess( TestApp.class.getSimpleName(), @@ -475,7 +475,7 @@ pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[0])); Process process = ProcessTools.startProcess( TestApp.class.getSimpleName(), diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/DTLS/DTLSWontNegotiateV10.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/DTLS/DTLSWontNegotiateV10.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/DTLS/DTLSWontNegotiateV10.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/DTLS/DTLSWontNegotiateV10.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,13 +21,13 @@ * questions. */ +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.security.SecurityUtils; import javax.net.ssl.*; import java.io.IOException; import java.net.*; import java.nio.ByteBuffer; -import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -87,14 +87,13 @@ Process clientProcess = null; try (DTLSServer server = new DTLSServer(protocol)) { List command = List.of( - Path.of(System.getProperty("java.home"), "bin", "java").toString(), "DTLSWontNegotiateV10", // if server is "DTLS" then the client should be v1.0 and vice versa protocol.equals(DTLS) ? DTLSV_1_0 : DTLS, Integer.toString(server.getListeningPortNumber()) ); - ProcessBuilder builder = new ProcessBuilder(command); + ProcessBuilder builder = ProcessTools.createTestJavaProcessBuilder(command); clientProcess = builder.inheritIO().start(); server.run(); System.out.println("Success: DTLSv1.0 connection was not established."); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/AbstractServer.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/AbstractServer.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/AbstractServer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/AbstractServer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,6 +22,8 @@ */ import java.io.IOException; +import java.net.InetAddress; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -52,11 +54,21 @@ public static abstract class Builder extends AbstractPeer.Builder { + private InetAddress listenInterface = InetAddress.getLoopbackAddress(); private int port; // Indicates if requires client authentication. private boolean clientAuth = true; + public InetAddress getListenInterface() { + return listenInterface; + } + + public Builder setListenInterface(InetAddress listenInterface) { + this.listenInterface = listenInterface; + return this; + } + public int getPort() { return port; } diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,6 +22,7 @@ */ import java.io.IOException; +import java.net.InetAddress; import java.net.SocketException; import java.util.ArrayList; import java.util.List; @@ -53,7 +54,8 @@ context = Utilities.createSSLContext(builder.getCertTuple()); SSLServerSocketFactory serverFactory = context.getServerSocketFactory(); serverSocket - = (SSLServerSocket) serverFactory.createServerSocket(builder.getPort()); + = (SSLServerSocket) serverFactory.createServerSocket(builder.getPort(), + 0, builder.getListenInterface()); configServerSocket(builder); } diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ */ public static OutputAnalyzer java(Path javaPath, Class clazz, Map props) { - ProcessBuilder pb = createJavaProcessBuilder(javaPath, clazz, props); + ProcessBuilder pb = createLimitedTestJavaProcessBuilder(javaPath, clazz, props); try { return ProcessTools.executeCommand(pb); } catch (Throwable e) { @@ -50,7 +50,7 @@ } } - private static ProcessBuilder createJavaProcessBuilder(Path javaPath, + private static ProcessBuilder createLimitedTestJavaProcessBuilder(Path javaPath, Class clazz, Map props) { List cmds = new ArrayList<>(); cmds.add(javaPath.toString()); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/ciphersuites/DisabledAlgorithms.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/DisabledAlgorithms.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/ciphersuites/DisabledAlgorithms.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/DisabledAlgorithms.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 * @bug 8076221 8211883 8279164 * @summary Check if weak cipher suites are disabled + * @library /javax/net/ssl/templates * @modules jdk.crypto.ec * @run main/othervm DisabledAlgorithms default * @run main/othervm DisabledAlgorithms empty @@ -35,7 +36,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.security.NoSuchAlgorithmException; import java.security.Security; import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLContext; @@ -45,68 +45,72 @@ import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; +/* + * This test verifies that setEnabledProtocols() does not override the + * jdk.tls.disabledAlgorithms property. Both the client and server throw + * an exception when creating a handshake context. + * + * In the TLSWontNegotiateDisabledCipherAlgoos test, one side of the connection + * disables the cipher suites and the other side enables them and verifies + * that the handshake cannot complete successfully. + */ public class DisabledAlgorithms { - 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; - - private static final String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; + public static final SSLContextTemplate.Cert[] CERTIFICATES = { + SSLContextTemplate.Cert.EE_DSA_SHA1_1024, + SSLContextTemplate.Cert.EE_DSA_SHA224_1024, + SSLContextTemplate.Cert.EE_DSA_SHA256_1024, + SSLContextTemplate.Cert.CA_ECDSA_SECP256R1, + SSLContextTemplate.Cert.CA_RSA_2048 + }; // disabled RC4, NULL, anon, and ECDH cipher suites - private static final String[] disabled_ciphersuites - = new String[] { - "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_NULL_MD5", - "SSL_RSA_WITH_NULL_SHA", - "TLS_RSA_WITH_NULL_SHA256", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "TLS_DH_anon_WITH_AES_128_CBC_SHA256", - "TLS_DH_anon_WITH_AES_128_GCM_SHA256", - "TLS_DH_anon_WITH_AES_256_CBC_SHA", - "TLS_DH_anon_WITH_AES_256_CBC_SHA256", - "TLS_DH_anon_WITH_AES_256_GCM_SHA384", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", - "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" + public static final String[] DISABLED_CIPHERSUITES + = new String[]{ + "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_NULL_MD5", + "SSL_RSA_WITH_NULL_SHA", + "TLS_RSA_WITH_NULL_SHA256", + "TLS_ECDH_ECDSA_WITH_NULL_SHA", + "TLS_ECDHE_ECDSA_WITH_NULL_SHA", + "TLS_ECDH_RSA_WITH_NULL_SHA", + "TLS_ECDHE_RSA_WITH_NULL_SHA", + "TLS_ECDH_anon_WITH_NULL_SHA", + "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", + "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", + "SSL_DH_anon_WITH_DES_CBC_SHA", + "SSL_DH_anon_WITH_RC4_128_MD5", + "TLS_DH_anon_WITH_AES_128_CBC_SHA", + "TLS_DH_anon_WITH_AES_128_CBC_SHA256", + "TLS_DH_anon_WITH_AES_128_GCM_SHA256", + "TLS_DH_anon_WITH_AES_256_CBC_SHA", + "TLS_DH_anon_WITH_AES_256_CBC_SHA256", + "TLS_DH_anon_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", + "TLS_ECDH_anon_WITH_NULL_SHA", + "TLS_ECDH_anon_WITH_RC4_128_SHA", + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" }; public static void main(String[] args) throws Exception { @@ -114,11 +118,6 @@ throw new RuntimeException("No parameters specified"); } - 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); - switch (args[0]) { case "default": // use default jdk.tls.disabledAlgorithms @@ -126,7 +125,7 @@ + Security.getProperty("jdk.tls.disabledAlgorithms")); // check that disabled cipher suites can't be used by default - checkFailure(disabled_ciphersuites); + checkFailure(DISABLED_CIPHERSUITES); break; case "empty": // reset jdk.tls.disabledAlgorithms @@ -136,7 +135,7 @@ // check that disabled cipher suites can be used if // jdk.{tls,certpath}.disabledAlgorithms is empty - checkSuccess(disabled_ciphersuites); + checkSuccess(DISABLED_CIPHERSUITES); break; default: throw new RuntimeException("Wrong parameter: " + args[0]); @@ -149,7 +148,7 @@ * Checks if that specified cipher suites cannot be used. */ private static void checkFailure(String[] ciphersuites) throws Exception { - try (SSLServer server = SSLServer.init(ciphersuites)) { + try (SSLServer server = new SSLServer(ciphersuites)) { startNewThread(server); while (!server.isRunning()) { sleep(); @@ -157,7 +156,7 @@ int port = server.getPort(); for (String ciphersuite : ciphersuites) { - try (SSLClient client = SSLClient.init(port, ciphersuite)) { + try (SSLClient client = new SSLClient(port, ciphersuite)) { client.connect(); throw new RuntimeException("Expected SSLHandshakeException " + "not thrown"); @@ -184,7 +183,7 @@ * Checks if specified cipher suites can be used. */ private static void checkSuccess(String[] ciphersuites) throws Exception { - try (SSLServer server = SSLServer.init(ciphersuites)) { + try (SSLServer server = new SSLServer(ciphersuites)) { startNewThread(server); while (!server.isRunning()) { sleep(); @@ -192,7 +191,7 @@ int port = server.getPort(); for (String ciphersuite : ciphersuites) { - try (SSLClient client = SSLClient.init(port, ciphersuite)) { + try (SSLClient client = new SSLClient(port, ciphersuite)) { client.connect(); String negotiated = client.getNegotiatedCipherSuite(); System.out.println("Negotiated cipher suite: " @@ -231,7 +230,8 @@ } } - static class SSLServer implements Runnable, AutoCloseable { + static class SSLServer extends SSLContextTemplate implements Runnable, AutoCloseable { + private final SSLServerSocket ssocket; private volatile boolean stopped = false; @@ -239,7 +239,19 @@ private volatile boolean sslError = false; private volatile boolean otherError = false; - private SSLServer(SSLServerSocket ssocket) { + private SSLServer(String[] ciphersuites) throws Exception { + SSLContext context = createSSLContext(null, + DisabledAlgorithms.CERTIFICATES, getServerContextParameters()); + SSLServerSocketFactory ssf = context.getServerSocketFactory(); + SSLServerSocket ssocket = (SSLServerSocket) + ssf.createServerSocket(0); + + if (ciphersuites != null) { + System.out.println("Server: enable cipher suites: " + + java.util.Arrays.toString(ciphersuites)); + ssocket.setEnabledCipherSuites(ciphersuites); + } + this.ssocket = ssocket; } @@ -273,8 +285,8 @@ } else { System.out.println("Server: run: " + e); System.out.println("The exception above occurred " - + "because socket was closed, " - + "please ignore it"); + + "because socket was closed, " + + "please ignore it"); } } } @@ -319,29 +331,23 @@ public void close() { stop(); } - - static SSLServer init(String[] ciphersuites) - throws IOException { - SSLServerSocketFactory ssf = (SSLServerSocketFactory) - SSLServerSocketFactory.getDefault(); - SSLServerSocket ssocket = (SSLServerSocket) - ssf.createServerSocket(0); - - if (ciphersuites != null) { - System.out.println("Server: enable cipher suites: " - + java.util.Arrays.toString(ciphersuites)); - ssocket.setEnabledCipherSuites(ciphersuites); - } - - return new SSLServer(ssocket); - } } - static class SSLClient implements AutoCloseable { + static class SSLClient extends SSLContextTemplate implements AutoCloseable { private final SSLSocket socket; - private SSLClient(SSLSocket socket) { + private SSLClient(int port, String ciphersuite) throws Exception { + SSLContext context = createSSLContext(DisabledAlgorithms.CERTIFICATES, + null, getClientContextParameters()); + SSLSocketFactory ssf = context.getSocketFactory(); + SSLSocket socket = (SSLSocket) ssf.createSocket("localhost", port); + + if (ciphersuite != null) { + System.out.println("Client: enable cipher suite: " + + ciphersuite); + socket.setEnabledCipherSuites(new String[]{ciphersuite}); + } this.socket = socket; } @@ -381,29 +387,5 @@ } } } - - static SSLClient init(int port) - throws NoSuchAlgorithmException, IOException { - return init(port, null); - } - - static SSLClient init(int port, String ciphersuite) - throws NoSuchAlgorithmException, IOException { - SSLContext context = SSLContext.getDefault(); - SSLSocketFactory ssf = (SSLSocketFactory) - context.getSocketFactory(); - SSLSocket socket = (SSLSocket) ssf.createSocket("localhost", port); - - if (ciphersuite != null) { - System.out.println("Client: enable cipher suite: " - + ciphersuite); - socket.setEnabledCipherSuites(new String[] { ciphersuite }); - } - - return new SSLClient(socket); - } - } - - } diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/ciphersuites/TLSWontNegotiateDisabledCipherAlgos.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023, 2024, 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.ProcessTools; + +import javax.net.ssl.*; +import java.io.IOException; +import java.net.Socket; +import java.nio.charset.StandardCharsets; +import java.security.Security; +import java.util.List; + +/* + * @test id=Server + * @bug 8301379 + * @library /test/lib + * @summary Verify that Java will not negotiate disabled cipher suites when the + * other side of the connection requests them. + * + * @library /javax/net/ssl/templates + * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server true + */ + +/* + * @test id=Client + * @bug 8301379 + * @library /test/lib + * @summary Verify that Java will not negotiate disabled cipher suites when the + * other side of the connection requests them. + * + * @library /javax/net/ssl/templates + * @run main/othervm TLSWontNegotiateDisabledCipherAlgos server false + */ + + +public class TLSWontNegotiateDisabledCipherAlgos { + + public static void main(String [] args) throws Exception { + boolean useDisabledAlgo = Boolean.parseBoolean(args[1]); + if (useDisabledAlgo) { + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + } + + if (args[0].equals("server")) { + try (TLSServer server = new TLSServer(useDisabledAlgo)) { + List command = List.of( + "TLSWontNegotiateDisabledCipherAlgos", + "client", + Boolean.toString(!useDisabledAlgo), + Integer.toString(server.getListeningPort()) + ); + ProcessBuilder builder = ProcessTools.createTestJavaProcessBuilder(command); + Process p = builder.inheritIO().start(); + server.run(); + p.destroy(); + } + } else if (args[0].equals("client")) { + try (TLSClient client = new TLSClient(Integer.parseInt(args[2]), useDisabledAlgo)) { + client.run(); + } + } + } + + private static class TLSClient extends SSLContextTemplate implements AutoCloseable { + private final SSLSocket socket; + + public TLSClient(int portNumber, boolean useDisableAlgo) throws Exception { + SSLContext context = createClientSSLContext(); + socket = (SSLSocket)context.getSocketFactory().createSocket("localhost", portNumber); + if (useDisableAlgo) { + socket.setEnabledCipherSuites(DisabledAlgorithms.DISABLED_CIPHERSUITES); + } + } + + public void run() throws IOException { + try { + socket.getOutputStream().write("SECRET MESSAGE".getBytes(StandardCharsets.UTF_8)); + throw new RuntimeException("SSL handshake completed successfully."); + } catch (SSLHandshakeException exc) { + if (!exc.getMessage().equals("Received fatal alert: handshake_failure")) { + throw new RuntimeException("Expected handshake_failure message. Got: " + + "\"" + exc.getMessage() + "\" message.", exc); + } + } + } + + @Override + public void close() throws Exception { + socket.close(); + } + } + + private static class TLSServer extends SSLContextTemplate implements AutoCloseable { + private SSLServerSocket serverSocket; + + public TLSServer(boolean useDisableAlgo) throws Exception { + SSLContext ctx = createServerSSLContext(); + serverSocket = (SSLServerSocket) ctx.getServerSocketFactory().createServerSocket(0); + if (useDisableAlgo) { + serverSocket.setEnabledCipherSuites(DisabledAlgorithms.DISABLED_CIPHERSUITES); + } + } + + @Override + public void close() throws Exception { + serverSocket.close(); + } + + public int getListeningPort() { + return serverSocket.getLocalPort(); + } + + public void run() throws IOException { + try (Socket clientSocket = serverSocket.accept()) { + try { + byte[] bytes = clientSocket.getInputStream().readAllBytes(); + throw new RuntimeException("The expected SSLHandshakeException was not thrown."); + } catch (SSLHandshakeException exc) { + if (!exc.getMessage().contains("no cipher suites in common")) { + throw exc; + } else { + System.out.println("Success: The connection could not be negotiated (as expected.)"); + } + } + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java 2025-01-04 20:25:18.000000000 +0000 @@ -645,9 +645,63 @@ "zjgEAwMvADAsAhQ6Y1I6LtIEBMqNo8o6GIe4LLEJuwIUbVQUKi8tvtWyRoxm8AFV\n" + "0axJYUU=\n" + "-----END CERTIFICATE-----", - "" + "" ), + CA_SHA1_RSA_2048( // for DHEKeySizing.java + "RSA", + // Signature Algorithm: sha1WithRSAEncryption + // Issuer: OU = SunJSSE Test Serivce, O = Java, C = US + // Validity + // Not Before: Sep 18 04:38:31 2013 GMT + // Not After : Dec 17 04:38:31 2013 GMT + "-----BEGIN CERTIFICATE-----\n" + + "MIIC8jCCAdqgAwIBAgIEUjkuRzANBgkqhkiG9w0BAQUFADA7MR0wGwYDVQQLExRT\n" + + "dW5KU1NFIFRlc3QgU2VyaXZjZTENMAsGA1UEChMESmF2YTELMAkGA1UEBhMCVVMw\n" + + "HhcNMTMwOTE4MDQzODMxWhcNMTMxMjE3MDQzODMxWjA7MR0wGwYDVQQLExRTdW5K\n" + + "U1NFIFRlc3QgU2VyaXZjZTENMAsGA1UEChMESmF2YTELMAkGA1UEBhMCVVMwggEi\n" + + "MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCO+IGeaskJAvEcYc7pCl9neK3E\n" + + "a28fwWLtChufYNaC9hQfZlUdETWYjV7fZJVJKT/oLzdDNMWuVA0LKXArpI3thLNK\n" + + "QLXisdF9hKPlZRDazACL9kWUUtJ0FzpEySK4e8wW/z9FuU6e6iO19FbjxAfInJqk\n" + + "3EDiEhB5g73S2vtvPCxgq2DvWw9TDl/LIqdKG2JCS93koXCCaHmQ7MrIOqHPd+8r\n" + + "RbGpatXT9qyHKppUv9ATxVygO4rA794mgCFxpT+fkhz+NEB0twTkM65T1hnnOv5n\n" + + "ZIxkcjBggt85UlZtnP3b9P7SYxsWIa46Oc38Od2f3YejfVg6B+PqPgWNl3+/AgMB\n" + + "AAEwDQYJKoZIhvcNAQEFBQADggEBAAlrP6DFLRPSy0IgQhcI2i56tR/na8pezSte\n" + + "ZHcCdaCZPDy4UP8mpLJ9QCjEB5VJv8hPm4xdK7ULnKGOGHgYqDpV2ZHvQlhV1woQ\n" + + "TZGb/LM3c6kAs0j4j9KM2fq3iYUYexjIkS1KzsziflxMM6igS9BRMBR2LQyU+cYq\n" + + "YEsFzkF7Aj2ET4v/+tgot9mRr2NioJcaJkdsPDpMU3IKB1cczfu+OuLQ/GCG0Fqu\n" + + "6ijCeCqfnaAbemHbJeVZZ6Qgka3uC2YMntLBmLkhqEo1d9zGYLoh7oWL77y5ibQZ\n" + + "LK5/H/zikcu579TWjlDHcqL3arCwBcrtsjSaPrRSWMrWV/6c0qw=\n" + + "-----END CERTIFICATE-----", + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCO+IGeaskJAvEc\n" + + "Yc7pCl9neK3Ea28fwWLtChufYNaC9hQfZlUdETWYjV7fZJVJKT/oLzdDNMWuVA0L\n" + + "KXArpI3thLNKQLXisdF9hKPlZRDazACL9kWUUtJ0FzpEySK4e8wW/z9FuU6e6iO1\n" + + "9FbjxAfInJqk3EDiEhB5g73S2vtvPCxgq2DvWw9TDl/LIqdKG2JCS93koXCCaHmQ\n" + + "7MrIOqHPd+8rRbGpatXT9qyHKppUv9ATxVygO4rA794mgCFxpT+fkhz+NEB0twTk\n" + + "M65T1hnnOv5nZIxkcjBggt85UlZtnP3b9P7SYxsWIa46Oc38Od2f3YejfVg6B+Pq\n" + + "PgWNl3+/AgMBAAECggEAPdb5Ycc4m4A9QBSCRcRpzbyiFLKPh0HDg1n65q4hOtYr\n" + + "kAVYTVFTSF/lqGS+Ob3w2YIKujQKSUQrvCc5UHdFuHXMgxKIWbymK0+DAMb9SlYw\n" + + "6lkkcWp9gx9E4dnJ/df2SAAxovvrKMuHlL1SFASHhVtPfH2URvSfUaANLDXxyYOs\n" + + "8BX0Nr6wazhWjLjXo9yIGnKSvFfB8XisYcA78kEgas43zhmIGCDPqaYyyffOfRbx\n" + + "pM1KNwGmlN86iWR1CbwA/wwhcMySWQueS+s7cHbpRqZIYJF9jEeELiwi0vxjealS\n" + + "EMuHYedIRFMWaDIq9XyjrvXamHb0Z25jlXBNZHaM0QKBgQDE9adl+zAezR/n79vw\n" + + "0XiX2Fx1UEo3ApZHuoA2Q/PcBk+rlKqqQ3IwTcy6Wo648wK7v6Nq7w5nEWcsf0dU\n" + + "QA2Ng/AJEev/IfF34x7sKGYxtk1gcE0EuSBA3R+ocEZxnNw1Ryd5nUU24s8d4jCP\n" + + "Mkothnyaim+zE2raDlEtVc0CaQKBgQC509av+02Uq5oMjzbQp5PBJfQFjATOQT15\n" + + "eefYnVYurkQ1kcVfixkrO2ORhg4SjmI2Z5hJDgGtXdwgidpzkad+R2epS5qLMyno\n" + + "lQVpY6bMpEZ7Mos0yQygxnm8uNohEcTExOe+nP5fNJVpzBsGmfeyYOhnPQlf6oqf\n" + + "0cHizedb5wKBgQC/l5LyMil6HOGHlhzmIm3jj7VI7QR0hJC5T6N+phVml8ESUDjA\n" + + "DYHbmSKouISTRtkG14FY+RiSjCxH7bvuKazFV2289PETquogTA/9e8MFYqfcQwG4\n" + + "sXi9gBxWlnj/9a2EKiYtOB5nKLR/BlNkSHA93tAA6N+FXEMZwMmYhxk42QKBgAuY\n" + + "HQgD3PZOsqDf+qKQIhbmAFCsSMx5o5VFtuJ8BpmJA/Z3ruHkMuDQpsi4nX4o5hXQ\n" + + "5t6AAjjH52kcUMXvK40kdWJJtk3DFnVNfvXxYsHX6hHbuHXFqYUKfSP6QJnZmvZP\n" + + "9smcz/4usLfWJUWHK740b6upUkFqx9Vq5/b3s9y3AoGAdM5TW7LkkOFsdMGVAUzR\n" + + "9iXmCWElHTK2Pcp/3yqDBHSfiQx6Yp5ANyPnE9NBM0yauCfOyBB2oxLO4Rdv3Rqk\n" + + "9V9kyR/YAGr7dJaPcQ7pZX0OpkzgueAOJYPrx5VUzPYUtklYV1ycFZTfKlpFCxT+\n" + + "Ei6KUo0NXSdUIcB4yib1J10=" + ), + + EE_DSA_SHA1_1024( // for SignatureAlgorithms test "DSA", // Signature Algorithm: dsaWithSHA1 @@ -1170,7 +1224,41 @@ "ofaiiWffsaytVvotmT6+atElvAMbAua42V+nAQKBgHtIn3mYMHLriYGhQzpkFEA2\n" + "8YcAMlKppueOMAKVy8nLu2r3MidmLAhMiKJQKG45I3Yg0/t/25tXLiOPJlwrOebh\n" + "xQqUBI/JUOIpGAEnr48jhOXnCS+i+z294G5U/RgjXrlR4bCPvrtCmwzWwe0h79w2\n" + - "Q2hO5ZTW6UD9CVA85whf"); + "Q2hO5ZTW6UD9CVA85whf"), + + DSA_SHA1_1024_EXPIRED( // for NullCerts test + "DSA", + // Signature Algorithm: dsaWithSHA1 + // Issuer: C = US, ST = CA, L = Cupertino, O = Dummy, OU = Dummy, CN = Example + // Validity + // Not Before: Mar 11 06:33:43 2001 GMT + // Not After : Dec 6 06:33:43 2003 GMT + "-----BEGIN CERTIFICATE-----\n" + + "MIIC9TCCArMCBDqrHEcwCwYHKoZIzjgEAwUAMGAxCzAJBgNVBAYTAlVTMQswCQYD\n" + + "VQQIEwJDQTESMBAGA1UEBxMJQ3VwZXJ0aW5vMQ4wDAYDVQQKEwVEdW1teTEOMAwG\n" + + "A1UECxMFRHVtbXkxEDAOBgNVBAMTB0V4YW1wbGUwHhcNMDEwMzExMDYzMzQzWhcN\n" + + "MDMxMjA2MDYzMzQzWjBgMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEjAQBgNV\n" + + "BAcTCUN1cGVydGlubzEOMAwGA1UEChMFRHVtbXkxDjAMBgNVBAsTBUR1bW15MRAw\n" + + "DgYDVQQDEwdFeGFtcGxlMIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIp\n" + + "Ut9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7\n" + + "gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1\n" + + "VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUC\n" + + "gYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCB\n" + + "gLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6\n" + + "ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAPqO/boo\n" + + "m+n+tAdqetoQ2ZRoS8BpYIEFOJt4OJ8flb52T3vGNNdapq9pbjN+HKrT62ggNhZs\n" + + "hajxYwFCpaidKZuGQXvvpHkj0UHjhZFry6Dd41cfEG13dfgACf8uooeTzPGFvUPv\n" + + "TCHcPRh820BZMeOqdS4PjWPyf3HEtiTtFWR7MAsGByqGSM44BAMFAAMvADAsAhRH\n" + + "dZQef04MwUTlAALf2J6PIcgmQAIUB2H/RnW2tVg+mbCl5jQLfudsEhI=\n" + + "-----END CERTIFICATE-----", + "MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdS\n" + + "PO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVCl\n" + + "pJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith\n" + + "1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7L\n" + + "vKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3\n" + + "zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImo\n" + + "g9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoEFgIUZC+jBuwAPm8ejkybfAm2gT49ApY=" + ); final String keyAlgo; final String certStr; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2025-01-04 20:25:18.000000000 +0000 @@ -92,14 +92,22 @@ cTOs = ByteBuffer.allocateDirect(netBufferMax); sTOc = ByteBuffer.allocateDirect(netBufferMax); - clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); - serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); + clientOut = createClientOutputBuffer(); + serverOut = createServerOutputBuffer(); + } + + protected ByteBuffer createServerOutputBuffer() { + return ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); } // // Protected methods could be used to customize the test case. // + protected ByteBuffer createClientOutputBuffer() { + return ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); + } + /* * Configure the client side engine. */ diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -273,7 +273,7 @@ configureClientSocket(sslSocket); InetAddress serverAddress = this.serverAddress; InetSocketAddress connectAddress = serverAddress == null - ? new InetSocketAddress("localhost", serverPort) + ? new InetSocketAddress(InetAddress.getLoopbackAddress(), serverPort) : new InetSocketAddress(serverAddress, serverPort); sslSocket.connect(connectAddress, 15000); } catch (IOException ioe) { diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/TLSBase.java openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/TLSBase.java --- openjdk-17-17.0.13+11/test/jdk/javax/net/ssl/templates/TLSBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/net/ssl/templates/TLSBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -31,6 +31,7 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.Arrays; import java.util.concurrent.ConcurrentHashMap; @@ -222,7 +223,7 @@ try { sslContext = SSLContext.getDefault(); sock = (SSLSocket)sslContext.getSocketFactory().createSocket(); - sock.connect(new InetSocketAddress("localhost", serverPort)); + sock.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), serverPort)); System.err.println("Client connected using port " + sock.getLocalPort()); name = "client(" + sock.toString() + ")"; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java openjdk-17-17.0.14+7/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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,6 +24,7 @@ /* * @test * @bug 6263419 + * @library /test/lib * @summary No way to clean the memory for a java.security.Key */ @@ -32,10 +33,12 @@ import javax.crypto.*; import javax.security.auth.Destroyable; import javax.security.auth.DestroyFailedException; +import jdk.test.lib.security.SecurityUtils; public class KeyDestructionTest { public static void main(String[] args) throws Exception { - KeyPair keypair = generateKeyPair("RSA", 1024); + String kpgAlgorithm = "RSA"; + KeyPair keypair = generateKeyPair(kpgAlgorithm, SecurityUtils.getTestKeySize(kpgAlgorithm)); // Check keys that support and have implemented key destruction testKeyDestruction(new MyDestroyableSecretKey()); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstance.java openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstance.java --- openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstance.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstance.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -84,12 +84,14 @@ private int testStringProvider(int testnum) throws Exception { // get an instance of JavaLoginConfig from SUN - Configuration c = Configuration.getInstance(JAVA_CONFIG, null, "SUN"); + Configuration c = Configuration.getInstance(JAVA_CONFIG, null, + System.getProperty("test.provider.name", "SUN")); doTest(c, testnum++); // get an instance of JavaLoginConfig from SunRsaSign try { - c = Configuration.getInstance(JAVA_CONFIG, null, "SunRsaSign"); + c = Configuration.getInstance(JAVA_CONFIG, null, + System.getProperty("test.provider.name", "SunRsaSign")); throw new SecurityException("test " + testnum++ + " failed"); } catch (NoSuchAlgorithmException nsae) { // good @@ -112,14 +114,16 @@ // get an instance of JavaLoginConfig from SUN Configuration c = Configuration.getInstance(JAVA_CONFIG, null, - Security.getProvider("SUN")); + Security.getProvider( + System.getProperty("test.provider.name", "SUN"))); doTest(c, testnum++); // get an instance of JavaLoginConfig from SunRsaSign try { c = Configuration.getInstance(JAVA_CONFIG, null, - Security.getProvider("SunRsaSign")); + Security.getProvider( + System.getProperty("test.provider.name","SunRsaSign"))); throw new SecurityException("test " + testnum++ + " failed"); } catch (NoSuchAlgorithmException nsae) { // good @@ -186,7 +190,7 @@ try { Configuration c = Configuration.getInstance(JAVA_CONFIG, new BadParam(), - "SUN"); + System.getProperty("test.provider.name","SUN")); throw new SecurityException("test " + testnum++ + " failed"); } catch (IllegalArgumentException iae) { // good @@ -196,7 +200,7 @@ try { Configuration c = Configuration.getInstance(JAVA_CONFIG, new BadParam(), - Security.getProvider("SUN")); + Security.getProvider(System.getProperty("test.provider.name","SUN"))); throw new SecurityException("test " + testnum++ + " failed"); } catch (IllegalArgumentException iae) { // good @@ -285,7 +289,7 @@ testnum = doCommon(c, testnum); // test getProvider - if ("SUN".equals(c.getProvider().getName())) { + if (System.getProperty("test.provider.name","SUN").equals(c.getProvider().getName())) { System.out.println("test " + testnum + " (getProvider) passed"); } else { throw new SecurityException("test " + testnum + @@ -325,7 +329,7 @@ } // test getProvider - if ("SUN".equals(c.getProvider().getName())) { + if (System.getProperty("test.provider.name","SUN").equals(c.getProvider().getName())) { System.out.println("test " + testnum + " (getProvider) passed"); } else { throw new SecurityException("test " + testnum + diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy --- openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy 2025-01-04 20:25:18.000000000 +0000 @@ -1,4 +1,5 @@ grant { + permission java.util.PropertyPermission "test.provider.name", "read"; permission java.util.PropertyPermission "test.src", "read"; permission java.io.FilePermission "${test.src}${/}*", "read"; diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java --- openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -51,7 +51,7 @@ try { Configuration c = Configuration.getInstance - (JAVA_CONFIG, null, "SUN"); + (JAVA_CONFIG, null, System.getProperty("test.provider.name","SUN")); throw new RuntimeException("did not catch security exception"); } catch (SecurityException se) { // good @@ -59,7 +59,8 @@ try { Configuration c = Configuration.getInstance - (JAVA_CONFIG, null, Security.getProvider("SUN")); + (JAVA_CONFIG, null, Security.getProvider( + System.getProperty("test.provider.name","SUN"))); throw new RuntimeException("did not catch security exception"); } catch (SecurityException se) { // good @@ -71,7 +72,8 @@ "GetInstanceSecurity.grantedPolicy"); URI uri = file.toURI(); URIParameter param = new URIParameter(uri); - Policy p = Policy.getInstance("JavaPolicy", param, "SUN"); + Policy p = Policy.getInstance("JavaPolicy", param, + System.getProperty("test.provider.name","SUN")); Policy.setPolicy(p); // retry operations @@ -88,7 +90,7 @@ try { Configuration c = Configuration.getInstance - (JAVA_CONFIG, uriParam, "SUN"); + (JAVA_CONFIG, uriParam, System.getProperty("test.provider.name","SUN")); // good } catch (SecurityException se) { throw new RuntimeException("unexpected SecurityException"); @@ -96,7 +98,8 @@ try { Configuration c = Configuration.getInstance - (JAVA_CONFIG, uriParam, Security.getProvider("SUN")); + (JAVA_CONFIG, uriParam, Security.getProvider( + System.getProperty("test.provider.name","SUN"))); // good } catch (SecurityException se) { throw new RuntimeException("unexpected SecurityException"); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy --- openjdk-17-17.0.13+11/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy 2025-01-04 20:25:18.000000000 +0000 @@ -1,6 +1,6 @@ grant { - + permission java.util.PropertyPermission "test.provider.name", "read"; permission java.util.PropertyPermission "test.src", "read"; permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www"; permission java.io.FilePermission diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/sound/midi/SysexMessage/EmptySysExMessageTest.java openjdk-17-17.0.14+7/test/jdk/javax/sound/midi/SysexMessage/EmptySysExMessageTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/sound/midi/SysexMessage/EmptySysExMessageTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/sound/midi/SysexMessage/EmptySysExMessageTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2022, 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.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/* + * @test + * @key sound + * @bug 8282578 + * @summary AIOOBE in javax.sound.sampled.Clip + * @run main EmptySysExMessageTest + */ + +public class EmptySysExMessageTest { + public static void main(String[] args) { + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String name = "zerosysex.mid"; + try { + readAudioFile(dir + sep + name); + } catch (Throwable t) { + throw new RuntimeException("Invalid file " + name + + " caused unexpected exception during read: " + + t + System.lineSeparator()); + } + } + + static void readAudioFile(String name) throws IOException { + File soundFile = new File(name); + Path path = Paths.get(soundFile.getAbsolutePath()); + byte[] samples = Files.readAllBytes(path); + + try { + AudioInputStream audioInputStream = + AudioSystem.getAudioInputStream(new ByteArrayInputStream(samples)); + try (Clip clip = AudioSystem.getClip()) { + clip.open(audioInputStream); + clip.start(); + Thread.sleep(1000); + clip.stop(); + } + } catch (UnsupportedAudioFileException + | LineUnavailableException + | IOException + | InterruptedException + | IllegalArgumentException + | IllegalStateException + | SecurityException expected) { + // Do nothing, these types of exception are expected on invalid file + } + } +} Binary files /srv/release.debian.org/tmp/uHIlyAU3ag/openjdk-17-17.0.13+11/test/jdk/javax/sound/midi/SysexMessage/zerosysex.mid and /srv/release.debian.org/tmp/iKHNJPeSh2/openjdk-17-17.0.14+7/test/jdk/javax/sound/midi/SysexMessage/zerosysex.mid differ diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,9 +24,12 @@ import java.awt.AWTException; import java.awt.BorderLayout; +import java.awt.EventQueue; import java.awt.Point; import java.awt.Robot; import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; @@ -46,13 +49,7 @@ public static void main(String[] args) throws Throwable { - SwingUtilities.invokeAndWait(new Runnable() { - - @Override - public void run() { - constructTestUI(); - } - }); + SwingUtilities.invokeAndWait(PressedButtonRightClickTest::constructTestUI); try { testRobot = new Robot(); @@ -61,11 +58,14 @@ } testRobot.waitForIdle(); + testRobot.delay(500); // Method performing auto test operation - test(); - - disposeTestUI(); + try { + test(); + } finally { + EventQueue.invokeAndWait(PressedButtonRightClickTest::disposeTestUI); + } } private static void test() { @@ -74,22 +74,27 @@ testRobot.mouseMove((loc.x + 100), (loc.y + 100)); // Press the left mouse button + System.out.println("press BUTTON1_DOWN_MASK"); testRobot.mousePress(InputEvent.BUTTON1_DOWN_MASK); myButton.setText("Left button pressed"); - testRobot.delay(1000); + testRobot.delay(500); // Press the right mouse button + System.out.println("press BUTTON3_DOWN_MASK"); testRobot.mousePress(InputEvent.BUTTON3_DOWN_MASK); myButton.setText("Left button pressed + Right button pressed"); - testRobot.delay(1000); + testRobot.delay(500); // Release the right mouse button + System.out.println("release BUTTON3_DOWN_MASK"); testRobot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); myButton.setText("Right button released"); - testRobot.delay(1000); + testRobot.waitForIdle(); + testRobot.delay(500); // Test whether the button is still pressed boolean pressed = myButton.getModel().isPressed(); + System.out.println("release BUTTON1_DOWN_MASK"); testRobot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); if (!pressed) { disposeTestUI(); @@ -106,6 +111,32 @@ myFrame = new JFrame(); myFrame.setLayout(new BorderLayout()); myButton = new JButton("Whatever"); + myButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + System.out.println(e); + } + + @Override + public void mousePressed(MouseEvent e) { + System.out.println(e); + } + + @Override + public void mouseReleased(MouseEvent e) { + System.out.println(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + System.out.println(e); + } + + @Override + public void mouseExited(MouseEvent e) { + System.out.println(e); + } + }); myFrame.add(myButton, BorderLayout.CENTER); myFrame.setSize(400, 300); myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JButton/bug4490179.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/bug4490179.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JButton/bug4490179.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JButton/bug4490179.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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,8 +31,6 @@ import java.awt.Point; import java.awt.Robot; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.InputEvent; import javax.swing.JButton; import javax.swing.JFrame; @@ -49,13 +47,16 @@ public static void main(String[] args) throws Exception { Robot robot = new Robot(); robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); try { SwingUtilities.invokeAndWait(() -> { frame = new JFrame("bug4490179"); button = new JButton("Button"); frame.getContentPane().add(button); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + button.addActionListener(e -> { + if ((e.getModifiers() & InputEvent.BUTTON1_MASK) + != InputEvent.BUTTON1_MASK) { + System.out.println("Status: Failed"); passed = false; } }); @@ -80,6 +81,8 @@ robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mousePress(InputEvent.BUTTON3_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); if (!passed) { throw new RuntimeException("Test Failed"); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /** * @test * @key headful - * @bug 6567433 + * @bug 6567433 8283214 * * @summary JComboBox.updateUI() invokes updateUI() on its cellrenderer via * SwingUtilities.updateComponentTreeUI(). diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/ComboPopupBug.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/ComboPopupBug.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/ComboPopupBug.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/ComboPopupBug.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024, 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.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; + +/* + * @test + * @bug 8322754 + * @summary Verifies clicking JComboBox during frame closure causes Exception + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ComboPopupBug + */ + +public class ComboPopupBug { + private static final String instructionsText = """ + This test is used to verify that clicking on JComboBox + when frame containing it is about to close should not + cause IllegalStateException. + + A JComboBox is shown with Close button at the bottom. + Click on Close and then click on JComboBox arrow button + to try to show combobox popup. + If IllegalStateException is thrown, test will automatically Fail + otherwise click Pass."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ComboPopup Instructions") + .instructions(instructionsText) + .testTimeOut(5) + .rows(10) + .columns(35) + .testUI(ComboPopupBug::createUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createUI() { + JFrame frame = new JFrame("ComboPopup"); + + JComboBox cb = new JComboBox<>(); + cb.setEditable(true); + cb.addItem("test"); + cb.addItem("test2"); + cb.addItem("test3"); + + JButton b = new JButton("Close"); + b.addActionListener( + (e)->{ + try { + Thread.sleep(3000); + } catch (Exception ignored) { + } + frame.setVisible(false); + }); + + frame.getContentPane().add(cb, "North"); + frame.getContentPane().add(b, "South"); + frame.setSize(200, 200); + + return frame; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2023, 2024, 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.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import javax.imageio.ImageIO; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JComboBox; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +import static java.awt.image.BufferedImage.TYPE_INT_ARGB; + +/* + * @test + * @bug 7093691 8310072 + * @summary Tests if JComboBox has correct font color when disabled/enabled + * @key headful + * @run main/othervm -Dsun.java2d.uiScale=1 DisabledComboBoxFontTestAuto + */ + +public class DisabledComboBoxFontTestAuto { + private static JComboBox combo, combo2; + private static BufferedImage enabledImage, disabledImage, enabledImage2, disabledImage2; + private static String lafName; + private static StringBuffer failingLafs; + private static int COMBO_HEIGHT, COMBO_WIDTH, COMBO2_HEIGHT, COMBO2_WIDTH; + + private static void createCombo() { + combo = new JComboBox(); + combo.addItem("\u2588".repeat(5)); + combo.setFont(combo.getFont().deriveFont(50.0f)); + combo.setRenderer(new DefaultListCellRenderer()); + combo2 = new JComboBox(); + combo2.addItem("\u2588".repeat(5)); + combo2.setFont(combo2.getFont().deriveFont(50.0f)); + COMBO_WIDTH = (int) combo.getPreferredSize().getWidth(); + COMBO_HEIGHT = (int) combo.getPreferredSize().getHeight(); + COMBO2_WIDTH = (int) combo2.getPreferredSize().getWidth(); + COMBO2_HEIGHT = (int) combo2.getPreferredSize().getHeight(); + combo.setSize(COMBO_WIDTH, COMBO_HEIGHT); + combo2.setSize(COMBO2_WIDTH, COMBO2_HEIGHT); + } + + private static void paintCombo() { + combo.setEnabled(true); + enabledImage = new BufferedImage(COMBO_WIDTH, COMBO_HEIGHT, TYPE_INT_ARGB); + Graphics2D graphics2D = enabledImage.createGraphics(); + combo.paint(graphics2D); + graphics2D.dispose(); + combo.setEnabled(false); + disabledImage = new BufferedImage(COMBO_WIDTH, COMBO_HEIGHT, TYPE_INT_ARGB); + graphics2D = disabledImage.createGraphics(); + combo.paint(graphics2D); + graphics2D.dispose(); + combo2.setEnabled(true); + enabledImage2 = new BufferedImage(COMBO2_WIDTH, COMBO2_HEIGHT, TYPE_INT_ARGB); + graphics2D = enabledImage2.createGraphics(); + combo2.paint(graphics2D); + graphics2D.dispose(); + combo2.setEnabled(false); + disabledImage2 = new BufferedImage(COMBO2_WIDTH, COMBO2_HEIGHT, TYPE_INT_ARGB); + graphics2D = disabledImage2.createGraphics(); + combo2.paint(graphics2D); + graphics2D.dispose(); + } + + private static void testMethod() throws IOException { + Color eColor1, eColor2, dColor1, dColor2; + Path testDir = Path.of(System.getProperty("test.classes", ".")); + + // Use center line to compare RGB values + int y = enabledImage.getHeight() / 2; + for (int x = (enabledImage.getWidth() / 2) - 20; + x < (enabledImage.getWidth() / 2) + 20; x++) { + eColor1 = new Color(enabledImage.getRGB(x, y)); + eColor2 = new Color(enabledImage2.getRGB(x, y)); + dColor1 = new Color(disabledImage.getRGB(x, y)); + dColor2 = new Color(disabledImage2.getRGB(x, y)); + + if ((!isColorMatching(eColor1, eColor2)) || (!isColorMatching(dColor1, dColor2))) { + failingLafs.append(lafName + ", "); + ImageIO.write(enabledImage, "png", new File(testDir + + "/" + lafName + "Enabled.png")); + ImageIO.write(disabledImage, "png", new File(testDir + + "/" + lafName + "Disabled.png")); + ImageIO.write(enabledImage2, "png", new File(testDir + + "/" + lafName + "EnabledDLCR.png")); + ImageIO.write(disabledImage2, "png", new File(testDir + + "/" + lafName + "DisabledDLCR.png")); + return; + } + } + System.out.println("Test Passed: " + lafName); + } + + private static boolean isColorMatching(Color c1, Color c2) { + if ((c1.getRed() != c2.getRed()) + || (c1.getBlue() != c2.getBlue()) + || (c1.getGreen() != c2.getGreen())) { + System.out.println(lafName + " Enabled RGB failure: " + + c1.getRed() + ", " + + c1.getBlue() + ", " + + c1.getGreen() + " vs " + + c2.getRed() + ", " + + c2.getBlue() + ", " + + c2.getGreen()); + return false; + } + return true; + } + + private static void setLookAndFeel(UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + } catch (UnsupportedLookAndFeelException ignored){ + System.out.println("Unsupported LookAndFeel: " + laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public static void main(String[] args) throws Exception { + lafName = "null"; + failingLafs = new StringBuffer(); + for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { + // Change Motif LAF name to avoid using slash in saved image file path + lafName = laf.getName().equals("CDE/Motif") ? "Motif" : laf.getName(); + SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); + SwingUtilities.invokeAndWait(DisabledComboBoxFontTestAuto::createCombo); + SwingUtilities.invokeAndWait(DisabledComboBoxFontTestAuto::paintCombo); + testMethod(); + } + if (!failingLafs.isEmpty()) { + // Remove trailing comma and whitespace + failingLafs.setLength(failingLafs.length() - 2); + throw new RuntimeException("FAIL - Enabled and disabled ComboBox " + + "does not match in these LAFs: " + failingLafs); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JFrame/DefaultCloseOperation.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JFrame/DefaultCloseOperation.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JFrame/DefaultCloseOperation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JFrame/DefaultCloseOperation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.SwingUtilities; import javax.swing.WindowConstants; /* @@ -73,31 +72,26 @@ JComboBox dialogCloseOp; public static void main(String[] args) throws Exception { - - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("DefaultCloseOperation Manual Test") .instructions(INSTRUCTIONS) .testTimeOut(5) .rows(20) - .columns(70) - .build(); - - SwingUtilities.invokeAndWait(() -> { - DefaultCloseOperation dco = new DefaultCloseOperation(); - dco.init(); - - JFrame frame = new JFrame("DefaultCloseOperation"); - frame.add(dco); - frame.setSize(500,200); - - PassFailJFrame.addTestWindow(frame); - PassFailJFrame - .positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); + .columns(50) + .testUI(DefaultCloseOperation::createUI) + .build() + .awaitAndCheck(); + } - frame.setVisible(true); - }); + private static JFrame createUI() { + DefaultCloseOperation dco = new DefaultCloseOperation(); + dco.init(); + + JFrame frame = new JFrame("DefaultCloseOperation"); + frame.add(dco); + frame.setSize(500,200); - passFailJFrame.awaitAndCheck(); + return frame; } public void init() { diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1999, 2022, 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.AWTException; +import java.awt.BorderLayout; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.lang.reflect.InvocationTargetException; + +import javax.swing.JButton; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 4202966 + * @key headful + * @summary Wrong coordinates in events retargeted to subcomponents of + * JInternalFrame + * @run main IntFrameCoord + */ + +public class IntFrameCoord { + private static JFrame frame; + private static JDesktopPane dt; + private static JButton tf; + private static volatile JButton b; + private static JInternalFrame if1; + private static JInternalFrame if2; + private static boolean isFail; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, AWTException { + Robot robot = new Robot(); + robot.setAutoDelay(100); + + SwingUtilities.invokeAndWait(IntFrameCoord::createGUI); + + robot.delay(1000); + + MouseListener mouseListener = new MouseAdapter() { + public void mousePressed(MouseEvent e) { + double height = b.getSize().getHeight(); + if (e.getY() >= height) { + isFail = true; + } else { + isFail = false; + } + } + }; + + b.addMouseListener(mouseListener); + + robot.waitForIdle(); + + robot.mouseMove(if2.getLocationOnScreen().x + (if2.getWidth() / 2), + if2.getLocationOnScreen().y + 10); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.mouseMove(if1.getLocationOnScreen().x + (if1.getWidth() / 2), + if1.getLocationOnScreen().y + 10); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.mouseMove(b.getLocationOnScreen().x + (b.getWidth() / 2), + b.getLocationOnScreen().y + (b.getHeight() / 2)); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + SwingUtilities.invokeAndWait(() -> frame.dispose()); + + if(isFail) { + throw new RuntimeException("Mouse coordinates wrong in " + + "retargeted JInternalFrame"); + } + } + + private static void createGUI() { + frame = new JFrame(); + dt = new JDesktopPane(); + frame.setLayout(new BorderLayout()); + frame.add(BorderLayout.CENTER, dt); + + if1 = new JInternalFrame("Click here second", true, true, true, true); + if1.setLayout(new BorderLayout()); + + tf = new JButton ("ignore"); + if1.add(tf, BorderLayout.NORTH); + + tf = new JButton ("ignore"); + if1.add(tf, BorderLayout.CENTER); + + if1.setBounds(300,0,300,100); + + dt.add(if1); + + if2 = new JInternalFrame("Click here first", true, true, true, true); + if2.setLayout(new BorderLayout()); + + tf = new JButton ("ignore"); + if2.add(tf, BorderLayout.NORTH); + + b = new JButton ("Click here third"); + if2.add (b, BorderLayout.CENTER); + + if2.setBounds(0,0,300,100); + + dt.add(if2); + + if1.setVisible(true); + if2.setVisible(true); + + frame.setLocationRelativeTo(null); + frame.setTitle("test"); + frame.setSize(500, 300); + frame.setVisible(true); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JLabel/4138746/JLabelMnemonicsTest.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JLabel/4138746/JLabelMnemonicsTest.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JLabel/4138746/JLabelMnemonicsTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JLabel/4138746/JLabelMnemonicsTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,7 @@ continue; } robot.waitForIdle(); + robot.delay(500); // Verifier 1: Verifies if getDisplayedMnemonicIndex() returns the // right index set with setDisplayedMnemonicIndex method for JButton diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneArrowDirection.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneArrowDirection.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneArrowDirection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneArrowDirection.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2023, 2024, 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.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.GridLayout; +import javax.swing.AbstractAction; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +/* + * @test + * @bug 8225220 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "linux") + * @summary JTabbedPane arrow should point to left or right direction + * when tab layout policy is set to SCROLL_TAB_LAYOUT and tab + * placement is set to either TOP or BOTTOM + * @run main/manual TestJTabbedPaneArrowDirection + */ + +public class TestJTabbedPaneArrowDirection { + private static JFrame frame; + private static JTabbedPane tabPane; + private static final String INSTRUCTIONS = + "1. Observe the arrows are pointing to left and right direction\n" + + " for tab placement set to TOP. Default tab placement is TOP.\n\n" + + "2. Press BOTTOM to change the tab placement to bottom.\n\n" + + "3. Observe arrows are pointing to the left and right direction.\n\n" + + "4. If the behaviour is correct, press Pass else Fail."; + + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("JTabbedPane Arrow Direction Test Instructions") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(12) + .columns(40) + .screenCapture() + .build(); + SwingUtilities.invokeAndWait( + TestJTabbedPaneArrowDirection::createAndShowUI); + passFailJFrame.awaitAndCheck(); + } + + private static void createAndShowUI() { + int NUM_TABS = 15; + frame = new JFrame("Test JTabbedPane Arrow Direction"); + JTabbedPane tabPane = new JTabbedPane(); + tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); + tabPane.setTabPlacement(JTabbedPane.TOP); + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow( + frame, PassFailJFrame.Position.HORIZONTAL); + for( int i = 0; i < NUM_TABS; ++i) { + tabPane.addTab("Tab " + i , new JLabel("Content Area")); + } + JPanel panel = new JPanel(new BorderLayout()); + panel.add(tabPane, BorderLayout.CENTER); + JButton topButton = new JButton(new AbstractAction() { + public void actionPerformed(ActionEvent e) { + tabPane.setTabPlacement(JTabbedPane.TOP); + } + }); + topButton.setText("TOP"); + JButton bottomButton = new JButton(new AbstractAction() { + public void actionPerformed(ActionEvent e) { + tabPane.setTabPlacement(JTabbedPane.BOTTOM); + } + }); + bottomButton.setText("BOTTOM"); + JPanel buttonPanel = new JPanel(new GridLayout(1, 2)); + buttonPanel.add(topButton); + buttonPanel.add(bottomButton); + panel.add(buttonPanel, BorderLayout.SOUTH); + frame.add(panel); + frame.setSize(500, 500); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setVisible(true); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/JToolBar/bug4203039.java openjdk-17-17.0.14+7/test/jdk/javax/swing/JToolBar/bug4203039.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/JToolBar/bug4203039.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/JToolBar/bug4203039.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ locations but can dock on the NORTH and WEST"""; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame passFailJFrame = PassFailJFrame.builder() .title("bug4203039 Instructions") .instructions(instructionsText) .testTimeOut(5) diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/MultiMonitor/MultimonVImage.java openjdk-17-17.0.14+7/test/jdk/javax/swing/MultiMonitor/MultimonVImage.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/MultiMonitor/MultimonVImage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/MultiMonitor/MultimonVImage.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,9 +38,8 @@ import java.awt.Graphics; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import javax.swing.JViewport; import javax.swing.JFrame; -import javax.swing.SwingUtilities; +import javax.swing.JViewport; public class MultimonVImage { private static final String instructionsText = @@ -64,25 +63,20 @@ " issue, try to use the same or similar video cards for each monitor."; public static void main(String[] args) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame.builder() .title("MultimonVImage Instructions") .instructions(instructionsText) .testTimeOut(5) .rows(25) .columns(50) - .build(); - - SwingUtilities.invokeAndWait(() -> { - AnimatingFrame af = new AnimatingFrame(); - af.test(); - af.run(); - - PassFailJFrame.addTestWindow(af); - PassFailJFrame.positionTestWindow(af, - PassFailJFrame.Position.HORIZONTAL); - }); - - passFailJFrame.awaitAndCheck(); + .testUI(() -> { + AnimatingFrame af = new AnimatingFrame(); + af.test(); + af.run(); + return af; + }) + .build() + .awaitAndCheck(); } } @@ -164,9 +158,7 @@ setContentPane(component); component.setVisible(true); - setLocationRelativeTo(null); pack(); - setVisible(true); } public void test() { diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java openjdk-17-17.0.14+7/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -224,7 +224,7 @@ } private static Process runProcess(LookAndFeelInfo laf) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dswing.defaultlaf=" + laf.getClassName(), "-mx9m", "-XX:+HeapDumpOnOutOfMemoryError", UnninstallUIMemoryLeaks.class.getSimpleName(), "mark"); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,7 @@ setup(point); }); robot.waitForIdle(); + robot.delay(500); test(comboBox); robot.waitForIdle(); validate(comboBox); @@ -110,6 +111,7 @@ setup(finalLeft); }); robot.waitForIdle(); + robot.delay(500); test(comboBox); robot.waitForIdle(); validate(comboBox); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2024, 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.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.LongStream; +import java.util.stream.Stream; + +import javax.swing.JFileChooser; + +/* + * @test + * @bug 8325179 + * @requires os.family == "windows" + * @summary Verifies there's only one BasicDirectoryModel.FilesLoader thread + * at any given moment + * @run main/othervm -Djava.awt.headless=true LoaderThreadCount + */ +public final class LoaderThreadCount extends ThreadGroup { + /** Initial number of files. */ + private static final long NUMBER_OF_FILES = 500; + + /** + * Number of threads running {@code fileChooser.rescanCurrentDirectory()}. + */ + private static final int NUMBER_OF_THREADS = 5; + + /** Number of snapshots with live threads. */ + private static final int SNAPSHOTS = 20; + + /** The barrier to synchronise scanner threads and capturing live threads. */ + private static final CyclicBarrier start = new CyclicBarrier(NUMBER_OF_THREADS + 1); + + /** List of scanner threads. */ + private static final List threads = new ArrayList<>(NUMBER_OF_THREADS); + + /** + * Stores an exception caught by any of the threads. + * If more exceptions are caught, they're added as suppressed exceptions. + */ + private static final AtomicReference exception = + new AtomicReference<>(); + + /** + * Stores an {@code IOException} thrown while removing the files. + */ + private static final AtomicReference ioException = + new AtomicReference<>(); + + + public static void main(String[] args) throws Throwable { + try { + // Start the test in its own thread group to catch and handle + // all thrown exceptions, in particular in + // BasicDirectoryModel.FilesLoader which is created by Swing. + ThreadGroup threadGroup = new LoaderThreadCount(); + Thread runner = new Thread(threadGroup, + LoaderThreadCount::wrapper, + "Test Runner"); + runner.start(); + runner.join(); + } catch (Throwable throwable) { + handleException(throwable); + } + + if (ioException.get() != null) { + System.err.println("An error occurred while removing files:"); + ioException.get().printStackTrace(); + } + + if (exception.get() != null) { + throw exception.get(); + } + } + + private static void wrapper() { + final long timeStart = System.currentTimeMillis(); + try { + runTest(timeStart); + } catch (Throwable throwable) { + handleException(throwable); + } finally { + System.out.printf("Duration: %,d\n", + (System.currentTimeMillis() - timeStart)); + } + } + + private static void runTest(final long timeStart) throws Throwable { + final Path temp = Files.createDirectory(Paths.get("fileChooser-concurrency-" + timeStart)); + + try { + createFiles(temp); + + final JFileChooser fc = new JFileChooser(temp.toFile()); + + threads.addAll(Stream.generate(() -> new Thread(new Scanner(fc))) + .limit(NUMBER_OF_THREADS) + .toList()); + threads.forEach(Thread::start); + + // Create snapshots of live threads + List threadsCapture = + Stream.generate(LoaderThreadCount::getThreadSnapshot) + .limit(SNAPSHOTS) + .toList(); + + threads.forEach(Thread::interrupt); + + List loaderCount = + threadsCapture.stream() + .map(ta -> Arrays.stream(ta) + .filter(Objects::nonNull) + .map(Thread::getName) + .filter(tn -> tn.startsWith("Basic L&F File Loading Thread")) + .count()) + .filter(c -> c > 0) + .toList(); + + if (loaderCount.isEmpty()) { + throw new RuntimeException("Invalid results: no loader threads detected"); + } + + System.out.println("Number of snapshots: " + loaderCount.size()); + + long ones = loaderCount.stream() + .filter(n -> n == 1) + .count(); + long twos = loaderCount.stream() + .filter(n -> n == 2) + .count(); + long count = loaderCount.stream() + .filter(n -> n > 2) + .count(); + System.out.println("Number of snapshots where number of loader threads:"); + System.out.println(" = 1: " + ones); + System.out.println(" = 2: " + twos); + System.out.println(" > 2: " + count); + if (count > loaderCount.size() / 2) { + throw new RuntimeException("Detected " + count + " snapshots " + + "with several loading threads"); + } + } catch (Throwable e) { + threads.forEach(Thread::interrupt); + throw e; + } finally { + deleteFiles(temp); + deleteFile(temp); + } + } + + private static Thread[] getThreadSnapshot() { + try { + start.await(); + // Allow for the scanner threads to initiate re-scanning + Thread.sleep(10); + + Thread[] array = new Thread[Thread.activeCount()]; + Thread.currentThread() + .getThreadGroup() + .enumerate(array, false); + + // Additional delay between captures + Thread.sleep(500); + + return array; + } catch (InterruptedException | BrokenBarrierException e) { + handleException(e); + throw new RuntimeException("getThreadSnapshot is interrupted"); + } + } + + + private LoaderThreadCount() { + super("bdmConcurrency"); + } + + @Override + public void uncaughtException(Thread t, Throwable e) { + handleException(t, e); + } + + private static void handleException(Throwable throwable) { + handleException(Thread.currentThread(), throwable); + } + + private static void handleException(final Thread thread, + final Throwable throwable) { + System.err.println("Exception in " + thread.getName() + ": " + + throwable.getClass() + + (throwable.getMessage() != null + ? ": " + throwable.getMessage() + : "")); + if (!exception.compareAndSet(null, throwable)) { + exception.get().addSuppressed(throwable); + } + threads.stream() + .filter(t -> t != thread) + .forEach(Thread::interrupt); + } + + + private record Scanner(JFileChooser fileChooser) + implements Runnable { + + @Override + public void run() { + try { + do { + start.await(); + fileChooser.rescanCurrentDirectory(); + } while (!Thread.interrupted()); + } catch (InterruptedException | BrokenBarrierException e) { + // Just exit the loop + } + } + } + + private static void createFiles(final Path parent) { + LongStream.range(0, LoaderThreadCount.NUMBER_OF_FILES) + .mapToObj(n -> parent.resolve(n + ".file")) + .forEach(LoaderThreadCount::createFile); + } + + private static void createFile(final Path file) { + try { + Files.createFile(file); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static void deleteFiles(final Path parent) throws IOException { + try (var stream = Files.walk(parent)) { + stream.filter(p -> p != parent) + .forEach(LoaderThreadCount::deleteFile); + } + } + + private static void deleteFile(final Path file) { + try { + Files.delete(file); + } catch (IOException e) { + if (!ioException.compareAndSet(null, e)) { + ioException.get().addSuppressed(e); + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ public class bug4983388 { static volatile boolean bMenuSelected = false; + static JFrame frame; private static class TestMenuListener implements MenuListener { public void menuCanceled(MenuEvent e) {} @@ -55,8 +56,9 @@ JMenu menu = new JMenu("File"); menu.setMnemonic('F'); menuBar.add(menu); - JFrame frame = new JFrame(); + frame = new JFrame(); frame.setJMenuBar(menuBar); + frame.setLocationRelativeTo(null); frame.pack(); frame.setVisible(true); MenuListener listener = new TestMenuListener(); @@ -80,9 +82,13 @@ Robot robot = new Robot(); robot.setAutoDelay(50); robot.waitForIdle(); + robot.delay(500); + Util.hitMnemonics(robot, KeyEvent.VK_F); robot.waitForIdle(); - robot.delay(200); + robot.delay(500); + + SwingUtilities.invokeAndWait(() -> frame.dispose()); if (!bMenuSelected) { throw new RuntimeException("shortcuts on menus do not work"); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/text/JTextComponent/5074573/bug5074573.java openjdk-17-17.0.14+7/test/jdk/javax/swing/text/JTextComponent/5074573/bug5074573.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/text/JTextComponent/5074573/bug5074573.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/text/JTextComponent/5074573/bug5074573.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, 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,7 +25,7 @@ * @test * @key headful * @bug 5074573 8196100 - * @summary tests delte-next-word and delete-prev-word actions for all text compnents and all look&feels + * @summary tests delete-next-word and delete-prev-word actions for all text components and all look&feels * @run main bug5074573 */ @@ -49,6 +49,8 @@ public class bug5074573 { private static JTextComponent textComponent; + private static JFrame frame; + private static Robot robot; final static String testString = "123 456 789"; final static String resultString = "456 "; final static List> textClasses = Arrays.asList( @@ -56,24 +58,32 @@ JTextField.class, JFormattedTextField.class, JPasswordField.class); public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { UIManager.setLookAndFeel(info.getClassName()); System.out.println(info); for (Class clazz : textClasses) { - boolean res = test(clazz); - if (!res && clazz != JPasswordField.class) { - throw new RuntimeException("failed"); + try { + boolean res = test(clazz); + if (!res && clazz != JPasswordField.class) { + throw new RuntimeException("failed"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + frame = null; + } + }); } } } } static boolean test(final Class textComponentClass) throws Exception { - Robot robot = new Robot(); - robot.setAutoWaitForIdle(true); - robot.setAutoDelay(50); - - SwingUtilities.invokeAndWait(new Runnable() { @Override @@ -83,6 +93,7 @@ }); robot.waitForIdle(); + robot.delay(500); // Remove selection from JTextField components for the Aqua Look & Feel if (textComponent instanceof JTextField && "Aqua".equals(UIManager.getLookAndFeel().getID())) { @@ -120,6 +131,7 @@ robot.keyRelease(KeyEvent.VK_DELETE); robot.keyRelease(getCtrlKey()); robot.waitForIdle(); + robot.delay(250); return resultString.equals(getText()); } @@ -152,7 +164,7 @@ private static void initialize(Class textComponentClass) { try { - JFrame frame = new JFrame(); + frame = new JFrame(); textComponent = textComponentClass.newInstance(); textComponent.setText(testString); frame.add(textComponent); diff -Nru openjdk-17-17.0.13+11/test/jdk/javax/swing/text/html/CSS/bug8234913.java openjdk-17-17.0.14+7/test/jdk/javax/swing/text/html/CSS/bug8234913.java --- openjdk-17-17.0.13+11/test/jdk/javax/swing/text/html/CSS/bug8234913.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/javax/swing/text/html/CSS/bug8234913.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -52,7 +52,7 @@ Collections.addAll(argsList, "-Xmn8m"); Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", ".")); Collections.addAll(argsList, FontSizePercentTest.class.getName()); - return ProcessTools.createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); + return ProcessTools.createLimitedTestJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); } static void checkFor(String... outputStrings) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java openjdk-17-17.0.14+7/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java --- openjdk-17-17.0.13+11/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ } public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmn8m", "-Xlog:library=info", "--add-modules=jdk.incubator.vector", VectorTest.class.getName()); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java openjdk-17-17.0.14+7/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java --- openjdk-17-17.0.13+11/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +30,12 @@ * @run testng RuntimeArguments */ +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReader; +import java.lang.module.ModuleReference; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; @@ -41,6 +47,30 @@ public class RuntimeArguments { static final String TEST_CLASSES = System.getProperty("test.classes"); + static final List VM_OPTIONS = getInitialOptions(); + + /* + * Read jdk/internal/vm/options resource from the runtime image. + * If present, the runtime image was created with jlink --add-options and + * the java launcher launches the application as if + * $ java @options + * The VM options listed in the jdk/internal/vm/options resource file + * are passed to the VM. + */ + static List getInitialOptions() { + ModuleReference mref = ModuleFinder.ofSystem().find("java.base").orElseThrow(); + try (ModuleReader reader = mref.open()) { + InputStream in = reader.open("jdk/internal/vm/options").orElse(null); + if (in != null) { + // support the simplest form for now: whitespace-separated + return List.of(new String(in.readAllBytes()).split("\s")); + } else { + return List.of(); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } @DataProvider(name = "options") public Object[][] options() { @@ -83,13 +113,15 @@ @Test(dataProvider = "options") public void test(List args, List expected) throws Exception { // launch a test program - // $ java -classpath RuntimeArguments - + // $ java -classpath RuntimeArguments Stream options = Stream.concat(args.stream(), Stream.of("-classpath", TEST_CLASSES, "RuntimeArguments")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - Stream.concat(options, expected.stream()) + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( + // The runtime image may be created with jlink --add-options + // The initial VM options will be included in the result + // returned by VM.getRuntimeArguments() + Stream.concat(options, Stream.concat(VM_OPTIONS.stream(), expected.stream())) .toArray(String[]::new) ); ProcessTools.executeProcess(pb).shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/filestream/TestOrdered.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestOrdered.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/filestream/TestOrdered.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestOrdered.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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,6 @@ package jdk.jfr.api.consumer.filestream; -import java.nio.file.Files; import java.nio.file.Path; import java.time.Instant; import java.util.ArrayList; @@ -35,6 +34,7 @@ import jdk.jfr.Event; import jdk.jfr.Recording; import jdk.jfr.consumer.EventStream; +import jdk.test.lib.Utils; /** * @test @@ -148,7 +148,7 @@ e.join(); } r.stop(); - Path p = Files.createTempFile("recording", ".jfr"); + Path p = Utils.createTempFile("recording", ".jfr"); r.dump(p); return p; } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/filestream/TestReuse.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestReuse.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/filestream/TestReuse.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/filestream/TestReuse.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import jdk.jfr.Recording; import jdk.jfr.consumer.EventStream; import jdk.jfr.consumer.RecordedEvent; +import jdk.test.lib.Utils; /** * @test @@ -118,7 +119,7 @@ } r.stop(); rotation.close(); - Path p = Files.createTempFile("recording", ".jfr"); + Path p = Utils.createTempFile("recording", ".jfr"); r.dump(p); return p; } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/Application.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/Application.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/Application.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/Application.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -102,7 +102,7 @@ args[2] = Application.class.getName(); args[3] = lockFile.toString(); args[4] = message; - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); touch(lockFile); process = pb.start(); // For debugging diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,7 +127,7 @@ static Process start() throws Exception { String[] args = {"-XX:StartFlightRecording", EventProducer.class.getName()}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return ProcessTools.startProcess("Event-Producer", pb, line -> line.contains(MAIN_STARTED), 0, TimeUnit.SECONDS); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -66,7 +66,7 @@ "-XX:" + (createCore ? "+" : "-") + "CreateCoredumpOnCrash", TestProcess.class.getName(), path.toString() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); process = ProcessTools.startProcess(name, pb); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ "-Xms32m", "-Xmx64m", Tester.class.getName()}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(jvm_args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(jvm_args); OutputAnalyzer analyzer = ProcessTools.executeProcess(pb); analyzer.shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java 2025-01-04 20:25:18.000000000 +0000 @@ -55,11 +55,14 @@ r.enable(EventNames.OldObjectSample).withStackTrace().with("cutoff", "infinity"); r.start(); TestClassLoader testClassLoader = new TestClassLoader(); - for (Class clazz : testClassLoader.loadClasses(OldObjects.MIN_SIZE / 20)) { + for (Class clazz : testClassLoader.loadClasses(OldObjects.MIN_SIZE / 200)) { // Allocate array to trigger sampling code path for interpreter / c1 - for (int i = 0; i < 20; i++) { + for (int i = 0; i < 200; i++) { Object classArray = Array.newInstance(clazz, 20); - Array.set(classArray, i, clazz.newInstance()); + // No need to fill whole array + for (int j = 0; j < 5; j++) { + Array.set(classArray, j, clazz.getConstructors()[0].newInstance()); + } classObjects.add(classArray); } } @@ -67,6 +70,7 @@ List events = Events.fromRecording(r); Events.hasEvents(events); for (RecordedEvent e : events) { + System.out.println(e); RecordedObject object = e.getValue("object"); RecordedClass rc = object.getValue("type"); if (rc.getName().contains("TestClass")) { diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -48,7 +48,7 @@ private final static String EVENT_NAME = EventNames.InitialEnvironmentVariable; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(Test.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(Test.class.getName()); setEnv(pb.environment()); (new OutputAnalyzer(pb.start())).shouldHaveExitValue(0); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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,7 @@ private static long runProcess(Class crasher) throws Exception { System.out.println("Test case for " + crasher.getName()); - Process p = ProcessTools.createTestJvm( + Process p = ProcessTools.createTestJavaProcessBuilder( "-Xmx64m", "-XX:-CreateCoredumpOnCrash", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java 2025-01-04 20:25:18.000000000 +0000 @@ -89,7 +89,7 @@ } private static void runSubtest(int subTestIndex) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xlog:jfr=debug", "-XX:-CreateCoredumpOnCrash", "-XX:-TieredCompilation", diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java 2025-01-04 20:25:18.000000000 +0000 @@ -110,7 +110,7 @@ private static long runProcess(Class crasher, String signal, boolean disk) throws Exception { System.out.println("Test case for crasher " + crasher.getName()); final String flightRecordingOptions = "dumponexit=true,disk=" + Boolean.toString(disk); - Process p = ProcessTools.createTestJvm( + Process p = ProcessTools.createTestJavaProcessBuilder( "-Xmx64m", "-XX:-CreateCoredumpOnCrash", "-XX:-TieredCompilation", // Avoid secondary crashes (see JDK-8293166) diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java 2025-01-04 20:25:18.000000000 +0000 @@ -35,7 +35,7 @@ public class TestEventWriterLog { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:jfr+system+bytecode=trace", "-XX:StartFlightRecording", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:jfr+system+bytecode=trace", "-XX:StartFlightRecording", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("extends jdk/jfr/internal/handlers/EventHandler"); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2016, 2021, 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 8157032 - * @key jfr - * @summary verify that jfr can not be used when JVM is executed only with java.base - * @requires vm.hasJFR & !vm.graal.enabled - * @library /test/lib - * @modules java.base/jdk.internal.misc - * @run driver jdk.jfr.jvm.TestJfrJavaBase - */ - -package jdk.jfr.jvm; - - -import jdk.test.lib.dcmd.PidJcmdExecutor; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -public class TestJfrJavaBase { - - private static void checkOutput(OutputAnalyzer output) { - output.shouldContain("Module jdk.jfr not found."); - output.shouldContain("Flight Recorder can not be enabled."); - } - - public static void main(String[] args) throws Exception { - OutputAnalyzer output; - if (args.length == 0) { - output = ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( - "-Dtest.jdk=" + System.getProperty("test.jdk"), - "--limit-modules", "java.base", "-cp", System.getProperty("java.class.path"), - TestJfrJavaBase.class.getName(), "runtest")); - output.shouldHaveExitValue(0); - } else { - output = ProcessTools.executeTestJava("-XX:StartFlightRecording:dumponexit=true", - "--limit-modules", "java.base", "-version"); - checkOutput(output); - output.shouldHaveExitValue(1); - - // Verify that JFR.start jcmd command reports an error when jdk.jfr module is not available - output = new PidJcmdExecutor().execute("JFR.start"); - checkOutput(output); - output.shouldHaveExitValue(0); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestModularImage.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestModularImage.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/jvm/TestModularImage.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/jvm/TestModularImage.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2022, 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.jvm; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.spi.ToolProvider; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/** + * @test + * @key jfr + * @summary Checks that a JDK image with and without the jdk.jfr module behaves + * as expected + * @requires vm.hasJFR + * @library /test/lib + * @run driver jdk.jfr.jvm.TestModularImage + */ +public class TestModularImage { + private static final String STARTED_RECORDING = "Started recording"; + private static final String HELLO_WORLD = "hello, world"; + private static final String ERROR_LINE1 = "Error occurred during initialization of boot layer"; + private static final String ERROR_LINE2 = "java.lang.module.FindException: Module jdk.jfr not found"; + + private static final ToolProvider javac = find("javac"); + private static final ToolProvider jlink = find("jlink"); + + private static final Path out = Path.of("out"); + private static final Path src = out.resolve("src"); + private static final Path classes = out.resolve("classes"); + + private static final Path testJDK = Path.of(System.getProperty("test.jdk")); + private static final Path jmods = testJDK.resolve("jmods"); + + private static final String modulePath = jmods.toString() + File.pathSeparator + classes.toString(); + + public static void main(String[] args) throws Exception { + preparseSourceTree(); + compileSourceCode(); + + // Jcmd for the current JVM where jdk.attach module is available + String currentJcmd = JDKToolFinder.getJDKTool("jcmd"); + currentJcmd = Path.of(currentJcmd).normalize().toAbsolutePath().toString(); + + // Image 1: Should be able to start JFR if jdk.jfr module is present + Path javaBin1 = jlink("hello.world,jdk.jfr", "with-jfr"); + testCommandLineWithJFR(javaBin1); + testJcmdWithJFR(javaBin1, currentJcmd); + + // Image 2: Should fail if jdk.jfr module is not present + Path javaBin2 = jlink("hello.world", "without-jfr"); + testCommandLineWithoutJFR(javaBin2); + testJcmdWithoutJFR(javaBin2, currentJcmd); + } + + private static void testCommandLineWithJFR(Path binPath) throws Exception { + var result = java(binPath, "-XX:StartFlightRecording", "--module", "hello.world/hello.Main"); + result.shouldNotContain(ERROR_LINE1); + result.shouldNotContain(ERROR_LINE2); + result.shouldContain(HELLO_WORLD); + result.shouldContain(STARTED_RECORDING); + result.shouldHaveExitValue(0); + } + + private static void testJcmdWithJFR(Path binPath, String jcmd) throws Exception { + var result = java(binPath, "--module", "hello.world/hello.Main", jcmd); + result.shouldContain(HELLO_WORLD); + result.shouldNotContain(ERROR_LINE1); + result.shouldNotContain(ERROR_LINE2); + result.shouldContain(STARTED_RECORDING); + result.shouldHaveExitValue(0); + } + + private static void testCommandLineWithoutJFR(Path binPath) throws Exception { + var result = java(binPath, "-XX:StartFlightRecording", "--module", "hello.world/hello.Main"); + result.shouldContain(ERROR_LINE1); + result.shouldContain(ERROR_LINE2); + result.shouldNotContain(HELLO_WORLD); + result.shouldNotContain(STARTED_RECORDING); + result.shouldHaveExitValue(1); + } + + private static void testJcmdWithoutJFR(Path binPath, String jcmd) throws Exception { + OutputAnalyzer result = java(binPath, "--module", "hello.world/hello.Main", jcmd); + result.shouldContain(HELLO_WORLD); + result.shouldContain("Module jdk.jfr not found."); + result.shouldContain("Flight Recorder can not be enabled."); + result.shouldNotContain(STARTED_RECORDING); + result.shouldHaveExitValue(0); + } + + private static ToolProvider find(String tool) { + return ToolProvider.findFirst(tool).orElseThrow(() -> new RuntimeException("No " + tool)); + } + + private static void preparseSourceTree() throws IOException { + String main = + """ + package hello; + import java.io.ByteArrayOutputStream; + public class Main { + public static void main(String... args) throws Exception { + System.out.println("hello, world!"); + if (args.length > 0) { + long pid = ProcessHandle.current().pid(); + String jcmd = args[0]; + String[] cmds = { jcmd, Long.toString(pid), "JFR.start" }; + Process process = new ProcessBuilder(cmds).redirectErrorStream(true).start(); + process.waitFor(); + var baos = new ByteArrayOutputStream(); + process.getInputStream().transferTo(baos); + System.out.println(baos.toString()); + System.exit(process.exitValue()); + } + } + } + """; + String moduleInfo = "module hello.world {}"; + Path helloWorld = src.resolve("hello.world"); + Files.createDirectories(helloWorld.resolve("hello")); + Files.write(helloWorld.resolve("module-info.java"), moduleInfo.getBytes()); + Files.write(helloWorld.resolve("hello").resolve("Main.java"), main.getBytes()); + } + + private static void compileSourceCode() { + javac.run(System.out, System.err, + "--module-source-path", src.toString(), + "--module", "hello.world", + "-d", classes.toString()); + } + + private static Path jlink(String modules, String output) { + jlink.run(System.out, System.err, + "--add-modules", modules, + "--module-path", modulePath, + "--output", output); + return Path.of(output).resolve("bin").toAbsolutePath(); + } + + private static OutputAnalyzer java(Path jvm, String... args) throws Exception { + ProcessBuilder pb = new ProcessBuilder(); + String java = Platform.isWindows() ? "java.exe" : "java"; + List arguments = new ArrayList<>(); + arguments.add(jvm.resolve(java).toString()); + arguments.addAll(Arrays.asList(args)); + pb.command(arguments); + pb.directory(jvm.toFile()); + System.out.println("Executing: java " + String.join(" ", args)); + OutputAnalyzer result = ProcessTools.executeProcess(pb); + System.out.println("--- Output ----" + "-".repeat(65)); + System.out.println(result.getOutput()); + System.out.println("-".repeat(80)); + return result; + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ Asserts.assertGreaterThan(options.length, 0); for (String option : options) { - pb = ProcessTools.createJavaProcessBuilder(prepend + option, "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(prepend + option, "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain(expectedOutput); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -92,7 +92,7 @@ } private static void testDumponExit(Supplier p,String... args) throws Exception, IOException { - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -70,7 +70,7 @@ } private static void launch(String commandLine, String expectedOutput) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commandLine, "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(commandLine, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(expectedOutput); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -483,19 +483,19 @@ final String flightRecorderOptions = tc.getTestString(); ProcessBuilder pb; if (flightRecorderOptions != null) { - pb = ProcessTools.createTestJvm("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", - "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", - flightRecorderOptions, - "-XX:StartFlightRecording", - SUT.class.getName(), - tc.getTestName()); + pb = ProcessTools.createTestJavaProcessBuilder("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + flightRecorderOptions, + "-XX:StartFlightRecording", + SUT.class.getName(), + tc.getTestName()); } else { // default, no FlightRecorderOptions passed - pb = ProcessTools.createTestJvm("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", - "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", - "-XX:StartFlightRecording", - SUT.class.getName(), - tc.getTestName()); + pb = ProcessTools.createTestJavaProcessBuilder("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + "-XX:StartFlightRecording", + SUT.class.getName(), + tc.getTestName()); } System.out.println("Driver launching SUT with string: " + flightRecorderOptions != null ? flightRecorderOptions : "default"); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -55,14 +55,14 @@ private static void launchUnary(String options) throws Exception { String recording1 = START_FLIGHT_RECORDING + (options != null ? options : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, MainClass.class.getName()); test(pb, "Started recording 1"); } private static void launchBinary(String options1, String options2) throws Exception { String recording1 = START_FLIGHT_RECORDING + (options1 != null ? options1 : ""); String recording2 = START_FLIGHT_RECORDING + (options2 != null ? options2 : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, recording2, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, recording2, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2"); } @@ -70,7 +70,7 @@ String recording1 = START_FLIGHT_RECORDING + (options1 != null ? options1 : ""); String recording2 = START_FLIGHT_RECORDING + (options2 != null ? options2 : ""); String recording3 = START_FLIGHT_RECORDING + (options3 != null ? options3 : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, recording2, recording3, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, recording2, recording3, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2", "Started recording 3"); } @@ -94,7 +94,7 @@ String flightRecorderOptions = FLIGHT_RECORDER_OPTIONS + "=maxchunksize=8m"; String recording1 = START_FLIGHT_RECORDING + "=filename=recording1.jfr"; String recording2 = START_FLIGHT_RECORDING + "=name=myrecording,filename=recording2.jfr"; - ProcessBuilder pb = ProcessTools.createTestJvm(flightRecorderOptions, recording1, recording2, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flightRecorderOptions, recording1, recording2, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2"); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java 2025-01-04 20:25:18.000000000 +0000 @@ -36,7 +36,7 @@ return; } - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Duser.country=DE", "-Duser.language=de", "-XX:FlightRecorderOptions:stackdepth=128", diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -104,7 +104,7 @@ } System.out.println(); System.out.println(); - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer out = ProcessTools.executeProcess(pb); System.out.println(out.getOutput()); verifier.accept(out); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartDuration.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartDuration.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartDuration.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartDuration.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -53,7 +53,7 @@ } private static void testDurationInRange(String duration, Duration durationString, boolean wait) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:StartFlightRecording:name=TestStartDuration,duration=" + duration, TestValues.class.getName(), durationString.toString(), wait ? "wait" : ""); OutputAnalyzer out = ProcessTools.executeProcess(pb); @@ -63,7 +63,7 @@ private static void testDurationJavaVersion(String duration, boolean inRange) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:StartFlightRecording:name=TestStartDuration,duration=" + duration, "-version"); OutputAnalyzer out = ProcessTools.executeProcess(pb); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartName.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartName.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartName.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartName.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ } private static void testName(String recordingName, boolean validName) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:StartFlightRecording:name=" + recordingName, TestName.class.getName(), recordingName); OutputAnalyzer out = ProcessTools.executeProcess(pb); diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartupMessage.java openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartupMessage.java --- openjdk-17-17.0.13+11/test/jdk/jdk/jfr/startupargs/TestStartupMessage.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/jfr/startupargs/TestStartupMessage.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ List commands = new ArrayList<>(Arrays.asList(args)); commands.add("-XX:StartFlightRecording"); commands.add(TestMessage.class.getName()); - ProcessBuilder pb = ProcessTools.createTestJvm(commands); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(commands); OutputAnalyzer out = ProcessTools.executeProcess(pb); out.shouldHaveExitValue(0); return out; diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/nio/zipfs/ZeroDate.java openjdk-17-17.0.14+7/test/jdk/jdk/nio/zipfs/ZeroDate.java --- openjdk-17-17.0.13+11/test/jdk/jdk/nio/zipfs/ZeroDate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/nio/zipfs/ZeroDate.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -44,42 +44,48 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import jdk.test.lib.Utils; + /* @test * @bug 8184940 8186227 8188869 * @summary JDK 9 rejects zip files where the modified day or month is 0 * or otherwise represent an invalid date, such as 1980-02-30 24:60:60 * @author Liam Miller-Cushon * @modules jdk.zipfs + * @library /test/lib */ public class ZeroDate { public static void main(String[] args) throws Exception { // create a zip file, and read it in as a byte array - Path path = Files.createTempFile("bad", ".zip"); - try (OutputStream os = Files.newOutputStream(path); - ZipOutputStream zos = new ZipOutputStream(os)) { - ZipEntry e = new ZipEntry("x"); - zos.putNextEntry(e); - zos.write((int) 'x'); - } - int len = (int) Files.size(path); - byte[] data = new byte[len]; - try (InputStream is = Files.newInputStream(path)) { - is.read(data); + Path path = Utils.createTempFile("bad", ".zip"); + try { + try (OutputStream os = Files.newOutputStream(path); + ZipOutputStream zos = new ZipOutputStream(os)) { + ZipEntry e = new ZipEntry("x"); + zos.putNextEntry(e); + zos.write((int) 'x'); + } + int len = (int) Files.size(path); + byte[] data = new byte[len]; + try (InputStream is = Files.newInputStream(path)) { + is.read(data); + } + + // year, month, day are zero + testDate(data.clone(), 0, LocalDate.of(1979, 11, 30).atStartOfDay()); + // only year is zero + testDate(data.clone(), 0 << 25 | 4 << 21 | 5 << 16, LocalDate.of(1980, 4, 5).atStartOfDay()); + // month is greater than 12 + testDate(data.clone(), 0 << 25 | 13 << 21 | 1 << 16, LocalDate.of(1981, 1, 1).atStartOfDay()); + // 30th of February + testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16, LocalDate.of(1980, 3, 1).atStartOfDay()); + // 30th of February, 24:60:60 + testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16 | 24 << 11 | 60 << 5 | 60 >> 1, + LocalDateTime.of(1980, 3, 2, 1, 1, 0)); + } finally { + Files.delete(path); } - Files.delete(path); - - // year, month, day are zero - testDate(data.clone(), 0, LocalDate.of(1979, 11, 30).atStartOfDay()); - // only year is zero - testDate(data.clone(), 0 << 25 | 4 << 21 | 5 << 16, LocalDate.of(1980, 4, 5).atStartOfDay()); - // month is greater than 12 - testDate(data.clone(), 0 << 25 | 13 << 21 | 1 << 16, LocalDate.of(1981, 1, 1).atStartOfDay()); - // 30th of February - testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16, LocalDate.of(1980, 3, 1).atStartOfDay()); - // 30th of February, 24:60:60 - testDate(data.clone(), 0 << 25 | 2 << 21 | 30 << 16 | 24 << 11 | 60 << 5 | 60 >> 1, - LocalDateTime.of(1980, 3, 2, 1, 1, 0)); } private static void testDate(byte[] data, int date, LocalDateTime expected) throws IOException { @@ -91,7 +97,7 @@ writeU32(data, locpos + LOCTIM, date); // ensure that the archive is still readable, and the date is 1979-11-30 - Path path = Files.createTempFile("out", ".zip"); + Path path = Utils.createTempFile("out", ".zip"); try (OutputStream os = Files.newOutputStream(path)) { os.write(data); } diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/security/JavaDotSecurity/MakeJavaSecurityTest.java openjdk-17-17.0.14+7/test/jdk/jdk/security/JavaDotSecurity/MakeJavaSecurityTest.java --- openjdk-17-17.0.13+11/test/jdk/jdk/security/JavaDotSecurity/MakeJavaSecurityTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/security/JavaDotSecurity/MakeJavaSecurityTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { Path toolPath = getMakeJavaSecPath(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( toolPath.toString(), TEST_SRC + "/raw_java_security", "outfile", diff -Nru openjdk-17-17.0.13+11/test/jdk/jdk/security/jarsigner/Spec.java openjdk-17-17.0.14+7/test/jdk/jdk/security/jarsigner/Spec.java --- openjdk-17-17.0.13+11/test/jdk/jdk/security/jarsigner/Spec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/jdk/security/jarsigner/Spec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ import com.sun.jarsigner.ContentSignerParameters; import jdk.security.jarsigner.JarSigner; import jdk.test.lib.util.JarUtils; +import jdk.test.lib.security.SecurityUtils; import sun.security.provider.certpath.X509CertPath; import java.io.File; @@ -181,14 +182,16 @@ assertTrue(JarSigner.Builder.getDefaultDigestAlgorithm().equals("SHA-256")); // Calculating large DSA and RSA keys are too slow. - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); - kpg.initialize(1024); + String kpgRSA = "RSA"; + String kpgDSA = "DSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgRSA); + kpg.initialize(SecurityUtils.getTestKeySize(kpgRSA)); assertTrue(JarSigner.Builder .getDefaultSignatureAlgorithm(kpg.generateKeyPair().getPrivate()) .equals("SHA256withRSA")); - kpg = KeyPairGenerator.getInstance("DSA"); - kpg.initialize(1024); + kpg = KeyPairGenerator.getInstance(kpgDSA); + kpg.initialize(SecurityUtils.getTestKeySize(kpgDSA)); assertTrue(JarSigner.Builder .getDefaultSignatureAlgorithm(kpg.generateKeyPair().getPrivate()) .equals("SHA256withDSA")); diff -Nru openjdk-17-17.0.13+11/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java openjdk-17-17.0.14+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java --- openjdk-17-17.0.13+11/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,14 +25,16 @@ * @test id=actalisauthenticationrootca * @bug 8189131 * @summary Interoperability tests with Actalis CA + * Before this test set to manual, the original timeout + * value if 180 * @library /test/lib * @build jtreg.SkippedException ValidatePathWithURL CAInterop * @run main/othervm/manual -Djava.security.debug=certpath,ocsp * CAInterop actalisauthenticationrootca OCSP - * @run main/othervm/manual/timeout=180 -Djava.security.debug=certpath,ocsp + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp * -Dcom.sun.security.ocsp.useget=false * CAInterop actalisauthenticationrootca OCSP - * @run main/othervm/manual/timeout=180 -Djava.security.debug=certpath,ocsp + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp * CAInterop actalisauthenticationrootca CRL */ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/awt/PaletteTester.java openjdk-17-17.0.14+7/test/jdk/sun/awt/PaletteTester.java --- openjdk-17-17.0.13+11/test/jdk/sun/awt/PaletteTester.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/awt/PaletteTester.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,7 +90,7 @@ public static void main( String args[] ) throws Exception { - PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + PassFailJFrame passFailJFrame = PassFailJFrame.builder() .title("PaletteTester Instructions") .instructions(INSTRUCTIONS) .testTimeOut(5) diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java openjdk-17-17.0.14+7/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java --- openjdk-17-17.0.13+11/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java 2025-01-04 20:25:18.000000000 +0000 @@ -323,7 +323,7 @@ private void executeJava() throws Throwable { String className = JavaProcess.class.getName(); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Dtest.timeout.factor=" + System.getProperty("test.timeout.factor", "1.0"), className, mainArgsIdentifier); OutputAnalyzer ob = ProcessTools.executeProcess(pb); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jdp/DynamicLauncher.java openjdk-17-17.0.14+7/test/jdk/sun/management/jdp/DynamicLauncher.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jdp/DynamicLauncher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jdp/DynamicLauncher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -67,7 +67,7 @@ protected OutputAnalyzer runVM() throws Exception { String[] options = this.options(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(options); OutputAnalyzer out = ProcessTools.executeProcess(pb); System.out.println(out.getStdout()); System.err.println(out.getStderr()); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,8 +41,8 @@ import java.util.Set; /** - * Change file permission for out-of-the-box management an do test used by - * PasswordFilePermissionTest and SSLConfigFilePermissionTest tests + * Change file permission for out-of-the-box management, and test. + * Used by PasswordFilePermissionTest and SSLConfigFilePermissionTest tests. * * @author Taras Ledkov */ @@ -140,13 +140,15 @@ perms_0700.add(PosixFilePermission.OWNER_EXECUTE); Files.setPosixFilePermissions(file2PermissionTest, perms_0700); - if (doTest() != 0) { + int e = doTest(); + if (e != 0) { + System.out.println("FAILURE: expected exit code 0, got: " + e); ++failures; } } /** - * Test 1 - SSL config file is secure - VM should start + * Test 2 - SSL config file is NOT secure - VM should not start */ private void test2() throws Exception { final Set perms = Files.getPosixFilePermissions(file2PermissionTest); @@ -154,7 +156,9 @@ perms.add(PosixFilePermission.OTHERS_EXECUTE); Files.setPosixFilePermissions(file2PermissionTest, perms); - if (doTest() == 0) { + int e = doTest(); + if (e == 0) { + System.out.println("FAILURE: expected exit code non-zero, got: " + e); ++failures; } } @@ -172,9 +176,7 @@ command.add(TEST_CLASSES); command.add(className); - - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( - command.toArray(new String[command.size()])); + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(command); System.out.println("test cmdline: " + Arrays.toString(processBuilder.command().toArray()).replace(",", "")); OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); @@ -182,13 +184,15 @@ System.out.println("test output:"); System.out.println(output.getOutput()); - if ((output.getExitValue() == 0) || - !output.getOutput().contains("Exception thrown by the agent : " + - "java.rmi.server.ExportException: Port already in use")) { - return output.getExitValue(); + if (output.getOutput().contains("Exception thrown by the agent: java.rmi.server.ExportException: Port already in use")) { + if (i < MAX_GET_FREE_PORT_TRIES - 1) { + System.out.println("Retrying..."); + continue; + } } + // Fail on too many port failures, and all other startup failures. + return output.getExitValue(); } - return -1; } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -95,9 +95,7 @@ System.out.println(" PID : " + serverPrc.pid()); System.out.println(" shutdown port : " + port.get()); - ProcessBuilder client = ProcessTools.createJavaProcessBuilder( - "-cp", - Utils.TEST_CLASS_PATH, + ProcessBuilder client = ProcessTools.createTestJavaProcessBuilder( "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", "TestManager", String.valueOf(serverPrc.pid()), diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java 2025-01-04 20:25:18.000000000 +0000 @@ -230,12 +230,10 @@ private static final String EXP_TERM_MSG_REG = "Exit: ([0-9]+)"; private static final Pattern EXIT_PATTERN = Pattern.compile(EXP_TERM_MSG_REG); private static final String COOP_EXIT = "MainThread: Cooperative Exit"; - private static final int WAIT_FOR_JMX_AGENT_TIMEOUT_MS = 20_000; private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; - private boolean jmxAgentStarted = false; private volatile Exception excptn; private MainThread(InetAddress bindAddress, int jmxPort, int rmiPort, boolean useSSL) { @@ -269,20 +267,12 @@ JMXConnectorThread connectionTester = new JMXConnectorThread( addr, jmxPort, rmiPort, useSSL, latch); connectionTester.start(); - boolean expired = false; try { - expired = !latch.await(WAIT_FOR_JMX_AGENT_TIMEOUT_MS, TimeUnit.MILLISECONDS); - System.out.println( - "MainThread: Finished waiting for JMX agent to become available: expired == " - + expired); - jmxAgentStarted = !expired; + latch.await(); + System.out.println("MainThread: Finished waiting for JMX agent to become available."); } catch (InterruptedException e) { throw new RuntimeException("Test failed", e); } - if (!jmxAgentStarted) { - throw new RuntimeException( - "Test failed. JMX server agents not becoming available."); - } if (connectionTester.isFailed() || !connectionTester.jmxConnectionWorked() || !connectionTester.rmiConnectionWorked()) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -42,7 +42,7 @@ * @modules java.management.rmi * * @build JMXAgentInterfaceBinding - * @run main/timeout=60 JMXInterfaceBindingTest + * @run main JMXInterfaceBindingTest */ public class JMXInterfaceBindingTest { @@ -65,7 +65,6 @@ "ssl" + File.separator + "truststore"; - public static final String TEST_CLASSPATH = System.getProperty("test.classes", "."); public void run(List addrs) { System.out.println("DEBUG: Running tests with plain sockets."); @@ -198,8 +197,6 @@ " == (%s,%d,%d)", address, jmxPort, rmiPort); System.out.println(msg); List args = new ArrayList<>(); - args.add("-classpath"); - args.add(TEST_CLASSPATH); args.add("-Dcom.sun.management.jmxremote.host=" + address); args.add("-Dcom.sun.management.jmxremote.port=" + jmxPort); args.add("-Dcom.sun.management.jmxremote.rmi.port=" + rmiPort); @@ -221,7 +218,7 @@ args.add(Boolean.toString(useSSL)); try { - ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[]{})); + ProcessBuilder builder = ProcessTools.createTestJavaProcessBuilder(args.toArray(new String[]{})); System.out.println(ProcessTools.getCommandLine(builder)); Process process = builder.start(); output = new OutputAnalyzer(process); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -107,7 +107,7 @@ args.add(arg); } args.add("TestApplication"); - ProcessBuilder server = ProcessTools.createJavaProcessBuilder( + ProcessBuilder server = ProcessTools.createTestJavaProcessBuilder( args.toArray(new String[args.size()]) ); @@ -133,7 +133,7 @@ System.out.println(" PID : " + serverPrc.pid()); System.out.println(" shutdown port : " + port.get()); - ProcessBuilder client = ProcessTools.createJavaProcessBuilder( + ProcessBuilder client = ProcessTools.createTestJavaProcessBuilder( "-cp", TEST_CLASSPATH, "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ +import jdk.test.lib.Utils; + import sun.management.jmxremote.ConnectorBootstrap; import java.io.File; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -188,7 +188,7 @@ command.add(TEST_CLASS_PATH); command.add(className); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(command.toArray(new String[command.size()])); + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(command); OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * */ import jdk.test.lib.Platform; +import jdk.test.lib.Utils; import java.io.File; import java.io.FilenameFilter; @@ -145,54 +146,16 @@ } /** - * Grant file access. - * - * @param file file to grant access - * @param access user access or full access - * @throws IOException if error occurs - */ - static void grantAccess(Path file, AccessControl access) throws IOException { - Set attr = file.getFileSystem().supportedFileAttributeViews(); - if (attr.contains("posix")) { - String perms = access == AccessControl.OWNER ? "rw-------" : "rwxrwxrwx"; - Files.setPosixFilePermissions(file, PosixFilePermissions.fromString(perms)); - } else if (attr.contains("acl")) { - AclFileAttributeView view = Files.getFileAttributeView(file, AclFileAttributeView.class); - List acl = new ArrayList<>(); - for (AclEntry thisEntry : view.getAcl()) { - if (access == AccessControl.OWNER) { - if (thisEntry.principal().getName().equals(view.getOwner().getName())) { - acl.add(Utils.allowAccess(thisEntry)); - } else if (thisEntry.type() == AclEntryType.ALLOW) { - acl.add(Utils.revokeAccess(thisEntry)); - } else { - acl.add(thisEntry); - } - } else { - if (!thisEntry.principal().getName().contains("NULL SID") - && thisEntry.type() != AclEntryType.ALLOW) { - acl.add(Utils.allowAccess(thisEntry)); - } else { - acl.add(thisEntry); - } - } - } - view.setAcl(acl); - } else { - throw new RuntimeException("Unsupported file attributes: " + attr); - } - } - - /** * Grant files' access. * * @param files files to grant access * @param access user access or full access * @throws IOException if error occurs */ - static void grantFilesAccess(List files, AccessControl access) throws IOException { + static void grantFilesAccess(List files, AccessControl access) + throws IOException { for (Path thisFile : files) { - grantAccess(thisFile, access); + Utils.grantFileAccess(thisFile, access == AccessControl.OWNER); } } @@ -209,7 +172,7 @@ Utils.copyFiles(files, sslTarget, StandardCopyOption.REPLACE_EXISTING); for (Path file : files) { - grantAccess(sslTarget.resolve(file.getFileName()), AccessControl.EVERYONE); + Utils.fullAccess(sslTarget.resolve(file.getFileName())); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/Utils.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/bootstrap/Utils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.nio.file.CopyOption; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.*; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * Utility class. - */ -public class Utils { - static private String fileSeparator = System.getProperty("file.separator"); - - /** - * Converts slashes in a pathname to backslashes - * if slashes is not the file separator. - */ - static String convertPath(String path) { - // No need to do the conversion if file separator is '/' - if (fileSeparator.length() == 1 && fileSeparator.charAt(0) == '/') { - return path; - } - - char[] cs = path.toCharArray(); - for (int i = 0; i < cs.length; i++) { - if (cs[i] == '/') { - cs[i] = '\\'; - } - } - String newPath = new String(cs); - return newPath; - } - - /** - * Return file directories that satisfy the specified filter. - * - * @param searchDirectory the base directory to search - * @param filter a filename filter - * @return file directories - */ - public static List findFiles(Path searchDirectory, - FilenameFilter filter) { - return Arrays.stream(searchDirectory.toFile().listFiles(filter)) - .map(f -> f.toPath()) - .collect(Collectors.toList()); - } - - /** - * Copy files to the target path. - * - * @param source the paths to the files to copy - * @param target the path to the target files - * @param filenameMapper mapper function applied to filenames - * @param options options specifying how the copy should be done - * @return the paths to the target files - * @throws IOException if error occurs - */ - public static List copyFiles(List source, Path target, - Function filenameMapper, - CopyOption... options) throws IOException { - List result = new ArrayList<>(); - - if (!target.toFile().exists()) { - Files.createDirectory(target); - } - - for (Path file : source) { - if (!file.toFile().exists()) { - continue; - } - - String baseName = file.getFileName().toString(); - - Path targetFile = target.resolve(filenameMapper.apply(baseName)); - Files.copy(file, targetFile, options); - result.add(targetFile); - } - return result; - } - - /** - * Copy files to the target path. - * - * @param source the paths to the files to copy - * @param target the path to the target files - * @param options options specifying how the copy should be done - * @return the paths to the target files - * @throws IOException if error occurs - */ - public static List copyFiles(List source, Path target, - CopyOption... options) throws IOException { - return copyFiles(source, target, (s) -> s, options); - } - - /** - * Return an ACL entry that revokes owner access. - * - * @param acl original ACL entry to build from - * @return an ACL entry that revokes all access - */ - public static AclEntry revokeAccess(AclEntry acl) { - return buildAclEntry(acl, AclEntryType.DENY); - } - - /** - * Return an ACL entry that allow owner access. - * @param acl original ACL entry to build from - * @return an ACL entry that allows all access - */ - public static AclEntry allowAccess(AclEntry acl) { - return buildAclEntry(acl, AclEntryType.ALLOW); - } - - /** - * Build an ACL entry with a given ACL entry type. - * - * @param acl original ACL entry to build from - * @return an ACL entry with a given ACL entry type - */ - public static AclEntry buildAclEntry(AclEntry acl, AclEntryType type) { - return AclEntry.newBuilder() - .setType(type) - .setPrincipal(acl.principal()) - .setPermissions(acl.permissions()) - .build(); - } - - /** - * Replace file string by applying the given mapper function. - * - * @param source the file to read - * @param contentMapper the mapper function applied to file's content - * @throws IOException if an I/O error occurs - */ - public static void replaceFileString(Path source, - Function contentMapper) throws IOException { - StringBuilder sb = new StringBuilder(); - String lineSep = System.getProperty("line.separator"); - - try (BufferedReader reader = - new BufferedReader(new FileReader(source.toFile()))) { - - String line; - - // read all and replace all at once?? - while ((line = reader.readLine()) != null) { - sb.append(contentMapper.apply(line)) - .append(lineSep); - } - } - - try (FileWriter writer = new FileWriter(source.toFile())) { - writer.write(sb.toString()); - } - } - - /** - * Replace files' string by applying the given mapper function. - * - * @param source the file to read - * @param contentMapper the mapper function applied to files' content - * @throws IOException if an I/O error occurs - */ - public static void replaceFilesString(List source, - Function contentMapper) throws IOException { - for (Path file : source) { - replaceFileString(file, contentMapper); - } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -72,7 +72,7 @@ private static final boolean verbose = false; - private static ManagementAgentJcmd jcmd = new ManagementAgentJcmd(TEST_APP_NAME, verbose); + private static ManagementAgentJcmd jcmd; private static void dbg_print(String msg) { if (verbose) { @@ -347,6 +347,7 @@ "the requested port not being available"); } pid = p.pid(); + jcmd = new ManagementAgentJcmd(p, verbose); } catch (TimeoutException e) { if (p != null) { p.destroy(); @@ -391,16 +392,14 @@ private static TestAppRun doTest(String name, String ... args) throws Exception { List pbArgs = new ArrayList<>(Arrays.asList( - "-cp", - System.getProperty("test.class.path"), + "-Duser.language=en", + "-Duser.country=US", "-XX:+UsePerfData" )); pbArgs.addAll(Arrays.asList(args)); pbArgs.add(TEST_APP_NAME); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - pbArgs.toArray(new String[pbArgs.size()]) - ); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(pbArgs); TestAppRun s = new TestAppRun(pb, name); s.start(); return s; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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,16 +59,14 @@ @BeforeClass public static void setupClass() throws Exception { - testAppPb = ProcessTools.createJavaProcessBuilder( + testAppPb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UsePerfData", - "-cp", System.getProperty("test.class.path"), TEST_APP_NAME ); } @BeforeTest public void setup() { - jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false); } @BeforeMethod @@ -77,6 +75,7 @@ TEST_APP_NAME, testAppPb, (Predicate)l->l.trim().equals("main enter") ); + jcmd = new ManagementAgentJcmd(testApp, false); } @AfterMethod diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -84,14 +84,10 @@ @BeforeTest public final void setup() throws Exception { List args = new ArrayList<>(); - args.add("-cp"); - args.add(System.getProperty("test.class.path")); args.add("-XX:+UsePerfData"); args.addAll(getCustomVmArgs()); args.add(TEST_APP_NAME); - testAppPb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); - - jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false); + testAppPb = ProcessTools.createTestJavaProcessBuilder(args); } @BeforeMethod @@ -100,6 +96,7 @@ TEST_APP_NAME, testAppPb, (Predicate)l->l.trim().equals("main enter") ); + jcmd = new ManagementAgentJcmd(testApp, false); } @AfterMethod diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java --- openjdk-17-17.0.13+11/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -47,11 +47,11 @@ private static final String CMD_STATUS = "ManagementAgent.status"; private static final String CMD_PRINTPERF = "PerfCounter.print"; - private final String id; + private final long pid; private final boolean verbose; - public ManagementAgentJcmd(String targetApp, boolean verbose) { - this.id = targetApp; + public ManagementAgentJcmd(Process targetApp, boolean verbose) { + this.pid = targetApp.pid(); this.verbose = verbose; } @@ -174,7 +174,7 @@ * @throws InterruptedException */ private String jcmd(Consumer c, String ... command) throws IOException, InterruptedException { - return jcmd(id, c, command); + return jcmd(Long.toString(pid), c, command); } /** diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/B8185898.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/B8185898.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/B8185898.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/B8185898.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 8185898 8163921 + * @bug 8185898 8163921 8339470 * @modules java.base/sun.net.www * @library /test/lib * @run main/othervm B8185898 @@ -143,32 +143,32 @@ // {{inputString1, expectedToString1, expectedPrint1}, {...}} String[][] strings = { {"HTTP/1.1 200 OK\r\n" - + "Accept: */*\r\n" + + "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n" + "Connection: keep-alive\r\n" + "Host: 127.0.0.1:12345\r\n" + "User-agent: Java/12\r\n\r\nfoooo", "pairs: {null: HTTP/1.1 200 OK}" - + "{Accept: */*}" + + "{Accept: text/html, image/gif, image/jpeg, */*; q=0.2}" + "{Connection: keep-alive}" + "{Host: 127.0.0.1:12345}" + "{User-agent: Java/12}", - "Accept: */*\r\n" + "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n" + "Connection: keep-alive\r\n" + "Host: 127.0.0.1:12345\r\n" + "User-agent: Java/12\r\n\r\n"}, {"HTTP/1.1 200 OK\r\n" - + "Accept: */*\r\n" + + "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n" + "Connection: keep-alive\r\n" + "Host: 127.0.0.1:12345\r\n" + "User-agent: Java/12\r\n" + "X-Header:\r\n\r\n", "pairs: {null: HTTP/1.1 200 OK}" - + "{Accept: */*}" + + "{Accept: text/html, image/gif, image/jpeg, */*; q=0.2}" + "{Connection: keep-alive}" + "{Host: 127.0.0.1:12345}" + "{User-agent: Java/12}" + "{X-Header: }", - "Accept: */*\r\n" + "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n" + "Connection: keep-alive\r\n" + "Host: 127.0.0.1:12345\r\n" + "User-agent: Java/12\r\n" diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,9 +24,9 @@ /* * @test * @bug 5045306 6356004 6993490 8255124 + * @summary Http keep-alive implementation is not efficient * @library /test/lib * @run main/othervm B5045306 - * @summary Http keep-alive implementation is not efficient */ import java.io.IOException; @@ -42,14 +42,17 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import jdk.test.lib.net.URIBuilder; + /* Part 1: - * The http client makes a connection to a URL whos content contains a lot of + * The http client makes a connection to a URL whose content contains a lot of * data, more than can fit in the socket buffer. The client only reads * 1 byte of the data from the InputStream leaving behind more data than can * fit in the socket buffer. The client then makes a second call to the http @@ -63,151 +66,167 @@ public class B5045306 { static HttpServer server; - - public static void main(String[] args) { - startHttpServer(); - clientHttpCalls(); - } + static ExecutorService executor = Executors.newSingleThreadExecutor(); public static void startHttpServer() { try { - server = HttpServer.create(new InetSocketAddress(InetAddress.getLocalHost(), 0), 10); + server = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 10); server.createContext("/", new SimpleHttpTransactionHandler()); - server.setExecutor(Executors.newSingleThreadExecutor()); - server.start(); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException(e); } + server.setExecutor(executor); + server.start(); + System.out.println("http server listens on: " + server.getAddress()); } - public static void clientHttpCalls() { + public static void stopHttpServer() { + server.stop(1); + executor.shutdown(); + } + + public static void clientHttpCalls() throws Exception { List uncaught = new ArrayList<>(); Thread.setDefaultUncaughtExceptionHandler((t, ex) -> { uncaught.add(ex); }); - try { - System.out.println("http server listen on: " + server.getAddress().getPort()); - String hostAddr = InetAddress.getLocalHost().getHostAddress(); - if (hostAddr.indexOf(':') > -1) hostAddr = "[" + hostAddr + "]"; - String baseURLStr = "http://" + hostAddr + ":" + server.getAddress().getPort() + "/"; - URL bigDataURL = new URL (baseURLStr + "firstCall"); - URL smallDataURL = new URL (baseURLStr + "secondCall"); + URL bigDataURL = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/firstCall") + .toURL(); + + URL smallDataURL = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/secondCall") + .toURL(); - HttpURLConnection uc = (HttpURLConnection)bigDataURL.openConnection(Proxy.NO_PROXY); + HttpURLConnection uc = (HttpURLConnection)bigDataURL.openConnection(Proxy.NO_PROXY); - //Only read 1 byte of response data and close the stream - InputStream is = uc.getInputStream(); + // Only read 1 byte of response data and close the stream + try (InputStream is = uc.getInputStream()) { byte[] ba = new byte[1]; is.read(ba); - is.close(); + } - // Allow the KeepAliveStreamCleaner thread to read the data left behind and cache the connection. - try { Thread.sleep(2000); } catch (Exception e) {} + // Allow the KeepAliveStreamCleaner thread to read the data left behind and cache the connection. + try { Thread.sleep(2000); } catch (Exception e) {} - uc = (HttpURLConnection)smallDataURL.openConnection(Proxy.NO_PROXY); - uc.getResponseCode(); + uc = (HttpURLConnection)smallDataURL.openConnection(Proxy.NO_PROXY); + uc.getResponseCode(); - if (SimpleHttpTransactionHandler.failed) - throw new RuntimeException("Failed: Initial Keep Alive Connection is not being reused"); - - // Part 2 - URL part2Url = new URL (baseURLStr + "part2"); - uc = (HttpURLConnection)part2Url.openConnection(Proxy.NO_PROXY); - is = uc.getInputStream(); - is.close(); - - // Allow the KeepAliveStreamCleaner thread to try and read the data left behind and cache the connection. - try { Thread.sleep(2000); } catch (Exception e) {} - - ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); - if (threadMXBean.isThreadCpuTimeSupported()) { - long[] threads = threadMXBean.getAllThreadIds(); - ThreadInfo[] threadInfo = threadMXBean.getThreadInfo(threads); - for (int i=0; i= 1000000000) // 1 second, or 1 billion nanoseconds - throw new RuntimeException("Failed: possible recursive loop in Keep-Alive-SocketCleaner"); - } + if (SimpleHttpTransactionHandler.failed) + throw new RuntimeException("Failed: Initial Keep Alive Connection is not being reused"); + + // Part 2 + URL part2Url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/part2") + .toURL(); + + uc = (HttpURLConnection)part2Url.openConnection(Proxy.NO_PROXY); + try (InputStream is = uc.getInputStream()) {} + + // Allow the KeepAliveStreamCleaner thread to try and read the data left behind and cache the connection. + try { Thread.sleep(2000); } catch (Exception e) {} + + ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); + if (threadMXBean.isThreadCpuTimeSupported()) { + long[] threads = threadMXBean.getAllThreadIds(); + ThreadInfo[] threadInfo = threadMXBean.getThreadInfo(threads); + for (int i = 0; i < threadInfo.length; i++) { + if (threadInfo[i].getThreadName().equals("Keep-Alive-SocketCleaner")) { + System.out.println("Found Keep-Alive-SocketCleaner thread"); + long threadID = threadInfo[i].getThreadId(); + long before = threadMXBean.getThreadCpuTime(threadID); + try { Thread.sleep(2000); } catch (Exception e) {} + long after = threadMXBean.getThreadCpuTime(threadID); + + if (before ==-1 || after == -1) + break; // thread has died, OK + + // if Keep-Alive-SocketCleaner consumes more than 50% of cpu then we + // can assume a recursive loop. + long total = after - before; + if (total >= 1000000000) // 1 second, or 1 billion nanoseconds + throw new RuntimeException("Failed: possible recursive loop in Keep-Alive-SocketCleaner"); } } - - } catch (IOException e) { - e.printStackTrace(); - } finally { - server.stop(1); } if (!uncaught.isEmpty()) { throw new RuntimeException("Unhandled exception:", uncaught.get(0)); } } -} - -class SimpleHttpTransactionHandler implements HttpHandler -{ - static volatile boolean failed = false; - // Need to have enough data here that is too large for the socket buffer to hold. - // Also http.KeepAlive.remainingData must be greater than this value, default is 256K. - static final int RESPONSE_DATA_LENGTH = 128 * 1024; + static class SimpleHttpTransactionHandler implements HttpHandler { + static volatile boolean failed = false; - int port1; - - public void handle(HttpExchange trans) { - try { - String path = trans.getRequestURI().getPath(); - if (path.equals("/firstCall")) { - port1 = trans.getRemoteAddress().getPort(); - System.out.println("First connection on client port = " + port1); - - byte[] responseBody = new byte[RESPONSE_DATA_LENGTH]; - for (int i=0; i passed = new CompletableFuture<>(); - static class Server extends Thread { - final ServerSocket serverSocket; - final int port; + static class Server extends Thread implements AutoCloseable { final String param; // the parameter to test "max" or "timeout" + final ServerSocket serverSocket = new ServerSocket(0); + final int port; volatile Socket s; public Server(String param) throws IOException { - serverSocket = new ServerSocket(0); + this.param = param; port = serverSocket.getLocalPort(); setDaemon(true); - this.param = param; } public int getPort() { return port; } - public void close() { - try { - serverSocket.close(); - if (s != null) - s.close(); - } catch (IOException e) {} + public void close() throws IOException { + serverSocket.close(); + if (s != null) + s.close(); } static void readRequest(Socket s) throws IOException { @@ -112,28 +114,29 @@ } } - public static void main(String[] args) throws Exception { - Server server = new Server(args[0]); - int port = server.getPort(); - server.start(); - URL url = new URL("http://127.0.0.1:" + Integer.toString(port) + "/"); - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); - InputStream i = urlc.getInputStream(); - int c,count=0; - byte[] buf = new byte[256]; - while ((c=i.read(buf)) != -1) { - count+=c; - } - i.close(); - System.out.println("Read " + count ); - try { + public static void runTest(String param) throws Exception { + try (Server server = new Server(param)) { + server.start(); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getPort()) + .path("/") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); + try (InputStream i = urlc.getInputStream()) { + System.out.println("Read " + i.readAllBytes().length); + } if (!passed.get()) { throw new RuntimeException("Test failed"); } else { System.out.println("Test passed"); } - } finally { - server.close(); } } + + public static void main(String[] args) throws Exception { + runTest("timeout"); + runTest("max"); + } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/B8293562.java 2025-01-04 20:25:18.000000000 +0000 @@ -24,20 +24,11 @@ /* * @test * @bug 8293562 + * @summary Http keep-alive thread should close sockets without holding a lock * @library /test/lib * @run main/othervm -Dhttp.keepAlive.time.server=1 B8293562 - * @summary Http keep-alive thread should close sockets without holding a lock */ -import com.sun.net.httpserver.HttpExchange; -import com.sun.net.httpserver.HttpHandler; -import com.sun.net.httpserver.HttpServer; - -import javax.net.ssl.HandshakeCompletedListener; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -53,6 +44,18 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import javax.net.ssl.HandshakeCompletedListener; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +import jdk.test.lib.net.URIBuilder; + public class B8293562 { static HttpServer server; static CountDownLatch closing = new CountDownLatch(1); @@ -73,12 +76,13 @@ public static void clientHttpCalls() throws Exception { try { - System.out.println("http server listen on: " + server.getAddress().getPort()); - String hostAddr = InetAddress.getLoopbackAddress().getHostAddress(); - if (hostAddr.indexOf(':') > -1) hostAddr = "[" + hostAddr + "]"; - String baseURLStr = "https://" + hostAddr + ":" + server.getAddress().getPort() + "/"; + System.out.println("http server listens on: " + server.getAddress().getPort()); - URL testUrl = new URL (baseURLStr); + URL testUrl = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(server.getAddress().getPort()) + .toURL(); // SlowCloseSocketFactory is not a real SSLSocketFactory; // it produces regular non-SSL sockets. Effectively, the request diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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,18 +23,29 @@ /* * @test - * @library /test/lib * @bug 8278067 + * @library /test/lib * @run main/othervm -Dhttp.keepAlive.time.server=30 KeepAliveProperty long * @run main/othervm -Dhttp.keepAlive.time.server=1 KeepAliveProperty short * @run main/othervm -ea -Dhttp.keepAlive.time.server=0 KeepAliveProperty short */ -import java.net.*; -import java.io.*; -import java.nio.charset.*; -import java.util.logging.*; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.Logger; + import jdk.test.lib.net.URIBuilder; + import static java.net.Proxy.NO_PROXY; public class KeepAliveProperty { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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,16 +23,26 @@ /* * @test - * @library /test/lib * @bug 4701299 * @summary Keep-Alive-Timer thread management in KeepAliveCache causes memory leak + * @library /test/lib * @run main KeepAliveTimerThread * @run main/othervm -Djava.net.preferIPv6Addresses=true KeepAliveTimerThread */ -import java.net.*; -import java.io.*; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.net.URL; + import jdk.test.lib.net.URIBuilder; + import static java.net.Proxy.NO_PROXY; public class KeepAliveTimerThread { @@ -131,8 +141,5 @@ if (grp.activeCount() > 0) { throw new RuntimeException("Keep-alive thread started in wrong thread group"); } - - grp.destroy(); } - } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jar/GetContentTypeTest.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/GetContentTypeTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jar/GetContentTypeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/GetContentTypeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,10 @@ * GetContentType GetContentTypeTest * @run main/othervm GetContentTypeTest * @summary Test JarURLConnection.getContentType would - * would return default "content/unknown" + * return default "content/unknown" */ -import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import java.io.File; @@ -49,9 +49,9 @@ Path resJar = Paths.get(System.getProperty("test.src"), "resource.jar"); Path classes = Paths.get(System.getProperty("test.classes")); - ProcessTools.executeCommand( - JDKToolFinder.getTestJDKTool("java"), - "-cp", resJar + File.pathSeparator + classes, "GetContentType") + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-cp", resJar + File.pathSeparator + classes, "GetContentType"); + new OutputAnalyzer(pb.start()) .outputTo(System.out) .errorTo(System.out) .shouldHaveExitValue(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -47,6 +47,7 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; import jdk.test.lib.JDKToolFinder; import jdk.test.lib.compiler.CompilerUtils; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.JarUtils; @@ -81,14 +82,14 @@ CompilerUtils.compile(srcDir.resolve("src").resolve("test"), targetDir); // Run tests - String java = JDKToolFinder.getTestJDKTool("java"); String cp = targetDir.toString() + File.pathSeparator + jarFile; String[] tests = new String[]{"TestBug4361044", "TestBug4523159"}; for (String test : tests) { - ProcessTools.executeCommand(java, "-cp", cp, test) - .outputTo(System.out) - .errorTo(System.out) - .shouldHaveExitValue(0); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", cp, test); + new OutputAnalyzer(pb.start()) + .outputTo(System.out) + .errorTo(System.out) + .shouldHaveExitValue(0); } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jrt/OtherResourcesTest.java openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jrt/OtherResourcesTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/net/www/protocol/jrt/OtherResourcesTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/net/www/protocol/jrt/OtherResourcesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,8 @@ * questions. */ -import jdk.test.lib.JDKToolFinder; -import static jdk.test.lib.process.ProcessTools.executeCommand; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /** * @test @@ -39,12 +39,13 @@ public class OtherResourcesTest { public static void main(String[] args) throws Throwable { String classes = System.getProperty("test.classes"); - executeCommand(JDKToolFinder.getTestJDKTool("java"), - "--limit-modules", "java.base", - "-cp", classes, "OtherResources") - .outputTo(System.out) - .errorTo(System.out) - .shouldHaveExitValue(0); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "--limit-modules", "java.base", + "-cp", classes, "OtherResources"); + new OutputAnalyzer(pb.start()) + .outputTo(System.out) + .errorTo(System.out) + .shouldHaveExitValue(0); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/InvalidCurve.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/InvalidCurve.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/InvalidCurve.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/InvalidCurve.java 2025-01-04 20:25:18.000000000 +0000 @@ -38,7 +38,8 @@ KeyPairGenerator keyGen; try { - keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); + keyGen = KeyPairGenerator.getInstance("EC", + System.getProperty("test.provider.name", "SunEC")); ECGenParameterSpec brainpoolSpec = new ECGenParameterSpec("brainpoolP160r1"); keyGen.initialize(brainpoolSpec); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { TestSignatureOidHelper helper = new TestSignatureOidHelper("EC", - "SunEC", 256, DATA); + System.getProperty("test.provider.name", "SunEC"), 256, DATA); helper.execute(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignatureDigestTruncate.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureDigestTruncate.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignatureDigestTruncate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureDigestTruncate.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,17 +96,20 @@ byte[] expectedSig = hex.parseHex(sigStr); AlgorithmParameters params = - AlgorithmParameters.getInstance("EC", "SunEC"); + AlgorithmParameters.getInstance("EC", + System.getProperty("test.provider.name", "SunEC")); params.init(new ECGenParameterSpec(curveName)); ECParameterSpec ecParams = params.getParameterSpec(ECParameterSpec.class); - KeyFactory kf = KeyFactory.getInstance("EC", "SunEC"); + KeyFactory kf = KeyFactory.getInstance("EC", + System.getProperty("test.provider.name", "SunEC")); BigInteger s = new BigInteger(1, privateKey); ECPrivateKeySpec privKeySpec = new ECPrivateKeySpec(s, ecParams); PrivateKey privKey = kf.generatePrivate(privKeySpec); - Signature sig = Signature.getInstance(alg, "SunEC"); + Signature sig = Signature.getInstance(alg, + System.getProperty("test.provider.name", "SunEC")); sig.initSign(privKey, new FixedRandom(k)); sig.update(msg); byte[] computedSig = sig.sign(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignatureKAT.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureKAT.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignatureKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignatureKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,16 +132,19 @@ System.out.println("Testing " + td.sigName + " with " + td.cd.name); AlgorithmParameters params = - AlgorithmParameters.getInstance("EC", "SunEC"); + AlgorithmParameters.getInstance("EC", + System.getProperty("test.provider.name", "SunEC")); params.init(new ECGenParameterSpec(td.cd.name)); ECParameterSpec ecParams = params.getParameterSpec(ECParameterSpec.class); - KeyFactory kf = KeyFactory.getInstance("EC", "SunEC"); + KeyFactory kf = KeyFactory.getInstance("EC", + System.getProperty("test.provider.name", "SunEC")); PrivateKey privKey = kf.generatePrivate (new ECPrivateKeySpec(td.cd.priv, ecParams)); - Signature sig = Signature.getInstance(td.sigName, "SunEC"); + Signature sig = Signature.getInstance(td.sigName, + System.getProperty("test.provider.name", "SunEC")); sig.initSign(privKey); sig.update(td.cd.msgBytes); // NOTE: there is no way to set the nonce value into current SunEC diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignedObjectChain.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignedObjectChain.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/SignedObjectChain.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/SignedObjectChain.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ private static class Test extends Chain.Test { public Test(Chain.SigAlg sigAlg) { - super(sigAlg, Chain.KeyAlg.EC, Chain.Provider.SunEC); + super(sigAlg, Chain.KeyAlg.EC, Chain.Provider.TestProvider_or_SunEC); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/TestEC.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/TestEC.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/TestEC.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/TestEC.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, 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 @@ -85,7 +85,7 @@ } public static void main0(String[] args) throws Exception { - Provider p = Security.getProvider("SunEC"); + Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunEC")); if (p == null) { throw new NoSuchProviderException("Can't get SunEC provider"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdCRLSign.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdCRLSign.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdCRLSign.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdCRLSign.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -44,7 +44,7 @@ private static final String OID25519 = "OID.1.3.101.112"; private static final String OIDN448 = "1.3.101.113"; private static final String OID448 = "OID.1.3.101.113"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final SecureRandom S_RND = new SecureRandom(new byte[]{0x1}); public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ private static final String EDDSA = "EdDSA"; private static final String ED25519 = "Ed25519"; private static final String ED448 = "Ed448"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAKeySize.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeySize.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAKeySize.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAKeySize.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ private static final String OID25519 = "OID.1.3.101.112"; private static final String OIDN448 = "1.3.101.113"; private static final String OID448 = "OID.1.3.101.113"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final SecureRandom RND = new SecureRandom(new byte[]{0x1}); public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -48,7 +48,7 @@ private static final String EDDSA = "EdDSA"; private static final String ED25519 = "Ed25519"; private static final String ED448 = "Ed448"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final String OTHER = "other"; private static final byte[] MSG = "TEST".getBytes(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -43,7 +43,7 @@ private static final String EDDSA = "EdDSA"; private static final String ED25519 = "Ed25519"; private static final String ED448 = "Ed448"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final byte[] MSG = "TEST".getBytes(); private static final SecureRandom RND = new SecureRandom(new byte[]{0x1}); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ private static final String EDDSA = "EdDSA"; private static final String ED25519 = "Ed25519"; private static final String ED448 = "Ed448"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final String MSG = "TEST"; private static final int REUSE = 20; private static final int ONCE = 1; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSATest.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSATest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/EdDSATest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/EdDSATest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -68,7 +68,7 @@ private static final String OID25519 = "OID.1.3.101.112"; private static final String OIDN448 = "1.3.101.113"; private static final String OID448 = "OID.1.3.101.113"; - private static final String PROVIDER = "SunEC"; + private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC"); private static final byte[] MSG = "TEST".getBytes(); private static final SecureRandom S_RND = new SecureRandom(new byte[]{0x1}); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/TestEdDSA.java openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/TestEdDSA.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ec/ed/TestEdDSA.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ec/ed/TestEdDSA.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -462,10 +462,14 @@ * when the algorithm ID for a specific curve is specified. */ private static void runCurveMixTest() throws Exception { - runCurveMixTest("SunEC", "Ed25519", 448); - runCurveMixTest("SunEC", "Ed25519", "Ed448"); - runCurveMixTest("SunEC", "Ed448", 255); - runCurveMixTest("SunEC", "Ed448", "Ed25519"); + runCurveMixTest(System.getProperty("test.provider.name", "SunEC"), + "Ed25519", 448); + runCurveMixTest(System.getProperty("test.provider.name", "SunEC"), + "Ed25519", "Ed448"); + runCurveMixTest(System.getProperty("test.provider.name", "SunEC"), + "Ed448", 255); + runCurveMixTest(System.getProperty("test.provider.name", "SunEC"), + "Ed448", "Ed25519"); } private static void runCurveMixTest(String providerName, String name, diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -107,7 +107,7 @@ String expected; String value = args[1]; - expected = "SunJCE"; + expected = System.getProperty("test.provider.name", "SunJCE"); if (args.length >= 2) { switch (args[0]) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/auto/ModuleName.java openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/ModuleName.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/auto/ModuleName.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/ModuleName.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -53,7 +53,7 @@ test("jdk.security.jgss"); // With limited modules - List cmd = ProcessTools.createJavaProcessBuilder().command(); + List cmd = ProcessTools.createLimitedTestJavaProcessBuilder().command(); Stream.of(jdk.internal.misc.VM.getRuntimeArguments()) .filter(arg -> arg.startsWith("--add-exports=") || arg.startsWith("--add-opens=")) diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/auto/Renew.java openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/Renew.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/auto/Renew.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/auto/Renew.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, 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 @@ -82,7 +82,10 @@ Date d1 = c.s().getPrivateCredentials(KerberosTicket.class).iterator().next().getAuthTime(); // 6s is longer than half of 10s - Thread.sleep(6000); + Date expiring = new Date(d1.getTime() + 6000); + while (new Date().before(expiring)) { + Thread.sleep(500); + } // The second login uses the cache c = Context.fromJAAS("second"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/runNameEquals.sh openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/runNameEquals.sh --- openjdk-17-17.0.13+11/test/jdk/sun/security/krb5/runNameEquals.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/krb5/runNameEquals.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,7 @@ if [ "${NATIVE}" = "true" ] ; then echo "Testing native provider" - ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \ + ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -classpath ${TESTCLASSES} \ -Dsun.security.jgss.native=true \ ${TEST} @@ -114,7 +114,7 @@ fi echo "Testing java provider" -${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \ +${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -classpath ${TESTCLASSES} \ -Djava.security.krb5.realm=R \ -Djava.security.krb5.kdc=127.0.0.1 \ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java openjdk-17-17.0.14+7/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,11 +103,13 @@ "-------", "----------------", "------", "--------", "------"); // KeyPairGenerator chooses SPI when getInstance() is called. - String[] provsForKPG = {"SunRsaSign", "SunMSCAPI"}; + String[] provsForKPG = {System.getProperty("test.provider.name", "SunRsaSign"), + "SunMSCAPI"}; // "-" means no preferred provider. In this case, SPI is chosen // when initSign/initVerify is called. Worth testing. - String[] provsForSignature = {"SunRsaSign", "SunMSCAPI", "-"}; + String[] provsForSignature = {System.getProperty("test.provider.name", "SunRsaSign"), + "SunMSCAPI", "-"}; int pos = 0; for (String pg : provsForKPG) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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,8 @@ * java.base/sun.security.util * java.base/sun.security.x509 * @compile -XDignore.symbol.file PKCS10AttrEncoding.java - * @run main PKCS10AttrEncoding + * @run main PKCS10AttrEncoding DSA 512 + * @run main PKCS10AttrEncoding Sha256withDSA 2048 */ import java.security.KeyPair; import java.security.KeyPairGenerator; @@ -69,11 +70,13 @@ constructedMap.put(ids[j], values[j]); } + String kpgAlgorithm = "DSA"; X500Name subject = new X500Name("cn=Test"); - KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA"); - String sigAlg = "DSA"; + KeyPairGenerator keyGen = KeyPairGenerator.getInstance(kpgAlgorithm); + String sigAlg = args[0]; + int keySize = Integer.parseInt(args[1]); - keyGen.initialize(512); + keyGen.initialize(keySize); KeyPair pair = keyGen.generateKeyPair(); X509Key publicKey = (X509Key) pair.getPublic(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -29,7 +29,8 @@ * @modules java.base/sun.security.pkcs * java.base/sun.security.util * java.base/sun.security.x509 - * @run main SignerOrder + * @run main SignerOrder default 1024 + * @run main SignerOrder Sha256 2048 */ import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -63,20 +64,21 @@ static final byte[] data1 = "12345".getBytes(); static final byte[] data2 = "abcde".getBytes(); - public static void main(String[] argv) throws Exception { - + public static void main(String[] args) throws Exception { + String digestAlg = "default".equals(args[0]) ? null : args[0]; + int keySize = Integer.parseInt(args[1]); SignerInfo[] signerInfos = new SignerInfo[9]; - SimpleSigner signer1 = new SimpleSigner(null, null, null, null); + SimpleSigner signer1 = new SimpleSigner(digestAlg, null, null, null, keySize); signerInfos[8] = signer1.genSignerInfo(data1); signerInfos[7] = signer1.genSignerInfo(new byte[]{}); signerInfos[6] = signer1.genSignerInfo(data2); - SimpleSigner signer2 = new SimpleSigner(null, null, null, null); + SimpleSigner signer2 = new SimpleSigner(digestAlg, null, null, null, keySize); signerInfos[5] = signer2.genSignerInfo(data1); signerInfos[4] = signer2.genSignerInfo(new byte[]{}); signerInfos[3] = signer2.genSignerInfo(data2); - SimpleSigner signer3 = new SimpleSigner(null, null, null, null); + SimpleSigner signer3 = new SimpleSigner(digestAlg, null, null, null, keySize); signerInfos[2] = signer3.genSignerInfo(data1); signerInfos[1] = signer3.genSignerInfo(new byte[]{}); signerInfos[0] = signer3.genSignerInfo(data2); @@ -157,28 +159,33 @@ public SimpleSigner(String digestAlg, String encryptionAlg, KeyPair keyPair, - X500Name agent) throws Exception { + X500Name agent, + int keySize) throws Exception { + String signAlgoDigest; if (agent == null) { agent = new X500Name("cn=test"); } - if (digestAlg == null) { - digestAlg = "SHA"; - } if (encryptionAlg == null) { encryptionAlg = "DSA"; } + if (digestAlg == null) { + digestAlg = "SHA"; + signAlgoDigest = encryptionAlg; + } else { + signAlgoDigest = digestAlg + "with" + encryptionAlg; + } if (keyPair == null) { KeyPairGenerator keyGen = KeyPairGenerator.getInstance(encryptionAlg); - keyGen.initialize(1024); + keyGen.initialize(keySize); keyPair = keyGen.generateKeyPair(); } publicKey = (X509Key) keyPair.getPublic(); privateKey = keyPair.getPrivate(); if ("DSA".equals(encryptionAlg)) { - this.sig = Signature.getInstance(encryptionAlg); + this.sig = Signature.getInstance(signAlgoDigest); } else { // RSA this.sig = Signature.getInstance(digestAlg + "/" + encryptionAlg); } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,8 @@ }; public static void main(String[] argv) throws Exception { - KeyFactory factory = KeyFactory.getInstance("DSA", "SUN"); + KeyFactory factory = KeyFactory.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); for (String encodings : PKCS8_ENCODINGS) { byte[] encodingBytes = hexToBytes(encodings); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java 2025-01-04 20:25:18.000000000 +0000 @@ -93,9 +93,10 @@ sunPKCS11cipher.doFinal(ByteBuffer.allocate(0), cipherText); } - Cipher sunJCECipher = Cipher.getInstance(transformation, "SunJCE"); - sunJCECipher.init(Cipher.DECRYPT_MODE, key); - byte[] sunJCEPlain = sunJCECipher.doFinal(cipherText.array()); + Cipher providerCipher = Cipher.getInstance(transformation, + System.getProperty("test.provider.name", "SunJCE")); + providerCipher.init(Cipher.DECRYPT_MODE, key); + byte[] sunJCEPlain = providerCipher.doFinal(cipherText.array()); if (!Arrays.equals(plainText, sunJCEPlain)) { throw new Exception("Cross-provider cipher test failed."); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, 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 @@ -78,7 +78,7 @@ KeyGenerator.getInstance(currTest.keyAlgo, p); SecretKey key = kg.generateKey(); Cipher c1 = Cipher.getInstance(currTest.transformation, - "SunJCE"); + System.getProperty("test.provider.name", "SunJCE")); c1.init(Cipher.ENCRYPT_MODE, key); byte[] cipherText = c1.doFinal(plainText); AlgorithmParameters params = c1.getParameters(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -44,6 +44,7 @@ import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; +import jdk.test.lib.security.SecurityUtils; public class TestRSACipher extends PKCS11Test { @@ -58,8 +59,10 @@ System.out.println("Not supported by provider, skipping"); return; } - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); - kpg.initialize(1024); + String kpgAlgorithm = "RSA"; + int keySize = SecurityUtils.getTestKeySize(kpgAlgorithm); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p); + kpg.initialize(keySize); KeyPair kp = kpg.generateKeyPair(); PublicKey publicKey = kp.getPublic(); PrivateKey privateKey = kp.getPrivate(); @@ -70,7 +73,8 @@ for (String rsaAlgo: RSA_ALGOS) { Cipher c1 = Cipher.getInstance(rsaAlgo, p); - Cipher c2 = Cipher.getInstance(rsaAlgo, "SunJCE"); + Cipher c2 = Cipher.getInstance(rsaAlgo, + System.getProperty("test.provider.name", "SunJCE")); c1.init(Cipher.ENCRYPT_MODE, publicKey); e = c1.doFinal(b); @@ -112,7 +116,8 @@ c1.update(b); e = c1.doFinal(); - c1.update(new byte[256]); + // Longer buffer size to verify IllegalBlockSizeException is thrown + c1.update(new byte[keySize / 4]); try { e = c1.doFinal(); throw new Exception("completed call"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -43,6 +43,7 @@ import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; +import jdk.test.lib.security.SecurityUtils; public class TestRSACipherWrap extends PKCS11Test { @@ -57,13 +58,15 @@ System.out.println(RSA_ALGOS[0] + " unsupported, skipping"); return; } - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); - kpg.initialize(1024); + String kpgAlgorithm = "RSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); for (String rsaAlgo: RSA_ALGOS) { Cipher cipherPKCS11 = Cipher.getInstance(rsaAlgo, p); - Cipher cipherJce = Cipher.getInstance(rsaAlgo, "SunJCE"); + Cipher cipherJce = Cipher.getInstance(rsaAlgo, + System.getProperty("test.provider.name", "SunJCE")); String algos[] = {"AES", "RC2", "Blowfish"}; int keySizes[] = {128, 256}; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ import java.util.HexFormat; import java.util.Random; import javax.crypto.Cipher; +import jdk.test.lib.security.SecurityUtils; public class TestRawRSACipher extends PKCS11Test { @@ -53,8 +54,9 @@ return; } - final int KEY_LEN = 1024; - KeyPairGenerator kpGen = KeyPairGenerator.getInstance("RSA", p); + String kpgAlgorithm = "RSA"; + final int KEY_LEN = SecurityUtils.getTestKeySize(kpgAlgorithm); + KeyPairGenerator kpGen = KeyPairGenerator.getInstance(kpgAlgorithm, p); kpGen.initialize(KEY_LEN); KeyPair kp = kpGen.generateKeyPair(); Random random = new Random(); @@ -64,7 +66,8 @@ plainText[0] = 0; // to ensure that it's less than modulus Cipher c1 = Cipher.getInstance("RSA/ECB/NoPadding", p); - Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding", "SunJCE"); + Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding", + System.getProperty("test.provider.name", "SunJCE")); c1.init(Cipher.ENCRYPT_MODE, kp.getPublic()); c2.init(Cipher.DECRYPT_MODE, kp.getPrivate()); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java 2025-01-04 20:25:18.000000000 +0000 @@ -102,7 +102,7 @@ SecretKey key = kg.generateKey(); Cipher c1 = Cipher.getInstance(currTest.transformation, p); Cipher c2 = Cipher.getInstance(currTest.transformation, - "SunJCE"); + System.getProperty("test.provider.name", "SunJCE")); byte[] plainTxt = new byte[currTest.dataSize]; random.nextBytes(plainTxt); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java 2025-01-04 20:25:18.000000000 +0000 @@ -87,7 +87,7 @@ SecretKey key = kg.generateKey(); Cipher c1 = Cipher.getInstance(currTest.transformation, p); Cipher c2 = Cipher.getInstance(currTest.transformation, - "SunJCE"); + System.getProperty("test.provider.name", "SunJCE")); byte[] plainTxt = new byte[currTest.dataSize]; random.nextBytes(plainTxt); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ import java.util.Arrays; import javax.crypto.KeyAgreement; import javax.crypto.SecretKey; +import jdk.test.lib.security.SecurityUtils; public class TestDH extends PKCS11Test { @@ -47,8 +48,9 @@ System.out.println("DH not supported, skipping"); return; } - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", p); - kpg.initialize(512); + String kpgAlgorithm = "DH"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp1 = kpg.generateKeyPair(); KeyPair kp2 = kpg.generateKeyPair(); @@ -68,7 +70,8 @@ throw new Exception("Secrets (1,2) do not match"); } - ka2 = KeyAgreement.getInstance("DH", "SunJCE"); + ka2 = KeyAgreement.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); ka2.init(kp1.getPrivate()); ka2.doPhase(kp2.getPublic(), true); System.out.println("Derive 3..."); @@ -101,7 +104,8 @@ ka1.init(kp1.getPrivate()); ka1.doPhase(kp2.getPublic(), true); - System.out.println("Derive " + algorithm + " using SunJCE..."); + System.out.println("Derive " + algorithm + " using " + + System.getProperty("test.provider.name", "SunJCE") + "..."); key1 = ka1.generateSecret(algorithm); ka2.init(kp1.getPrivate()); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,43 +39,40 @@ import javax.crypto.KeyAgreement; import javax.crypto.spec.DHPrivateKeySpec; import javax.crypto.spec.DHPublicKeySpec; +import jdk.test.lib.security.DiffieHellmanGroup; +import jdk.test.lib.security.SecurityUtils; public class TestInterop extends PKCS11Test { - private final static BigInteger p = new BigInteger - ("171718397966129586011229151993178480901904202533705695869569760169920539" - + "80807543778874708672297590042574075430109846864794139516459381007417046" - + "27996080624930219892858374168155487210358743785481212360509485282294161" - + "39585571568998066586304075565145536350296006867635076744949977849997684" - + "222020336013226588207303"); - - private final static BigInteger g = new BigInteger("2"); - private final static BigInteger ya = new BigInteger - ("687709211571508809414670982463565909269384277848448625781941269577397703" - + "73675199968849153119146758339814638228795348558483510369322822476757204" - + "22158455966026517829008713407587339322132253724742557954802911059639161" - + "24827916158465757962384625410294483756242900146397201260757102085985457" - + "09397033481077351036224"); + ("22272412859242949963897309866268099957623364986192222381531147912319" + + "23153170556019072276127184001075566033823724518300406542189341984" + + "14728033901164887842157675409022004721268960808255834930605035809" + + "96449867261598768663006346373969582073599358922631400907241847771" + + "58539394502794451638884093173505103869438428833148912071609829581" + + "89477284513896649100113024962862016311693389603523142235630316916" + + "51727812401021776761600004971782662420311224757086651213529674905" + + "34921437167341469749945865459714558842881915928697452568830704027" + + "08840053484115995358953663434943150292283157101600109003253293611" + + "67575903571371898272633920086"); private final static BigInteger xa = new BigInteger - ("104917367119952955556289227181599819745346393858545449202252025137706135" - + "98100778613457655440586438263591136003106529323555991109623536177695714" - + "66884181531401472902830508361532232717792847436112280721439936797741371" - + "245140912614191507"); + ("20959988947516815975588968321965141642005944293655257916834342975849"); private final static BigInteger yb = new BigInteger - ("163887874871842952463100699681506173424091615364591742415764095471629919" - + "08421025296419917755446931473037086355546823601999684501737493240373415" - + "65608293667837249198973539289354492348897732633852665609611113031379864" - + "58514616034107537409230452318065341748503347627733368519091332060477528" - + "173423377887175351037810"); + ("1788841814501653834923092375117807364896992833810838802030127811094" + + "8450381275318704655838368105000403140578033341448162321874634765" + + "6870663019881556386613144025875613921737258766185138415793010195" + + "3802511267742963370821568963965936108932734114202964873644126233" + + "6937947954023458790417933403303562491144788202839815534782475160" + + "7813094179390506418017926774832227342290968359943612529948409558" + + "4647213355501260440663649115694263879691520265343063263385211121" + + "3396751542827391711077192604441343359832896902306354119121777576" + + "6479255602858536672821464920683781338851326155035757018336622673" + + "39973666608754923308482789421630138499"); private final static BigInteger xb = new BigInteger - ("127757517533485947079959908591028646859165238853082197617179368337276371" - + "51601819447716934542027725311863797141734616730248519214531856941516613" - + "30313414180008978013330410484011186019824874948204261839391153650949864" - + "429505597086564709"); + ("37339373137107550077381337769340105015086522284791968753218309293526"); @Override public void main(Provider prov) throws Exception { @@ -90,14 +87,20 @@ DHPrivateKeySpec privateSpec; KeyFactory kf = KeyFactory.getInstance("DH"); KeyAgreement ka = KeyAgreement.getInstance("DH", prov); - KeyAgreement kbSunJCE = KeyAgreement.getInstance("DH", "SunJCE"); - DHPrivateKeySpec privSpecA = new DHPrivateKeySpec(xa, p, g); - DHPublicKeySpec pubSpecA = new DHPublicKeySpec(ya, p, g); + KeyAgreement kbSunJCE = KeyAgreement.getInstance("DH", + System.getProperty("test.provider.name", "SunJCE")); + DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(); + DHPrivateKeySpec privSpecA = new DHPrivateKeySpec(xa, dhGroup.getPrime(), + dhGroup.getBase()); + DHPublicKeySpec pubSpecA = new DHPublicKeySpec(ya, dhGroup.getPrime(), + dhGroup.getBase()); PrivateKey privA = kf.generatePrivate(privSpecA); PublicKey pubA = kf.generatePublic(pubSpecA); - DHPrivateKeySpec privSpecB = new DHPrivateKeySpec(xb, p, g); - DHPublicKeySpec pubSpecB = new DHPublicKeySpec(yb, p, g); + DHPrivateKeySpec privSpecB = new DHPrivateKeySpec(xb, dhGroup.getPrime(), + dhGroup.getBase()); + DHPublicKeySpec pubSpecB = new DHPublicKeySpec(yb, dhGroup.getPrime(), + dhGroup.getBase()); PrivateKey privB = kf.generatePrivate(privSpecB); PublicKey pubB = kf.generatePublic(pubSpecB); @@ -109,6 +112,10 @@ kbSunJCE.doPhase(pubA, true); byte[] n2 = kbSunJCE.generateSecret(); + // verify that a leading zero is present in secrets + if (n1[0] != 0 || n2[0] != 0) { + throw new Exception("First byte is not zero as expected"); + } if (Arrays.equals(n1, n2) == false) { throw new Exception("values mismatch!"); } else { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyStore/Basic.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyStore/Basic.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/KeyStore/Basic.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/KeyStore/Basic.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -142,7 +142,8 @@ // get private keys KeyFactory kf = KeyFactory.getInstance("RSA"); - KeyFactory dsaKf = KeyFactory.getInstance("DSA", "SUN"); + KeyFactory dsaKf = KeyFactory.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); ObjectInputStream ois1 = new ObjectInputStream (new FileInputStream(new File(DIR, "pk1.key"))); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -73,7 +73,8 @@ private void doTest(String alg, Provider p, byte[] data1, byte[] data2) throws Exception { System.out.println("Testing " + alg); - MessageDigest md1 = MessageDigest.getInstance(alg, "SUN"); + MessageDigest md1 = MessageDigest.getInstance(alg, + System.getProperty("test.provider.name", "SUN")); byte[] d1 = md1.digest(data1); MessageDigest md2 = MessageDigest.getInstance(alg, p); checkInstances(md1, md2); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/PKCS11Test.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/PKCS11Test.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/PKCS11Test.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/PKCS11Test.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -53,9 +53,7 @@ import java.util.ServiceConfigurationError; import java.util.ServiceLoader; import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; +import java.util.stream.Stream; import jdk.test.lib.Platform; import jdk.test.lib.artifacts.Artifact; @@ -79,7 +77,7 @@ // Version of the NSS artifact. This coincides with the version of // the NSS version - private static final String NSS_BUNDLE_VERSION = "3.91"; + private static final String NSS_BUNDLE_VERSION = "3.101"; private static final String NSSLIB = "jpg.tests.jdk.nsslib"; static double nss_version = -1; @@ -256,19 +254,13 @@ static Path getNSSLibPath(String library) throws Exception { String osid = getOsId(); - String nssLibDir = fetchNssLib(osid); - if (nssLibDir == null) { + Path libraryName = Path.of(System.mapLibraryName(library)); + Path nssLibPath = fetchNssLib(osid, libraryName); + if (nssLibPath == null) { throw new SkippedException("Warning: unsupported OS: " + osid + ", please initialize NSS library location, skipping test"); } - - String libraryName = System.mapLibraryName(library); - Path libPath = Paths.get(nssLibDir).resolve(libraryName); - if (!Files.exists(libPath)) { - throw new SkippedException("NSS library \"" + libraryName + "\" was not found in " + nssLibDir); - } - - return libPath; + return nssLibPath; } private static String getOsId() { @@ -674,42 +666,42 @@ return data; } - private static String fetchNssLib(String osId) { + private static Path fetchNssLib(String osId, Path libraryName) { switch (osId) { case "Windows-amd64-64": - return fetchNssLib(WINDOWS_X64.class); + return fetchNssLib(WINDOWS_X64.class, libraryName); case "MacOSX-x86_64-64": - return fetchNssLib(MACOSX_X64.class); + return fetchNssLib(MACOSX_X64.class, libraryName); case "MacOSX-aarch64-64": - return fetchNssLib(MACOSX_AARCH64.class); + return fetchNssLib(MACOSX_AARCH64.class, libraryName); case "Linux-amd64-64": if (Platform.isOracleLinux7()) { throw new SkippedException("Skipping Oracle Linux prior to v8"); } else { - return fetchNssLib(LINUX_X64.class); + return fetchNssLib(LINUX_X64.class, libraryName); } case "Linux-aarch64-64": if (Platform.isOracleLinux7()) { throw new SkippedException("Skipping Oracle Linux prior to v8"); } else { - return fetchNssLib(LINUX_AARCH64.class); + return fetchNssLib(LINUX_AARCH64.class, libraryName); } default: return null; } } - private static String fetchNssLib(Class clazz) { - String path = null; + private static Path fetchNssLib(Class clazz, Path libraryName) { + Path path = null; try { - path = ArtifactResolver.resolve(clazz).entrySet().stream() - .findAny().get().getValue() + File.separator + "nss" - + File.separator + "lib" + File.separator; - } catch (ArtifactResolverException e) { + Path p = ArtifactResolver.resolve(clazz).entrySet().stream() + .findAny().get().getValue(); + path = findNSSLibrary(p, libraryName); + } catch (ArtifactResolverException | IOException e) { Throwable cause = e.getCause(); if (cause == null) { System.out.println("Cannot resolve artifact, " @@ -723,6 +715,16 @@ return path; } + private static Path findNSSLibrary(Path path, Path libraryName) throws IOException { + try(Stream files = Files.find(path, 10, + (tp, attr) -> tp.getFileName().equals(libraryName))) { + + return files.findAny() + .orElseThrow(() -> + new RuntimeException("NSS library \"" + libraryName + "\" was not found in " + path)); + } + } + public abstract void main(Provider p) throws Exception; protected boolean skipTest(Provider p) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh 2025-01-04 20:25:18.000000000 +0000 @@ -122,7 +122,7 @@ ${TESTSRC}${FS}MultipleLogins.java \ ${TESTSRC}${FS}..${FS}PKCS11Test.java -TEST_ARGS="${TESTVMOPTS} -classpath ${TESTCLASSPATH} \ +TEST_ARGS="${TESTVMOPTS} ${TESTJAVAOPTS} -classpath ${TESTCLASSPATH} \ --add-modules jdk.crypto.cryptoki \ --add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED \ -DCUSTOM_DB_DIR=${TESTCLASSES} \ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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,7 +59,8 @@ } Signature sigSunRsaSign = - Signature.getInstance("RSASSA-PSS", "SunRsaSign"); + Signature.getInstance("RSASSA-PSS", + System.getProperty("test.provider.name", "SunRsaSign")); KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); kpg.initialize(3072); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java 2025-01-04 20:25:18.000000000 +0000 @@ -51,9 +51,10 @@ @Override public void main(Provider p) throws Exception { + String providerName = System.getProperty("test.provider.name", "SunRsaSign"); Signature sigPkcs11; Signature sigSunRsaSign = - Signature.getInstance("RSASSA-PSS", "SunRsaSign"); + Signature.getInstance("RSASSA-PSS", providerName); KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); kpg.initialize(3072); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -48,8 +48,12 @@ @Override protected boolean skipTest(Provider provider) { - if (isNSS(provider) && (getNSSVersion() == 0.0 || getNSSVersion() >= 3.14)) { - System.out.println("Skip testing NSS " + getNSSVersion()); + double version = getNSSVersion(); + String[] versionStrs = Double.toString(version).split("\\."); + int major = Integer.parseInt(versionStrs[0]); + int minor = Integer.parseInt(versionStrs[1]); + if (isNSS(provider) && (version == 0.0 || (major >= 3 && minor >= 14))) { + System.out.println("Skip testing NSS " + version); return true; } @@ -58,7 +62,8 @@ @Override public void main(Provider provider) throws Exception { - KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", "SUN"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); kpg.initialize(2048, new SecureRandom()); KeyPair pair = kpg.generateKeyPair(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/policy openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/policy --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/policy 2025-01-04 20:25:18.000000000 +0000 @@ -1,3 +1,4 @@ grant { permission java.lang.RuntimePermission "setSecurityManager"; -}; \ No newline at end of file + permission java.util.PropertyPermission "test.provider.name", "read"; +}; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -74,7 +74,8 @@ private static void generateKeyPair(KeyStore ks, int keyLength, String alias) throws Exception { System.out.println("Generating " + keyLength + " keypair " + alias + "..."); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); kpg.initialize(keyLength); KeyPair kp = kpg.generateKeyPair(); addToKeyStore(ks, kp, alias); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy 2025-01-04 20:25:18.000000000 +0000 @@ -1,4 +1,5 @@ grant { permission java.lang.RuntimePermission "setSecurityManager"; permission java.io.FilePermission "${test.src}/rsakeys.ks", "read"; -}; \ No newline at end of file + permission java.util.PropertyPermission "test.provider.name", "read"; +}; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs12/P12SecretKey.java openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs12/P12SecretKey.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/pkcs12/P12SecretKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/pkcs12/P12SecretKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.nio.file.Files; import java.security.KeyStore; import java.security.cert.CertificateException; import java.util.Arrays; @@ -66,24 +67,29 @@ ks.setEntry(ALIAS, ske, kspp); File ksFile = File.createTempFile("test", ".test"); - try (FileOutputStream fos = new FileOutputStream(ksFile)) { - ks.store(fos, pw); - fos.flush(); - } - // now see if we can get it back - try (FileInputStream fis = new FileInputStream(ksFile)) { - KeyStore ks2 = KeyStore.getInstance(keystoreType); - ks2.load(fis, pw); - KeyStore.Entry entry = ks2.getEntry(ALIAS, kspp); - SecretKey keyIn = ((KeyStore.SecretKeyEntry)entry).getSecretKey(); - if (Arrays.equals(key.getEncoded(), keyIn.getEncoded())) { - System.err.println("OK: worked just fine with " + keystoreType + - " keystore"); - } else { - System.err.println("ERROR: keys are NOT equal after storing in " - + keystoreType + " keystore"); + try { + try (FileOutputStream fos = new FileOutputStream(ksFile)) { + ks.store(fos, pw); + fos.flush(); + } + + // now see if we can get it back + try (FileInputStream fis = new FileInputStream(ksFile)) { + KeyStore ks2 = KeyStore.getInstance(keystoreType); + ks2.load(fis, pw); + KeyStore.Entry entry = ks2.getEntry(ALIAS, kspp); + SecretKey keyIn = ((KeyStore.SecretKeyEntry) entry).getSecretKey(); + if (Arrays.equals(key.getEncoded(), keyIn.getEncoded())) { + System.err.println("OK: worked just fine with " + keystoreType + + " keystore"); + } else { + System.err.println("ERROR: keys are NOT equal after storing in " + + keystoreType + " keystore"); + } } + } finally { + Files.deleteIfExists(ksFile.toPath()); } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,8 @@ public static void main(String[] args) throws Exception { AlgorithmParameterGenerator apg = - AlgorithmParameterGenerator.getInstance("DSA", "SUN"); + AlgorithmParameterGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); DSAGenParameterSpec spec = new DSAGenParameterSpec( Integer.valueOf(args[0]).intValue(), diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -73,7 +73,8 @@ public static void main(String[] args) throws Exception { AlgorithmParameterGenerator apg - = AlgorithmParameterGenerator.getInstance("DSA", "SUN"); + = AlgorithmParameterGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); long start, stop; // make sure no-init still works diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestDSA.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestDSA.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -108,7 +108,7 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - Provider provider = Security.getProvider("SUN"); + Provider provider = Security.getProvider(System.getProperty("test.provider.name", "SUN")); System.out.println("Testing provider " + provider + "..."); KeyFactory kf = KeyFactory.getInstance("DSA", provider); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestDSA2.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA2.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestDSA2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestDSA2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ // NOTE: need to explictly specify provider since the more // preferred provider SunPKCS11 provider only supports up // 1024 bits. - private static final String PROV = "SUN"; + private static final String PROV = + System.getProperty("test.provider.name", "SUN"); private static final String[] SIG_ALGOS = { "NONEwithDSA", diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,10 +57,12 @@ // problem was when not calling initialize() // do that twice to artifically inflate the time // on JDKs that do not have the fix - kpg = KeyPairGenerator.getInstance("DSA", "SUN"); + kpg = KeyPairGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); kp = kpg.generateKeyPair(); - kpg = KeyPairGenerator.getInstance("DSA", "SUN"); + kpg = KeyPairGenerator.getInstance("DSA", + System.getProperty("test.provider.name", "SUN")); kp = kpg.generateKeyPair(); // some other basic tests diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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,6 +24,7 @@ /* * @test * @bug 5091374 5100603 + * @library /test/lib * @summary make sure the JKS case sensitivity works correctly * @author Andreas Sterbenz */ @@ -34,6 +35,7 @@ import java.security.*; import java.security.cert.*; import java.security.cert.Certificate; +import jdk.test.lib.security.SecurityUtils; public class CaseSensitiveAliases { @@ -90,8 +92,9 @@ X509Certificate[] a1 = {c1}; X509Certificate[] a2 = {c2}; - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); - kpg.initialize(512); + String kpgAlgorithm = "RSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); PrivateKey p1 = kpg.generateKeyPair().getPrivate(); PrivateKey p2 = kpg.generateKeyPair().getPrivate(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/KeyStore/DKSTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/DKSTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/KeyStore/DKSTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/KeyStore/DKSTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -80,7 +80,7 @@ public static void main(String[] args) throws Exception { if (args.length == 0) { // Environment variable and system properties referred in domains.cfg used by this Test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(List.of( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(List.of( "-Dtest.src=" + TEST_SRC , "-Duser.dir=" + USER_DIR, "DKSTest", "run")); pb.environment().putAll(System.getenv()); pb.environment().put("KEYSTORE_PWD", "test12"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -177,7 +177,7 @@ static void runTests(Test[] tests) throws Exception { long start = System.currentTimeMillis(); - Provider p = Security.getProvider("SUN"); + Provider p = Security.getProvider(System.getProperty("test.provider.name","SUN")); System.out.println("Testing provider " + p.getName() + "..."); for (int i = 0; i < tests.length; i++) { Test test = tests[i]; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/Offsets.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/Offsets.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/Offsets.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/Offsets.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, 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 @@ -47,7 +47,8 @@ private static void test(String algorithm, int minOfs, int maxOfs, int minLen, int maxLen) throws Exception { Random random = new Random(); - MessageDigest md = MessageDigest.getInstance(algorithm, "SUN"); + MessageDigest md = MessageDigest.getInstance(algorithm, + System.getProperty("test.provider.name", "SUN")); System.out.println("Testing " + algorithm + "..."); outOfBounds(md, 16, 0, 32); outOfBounds(md, 16, -8, 16); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2024, 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 @@ -75,7 +75,8 @@ public static void main(String[] argv) throws Exception { - Provider p = Security.getProvider("SUN"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SUN")); for (int i=0; i DATA = Arrays.asList( diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java openjdk-17-17.0.14+7/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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,10 +23,12 @@ import java.util.Arrays; import java.util.List; +import jdk.test.lib.security.SecurityUtils; /* * @test * @bug 8075286 + * @library /test/lib * @summary Test the SHAwithDSA signature algorithm OIDs in JDK. * OID and algorithm transformation string should match. * Both could be able to be used to generate the algorithm instance. @@ -40,8 +42,10 @@ new OidAlgorithmPair("2.16.840.1.101.3.4.3.2", "SHA256withDSA")); public static void main(String[] args) throws Exception { - TestSignatureOidHelper helper = new TestSignatureOidHelper("DSA", - "SUN", 1024, DATA); + String kpgAlgorithm = "DSA"; + TestSignatureOidHelper helper = new TestSignatureOidHelper(kpgAlgorithm, + System.getProperty("test.provider.name", "SUN"), + SecurityUtils.getTestKeySize(kpgAlgorithm), DATA); helper.execute(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/provider/PolicyFile/getinstance/getinstance.sh openjdk-17-17.0.14+7/test/jdk/sun/security/provider/PolicyFile/getinstance/getinstance.sh --- openjdk-17-17.0.13+11/test/jdk/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}app \ ${TESTSRC}${FS}GetInstance.java -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -Xbootclasspath/a:"${TESTCLASSES}${FS}boot" \ -classpath "${TESTCLASSES}${FS}app" -Djava.security.manager \ -Djava.security.policy=GetInstance.policy \ @@ -110,7 +110,7 @@ echo "Failed on first test" fi -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -classpath "${TESTCLASSES}${FS}boot${PS}${TESTCLASSES}${FS}app" \ -Djava.security.manager \ -Djava.security.policy=GetInstance.policy \ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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,6 +24,7 @@ /* * @test * @bug 4503229 8220016 + * @library /test/lib * @summary default RSA KeyFactory can return broken RSAPrivateCrtKey objects * This test was taken directly from the bug report, which * was fixed in the crippled JSAFE provider, and needed @@ -35,12 +36,15 @@ import java.security.interfaces.*; import java.security.spec.*; import java.math.BigInteger; +import jdk.test.lib.security.SecurityUtils; public class BrokenRSAPrivateCrtKey { public static void main(String[] args) throws Exception { + String kpgAlgorithm = "RSA"; KeyPairGenerator generator = - KeyPairGenerator.getInstance("RSA", "SunRsaSign"); - generator.initialize(512); + KeyPairGenerator.getInstance(kpgAlgorithm, + System.getProperty("test.provider.name", "SunRsaSign")); + generator.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair pair = generator.generateKeyPair(); @@ -55,7 +59,8 @@ privatekey.getPrimeExponentQ(), privatekey.getCrtCoefficient()); - KeyFactory factory = KeyFactory.getInstance("RSA", "SunRsaSign"); + KeyFactory factory = KeyFactory.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); PrivateKey privatekey2 = factory.generatePrivate(spec); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/GenKeyStore.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/GenKeyStore.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/GenKeyStore.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/GenKeyStore.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -74,7 +74,8 @@ private static void generateKeyPair(KeyStore ks, int keyLength, String alias) throws Exception { System.out.println("Generating " + keyLength + " keypair " + alias + "..."); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); kpg.initialize(keyLength); KeyPair kp = kpg.generateKeyPair(); addToKeyStore(ks, kp, alias); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/KeySizeTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/KeySizeTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/KeySizeTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/KeySizeTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -53,7 +53,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER_NAME = "SunRsaSign"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunRsaSign"); public static void main(String[] args) throws Exception { int iKeyPairSize = Integer.parseInt(args[0]); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER_NAME = "SunRsaSign"; + private static final String PROVIDER_NAME = + System.getProperty("test.provider.name", "SunRsaSign"); public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/SignatureTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SignatureTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/SignatureTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SignatureTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -61,7 +61,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); /** * How much times signature updated. diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/SpecTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SpecTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/SpecTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/SpecTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -53,7 +53,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); /** * diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestCACerts.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestCACerts.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestCACerts.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestCACerts.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,8 @@ public class TestCACerts { - private final static String PROVIDER = "SunRsaSign"; + private final static String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); private final static char SEP = File.separatorChar; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyFactory.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyFactory.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyFactory.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyFactory.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -228,7 +228,8 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); KeyStore ks = getKeyStore(); - KeyFactory kf = KeyFactory.getInstance("RSA", "SunRsaSign"); + KeyFactory kf = KeyFactory.getInstance("RSA", + System.getProperty("test.provider.name", "SunRsaSign")); for (Enumeration e = ks.aliases(); e.hasMoreElements(); ) { String alias = (String)e.nextElement(); Key key = null; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGenerator.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGenerator.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGenerator.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGenerator.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ import java.security.interfaces.*; import java.security.spec.*; +import jdk.test.lib.security.SecurityUtils; import jdk.test.lib.SigTestUtil; import static jdk.test.lib.SigTestUtil.SignatureType; @@ -85,9 +86,10 @@ } // regression test for 4865198 - private static void testInvalidSignature(KeyPair kp1, KeyPair kp2) throws Exception { + private static void testInvalidSignature(KeyPair kp1, KeyPair kp2, String signAlgo) + throws Exception { System.out.println("Testing signature with incorrect key..."); - Signature sig = Signature.getInstance("MD5withRSA", provider); + Signature sig = Signature.getInstance(signAlgo, provider); sig.initSign(kp1.getPrivate()); byte[] data = new byte[100]; sig.update(data); @@ -111,14 +113,16 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - provider = Security.getProvider("SunRsaSign"); + provider = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); data = new byte[2048]; - // keypair generation is very slow, test only a few short keys - int[] keyLengths = {512, 512, 1024}; + String kpgAlgorithm = "RSA"; + int keySize = SecurityUtils.getTestKeySize(kpgAlgorithm); + int[] keyLengths = {keySize, keySize, keySize + 1024}; BigInteger[] pubExps = {null, BigInteger.valueOf(3), null}; KeyPair[] keyPairs = new KeyPair[3]; new Random().nextBytes(data); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", provider); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, provider); for (int i = 0; i < keyLengths.length; i++) { int len = keyLengths[i]; BigInteger exp = pubExps[i]; @@ -150,9 +154,14 @@ } test(privateKey, publicKey); } - testInvalidSignature(keyPairs[0], keyPairs[1]); - testInvalidSignature(keyPairs[0], keyPairs[2]); - testInvalidSignature(keyPairs[2], keyPairs[0]); + String md5Algo = "MD5withRSA"; + String sha256Algo = "Sha256withRSA"; + testInvalidSignature(keyPairs[0], keyPairs[1], md5Algo); + testInvalidSignature(keyPairs[0], keyPairs[2], md5Algo); + testInvalidSignature(keyPairs[2], keyPairs[0], md5Algo); + testInvalidSignature(keyPairs[0], keyPairs[1], sha256Algo); + testInvalidSignature(keyPairs[0], keyPairs[2], sha256Algo); + testInvalidSignature(keyPairs[2], keyPairs[0], sha256Algo); long stop = System.currentTimeMillis(); System.out.println("All tests passed (" + (stop - start) + " ms)."); } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,6 +24,7 @@ /** * @test * @bug 8216012 + * @library /test/lib * @summary Tests the RSA public key exponent for KeyPairGenerator * @run main/timeout=60 TestKeyPairGeneratorExponent */ @@ -33,14 +34,16 @@ import java.security.*; import java.security.interfaces.*; import java.security.spec.*; +import jdk.test.lib.security.SecurityUtils; public class TestKeyPairGeneratorExponent { - private static int keyLen = 512; + private static final String KPG_ALGORITHM = "RSA"; + private static final int KEY_LENGTH = SecurityUtils.getTestKeySize(KPG_ALGORITHM); private static BigInteger[] validExponents = new BigInteger[] { RSAKeyGenParameterSpec.F0, RSAKeyGenParameterSpec.F4, - BigInteger.ONE.shiftLeft(keyLen - 1).subtract(BigInteger.ONE) + BigInteger.ONE.shiftLeft(KEY_LENGTH - 1).subtract(BigInteger.ONE) }; private static BigInteger[] invalidExponents = new BigInteger[] { @@ -55,7 +58,7 @@ BigInteger exponent) { System.out.println("Testing exponent = " + exponent.toString(16)); try { - kpg.initialize(new RSAKeyGenParameterSpec(keyLen, exponent)); + kpg.initialize(new RSAKeyGenParameterSpec(KEY_LENGTH, exponent)); kpg.generateKeyPair(); System.out.println("OK, key pair generated"); } catch(InvalidAlgorithmParameterException iape){ @@ -67,7 +70,7 @@ BigInteger exponent) { System.out.println("Testing exponent = " + exponent.toString(16)); try { - kpg.initialize(new RSAKeyGenParameterSpec(keyLen, exponent)); + kpg.initialize(new RSAKeyGenParameterSpec(KEY_LENGTH, exponent)); kpg.generateKeyPair(); throw new RuntimeException("Error: Expected IAPE not thrown."); } catch(InvalidAlgorithmParameterException iape){ @@ -81,7 +84,8 @@ public static void main(String[] args) throws Exception { KeyPairGenerator kpg = - KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator.getInstance(KPG_ALGORITHM, + System.getProperty("test.provider.name", "SunRsaSign")); for(BigInteger validExponent : validExponents) { testValidExponents(kpg, validExponent); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,11 +24,13 @@ /** * @test * @bug 8211049 + * @library /test/lib * @summary make sure the supplied SecureRandom object is used */ import java.security.*; import java.security.interfaces.*; +import jdk.test.lib.security.SecurityUtils; public class TestKeyPairGeneratorInit { @@ -45,10 +47,12 @@ } public static void main(String[] args) throws Exception { + String kpgAlgorithm = "RSA"; KeyPairGenerator kpg = - KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator.getInstance(kpgAlgorithm, + System.getProperty("test.provider.name", "SunRsaSign")); MySecureRandom rnd = new MySecureRandom(); - kpg.initialize(2048, rnd); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm), rnd); System.out.println("Generate keypair then check"); KeyPair kp = kpg.generateKeyPair(); if (!rnd.isUsed) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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,23 +24,28 @@ /** * @test * @bug 5078280 + * @library /test/lib * @summary make sure generated key pairs are exactly the requested length * @author Andreas Sterbenz */ import java.security.*; import java.security.interfaces.*; +import jdk.test.lib.security.SecurityUtils; public class TestKeyPairGeneratorLength { + private static final String KPG_ALGORITHM = "RSA"; + private static final int KEY_LENGTH = SecurityUtils.getTestKeySize(KPG_ALGORITHM); public static void main(String[] args) throws Exception { - test(512); - test(513); + test(KEY_LENGTH); + test(KEY_LENGTH + 1); System.out.println("Done."); } private static void test(int len) throws Exception { - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(KPG_ALGORITHM, + System.getProperty("test.provider.name", "SunRsaSign")); kpg.initialize(len); for (int i = 0; i < 6; i++) { System.out.println("Generating keypair " + len + " bit keypair " + (i + 1) + "..."); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestRSAOidSupport.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestRSAOidSupport.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestRSAOidSupport.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestRSAOidSupport.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,14 +59,16 @@ X509EncodedKeySpec x509Spec = new X509EncodedKeySpec (toByteArray(DER_BYTES)); String keyAlgo = "RSA"; - KeyFactory kf = KeyFactory.getInstance(keyAlgo, "SunRsaSign"); + KeyFactory kf = KeyFactory.getInstance(keyAlgo, + System.getProperty("test.provider.name", "SunRsaSign")); RSAPublicKey rsaKey = (RSAPublicKey) kf.generatePublic(x509Spec); if (rsaKey.getAlgorithm() != keyAlgo) { throw new RuntimeException("Key algo should be " + keyAlgo + ", but got " + rsaKey.getAlgorithm()); } - kf = KeyFactory.getInstance("RSASSA-PSS", "SunRsaSign"); + kf = KeyFactory.getInstance("RSASSA-PSS", + System.getProperty("test.provider.name", "SunRsaSign")); try { kf.generatePublic(x509Spec); throw new RuntimeException("Should throw IKSE"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestSigGen15.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSigGen15.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestSigGen15.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSigGen15.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -71,7 +71,8 @@ static boolean runTest(List records) throws Exception { boolean success = true; //for (Provider provider : Security.getProviders()) { - Provider p = Security.getProvider("SunRsaSign"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name","SunRsaSign")); KeyFactory kf = KeyFactory.getInstance("RSA", p); for (SigRecord sr : records) { System.out.println("==Testing Record : " + sr + "=="); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestSignatures.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSignatures.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/TestSignatures.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/TestSignatures.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,8 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); - provider = Security.getProvider("SunRsaSign"); + provider = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); data = new byte[2048]; new Random().nextBytes(data); KeyStore ks = getKeyStore(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/WithoutNULL.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/WithoutNULL.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/WithoutNULL.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/WithoutNULL.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -48,7 +48,8 @@ b8oaWkxk069jDTM1RhllPJZkAjeQRbw4gkg4N6wKZz9B/jdSRMNJg/b9QdRYZOHOBxsEHMbUREPV DoCOLaxB8eIXX0EWkiE="""); - Signature s = Signature.getInstance("SHA1withRSA", "SunRsaSign"); + Signature s = Signature.getInstance("SHA1withRSA", + System.getProperty("test.provider.name", "SunRsaSign")); s.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key))); if (!s.verify(sig)) { throw new RuntimeException("Does not verify"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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,10 +30,12 @@ import java.security.spec.PSSParameterSpec; import java.security.spec.RSAKeyGenParameterSpec; import java.util.Date; +import jdk.test.lib.security.SecurityUtils; /** * @test * @bug 8242811 + * @library /test/lib * @modules java.base/sun.security.x509 * @summary AlgorithmId::getDefaultAlgorithmParameterSpec returns incompatible * PSSParameterSpec for an RSASSA-PSS key @@ -42,7 +44,7 @@ public static void main(String[] args) throws Exception { KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSASSA-PSS"); KeyFactory kf = KeyFactory.getInstance("RSASSA-PSS"); - kpg.initialize(new RSAKeyGenParameterSpec(2048, + kpg.initialize(new RSAKeyGenParameterSpec(SecurityUtils.getTestKeySize("RSA"), RSAKeyGenParameterSpec.F4, new PSSParameterSpec( "SHA-384", "MGF1", diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/InitAgain.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/InitAgain.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/InitAgain.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/InitAgain.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,26 +22,34 @@ */ import java.security.*; import java.security.spec.*; +import jdk.test.lib.security.SecurityUtils; /** * @test * @bug 8205445 + * @library /test/lib * @summary Make sure old state is cleared when init is called again + * @run main InitAgain default + * @run main InitAgain SHA-256 */ public class InitAgain { public static void main(String[] args) throws Exception { + String mdName = args[0]; + PSSParameterSpec pssParamSpec = "default".equals(mdName) ? PSSParameterSpec.DEFAULT : + new PSSParameterSpec(mdName, "MGF1", new MGF1ParameterSpec(mdName), 20, 1); byte[] msg = "hello".getBytes(); Signature s1 = Signature.getInstance("RSASSA-PSS"); Signature s2 = Signature.getInstance("RSASSA-PSS"); - s1.setParameter(PSSParameterSpec.DEFAULT); - s2.setParameter(PSSParameterSpec.DEFAULT); + s1.setParameter(pssParamSpec); + s2.setParameter(pssParamSpec); - KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); - kpg.initialize(1024); + String kpgAlgorithm = "RSA"; + KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm); + kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm)); KeyPair kp = kpg.generateKeyPair(); s1.initSign(kp.getPrivate()); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -51,7 +51,8 @@ private static final String ALGO = "RSASSA-PSS"; private static final String OID = "1.2.840.113549.1.1.10"; - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); public static void main(String[] args) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/PSSParametersTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSParametersTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/PSSParametersTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/PSSParametersTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); private static final String PSS_ALGO = "RSASSA-PSS"; private static final String PSS_OID = "1.2.840.113549.1.1.10"; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,11 @@ import java.security.spec.RSAPublicKeySpec; import java.security.spec.X509EncodedKeySpec; import java.util.Arrays; +import jdk.test.lib.security.SecurityUtils; /** * @test @bug 8242335 + * @library /test/lib * @summary Test RSASSA-PSS serialized keys * @run main SerializedPSSKey */ @@ -60,8 +62,9 @@ private static final String ALGO = "RSASSA-PSS"; private static final String OID = "1.2.840.113549.1.1.10"; - private static final String PROVIDER = "SunRsaSign"; - private static final int KEY_SIZE = 2048; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); + private static final int KEY_SIZE = SecurityUtils.getTestKeySize("RSA"); private static final byte[] DATA = "Test".getBytes(); /** * Digest algorithms to test w/ RSASSA-PSS signature algorithms diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SignatureTest2.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTest2.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SignatureTest2.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTest2.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -51,7 +51,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); /** * How much times signature updated. diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,8 @@ /** * JDK default RSA Provider. */ - private static final String PROVIDER = "SunRsaSign"; + private static final String PROVIDER = + System.getProperty("test.provider.name", "SunRsaSign"); /** * How much times signature updated. diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,6 +24,7 @@ /** * @test * @bug 8146293 8242556 8172366 8254717 + * @library /test/lib * @summary Test RSASSA-PSS Key related support such as KeyPairGenerator * and KeyFactory of the SunRsaSign provider */ @@ -35,6 +36,7 @@ import java.security.*; import java.security.interfaces.*; import java.security.spec.*; +import jdk.test.lib.security.SecurityUtils; public class TestPSSKeySupport { @@ -130,11 +132,13 @@ } public static void main(String[] args) throws Exception { + int keySize = SecurityUtils.getTestKeySize("RSA"); KeyPairGenerator kpg = - KeyPairGenerator.getInstance(ALGO, "SunRsaSign"); + KeyPairGenerator.getInstance(ALGO, + System.getProperty("test.provider.name", "SunRsaSign")); // Algorithm-Independent Initialization - kpg.initialize(2048); + kpg.initialize(keySize); KeyPair kp = kpg.generateKeyPair(); checkKeyPair(kp); BigInteger pubExp = ((RSAPublicKey)kp.getPublic()).getPublicExponent(); @@ -142,17 +146,18 @@ // Algorithm-specific Initialization PSSParameterSpec params = new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, 32, 1); - kpg.initialize(new RSAKeyGenParameterSpec(2048, pubExp, params)); + kpg.initialize(new RSAKeyGenParameterSpec(keySize, pubExp, params)); KeyPair kp2 = kpg.generateKeyPair(); checkKeyPair(kp2); params = new PSSParameterSpec("SHA3-256", "MGF1", new MGF1ParameterSpec("SHA3-256"), 32, 1); - kpg.initialize(new RSAKeyGenParameterSpec(2048, pubExp, params)); + kpg.initialize(new RSAKeyGenParameterSpec(keySize, pubExp, params)); KeyPair kp3 = kpg.generateKeyPair(); checkKeyPair(kp3); - KeyFactory kf = KeyFactory.getInstance(ALGO, "SunRsaSign"); + KeyFactory kf = KeyFactory.getInstance(ALGO, + System.getProperty("test.provider.name", "SunRsaSign")); test(kf, kp.getPublic()); test(kf, kp.getPrivate()); test(kf, kp2.getPublic()); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -62,7 +62,8 @@ public static void main(String[] args) throws Exception { //for (Provider provider : Security.getProviders()) { - Provider p = Security.getProvider("SunRsaSign"); + Provider p = Security.getProvider( + System.getProperty("test.provider.name", "SunRsaSign")); Signature sig; try { sig = Signature.getInstance("RSASSA-PSS", p); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ * @bug 8044860 * @summary Vectors and fixed length fields should be verified * for allowed sizes. - * @library /test/lib + * @library /test/lib /javax/net/ssl/templates * @modules java.base/sun.security.ssl * @run main/othervm LengthCheckTest * @key randomness @@ -70,7 +70,6 @@ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; import java.security.*; import java.nio.*; import java.util.List; @@ -79,7 +78,7 @@ import jdk.test.lib.security.SecurityUtils; -public class LengthCheckTest { +public class LengthCheckTest extends SSLEngineTemplate { /* * Enables logging of the SSLEngine operations. @@ -98,41 +97,9 @@ private static final boolean debug = false; private static final boolean dumpBufs = true; - private final SSLContext sslc; - - private SSLEngine clientEngine; // client Engine - private ByteBuffer clientOut; // write side of clientEngine - private ByteBuffer clientIn; // read side of clientEngine - - private SSLEngine serverEngine; // server Engine - private ByteBuffer serverOut; // write side of serverEngine - private ByteBuffer serverIn; // read side of serverEngine private HandshakeTest handshakeTest; - /* - * For data transport, this example uses local ByteBuffers. This - * isn't really useful, but the purpose of this example is to show - * SSLEngine concepts, not how to do network transport. - */ - private ByteBuffer cTOs; // "reliable" transport client->server - private ByteBuffer sTOc; // "reliable" transport server->client - - /* - * The following is to set up the keystores. - */ - private static final String pathToStores = "../../../../javax/net/ssl/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; - private static final String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; - // Define a few basic TLS record and message types we might need private static final int TLS_RECTYPE_CCS = 0x14; private static final int TLS_RECTYPE_ALERT = 0x15; @@ -176,20 +143,20 @@ // Send Client Hello clientResult = clientEngine.wrap(clientOut, cTOs); log("client wrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); cTOs.flip(); dumpByteBuffer("CLIENT-TO-SERVER", cTOs); // Server consumes Client Hello serverResult = serverEngine.unwrap(cTOs, serverIn); log("server unwrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); cTOs.compact(); // Server generates ServerHello/Cert/Done record serverResult = serverEngine.wrap(serverOut, sTOc); log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); sTOc.flip(); // Intercept the ServerHello messages and instead send @@ -220,19 +187,19 @@ gotException = true; } log("client unwrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); } } else { dumpByteBuffer("SERVER-TO-CLIENT", sTOc); log("client unwrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); } sTOc.compact(); // The Client should now send a TLS Alert clientResult = clientEngine.wrap(clientOut, cTOs); log("client wrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); cTOs.flip(); dumpByteBuffer("CLIENT-TO-SERVER", cTOs); @@ -264,7 +231,7 @@ // Server consumes Client Hello serverResult = serverEngine.unwrap(evilClientHello, serverIn); log("server unwrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); evilClientHello.compact(); // Under normal circumstances this should be a ServerHello @@ -273,7 +240,7 @@ try { serverResult = serverEngine.wrap(serverOut, sTOc); log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); } catch (SSLProtocolException ssle) { log("Received expected SSLProtocolException: " + ssle); gotException = true; @@ -282,7 +249,7 @@ // We expect to see the server generate an alert here serverResult = serverEngine.wrap(serverOut, sTOc); log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); sTOc.flip(); dumpByteBuffer("SERVER-TO-CLIENT", sTOc); @@ -326,26 +293,7 @@ * Create an initialized SSLContext to use for these tests. */ public LengthCheckTest(String testName) throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - sslc = sslCtx; + super(); switch (testName) { case "ServSendLongID": @@ -378,10 +326,8 @@ * sections of code. */ private void runTest() throws Exception { - boolean dataDone = false; - - createSSLEngines(); - createBuffers(); + configureSSLEngine(); +// createBuffers(); handshakeTest.execTest(); } @@ -390,19 +336,17 @@ * Using the SSLContext created during object creation, * create/configure the SSLEngines we'll use for this test. */ - private void createSSLEngines() throws Exception { + private void configureSSLEngine() throws Exception { /* * Configure the serverEngine to act as a server in the SSL/TLS * handshake. Also, require SSL client authentication. */ - serverEngine = sslc.createSSLEngine(); serverEngine.setUseClientMode(false); serverEngine.setNeedClientAuth(false); /* * Similar to above, but using client mode instead. */ - clientEngine = sslc.createSSLEngine("client", 80); clientEngine.setUseClientMode(true); // In order to make a test that will be backwards compatible @@ -414,84 +358,6 @@ } /* - * Create and size the buffers appropriately. - */ - private void createBuffers() { - - /* - * We'll assume the buffer sizes are the same - * between client and server. - */ - SSLSession session = clientEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - /* - * We'll make the input buffers a bit bigger than the max needed - * size, so that unwrap()s following a successful data transfer - * won't generate BUFFER_OVERFLOWS. - * - * We'll use a mix of direct and indirect ByteBuffers for - * tutorial purposes only. In reality, only use direct - * ByteBuffers when they give a clear performance enhancement. - */ - clientIn = ByteBuffer.allocate(appBufferMax + 50); - serverIn = ByteBuffer.allocate(appBufferMax + 50); - - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - - clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); - serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); - } - - /* - * If the result indicates that we have outstanding tasks to do, - * go ahead and run them in this thread. - */ - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("\trunning delegated task..."); - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - log("\tnew HandshakeStatus: " + hsStatus); - } - } - - private static boolean isEngineClosed(SSLEngine engine) { - return (engine.isOutboundDone() && engine.isInboundDone()); - } - - /* - * Simple check to make sure everything came across as expected. - */ - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("\tData transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - - /* * Logging code */ private static boolean resultOnce = true; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java 2025-01-04 20:25:18.000000000 +0000 @@ -30,6 +30,7 @@ * @test * @bug 6956398 8301700 * @summary make ephemeral DH key match the length of the certificate key + * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 * @run main/othervm -Djsse.enableFFDHE=false @@ -122,18 +123,10 @@ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; import java.nio.*; -import java.security.KeyStore; -import java.security.KeyFactory; import java.security.Security; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.interfaces.*; -import java.util.Base64; -public class DHEKeySizing { +public class DHEKeySizing extends SSLEngineTemplate { private final static boolean debug = true; @@ -145,89 +138,6 @@ // negotiated DH keys. private final static int KEY_LEN_BIAS = 6; - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - /* - * Where do we find the keystores? - */ - // Certificates and key used in the test. - static String trustedCertStr = - "-----BEGIN CERTIFICATE-----\n" + - "MIIC8jCCAdqgAwIBAgIEUjkuRzANBgkqhkiG9w0BAQUFADA7MR0wGwYDVQQLExRT\n" + - "dW5KU1NFIFRlc3QgU2VyaXZjZTENMAsGA1UEChMESmF2YTELMAkGA1UEBhMCVVMw\n" + - "HhcNMTMwOTE4MDQzODMxWhcNMTMxMjE3MDQzODMxWjA7MR0wGwYDVQQLExRTdW5K\n" + - "U1NFIFRlc3QgU2VyaXZjZTENMAsGA1UEChMESmF2YTELMAkGA1UEBhMCVVMwggEi\n" + - "MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCO+IGeaskJAvEcYc7pCl9neK3E\n" + - "a28fwWLtChufYNaC9hQfZlUdETWYjV7fZJVJKT/oLzdDNMWuVA0LKXArpI3thLNK\n" + - "QLXisdF9hKPlZRDazACL9kWUUtJ0FzpEySK4e8wW/z9FuU6e6iO19FbjxAfInJqk\n" + - "3EDiEhB5g73S2vtvPCxgq2DvWw9TDl/LIqdKG2JCS93koXCCaHmQ7MrIOqHPd+8r\n" + - "RbGpatXT9qyHKppUv9ATxVygO4rA794mgCFxpT+fkhz+NEB0twTkM65T1hnnOv5n\n" + - "ZIxkcjBggt85UlZtnP3b9P7SYxsWIa46Oc38Od2f3YejfVg6B+PqPgWNl3+/AgMB\n" + - "AAEwDQYJKoZIhvcNAQEFBQADggEBAAlrP6DFLRPSy0IgQhcI2i56tR/na8pezSte\n" + - "ZHcCdaCZPDy4UP8mpLJ9QCjEB5VJv8hPm4xdK7ULnKGOGHgYqDpV2ZHvQlhV1woQ\n" + - "TZGb/LM3c6kAs0j4j9KM2fq3iYUYexjIkS1KzsziflxMM6igS9BRMBR2LQyU+cYq\n" + - "YEsFzkF7Aj2ET4v/+tgot9mRr2NioJcaJkdsPDpMU3IKB1cczfu+OuLQ/GCG0Fqu\n" + - "6ijCeCqfnaAbemHbJeVZZ6Qgka3uC2YMntLBmLkhqEo1d9zGYLoh7oWL77y5ibQZ\n" + - "LK5/H/zikcu579TWjlDHcqL3arCwBcrtsjSaPrRSWMrWV/6c0qw=\n" + - "-----END CERTIFICATE-----"; - - // Private key in the format of PKCS#8 - static String targetPrivateKey = - "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCO+IGeaskJAvEc\n" + - "Yc7pCl9neK3Ea28fwWLtChufYNaC9hQfZlUdETWYjV7fZJVJKT/oLzdDNMWuVA0L\n" + - "KXArpI3thLNKQLXisdF9hKPlZRDazACL9kWUUtJ0FzpEySK4e8wW/z9FuU6e6iO1\n" + - "9FbjxAfInJqk3EDiEhB5g73S2vtvPCxgq2DvWw9TDl/LIqdKG2JCS93koXCCaHmQ\n" + - "7MrIOqHPd+8rRbGpatXT9qyHKppUv9ATxVygO4rA794mgCFxpT+fkhz+NEB0twTk\n" + - "M65T1hnnOv5nZIxkcjBggt85UlZtnP3b9P7SYxsWIa46Oc38Od2f3YejfVg6B+Pq\n" + - "PgWNl3+/AgMBAAECggEAPdb5Ycc4m4A9QBSCRcRpzbyiFLKPh0HDg1n65q4hOtYr\n" + - "kAVYTVFTSF/lqGS+Ob3w2YIKujQKSUQrvCc5UHdFuHXMgxKIWbymK0+DAMb9SlYw\n" + - "6lkkcWp9gx9E4dnJ/df2SAAxovvrKMuHlL1SFASHhVtPfH2URvSfUaANLDXxyYOs\n" + - "8BX0Nr6wazhWjLjXo9yIGnKSvFfB8XisYcA78kEgas43zhmIGCDPqaYyyffOfRbx\n" + - "pM1KNwGmlN86iWR1CbwA/wwhcMySWQueS+s7cHbpRqZIYJF9jEeELiwi0vxjealS\n" + - "EMuHYedIRFMWaDIq9XyjrvXamHb0Z25jlXBNZHaM0QKBgQDE9adl+zAezR/n79vw\n" + - "0XiX2Fx1UEo3ApZHuoA2Q/PcBk+rlKqqQ3IwTcy6Wo648wK7v6Nq7w5nEWcsf0dU\n" + - "QA2Ng/AJEev/IfF34x7sKGYxtk1gcE0EuSBA3R+ocEZxnNw1Ryd5nUU24s8d4jCP\n" + - "Mkothnyaim+zE2raDlEtVc0CaQKBgQC509av+02Uq5oMjzbQp5PBJfQFjATOQT15\n" + - "eefYnVYurkQ1kcVfixkrO2ORhg4SjmI2Z5hJDgGtXdwgidpzkad+R2epS5qLMyno\n" + - "lQVpY6bMpEZ7Mos0yQygxnm8uNohEcTExOe+nP5fNJVpzBsGmfeyYOhnPQlf6oqf\n" + - "0cHizedb5wKBgQC/l5LyMil6HOGHlhzmIm3jj7VI7QR0hJC5T6N+phVml8ESUDjA\n" + - "DYHbmSKouISTRtkG14FY+RiSjCxH7bvuKazFV2289PETquogTA/9e8MFYqfcQwG4\n" + - "sXi9gBxWlnj/9a2EKiYtOB5nKLR/BlNkSHA93tAA6N+FXEMZwMmYhxk42QKBgAuY\n" + - "HQgD3PZOsqDf+qKQIhbmAFCsSMx5o5VFtuJ8BpmJA/Z3ruHkMuDQpsi4nX4o5hXQ\n" + - "5t6AAjjH52kcUMXvK40kdWJJtk3DFnVNfvXxYsHX6hHbuHXFqYUKfSP6QJnZmvZP\n" + - "9smcz/4usLfWJUWHK740b6upUkFqx9Vq5/b3s9y3AoGAdM5TW7LkkOFsdMGVAUzR\n" + - "9iXmCWElHTK2Pcp/3yqDBHSfiQx6Yp5ANyPnE9NBM0yauCfOyBB2oxLO4Rdv3Rqk\n" + - "9V9kyR/YAGr7dJaPcQ7pZX0OpkzgueAOJYPrx5VUzPYUtklYV1ycFZTfKlpFCxT+\n" + - "Ei6KUo0NXSdUIcB4yib1J10="; - - static char passphrase[] = "passphrase".toCharArray(); - - /* - * Majority of the test case is here, setup is done below. - */ - - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine("server", 2); - ssle2.setUseClientMode(false); - } - - private boolean isHandshaking(SSLEngine e) { - return (e.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING); - } - private void checkResult(ByteBuffer bbIn, ByteBuffer bbOut, SSLEngineResult result, Status status, HandshakeStatus hsStatus, @@ -268,130 +178,127 @@ private void test(String cipherSuite, boolean exportable, int lenServerKeyEx, int lenClientKeyEx) throws Exception { - createSSLEngines(); - createBuffers(); - - SSLEngineResult result1; // ssle1's results from last operation - SSLEngineResult result2; // ssle2's results from last operation + SSLEngineResult result1; // clientEngine's results from last operation + SSLEngineResult result2; // serverEngine's results from last operation String[] suites = new String [] {cipherSuite}; - ssle1.setEnabledCipherSuites(suites); - ssle2.setEnabledCipherSuites(suites); + clientEngine.setEnabledCipherSuites(suites); + serverEngine.setEnabledCipherSuites(suites); log("======================================"); log("==================="); log("client hello"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, + result1 = clientEngine.wrap(clientOut, cTOs); + checkResult(clientOut, cTOs, result1, Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - oneToTwo.flip(); + cTOs.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result2, + result2 = serverEngine.unwrap(cTOs, serverIn); + checkResult(cTOs, serverIn, result2, Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - oneToTwo.compact(); + runDelegatedTasks(serverEngine); + cTOs.compact(); log("==================="); log("ServerHello"); - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, + result2 = serverEngine.wrap(serverOut, sTOc); + checkResult(serverOut, sTOc, result2, Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - twoToOne.flip(); + sTOc.flip(); - log("Message length of ServerHello series: " + twoToOne.remaining()); - if (twoToOne.remaining() < (lenServerKeyEx - KEY_LEN_BIAS) || - twoToOne.remaining() > lenServerKeyEx) { + log("Message length of ServerHello series: " + sTOc.remaining()); + if (sTOc.remaining() < (lenServerKeyEx - KEY_LEN_BIAS) || + sTOc.remaining() > lenServerKeyEx) { throw new Exception( "Expected to generate ServerHello series messages of " + - lenServerKeyEx + " bytes, but not " + twoToOne.remaining()); + lenServerKeyEx + " bytes, but not " + sTOc.remaining()); } - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, + result1 = clientEngine.unwrap(sTOc, clientIn); + checkResult(sTOc, clientIn, result1, Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); - runDelegatedTasks(ssle1); - twoToOne.compact(); + runDelegatedTasks(clientEngine); + sTOc.compact(); log("==================="); log("Key Exchange"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, + result1 = clientEngine.wrap(clientOut, cTOs); + checkResult(clientOut, cTOs, result1, Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - oneToTwo.flip(); + cTOs.flip(); - log("Message length of ClientKeyExchange: " + oneToTwo.remaining()); - if (oneToTwo.remaining() < (lenClientKeyEx - KEY_LEN_BIAS) || - oneToTwo.remaining() > lenClientKeyEx) { + log("Message length of ClientKeyExchange: " + cTOs.remaining()); + if (cTOs.remaining() < (lenClientKeyEx - KEY_LEN_BIAS) || + cTOs.remaining() > lenClientKeyEx) { throw new Exception( "Expected to generate ClientKeyExchange message of " + - lenClientKeyEx + " bytes, but not " + oneToTwo.remaining()); + lenClientKeyEx + " bytes, but not " + cTOs.remaining()); } - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result2, + result2 = serverEngine.unwrap(cTOs, serverIn); + checkResult(cTOs, serverIn, result2, Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - oneToTwo.compact(); + runDelegatedTasks(serverEngine); + cTOs.compact(); log("==================="); log("Client CCS"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, + result1 = clientEngine.wrap(clientOut, cTOs); + checkResult(clientOut, cTOs, result1, Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - oneToTwo.flip(); + cTOs.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result2, + result2 = serverEngine.unwrap(cTOs, serverIn); + checkResult(cTOs, serverIn, result2, Status.OK, HandshakeStatus.NEED_UNWRAP, result1.bytesProduced(), 0); - oneToTwo.compact(); + cTOs.compact(); log("==================="); log("Client Finished"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, + result1 = clientEngine.wrap(clientOut, cTOs); + checkResult(clientOut, cTOs, result1, Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - oneToTwo.flip(); + cTOs.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result2, + result2 = serverEngine.unwrap(cTOs, serverIn); + checkResult(cTOs, serverIn, result2, Status.OK, HandshakeStatus.NEED_WRAP, result1.bytesProduced(), 0); - oneToTwo.compact(); + cTOs.compact(); log("==================="); log("Server CCS"); - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, + result2 = serverEngine.wrap(serverOut, sTOc); + checkResult(serverOut, sTOc, result2, Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - twoToOne.flip(); + sTOc.flip(); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, + result1 = clientEngine.unwrap(sTOc, clientIn); + checkResult(sTOc, clientIn, result1, Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); - twoToOne.compact(); + sTOc.compact(); log("==================="); log("Server Finished"); - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, + result2 = serverEngine.wrap(serverOut, sTOc); + checkResult(serverOut, sTOc, result2, Status.OK, HandshakeStatus.FINISHED, 0, -1); - twoToOne.flip(); + sTOc.flip(); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, + result1 = clientEngine.unwrap(sTOc, clientIn); + checkResult(sTOc, clientIn, result1, Status.OK, HandshakeStatus.FINISHED, result2.bytesProduced(), 0); - twoToOne.compact(); + sTOc.compact(); log("==================="); log("Check Session/Ciphers"); - String cs = ssle1.getSession().getCipherSuite(); + String cs = clientEngine.getSession().getCipherSuite(); if (!cs.equals(suites[0])) { throw new Exception("suites not equal: " + cs + "/" + suites[0]); } - cs = ssle2.getSession().getCipherSuite(); + cs = serverEngine.getSession().getCipherSuite(); if (!cs.equals(suites[0])) { throw new Exception("suites not equal: " + cs + "/" + suites[0]); } @@ -428,84 +335,36 @@ */ public DHEKeySizing() throws Exception { - sslc = getSSLContext(); + super(); } - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext() throws Exception { - - // generate certificate from cert string - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // create a key store - KeyStore ts = KeyStore.getInstance("JKS"); - KeyStore ks = KeyStore.getInstance("JKS"); - ts.load(null, null); - ks.load(null, null); - - // import the trused cert - ByteArrayInputStream is = - new ByteArrayInputStream(trustedCertStr.getBytes()); - Certificate trusedCert = cf.generateCertificate(is); - is.close(); - ts.setCertificateEntry("rsa-trusted-2048", trusedCert); - - // generate the private key. - String keySpecStr = targetPrivateKey; - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(keySpecStr)); - KeyFactory kf = KeyFactory.getInstance("RSA"); - RSAPrivateKey priKey = (RSAPrivateKey)kf.generatePrivate(priKeySpec); - - Certificate[] chain = new Certificate[1]; - chain[0] = trusedCert; - - // import the key entry. - ks.setKeyEntry("rsa-key-2048", priKey, passphrase, chain); - - // create SSL context - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLSv1"); - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; + @Override + protected SSLEngine configureServerEngine(SSLEngine engine) { + engine.setNeedClientAuth(false); + engine.setUseClientMode(false); + return engine; } - private void createBuffers() { - // Size the buffers as appropriate. - - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); + @Override + protected SSLContext createServerSSLContext() throws Exception { + return createSSLContext(null, new Cert[]{Cert.CA_SHA1_RSA_2048}, + getServerContextParameters()); + } - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); - log(""); + @Override + protected SSLContext createClientSSLContext() throws Exception { + return createSSLContext(new Cert[]{Cert.CA_SHA1_RSA_2048}, null, + getClientContextParameters()); } - private static void runDelegatedTasks(SSLEngine engine) throws Exception { + @Override + protected ContextParameters getClientContextParameters() { + return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); + } - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("running delegated task..."); - runnable.run(); - } + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); } private static void log(String str) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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,7 +25,7 @@ * @test * @bug 7126889 * @summary Incorrect SSLEngine debug output - * @library /test/lib + * @library /test/lib /javax/net/ssl/templates * @run main DebugReportsOneExtraByte */ /* @@ -74,54 +74,19 @@ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; import java.nio.*; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.security.SecurityUtils; -public class DebugReportsOneExtraByte { +public class DebugReportsOneExtraByte extends SSLEngineTemplate { /* * Enables logging of the SSLEngine operations. */ private static boolean logging = true; - private SSLContext sslc; - - private SSLEngine clientEngine; // client Engine - private ByteBuffer clientOut; // write side of clientEngine - private ByteBuffer clientIn; // read side of clientEngine - - private SSLEngine serverEngine; // server Engine - private ByteBuffer serverOut; // write side of serverEngine - private ByteBuffer serverIn; // read side of serverEngine - - /* - * For data transport, this example uses local ByteBuffers. This - * isn't really useful, but the purpose of this example is to show - * SSLEngine concepts, not how to do network transport. - */ - private ByteBuffer cTOs; // "reliable" transport client->server - private ByteBuffer sTOc; // "reliable" transport server->client - - /* - * The following is to set up the keystores. - */ - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; - /* * Main entry point for this test. */ @@ -147,26 +112,38 @@ * Create an initialized SSLContext to use for these tests. */ public DebugReportsOneExtraByte() throws Exception { + super(); + } - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); + @Override + protected SSLEngine configureServerEngine(SSLEngine serverEngine) { + serverEngine.setUseClientMode(false); + // Force a block-oriented ciphersuite. + serverEngine.setEnabledCipherSuites( + new String [] {"TLS_RSA_WITH_AES_128_CBC_SHA"}); + return serverEngine; + } - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); + @Override + protected ContextParameters getClientContextParameters() { + return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); + } - SSLContext sslCtx = SSLContext.getInstance("TLSv1"); + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); + } - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + @Override + protected ByteBuffer createClientOutputBuffer() { + // No need to write anything on the client side, it will + // just confuse the output. + return ByteBuffer.wrap("".getBytes()); + } - sslc = sslCtx; + @Override + protected ByteBuffer createServerOutputBuffer() { + return ByteBuffer.wrap("Hi Client!".getBytes()); } /* @@ -189,9 +166,6 @@ private void runTest() throws Exception { boolean dataDone = false; - createSSLEngines(); - createBuffers(); - SSLEngineResult clientResult; // results from client's last operation SSLEngineResult serverResult; // results from server's last operation @@ -217,11 +191,11 @@ clientResult = clientEngine.wrap(clientOut, cTOs); log("client wrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); serverResult = serverEngine.wrap(serverOut, sTOc); log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); // Next wrap will split. if (serverOut.position() == 1) { @@ -235,11 +209,11 @@ clientResult = clientEngine.unwrap(sTOc, clientIn); log("client unwrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); serverResult = serverEngine.unwrap(cTOs, serverIn); log("server unwrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); cTOs.compact(); sTOc.compact(); @@ -266,112 +240,11 @@ } } - /* - * Using the SSLContext created during object creation, - * create/configure the SSLEngines we'll use for this test. - */ - private void createSSLEngines() throws Exception { - /* - * Configure the serverEngine to act as a server in the SSL/TLS - * handshake. Also, require SSL client authentication. - */ - serverEngine = sslc.createSSLEngine(); - serverEngine.setUseClientMode(false); - serverEngine.setNeedClientAuth(true); - - // Force a block-oriented ciphersuite. - serverEngine.setEnabledCipherSuites( - new String [] {"TLS_RSA_WITH_AES_128_CBC_SHA"}); - - /* - * Similar to above, but using client mode instead. - */ - clientEngine = sslc.createSSLEngine("client", 80); - clientEngine.setUseClientMode(true); - } - - /* - * Create and size the buffers appropriately. - */ - private void createBuffers() { - - /* - * We'll assume the buffer sizes are the same - * between client and server. - */ - SSLSession session = clientEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - /* - * We'll make the input buffers a bit bigger than the max needed - * size, so that unwrap()s following a successful data transfer - * won't generate BUFFER_OVERFLOWS. - * - * We'll use a mix of direct and indirect ByteBuffers for - * tutorial purposes only. In reality, only use direct - * ByteBuffers when they give a clear performance enhancement. - */ - clientIn = ByteBuffer.allocate(appBufferMax + 50); - serverIn = ByteBuffer.allocate(appBufferMax + 50); - - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - - // No need to write anything on the client side, it will - // just confuse the output. - clientOut = ByteBuffer.wrap("".getBytes()); - // 10 bytes long - serverOut = ByteBuffer.wrap("Hi Client!".getBytes()); - } - - /* - * If the result indicates that we have outstanding tasks to do, - * go ahead and run them in this thread. - */ - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("\trunning delegated task..."); - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - log("\tnew HandshakeStatus: " + hsStatus); - } - } - private static boolean isEngineClosed(SSLEngine engine) { return (engine.isOutboundDone() && engine.isInboundDone()); } /* - * Simple check to make sure everything came across as expected. - */ - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("\tData transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - - /* * Logging code */ private static boolean resultOnce = true; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,13 +59,13 @@ public static final class SHA extends DigestBase { public SHA() throws Exception { - super("SHA", "SUN"); + super("SHA", System.getProperty("test.provider.name", "SUN")); } } public static final class SHA256 extends DigestBase { public SHA256() throws Exception { - super("SHA-256", "SUN"); + super("SHA-256", System.getProperty("test.provider.name", "SUN")); } } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/HandshakeOutStream/NullCerts.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeOutStream/NullCerts.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/HandshakeOutStream/NullCerts.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/HandshakeOutStream/NullCerts.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 4453053 * @summary If a server shuts down correctly during handshaking, the client * doesn't see it. + * @library /javax/net/ssl/templates * @run main/othervm NullCerts * * SunJSSE does not support dynamic system properties, no way to re-use @@ -34,40 +35,11 @@ */ import java.io.*; -import java.net.*; -import java.security.*; import javax.net.ssl.*; -public class NullCerts { +public class NullCerts extends SSLSocketTemplate { - /* - * ============================================================= - * 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. - */ - private static boolean separateServerThread = true; - - /* - * Where do we find the keystores? - */ - private final static String pathToStores = "../../../../javax/net/ssl/etc"; - private final static String keyStoreFile = "keystore"; - private final static String trustStoreFile = "truststore"; - private final static String passwd = "passphrase"; - private final static char[] cpasswd = "passphrase".toCharArray(); - - /* - * Is the server ready to serve? - */ - volatile static boolean serverReady = false; - - /* + /* * Turn on SSL debugging? */ private final static boolean DEBUG = false; @@ -81,29 +53,22 @@ * smart about it.... */ + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(true); + socket.setUseClientMode(false); + } + /* * Define the server side of the test. * * If the server prematurely exits, serverReady will be set to true * to avoid infinite hangs. */ - private void doServerSide() throws Exception { - SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); - SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort, 3); - sslServerSocket.setNeedClientAuth(true); - - serverPort = sslServerSocket.getLocalPort(); - - /* - * Signal Client, we're ready for his connect. - */ - serverReady = true; - - SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - InputStream sslIS = sslSocket.getInputStream(); - OutputStream sslOS = sslSocket.getOutputStream(); + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { + InputStream sslIS = socket.getInputStream(); + OutputStream sslOS = socket.getOutputStream(); try { sslIS.read(); @@ -115,7 +80,6 @@ + e.toString()); } - sslSocket.close(); System.out.println("Server done and exiting!"); } @@ -125,36 +89,11 @@ * If the server prematurely exits, serverReady will be set to true * to avoid infinite hangs. */ - private void doClientSide() throws Exception { - - /* - * Wait for server to get started. - */ - while (!serverReady) { - Thread.sleep(50); - } + @Override + protected void runClientApplication(SSLSocket sslSocket) throws Exception { System.out.println("Starting test"); - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore uks = KeyStore.getInstance("JKS"); - SSLContext ctx = SSLContext.getInstance("TLS"); - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - - uks.load(new FileInputStream(unknownFilename), cpasswd); - kmf.init(uks, cpasswd); - - ks.load(new FileInputStream(trustFilename), cpasswd); - tmf.init(ks); - - ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - SSLSocketFactory sslsf = - (SSLSocketFactory) ctx.getSocketFactory(); - SSLSocket sslSocket = (SSLSocket) - sslsf.createSocket("localhost", serverPort); - InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); @@ -163,7 +102,6 @@ sslOS.flush(); sslIS.read(); - sslSocket.close(); } catch (IOException e) { String str = "\nYou will either see a bad_certificate SSLException\n" + @@ -174,131 +112,21 @@ } } - /* - * ============================================================= - * The remainder is just support stuff - */ - - // use any free port by default - volatile int serverPort = 0; - - private volatile Exception serverException = null; - private volatile Exception clientException = null; - - private final static String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + keyStoreFile; - private final static String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; - private final static String unknownFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + "unknown_keystore"; + @Override + protected KeyManager createClientKeyManager() throws Exception { + return createKeyManager(new Cert[]{Cert.DSA_SHA1_1024_EXPIRED}, + getClientContextParameters()); + } // Used for running test standalone public static void main(String[] args) throws Exception { - String testRoot = System.getProperty("test.src", "."); - 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 NullCerts(); - } - - private Thread clientThread = null; - private Thread serverThread = null; - - /* - * Primary constructor, used to drive remainder of the test. - * - * Fork off the other side, then do your work. - */ - NullCerts() 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.err.print("Server Exception:"); - throw serverException; - } - if (clientException != null) { - System.err.print("Client Exception:"); - throw clientException; - } - } - - private 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..."); - serverReady = true; - serverException = e; - } - } - }; - serverThread.start(); - } else { - doServerSide(); - } - } - - private 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(); - } + new NullCerts().run(); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ * @bug 4969799 * @summary javax.net.ssl.SSLSocket.SSLSocket(InetAddress,int) shouldn't * throw exception + * @library /javax/net/ssl/templates * @run main/othervm CloseEngineException */ @@ -40,128 +41,85 @@ // import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; // Note that this test case depends on JSSE provider implementation details. -public class CloseEngineException { +public class CloseEngineException extends SSLEngineTemplate { private static boolean debug = true; - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - /* - * Majority of the test case is here, setup is done below. - */ - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine(); - ssle2.setUseClientMode(false); - ssle2.setNeedClientAuth(true); - } - private void runTest() throws Exception { boolean dataDone = false; - createSSLEngines(); - createBuffers(); - - SSLEngineResult result1; // ssle1's results from last operation + SSLEngineResult result1; // clientEngine's results from last operation SSLEngineResult result2; // ssle2's results from last operation - while (!isEngineClosed(ssle1) && !isEngineClosed(ssle2)) { + while (!isEngineClosed(clientEngine) && !isEngineClosed(serverEngine)) { log("================"); - if (!isEngineClosed(ssle1)) { - result1 = ssle1.wrap(appOut1, oneToTwo); - runDelegatedTasks(result1, ssle1); + if (!isEngineClosed(clientEngine)) { + result1 = clientEngine.wrap(clientOut, cTOs); + runDelegatedTasks(clientEngine); log("wrap1: " + result1); - log("oneToTwo = " + oneToTwo); + log("oneToTwo = " + cTOs); log(""); - oneToTwo.flip(); + cTOs.flip(); } - if (!isEngineClosed(ssle2)) { - result2 = ssle2.wrap(appOut2, twoToOne); - runDelegatedTasks(result2, ssle2); + if (!isEngineClosed(serverEngine)) { + result2 = serverEngine.wrap(serverOut, sTOc); + runDelegatedTasks(serverEngine); log("wrap2: " + result2); - log("twoToOne = " + twoToOne); + log("twoToOne = " + sTOc); - twoToOne.flip(); + sTOc.flip(); } log("----"); - if (!isEngineClosed(ssle1) && !dataDone) { + if (!isEngineClosed(clientEngine) && !dataDone) { log("--"); - result1 = ssle1.unwrap(twoToOne, appIn1); - runDelegatedTasks(result1, ssle1); + result1 = clientEngine.unwrap(sTOc, clientIn); + runDelegatedTasks(clientEngine); log("unwrap1: " + result1); - log("twoToOne = " + twoToOne); + log("twoToOne = " + sTOc); log(""); - twoToOne.compact(); + sTOc.compact(); } - if (!isEngineClosed(ssle2)) { + if (!isEngineClosed(serverEngine)) { log("---"); - result2 = ssle2.unwrap(oneToTwo, appIn2); - runDelegatedTasks(result2, ssle2); + result2 = serverEngine.unwrap(cTOs, serverIn); + runDelegatedTasks(serverEngine); log("unwrap2: " + result2); - log("oneToTwo = " + oneToTwo); + log("oneToTwo = " + cTOs); - oneToTwo.compact(); + cTOs.compact(); } /* * If we've transfered all the data between app1 and app2, * we try to close and see what that gets us. */ - if (!dataDone && (appOut1.limit() == appIn2.position()) && - (appOut2.limit() == appIn1.position())) { + if (!dataDone && (clientOut.limit() == serverIn.position()) && + (serverOut.limit() == clientIn.position())) { - checkTransfer(appOut1, appIn2); - checkTransfer(appOut2, appIn1); + checkTransfer(clientOut, serverIn); + checkTransfer(serverOut, clientIn); - log("Closing ssle1's *OUTBOUND*..."); - ssle1.closeOutbound(); + log("Closing clientEngine's *OUTBOUND*..."); + clientEngine.closeOutbound(); dataDone = true; try { /* * Check that closed Outbound generates. */ - ssle1.beginHandshake(); + clientEngine.beginHandshake(); throw new Exception( "TEST FAILED: didn't throw Exception"); } catch (SSLException e) { @@ -174,7 +132,7 @@ /* * Check that closed Inbound generates. */ - ssle2.beginHandshake(); + serverEngine.beginHandshake(); throw new Exception( "TEST FAILED: didn't throw Exception"); } catch (SSLException e) { @@ -184,12 +142,7 @@ public static void main(String args[]) throws Exception { - CloseEngineException test; - - test = new CloseEngineException(); - - test.createSSLEngines(); - + CloseEngineException test = new CloseEngineException(); test.runTest(); System.err.println("Test Passed."); @@ -202,90 +155,20 @@ */ public CloseEngineException() throws Exception { - sslc = getSSLContext(keyFilename, trustFilename); - } - - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext(String keyFile, String trustFile) - throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; - } - - private void createBuffers() { - // Size the buffers as appropriate. - - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); - - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); - log(""); + super(); } - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("running delegated task..."); - runnable.run(); - } - } + @Override + protected SSLEngine configureServerEngine(SSLEngine engine) { + engine.setUseClientMode(false); + engine.setNeedClientAuth(true); + return engine; } private static boolean isEngineClosed(SSLEngine engine) { return (engine.isOutboundDone() && engine.isInboundDone()); } - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("Data transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - private static void log(String str) { if (debug) { System.err.println(str); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/CloseStart.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseStart.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/CloseStart.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/CloseStart.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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,6 +30,7 @@ * @test * @bug 5019096 * @summary Add scatter/gather APIs for SSLEngine + * @library /javax/net/ssl/templates * @run main/othervm CloseStart */ @@ -38,26 +39,8 @@ // import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; - -public class CloseStart { - - private static boolean debug = false; - - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; + +public class CloseStart extends SSLContextTemplate { private static void checkDone(SSLEngine ssle) throws Exception { if (!ssle.isInboundDone()) { @@ -74,14 +57,17 @@ } public static void main(String args[]) throws Exception { + new CloseStart().run(); + } - SSLEngine ssle = createSSLEngine(keyFilename, trustFilename); + private void run() throws Exception { + SSLEngine ssle = createSSLEngine(); ssle.closeInbound(); if (!ssle.isInboundDone()) { throw new Exception("isInboundDone isn't done"); } - ssle = createSSLEngine(keyFilename, trustFilename); + ssle = createSSLEngine(); ssle.closeOutbound(); if (!ssle.isOutboundDone()) { throw new Exception("isOutboundDone isn't done"); @@ -93,30 +79,10 @@ /* * Create an initialized SSLContext to use for this test. */ - static private SSLEngine createSSLEngine(String keyFile, String trustFile) - throws Exception { - - SSLEngine ssle; - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + private SSLEngine createSSLEngine() throws Exception { - ssle = sslCtx.createSSLEngine("client", 1001); + SSLContext sslCtx = createClientSSLContext(); + SSLEngine ssle = sslCtx.createSSLEngine("client", 1001); ssle.setUseClientMode(true); return ssle; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/DelegatedTaskWrongException.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/DelegatedTaskWrongException.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/DelegatedTaskWrongException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/DelegatedTaskWrongException.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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,72 +30,38 @@ * @test * @bug 4969459 * @summary Delegated tasks are not reflecting the subclasses of SSLException + * @library /javax/net/ssl/templates * @run main/othervm DelegatedTaskWrongException */ import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; import java.security.*; -import java.nio.*; -public class DelegatedTaskWrongException { +public class DelegatedTaskWrongException extends SSLEngineTemplate { private static boolean debug = false; - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - /* - * Majority of the test case is here, setup is done below. - */ - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine(); - ssle2.setUseClientMode(false); + @Override + protected SSLEngine configureServerEngine(SSLEngine engine) { + engine.setUseClientMode(false); + engine.setEnabledProtocols(new String [] { "TLSv1" }); + return engine; + } - ssle1.setEnabledProtocols(new String [] { "SSLv3" }); - ssle2.setEnabledProtocols(new String [] { "TLSv1" }); + @Override + protected SSLEngine configureClientEngine(SSLEngine engine) { + engine.setUseClientMode(true); + engine.setEnabledProtocols(new String [] { "SSLv3" }); + return engine; } private void runTest() throws Exception { - boolean dataDone = false; - createSSLEngines(); - createBuffers(); + clientEngine.wrap(clientOut, cTOs); + cTOs.flip(); - SSLEngineResult result1; // ssle1's results from last operation - SSLEngineResult result2; // ssle2's results from last operation - - result1 = ssle1.wrap(appOut1, oneToTwo); - oneToTwo.flip(); - - result2 = ssle2.unwrap(oneToTwo, appIn2); - - runDelegatedTasks(result2, ssle2); + serverEngine.unwrap(cTOs, serverIn); + runDelegatedTasks(serverEngine); try { /* @@ -103,7 +69,7 @@ * If this changes, we'll need to update this test. * Anything else and we fail. */ - result2 = ssle2.unwrap(oneToTwo, appIn2); + serverEngine.unwrap(cTOs, serverIn); throw new Exception( "TEST FAILED: Didn't generate any exception"); } catch (SSLHandshakeException e) { @@ -119,12 +85,7 @@ // and keys used in this test are not disabled. Security.setProperty("jdk.tls.disabledAlgorithms", ""); - DelegatedTaskWrongException test; - - test = new DelegatedTaskWrongException(); - - test.createSSLEngines(); - + DelegatedTaskWrongException test = new DelegatedTaskWrongException(); test.runTest(); System.out.println("Test Passed."); @@ -137,88 +98,7 @@ */ public DelegatedTaskWrongException() throws Exception { - sslc = getSSLContext(keyFilename, trustFilename); - } - - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext(String keyFile, String trustFile) - throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; - } - - private void createBuffers() { - // Size the buffers as appropriate. - - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); - - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); - log(""); - } - - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("running delegated task..."); - runnable.run(); - } - } - } - - private static boolean isEngineClosed(SSLEngine engine) { - return (engine.isOutboundDone() && engine.isInboundDone()); - } - - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("Data transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); + super(); } private static void log(String str) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/EmptyExtensionData.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EmptyExtensionData.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/EmptyExtensionData.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EmptyExtensionData.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, 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,44 +30,21 @@ * @test * @bug 6728126 * @summary Parsing Extensions in Client Hello message is done in a wrong way - * @library /test/lib + * @library /test/lib /javax/net/ssl/templates * @run main/othervm EmptyExtensionData */ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; import java.nio.*; import jdk.test.lib.security.SecurityUtils; -public class EmptyExtensionData { +public class EmptyExtensionData extends SSLContextTemplate { private static boolean debug = false; - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private static void checkDone(SSLEngine ssle) throws Exception { - if (!ssle.isInboundDone()) { - throw new Exception("isInboundDone isn't done"); - } - if (!ssle.isOutboundDone()) { - throw new Exception("isOutboundDone isn't done"); - } - } - - private static void runTest(SSLEngine ssle) throws Exception { + private void runTest(SSLEngine ssle) throws Exception { // a client hello message with an empty extension data byte[] msg_clihello = { (byte)0x16, (byte)0x03, (byte)0x01, (byte)0x00, @@ -138,7 +115,7 @@ * If the result indicates that we have outstanding tasks to do, * go ahead and run them in this thread. */ - private static void runDelegatedTasks(SSLEngineResult result, + private void runDelegatedTasks(SSLEngineResult result, SSLEngine engine) throws Exception { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { @@ -159,46 +136,17 @@ public static void main(String args[]) throws Exception { // Re-enable TLSv1 since test depends on it. SecurityUtils.removeFromDisabledTlsAlgs("TLSv1"); - - SSLEngine ssle = createSSLEngine(keyFilename, trustFilename); - runTest(ssle); - - System.out.println("Test Passed."); + new EmptyExtensionData().run(); } - /* - * Create an initialized SSLContext to use for this test. - */ - static private SSLEngine createSSLEngine(String keyFile, String trustFile) - throws Exception { - - SSLEngine ssle; - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - ssle = sslCtx.createSSLEngine(); + private void run() throws Exception { + SSLEngine ssle = createServerSSLContext().createSSLEngine(); ssle.setUseClientMode(false); + runTest(ssle); - return ssle; + System.out.println("Test Passed."); } - private static void log(String str) { if (debug) { System.out.println(str); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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,67 +30,34 @@ * @test * @bug 4980882 8207250 8237474 * @summary SSLEngine should enforce setUseClientMode + * @library /javax/net/ssl/templates * @run main/othervm EngineEnforceUseClientMode * @author Brad R. Wetmore */ import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; -public class EngineEnforceUseClientMode { +public class EngineEnforceUseClientMode extends SSLEngineTemplate { private static boolean debug = false; - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private SSLEngine ssle3; // server - private SSLEngine ssle4; // server - private SSLEngine ssle5; // server - - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 + private SSLEngine serverEngine2; // server + private SSLEngine serverEngine3; // server + private SSLEngine serverEngine4; // server /* * Majority of the test case is here, setup is done below. */ - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine(); - ssle2.setUseClientMode(false); - ssle2.setNeedClientAuth(true); - + private void createAdditionalSSLEngines() throws Exception { + SSLContext sslc = createServerSSLContext(); /* * Note, these are not initialized to client/server */ - ssle3 = sslc.createSSLEngine(); - ssle4 = sslc.createSSLEngine(); - ssle5 = sslc.createSSLEngine(); + serverEngine2 = sslc.createSSLEngine(); + serverEngine3 = sslc.createSSLEngine(); + serverEngine4 = sslc.createSSLEngine(); //Check default SSLEngine role. - if (ssle5.getUseClientMode()) { + if (serverEngine4.getUseClientMode()) { throw new RuntimeException("Expected default role to be server"); } @@ -98,8 +65,7 @@ private void runTest() throws Exception { - createSSLEngines(); - createBuffers(); + createAdditionalSSLEngines(); /* * First try the engines with no client/server initialization @@ -107,35 +73,35 @@ */ try { System.out.println("Testing wrap()"); - ssle3.wrap(appOut1, oneToTwo); + serverEngine2.wrap(clientOut, cTOs); throw new RuntimeException( "wrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { System.out.println("Caught the correct exception."); - oneToTwo.flip(); - if (oneToTwo.hasRemaining()) { + cTOs.flip(); + if (cTOs.hasRemaining()) { throw new Exception("wrap generated data"); } - oneToTwo.clear(); + cTOs.clear(); } try { System.out.println("Testing unwrap()"); - ssle4.unwrap(oneToTwo, appIn1); + serverEngine3.unwrap(cTOs, clientIn); throw new RuntimeException( "unwrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { System.out.println("Caught the correct exception."); - appIn1.flip(); - if (appIn1.hasRemaining()) { + clientIn.flip(); + if (clientIn.hasRemaining()) { throw new Exception("unwrap generated data"); } - appIn1.clear(); + clientIn.clear(); } try { System.out.println("Testing beginHandshake()"); - ssle5.beginHandshake(); + serverEngine4.beginHandshake(); throw new RuntimeException( "unwrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { @@ -147,60 +113,60 @@ SSLEngineResult result1; // ssle1's results from last operation SSLEngineResult result2; // ssle2's results from last operation - while (!isEngineClosed(ssle1) || !isEngineClosed(ssle2)) { + while (!isEngineClosed(clientEngine) || !isEngineClosed(serverEngine)) { log("================"); - result1 = ssle1.wrap(appOut1, oneToTwo); - result2 = ssle2.wrap(appOut2, twoToOne); + result1 = clientEngine.wrap(clientOut, cTOs); + result2 = serverEngine.wrap(serverOut, sTOc); log("wrap1: " + result1); - log("oneToTwo = " + oneToTwo); + log("oneToTwo = " + cTOs); log(""); log("wrap2: " + result2); - log("twoToOne = " + twoToOne); + log("twoToOne = " + sTOc); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + runDelegatedTasks(clientEngine); + runDelegatedTasks(serverEngine); - oneToTwo.flip(); - twoToOne.flip(); + cTOs.flip(); + sTOc.flip(); log("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); - result2 = ssle2.unwrap(oneToTwo, appIn2); + result1 = clientEngine.unwrap(sTOc, clientIn); + result2 = serverEngine.unwrap(cTOs, serverIn); log("unwrap1: " + result1); - log("twoToOne = " + twoToOne); + log("twoToOne = " + sTOc); log(""); log("unwrap2: " + result2); - log("oneToTwo = " + oneToTwo); + log("oneToTwo = " + cTOs); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + runDelegatedTasks(clientEngine); + runDelegatedTasks(serverEngine); - oneToTwo.compact(); - twoToOne.compact(); + cTOs.compact(); + sTOc.compact(); /* * If we've transfered all the data between app1 and app2, * we try to close and see what that gets us. */ - if (!dataDone && (appOut1.limit() == appIn2.position()) && - (appOut2.limit() == appIn1.position())) { + if (!dataDone && (clientOut.limit() == serverIn.position()) && + (serverOut.limit() == clientIn.position())) { - checkTransfer(appOut1, appIn2); - checkTransfer(appOut2, appIn1); + checkTransfer(clientOut, serverIn); + checkTransfer(serverOut, clientIn); // Should not be able to set mode now, no matter if // it is the same of different. System.out.println("Try changing modes..."); for (boolean b : new Boolean[] {true, false}) { try { - ssle2.setUseClientMode(b); + serverEngine.setUseClientMode(b); throw new RuntimeException( "setUseClientMode(" + b + "): " + "Didn't catch the exception properly"); @@ -216,12 +182,8 @@ public static void main(String args[]) throws Exception { - EngineEnforceUseClientMode test; - - test = new EngineEnforceUseClientMode(); - - test.createSSLEngines(); - + EngineEnforceUseClientMode test = new EngineEnforceUseClientMode(); + test.createAdditionalSSLEngines(); test.runTest(); System.out.println("Test Passed."); @@ -234,89 +196,13 @@ */ public EngineEnforceUseClientMode() throws Exception { - sslc = getSSLContext(keyFilename, trustFilename); - } - - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext(String keyFile, String trustFile) - throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; - } - - private void createBuffers() { - // Size the buffers as appropriate. - - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); - - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); - log(""); - } - - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("running delegated task..."); - runnable.run(); - } - } + super(); } private static boolean isEngineClosed(SSLEngine engine) { return (engine.isOutboundDone() && engine.isInboundDone()); } - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("Data transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } private static void log(String str) { if (debug) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ * @bug 6207322 * @summary SSLEngine is returning a premature FINISHED message when doing * an abbreviated handshake. + * @library /javax/net/ssl/templates * @run main/othervm RehandshakeFinished * @author Brad Wetmore */ @@ -86,11 +87,9 @@ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; import java.nio.*; -public class RehandshakeFinished { +public class RehandshakeFinished extends SSLContextTemplate { /* * Enables logging of the SSLEngine operations. @@ -108,7 +107,7 @@ */ private static boolean debug = false; - static private SSLContext sslc; + private final SSLContext sslc; private SSLEngine clientEngine; // client Engine private ByteBuffer clientOut; // write side of clientEngine @@ -126,46 +125,8 @@ private ByteBuffer cTOs; // "reliable" transport client->server private ByteBuffer sTOc; // "reliable" transport server->client - /* - * The following is to set up the keystores. - */ - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private static Exception loadException = null; - - static { - try { - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = - TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLSv1.2"); - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - sslc = sslCtx; - } catch (Exception e) { - loadException = e; - } + public RehandshakeFinished() throws Exception { + sslc = createServerSSLContext(); } /* @@ -176,14 +137,10 @@ System.setProperty("javax.net.debug", "all"); } - if (loadException != null) { - throw loadException; - } - + RehandshakeFinished test = new RehandshakeFinished(); // Prime the session cache with a good session // Second connection should be a simple session resumption. - if ((new RehandshakeFinished().runTest()) != - new RehandshakeFinished().runRehandshake()) { + if (test.runTest() != test.runRehandshake()) { throw new Exception("Sessions not equivalent"); } @@ -412,6 +369,11 @@ clientEngine.setUseClientMode(true); } + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLSv1.2", "PKIX", "NewSunX509"); + } + /* * Create and size the buffers appropriately. */ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineDeadlock.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineDeadlock.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineDeadlock.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineDeadlock.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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,6 +28,7 @@ * @test * @bug 6492872 * @summary Deadlock in SSLEngine + * @library /javax/net/ssl/templates * @run main/othervm SSLEngineDeadlock * @author Brad R. Wetmore */ @@ -70,12 +71,9 @@ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; import java.lang.management.*; -public class SSLEngineDeadlock { +public class SSLEngineDeadlock extends SSLEngineTemplate { /* * Enables logging of the SSLEngine operations. @@ -93,42 +91,9 @@ */ private static boolean debug = false; - private SSLContext sslc; - - private SSLEngine clientEngine; // client Engine - private ByteBuffer clientOut; // write side of clientEngine - private ByteBuffer clientIn; // read side of clientEngine - - private SSLEngine serverEngine; // server Engine - private ByteBuffer serverOut; // write side of serverEngine - private ByteBuffer serverIn; // read side of serverEngine - private volatile boolean testDone = false; /* - * For data transport, this example uses local ByteBuffers. This - * isn't really useful, but the purpose of this example is to show - * SSLEngine concepts, not how to do network transport. - */ - private ByteBuffer cTOs; // "reliable" transport client->server - private ByteBuffer sTOc; // "reliable" transport server->client - - /* - * The following is to set up the keystores. - */ - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; - - /* * Main entry point for this test. */ public static void main(String args[]) throws Exception { @@ -154,26 +119,7 @@ * Create an initialized SSLContext to use for these tests. */ public SSLEngineDeadlock() throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - sslc = sslCtx; + super(); } /* @@ -214,9 +160,6 @@ private void runTest() throws Exception { boolean dataDone = false; - createSSLEngines(); - createBuffers(); - SSLEngineResult clientResult; // results from client's last operation SSLEngineResult serverResult; // results from server's last operation @@ -287,83 +230,11 @@ testDone = true; } - /* - * Using the SSLContext created during object creation, - * create/configure the SSLEngines we'll use for this test. - */ - private void createSSLEngines() throws Exception { - /* - * Configure the serverEngine to act as a server in the SSL/TLS - * handshake. Also, require SSL client authentication. - */ - serverEngine = sslc.createSSLEngine(); - serverEngine.setUseClientMode(false); - serverEngine.setNeedClientAuth(true); - - /* - * Similar to above, but using client mode instead. - */ - clientEngine = sslc.createSSLEngine("client", 80); - clientEngine.setUseClientMode(true); - } - - /* - * Create and size the buffers appropriately. - */ - private void createBuffers() { - - /* - * We'll assume the buffer sizes are the same - * between client and server. - */ - SSLSession session = clientEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - /* - * We'll make the input buffers a bit bigger than the max needed - * size, so that unwrap()s following a successful data transfer - * won't generate BUFFER_OVERFLOWS. - * - * We'll use a mix of direct and indirect ByteBuffers for - * tutorial purposes only. In reality, only use direct - * ByteBuffers when they give a clear performance enhancement. - */ - clientIn = ByteBuffer.allocate(appBufferMax + 50); - serverIn = ByteBuffer.allocate(appBufferMax + 50); - - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - - clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); - serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); - } - private static boolean isEngineClosed(SSLEngine engine) { return (engine.isOutboundDone() && engine.isInboundDone()); } /* - * Simple check to make sure everything came across as expected. - */ - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("\tData transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - - /* * Detect dead lock */ private static void detectDeadLock() throws Exception { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineFailedALPN.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineFailedALPN.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineFailedALPN.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineFailedALPN.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ -29,6 +29,7 @@ * @bug 8207317 * @summary SSLEngine negotiation fail Exception behavior changed from * fail-fast to fail-lazy + * @library /javax/net/ssl/templates * @run main/othervm SSLEngineFailedALPN */ /** @@ -68,11 +69,8 @@ */ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; -public class SSLEngineFailedALPN { +public class SSLEngineFailedALPN extends SSLEngineTemplate { /* * Enables logging of the SSLEngine operations. @@ -90,39 +88,6 @@ */ private static final boolean debug = false; - private final SSLContext sslc; - - private SSLEngine clientEngine; // client Engine - private ByteBuffer clientOut; // write side of clientEngine - private ByteBuffer clientIn; // read side of clientEngine - - private SSLEngine serverEngine; // server Engine - private ByteBuffer serverOut; // write side of serverEngine - private ByteBuffer serverIn; // read side of serverEngine - - /* - * For data transport, this example uses local ByteBuffers. This - * isn't really useful, but the purpose of this example is to show - * SSLEngine concepts, not how to do network transport. - */ - private ByteBuffer cTOs; // "reliable" transport client->server - private ByteBuffer sTOc; // "reliable" transport server->client - - /* - * The following is to set up the keystores. - */ - private static final String pathToStores = "../../../../javax/net/ssl/etc"; - private static final String keyStoreFile = "keystore"; - private static final String trustStoreFile = "truststore"; - private static final char[] passphrase = "passphrase".toCharArray(); - - private static final String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + keyStoreFile; - private static final String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; - /* * Main entry point for this test. */ @@ -141,24 +106,7 @@ * Create an initialized SSLContext to use for these tests. */ public SSLEngineFailedALPN() throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - sslc = sslCtx; + super(); } /* @@ -181,9 +129,6 @@ private void runTest() throws Exception { boolean dataDone = false; - createSSLEngines(); - createBuffers(); - // results from client's last operation SSLEngineResult clientResult; @@ -309,87 +254,27 @@ log("\tisOutboundDone(): " + engine.isOutboundDone()); } - /* - * Using the SSLContext created during object creation, - * create/configure the SSLEngines we'll use for this test. - */ - private void createSSLEngines() throws Exception { - /* - * Configure the serverEngine to act as a server in the SSL/TLS - * handshake. Also, require SSL client authentication. - */ - serverEngine = sslc.createSSLEngine(); - serverEngine.setUseClientMode(false); - serverEngine.setNeedClientAuth(true); + @Override + protected SSLEngine configureServerEngine(SSLEngine engine) { + engine.setUseClientMode(false); + engine.setNeedClientAuth(true); // Get/set parameters if needed - SSLParameters paramsServer = serverEngine.getSSLParameters(); + SSLParameters paramsServer = engine.getSSLParameters(); paramsServer.setApplicationProtocols(new String[]{"one"}); - serverEngine.setSSLParameters(paramsServer); + engine.setSSLParameters(paramsServer); + return engine; + } - /* - * Similar to above, but using client mode instead. - */ - clientEngine = sslc.createSSLEngine("client", 80); - clientEngine.setUseClientMode(true); + @Override + protected SSLEngine configureClientEngine(SSLEngine engine) { + engine.setUseClientMode(true); // Get/set parameters if needed - SSLParameters paramsClient = clientEngine.getSSLParameters(); + SSLParameters paramsClient = engine.getSSLParameters(); paramsClient.setApplicationProtocols(new String[]{"two"}); - clientEngine.setSSLParameters(paramsClient); - } - - /* - * Create and size the buffers appropriately. - */ - private void createBuffers() { - - /* - * We'll assume the buffer sizes are the same - * between client and server. - */ - SSLSession session = clientEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - /* - * We'll make the input buffers a bit bigger than the max needed - * size, so that unwrap()s following a successful data transfer - * won't generate BUFFER_OVERFLOWS. - * - * We'll use a mix of direct and indirect ByteBuffers for - * tutorial purposes only. In reality, only use direct - * ByteBuffers when they give a clear performance enhancement. - */ - clientIn = ByteBuffer.allocate(appBufferMax + 50); - serverIn = ByteBuffer.allocate(appBufferMax + 50); - - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - - clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); - serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); - } - - /* - * If the result indicates that we have outstanding tasks to do, - * go ahead and run them in this thread. - */ - private static void runDelegatedTasks(SSLEngine engine) throws Exception { - - if (engine.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log(" running delegated task..."); - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - logEngineStatus(engine); - } + engine.setSSLParameters(paramsClient); + return engine; } private static boolean isEngineClosed(SSLEngine engine) { @@ -397,26 +282,6 @@ } /* - * Simple check to make sure everything came across as expected. - */ - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("\tData transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - - /* * Logging code */ private static boolean resultOnce = true; diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java 2025-01-04 20:25:18.000000000 +0000 @@ -25,7 +25,8 @@ * @test * @bug 8164879 8300285 * @library ../../ - * @library /test/lib + * /test/lib + * /javax/net/ssl/templates * @summary Verify AEAD TLS cipher suite limits set in the jdk.tls.keyLimits * property * start a new handshake sequence to renegotiate the symmetric key with an @@ -49,23 +50,19 @@ * success. */ -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; -import javax.net.ssl.TrustManagerFactory; import java.io.File; import java.io.PrintWriter; import java.nio.ByteBuffer; -import java.security.KeyStore; -import java.security.SecureRandom; import java.util.Arrays; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; -public class SSLEngineKeyLimit { +public class SSLEngineKeyLimit extends SSLContextTemplate { SSLEngine eng; static ByteBuffer cTos; @@ -73,11 +70,6 @@ static ByteBuffer outdata; ByteBuffer buf; static boolean ready = false; - - static String pathToStores = "../../../../javax/net/ssl/etc/"; - static String keyStoreFile = "keystore"; - static String passwd = "passphrase"; - static String keyFilename; static int dataLen = 10240; static boolean serverwrite = true; int totalDataLen = 0; @@ -126,7 +118,7 @@ System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1], args[2])); @@ -164,13 +156,6 @@ } cTos = ByteBuffer.allocateDirect(dataLen*4); - keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - - System.setProperty("javax.net.ssl.keyStore", keyFilename); - System.setProperty("javax.net.ssl.keyStorePassword", passwd); - sToc = ByteBuffer.allocateDirect(dataLen*4); outdata = ByteBuffer.allocateDirect(dataLen); @@ -412,19 +397,12 @@ SSLContext initContext() throws Exception { - SSLContext sc = SSLContext.getInstance("TLSv1.3"); - KeyStore ks = KeyStore.getInstance( - new File(System.getProperty("javax.net.ssl.keyStore")), - passwd.toCharArray()); - KeyManagerFactory kmf = KeyManagerFactory.getInstance( - KeyManagerFactory.getDefaultAlgorithm()); - kmf.init(ks, passwd.toCharArray()); - TrustManagerFactory tmf = TrustManagerFactory.getInstance( - TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - sc.init(kmf.getKeyManagers(), - tmf.getTrustManagers(), new SecureRandom()); - return sc; + return createServerSSLContext(); + } + + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLSv1.3", "PKIX", "NewSunX509"); } static class Server extends SSLEngineKeyLimit implements Runnable { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,52 +25,36 @@ * @test * @summary Test SSLEngine.begineHandshake() triggers a KeyUpdate handshake * in TLSv1.3 + * @library /javax/net/ssl/templates * @run main/othervm TLS13BeginHandshake */ -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; -import javax.net.ssl.SSLEngineResult.HandshakeStatus; -import javax.net.ssl.SSLSession; -import javax.net.ssl.TrustManagerFactory; -import java.io.File; -import java.nio.ByteBuffer; -import java.security.KeyStore; -import java.security.SecureRandom; - -public class TLS13BeginHandshake { - static String pathToStores = - System.getProperty("test.src") + "/../../../../javax/net/ssl/etc/"; - static String keyStoreFile = "keystore"; - static String passwd = "passphrase"; - private SSLEngine serverEngine, clientEngine; +public class TLS13BeginHandshake extends SSLEngineTemplate { SSLEngineResult clientResult, serverResult; - private ByteBuffer clientOut, clientIn; - private ByteBuffer serverOut, serverIn; - private ByteBuffer cTOs,sTOc; public static void main(String args[]) throws Exception{ new TLS13BeginHandshake().runDemo(); } + public TLS13BeginHandshake() throws Exception { + super(); + } + private void runDemo() throws Exception { int done = 0; - createSSLEngines(); - createBuffers(); - while (!isEngineClosed(clientEngine) || !isEngineClosed(serverEngine)) { System.out.println("================"); clientResult = clientEngine.wrap(clientOut, cTOs); System.out.println("client wrap: " + clientResult); - runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(clientEngine); serverResult = serverEngine.wrap(serverOut, sTOc); System.out.println("server wrap: " + serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); cTOs.flip(); sTOc.flip(); @@ -80,10 +64,11 @@ System.out.println("client unwrap: " + clientResult); if (clientResult.getStatus() == SSLEngineResult.Status.CLOSED) { break; - } runDelegatedTasks(clientResult, clientEngine); + } + runDelegatedTasks(clientEngine); serverResult = serverEngine.unwrap(cTOs, serverIn); System.out.println("server unwrap: " + serverResult); - runDelegatedTasks(serverResult, serverEngine); + runDelegatedTasks(serverEngine); cTOs.compact(); sTOc.compact(); @@ -121,71 +106,13 @@ return (engine.isOutboundDone() && engine.isInboundDone()); } - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - System.out.println("\tData transferred cleanly"); - } - - a.compact(); - b.compact(); - - } - private void createBuffers() { - SSLSession session = clientEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - clientIn = ByteBuffer.allocate(appBufferMax + 50); - serverIn = ByteBuffer.allocate(appBufferMax + 50); - - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - - clientOut = ByteBuffer.wrap("client".getBytes()); - serverOut = ByteBuffer.wrap("server".getBytes()); - } - - private void createSSLEngines() throws Exception { - serverEngine = initContext().createSSLEngine(); - serverEngine.setUseClientMode(false); - serverEngine.setNeedClientAuth(true); - - clientEngine = initContext().createSSLEngine("client", 80); - clientEngine.setUseClientMode(true); - } - - private SSLContext initContext() throws Exception { - SSLContext sc = SSLContext.getInstance("TLSv1.3"); - KeyStore ks = KeyStore.getInstance(new File(pathToStores + keyStoreFile), - passwd.toCharArray()); - KeyManagerFactory kmf = - KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - kmf.init(ks, passwd.toCharArray()); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); - return sc; + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLSv1.3", "PKIX", "NewSunX509"); } - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - } + @Override + protected ContextParameters getClientContextParameters() { + return new ContextParameters("TLSv1.3", "PKIX", "NewSunX509"); } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/HashCodeMissing.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/HashCodeMissing.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/HashCodeMissing.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/HashCodeMissing.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 * @bug 4910892 * @summary 4518403 was not properly fixed. hashcode should be hashCode. + * @library /javax/net/ssl/templates * @run main/othervm HashCodeMissing * * SunJSSE does not support dynamic system properties, no way to re-use @@ -33,72 +34,19 @@ */ import java.io.*; -import java.net.*; import javax.net.ssl.*; import java.lang.reflect.*; -public class HashCodeMissing { - - /* - * ============================================================= - * 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 = false; - - /* - * 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; +public class HashCodeMissing extends SSLSocketTemplate { /* * Turn on SSL debugging? */ static boolean debug = false; - /* - * If the client or server is doing some kind of object creation - * that the other side depends on, and that thread prematurely - * exits, you may experience a hang. The test harness will - * terminate all hung threads after its timeout has expired, - * currently 3 minutes by default, but you might try to be - * smart about it.... - */ - - /* - * 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(); + @Override + protected void runServerApplication(SSLSocket sslSocket) throws Exception { InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); @@ -106,28 +54,10 @@ sslOS.write(85); sslOS.flush(); - 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 { - - /* - * Wait for server to get started. - */ - while (!serverReady) { - Thread.sleep(50); - } - - SSLSocketFactory sslsf = - (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) - sslsf.createSocket("localhost", serverPort); + @Override + protected void runClientApplication(SSLSocket sslSocket) throws Exception { InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); @@ -150,29 +80,7 @@ System.out.println("Method = " + method); } - /* - * ============================================================= - * The remainder is just support stuff - */ - - // 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"); @@ -180,129 +88,7 @@ /* * Start the tests. */ - new HashCodeMissing(); - } - - Thread clientThread = null; - Thread serverThread = null; - - /* - * Primary constructor, used to drive remainder of the test. - * - * Fork off the other side, then do your work. - */ - HashCodeMissing() throws Exception { - try { - if (separateServerThread) { - startServer(true); - startClient(false); - } else { - startClient(true); - startServer(false); - } - } catch (Exception e) { - //swallow for now. Show later - } - - /* - * Wait for other side to close down. - */ - if (separateServerThread) { - serverThread.join(); - } else { - clientThread.join(); - } - - /* - * When we get here, the test is pretty much over. - * Which side threw the error? - */ - Exception local; - Exception remote; - String whichRemote; - - if (separateServerThread) { - remote = serverException; - local = clientException; - whichRemote = "server"; - } else { - remote = clientException; - local = serverException; - whichRemote = "client"; - } - - /* - * If both failed, return the curthread's exception, but also - * print the remote side Exception - */ - if ((local != null) && (remote != null)) { - System.out.println(whichRemote + " also threw:"); - remote.printStackTrace(); - System.out.println(); - throw local; - } - - if (remote != null) { - throw remote; - } - - if (local != null) { - throw local; - } + new HashCodeMissing().run(); } - 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..."); - serverReady = true; - serverException = e; - } - } - }; - serverThread.start(); - } else { - try { - doServerSide(); - } catch (Exception e) { - serverException = e; - } finally { - serverReady = true; - } - } - } - - 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 { - try { - doClientSide(); - } catch (Exception e) { - clientException = e; - } - } - } } diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ * @bug 8206929 8212885 * @summary ensure that client only resumes a session if certain properties * of the session are compatible with the new connection + * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC @@ -47,13 +48,7 @@ import java.net.*; import java.util.*; -public class ResumeChecksClient { - - static String pathToStores = "../../../../javax/net/ssl/etc"; - static String keyStoreFile = "keystore"; - static String trustStoreFile = "truststore"; - static String passwd = "passphrase"; - +public class ResumeChecksClient extends SSLContextTemplate { enum TestMode { BASIC, VERSION_2_TO_3, @@ -63,38 +58,32 @@ } public static void main(String[] args) throws Exception { + new ResumeChecksClient(TestMode.valueOf(args[0])).run(); + } - TestMode mode = TestMode.valueOf(args[0]); - - 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); + private final TestMode testMode; + public ResumeChecksClient(TestMode mode) { + this.testMode = mode; + } + private void run() throws Exception { Server server = startServer(); server.signal(); - SSLContext sslContext = SSLContext.getDefault(); + SSLContext sslContext = createClientSSLContext(); while (!server.started) { Thread.yield(); } - SSLSession firstSession = connect(sslContext, server.port, mode, false); + SSLSession firstSession = connect(sslContext, server.port, testMode, false); server.signal(); long secondStartTime = System.currentTimeMillis(); Thread.sleep(10); - SSLSession secondSession = connect(sslContext, server.port, mode, true); + SSLSession secondSession = connect(sslContext, server.port, testMode, true); server.go = false; server.signal(); - switch (mode) { + switch (testMode) { case BASIC: // fail if session is not resumed checkResumedSession(firstSession, secondSession); @@ -109,7 +98,7 @@ } break; default: - throw new RuntimeException("unknown mode: " + mode); + throw new RuntimeException("unknown mode: " + testMode); } } @@ -291,7 +280,7 @@ return server; } - private static class Server implements Runnable { + private static class Server extends SSLContextTemplate implements Runnable { public volatile boolean go = true; private boolean signal = false; @@ -317,7 +306,7 @@ public void run() { try { - SSLContext sc = SSLContext.getDefault(); + SSLContext sc = createServerSSLContext(); ServerSocketFactory fac = sc.getServerSocketFactory(); SSLServerSocket ssock = (SSLServerSocket) fac.createServerSocket(0); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8211018 * @summary ensure that client only resumes a session if certain properties * of the session are compatible with the new connection + * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ * @bug 8206929 * @summary ensure that server only resumes a session if certain properties * of the session are compatible with the new connection + * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksServer BASIC @@ -48,12 +49,7 @@ import java.net.*; import java.util.*; -public class ResumeChecksServer { - - static String pathToStores = "../../../../javax/net/ssl/etc"; - static String keyStoreFile = "keystore"; - static String trustStoreFile = "truststore"; - static String passwd = "passphrase"; +public class ResumeChecksServer extends SSLContextTemplate { enum TestMode { BASIC, @@ -66,23 +62,18 @@ public static void main(String[] args) throws Exception { - TestMode mode = TestMode.valueOf(args[0]); + new ResumeChecksServer(TestMode.valueOf(args[0])).run(); + } + private final TestMode testMode; - 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); + public ResumeChecksServer(TestMode testMode) { + this.testMode = testMode; + } + private void run() throws Exception { SSLSession secondSession = null; - SSLContext sslContext = SSLContext.getDefault(); + SSLContext sslContext = createServerSSLContext(); ServerSocketFactory fac = sslContext.getServerSocketFactory(); SSLServerSocket ssock = (SSLServerSocket) fac.createServerSocket(0); @@ -90,7 +81,7 @@ Client client = startClient(ssock.getLocalPort()); try { - connect(client, ssock, mode, false); + connect(client, ssock, testMode, false); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -98,7 +89,7 @@ long secondStartTime = System.currentTimeMillis(); Thread.sleep(10); try { - secondSession = connect(client, ssock, mode, true); + secondSession = connect(client, ssock, testMode, true); } catch (SSLHandshakeException ex) { // this is expected } catch (Exception ex) { @@ -108,7 +99,7 @@ client.go = false; client.signal(); - switch (mode) { + switch (testMode) { case BASIC: // fail if session is not resumed if (secondSession.getCreationTime() > secondStartTime) { @@ -129,7 +120,7 @@ } break; default: - throw new RuntimeException("unknown mode: " + mode); + throw new RuntimeException("unknown mode: " + testMode); } } @@ -244,7 +235,7 @@ return client; } - private static class Client implements Runnable { + private static class Client extends SSLContextTemplate implements Runnable { public volatile boolean go = true; private boolean signal = false; @@ -278,7 +269,7 @@ public void run() { try { - SSLContext sc = SSLContext.getDefault(); + SSLContext sc = createClientSSLContext(); waitForSignal(); while (go) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8211018 * @summary ensure that server only resumes a session if certain properties * of the session are compatible with the new connection + * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer BASIC * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CLIENT_AUTH * @run main/othervm ResumeChecksServer VERSION_2_TO_3 diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java 2025-01-04 20:25:18.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @library /test/lib + * @library /test/lib /javax/net/ssl/templates * @summary Test that a New Session Ticket will be generated when a * SSLSessionBindingListener is set (boundValues) * @run main/othervm ResumptionUpdateBoundValues @@ -47,7 +47,7 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -public class ResumptionUpdateBoundValues { +public class ResumptionUpdateBoundValues extends SSLContextTemplate { static boolean separateServerThread = true; @@ -76,8 +76,7 @@ * to avoid infinite hangs. */ void doServerSide() throws Exception { - SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocketFactory sslssf = createServerSSLContext().getServerSocketFactory(); SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(serverPort); serverPort = sslServerSocket.getLocalPort(); @@ -122,8 +121,7 @@ Thread.sleep(50); } - SSLSocketFactory sslsf = - (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocketFactory sslsf = createClientSSLContext().getSocketFactory(); try { SSLSocket sslSocket = (SSLSocket) @@ -189,7 +187,7 @@ System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("ResumptionUpdateBoundValues", "p")); OutputAnalyzer output = ProcessTools.executeProcess(pb); @@ -209,17 +207,6 @@ return; } - 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"); @@ -227,19 +214,14 @@ * Start the tests. */ - new ResumptionUpdateBoundValues(); + new ResumptionUpdateBoundValues().run(); } ArrayBlockingQueue threads = new ArrayBlockingQueue(100); ArrayBlockingQueue sbListeners = new ArrayBlockingQueue<>(100); - /* - * Primary constructor, used to drive remainder of the test. - * - * Fork off the other side, then do your work. - */ - ResumptionUpdateBoundValues() throws Exception { + private void run() throws Exception { final int count = 1; if (separateServerThread) { startServer(true); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSocketImpl/NotifyHandshakeTest.sh openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/NotifyHandshakeTest.sh --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2024, 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 @@ -86,7 +86,7 @@ # This is the only thing we really care about as far as # test status goes. # -${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \ +${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} ${TESTJAVAOPTS} \ -Dtest.src=${TESTSRC} \ -classpath "com.jar${PATHSEP}edu.jar" \ -Djava.security.manager \ diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java 2025-01-04 20:25:18.000000000 +0000 @@ -134,7 +134,7 @@ System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("SSLSocketKeyLimit", "p", args[1], args[2])); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.security.cert.*; -import java.time.*; -import java.util.*; -import javax.net.ssl.*; -import sun.security.validator.Validator; -import sun.security.validator.ValidatorException; - -import jdk.test.lib.security.SecurityUtils; - -/** - * @test - * @bug 8337664 8341059 - * @summary Check that TLS Server certificates chaining back to distrusted - * Entrust roots are invalid - * @library /test/lib - * @modules java.base/sun.security.validator - * @run main/othervm Distrust after policyOn invalid - * @run main/othervm Distrust after policyOff valid - * @run main/othervm Distrust before policyOn valid - * @run main/othervm Distrust before policyOff valid - */ - -public class Distrust { - - private static final String TEST_SRC = System.getProperty("test.src", "."); - private static CertificateFactory cf; - - // Each of the roots have a test certificate chain stored in a file - // named "-chain.pem". - private static String[] rootsToTest = new String[] { - "entrustevca", "entrustrootcaec1", "entrustrootcag2", "entrustrootcag4", - "entrust2048ca", "affirmtrustcommercialca", "affirmtrustnetworkingca", - "affirmtrustpremiumca", "affirmtrustpremiumeccca" }; - - // A date that is after the restrictions take effect - private static final Date NOVEMBER_12_2024 = - Date.from(LocalDate.of(2024, 11, 12) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the restrictions take effect - private static final Date BEFORE_NOVEMBER_12_2024 = - Date.from(LocalDate.of(2024, 11, 12) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - public static void main(String[] args) throws Exception { - - cf = CertificateFactory.getInstance("X.509"); - - boolean before = args[0].equals("before"); - boolean policyOn = args[1].equals("policyOn"); - boolean isValid = args[2].equals("valid"); - - if (!policyOn) { - // disable policy (default is on) - Security.setProperty("jdk.security.caDistrustPolicies", ""); - } - - Date notBefore = before ? BEFORE_NOVEMBER_12_2024 : NOVEMBER_12_2024; - - X509TrustManager pkixTM = getTMF("PKIX", null); - X509TrustManager sunX509TM = getTMF("SunX509", null); - for (String test : rootsToTest) { - System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); - - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); - } - } - - private static X509TrustManager getTMF(String type, - PKIXBuilderParameters params) throws Exception { - TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); - if (params == null) { - tmf.init((KeyStore)null); - } else { - tmf.init(new CertPathTrustManagerParameters(params)); - } - TrustManager[] tms = tmf.getTrustManagers(); - for (TrustManager tm : tms) { - X509TrustManager xtm = (X509TrustManager)tm; - return xtm; - } - throw new Exception("No TrustManager for " + type); - } - - private static PKIXBuilderParameters getParams() throws Exception { - PKIXBuilderParameters pbp = - new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), - new X509CertSelector()); - pbp.setRevocationEnabled(false); - return pbp; - } - - private static void testTM(X509TrustManager xtm, X509Certificate[] chain, - Date notBefore, boolean valid) throws Exception { - // Check if TLS Server certificate (the first element of the chain) - // is issued after the specified notBefore date (should be rejected - // unless distrust property is false). To do this, we need to - // fake the notBefore date since none of the test certs are issued - // after then. - chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); - - try { - xtm.checkServerTrusted(chain, "ECDHE_RSA"); - if (!valid) { - throw new Exception("chain should be invalid"); - } - } catch (CertificateException ce) { - // expired TLS certificates should not be treated as failure - if (expired(ce)) { - System.err.println("Test is N/A, chain is expired"); - return; - } - if (valid) { - throw new Exception("Unexpected exception, chain " + - "should be valid", ce); - } - if (ce instanceof ValidatorException) { - ValidatorException ve = (ValidatorException)ce; - if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { - ce.printStackTrace(System.err); - throw new Exception("Unexpected exception: " + ce); - } - } else { - throw new Exception("Unexpected exception: " + ce); - } - } - } - - // check if a cause of exception is an expired cert - private static boolean expired(CertificateException ce) { - if (ce instanceof CertificateExpiredException) { - return true; - } - Throwable t = ce.getCause(); - while (t != null) { - if (t instanceof CertificateExpiredException) { - return true; - } - t = t.getCause(); - } - return false; - } - - private static X509Certificate[] loadCertificateChain(String name) - throws Exception { - try (InputStream in = new FileInputStream(TEST_SRC + File.separator + - name + "-chain.pem")) { - Collection certs = - (Collection)cf.generateCertificates(in); - return certs.toArray(new X509Certificate[0]); - } - } - - private static class DistrustedTLSServerCert extends X509Certificate { - private final X509Certificate cert; - private final Date notBefore; - DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { - this.cert = cert; - this.notBefore = notBefore; - } - public Set getCriticalExtensionOIDs() { - return cert.getCriticalExtensionOIDs(); - } - public byte[] getExtensionValue(String oid) { - return cert.getExtensionValue(oid); - } - public Set getNonCriticalExtensionOIDs() { - return cert.getNonCriticalExtensionOIDs(); - } - public boolean hasUnsupportedCriticalExtension() { - return cert.hasUnsupportedCriticalExtension(); - } - public void checkValidity() throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public void checkValidity(Date date) throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public int getVersion() { return cert.getVersion(); } - public BigInteger getSerialNumber() { return cert.getSerialNumber(); } - public Principal getIssuerDN() { return cert.getIssuerDN(); } - public Principal getSubjectDN() { return cert.getSubjectDN(); } - public Date getNotBefore() { return notBefore; } - public Date getNotAfter() { return cert.getNotAfter(); } - public byte[] getTBSCertificate() throws CertificateEncodingException { - return cert.getTBSCertificate(); - } - public byte[] getSignature() { return cert.getSignature(); } - public String getSigAlgName() { return cert.getSigAlgName(); } - public String getSigAlgOID() { return cert.getSigAlgOID(); } - public byte[] getSigAlgParams() { return cert.getSigAlgParams(); } - public boolean[] getIssuerUniqueID() { - return cert.getIssuerUniqueID(); - } - public boolean[] getSubjectUniqueID() { - return cert.getSubjectUniqueID(); - } - public boolean[] getKeyUsage() { return cert.getKeyUsage(); } - public int getBasicConstraints() { return cert.getBasicConstraints(); } - public byte[] getEncoded() throws CertificateEncodingException { - return cert.getEncoded(); - } - public void verify(PublicKey key) throws CertificateException, - InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key); - } - public void verify(PublicKey key, String sigProvider) throws - CertificateException, InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key, sigProvider); - } - public PublicKey getPublicKey() { return cert.getPublicKey(); } - public String toString() { return cert.toString(); } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 8608355977964138876 (0x7777062726a9b17c) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Commercial - Validity - Not Before: Jan 29 14:06:06 2010 GMT - Not After : Dec 31 14:06:06 2030 GMT - ------BEGIN CERTIFICATE----- -MIIHHjCCBgagAwIBAgIQAWZjFOyCvT00u/gtkCvS2TANBgkqhkiG9w0BAQsFADCB -gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT -ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp -cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYxMB4XDTI0MDYyODIx -MzgwNVoXDTI1MDcyODIxMzgwNFowgdgxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP -bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW -BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt -aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 -NDA1NDcxKDAmBgNVBAMTH3ZhbGlkY29tbWVyY2lhbC5hZmZpcm10cnVzdC5jb20w -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDeIT2XO0hJ5wDSbIiIcMvs -P3NpQc7O7v5DqldpME6+Qn2sF5b9hc6j72hgTXREa77uUcP5u1JcMWCSWwYQHMpJ -kFzmIzijhS60wW1epb5QyTgM3ZYh1WKvttFCbHUcrTtd+LoPFYsjw9ZK//K9tPp+ -ddn06/ivWvUO5y5vn0wrCaB9tuLdDn4RCQzK2XoZdDuqhPlBBogJX0vM6lsXjgLy -EbvE+/sKYps/In6VtRvCoYavg3OqaIMeaA7gTiYTb1ZGFOAiltnq7fcp6SZUohK3 -QNihv1DadVc+n8LnEUKKDkgG2YgWEFczaE3qwG3ef6L3MzLGrkgVY+qGHyyv2IE7 -AgMBAAGjggM1MIIDMTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBT4ARNL47hAsOpa -96VMgKEY3sLIAjAfBgNVHSMEGDAWgBTb72U3C+VHyzXRkB8DwbyIx6fqgDBsBggr -BgEFBQcBAQRgMF4wJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmFmZmlybXRydXN0 -LmNvbTAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5hZmZpcm10cnVzdC5jb20vYWZ0 -ZXYxY2EuY3J0MDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuYWZmaXJtdHJ1 -c3QuY29tL2NybC9hZnRldjFjYS5jcmwwKgYDVR0RBCMwIYIfdmFsaWRjb21tZXJj -aWFsLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYI -KwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARPME0wBwYFZ4EMAQEwQgYKKwYBBAGC -jwkCATA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5hZmZpcm10cnVzdC5jb20v -cmVwb3NpdG9yeTCCAYAGCisGAQQB1nkCBAIEggFwBIIBbAFqAHcAEvFONL1TckyE -BhnDjz96E/jntWKHiJxtMAWE6+WGJjoAAAGQYMi3wQAABAMASDBGAiEAjvdsU4G2 -o4BZSOOjaH6gOp7zhKtXQByQUvfHfsi2ePcCIQDnnIO2qlHBm+sskUDlXfR0lCUW -yFPVr9nFZ0L9YPpozgB2AA3h8jAr0w3BQGISCepVLvxHdHyx1+kw7w5CHrR+Tqo0 -AAABkGDIt9MAAAQDAEcwRQIhANh1zS3Qeo9yKF+j3G52JhmDRYBS+1TM0wykoXCY -llpxAiAG+LAlKSbwwgrboUSTDDXWNeoRYZ7fKbU72kKfHrpZvwB3ABoE/0nQVB1A -r/agw7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDIt9sAAAQDAEgwRgIhAN8OoC4I -zw8bFJy8ACgK40c9ZfsIfFhePTc9CyrL5uDsAiEA4Jn/IqBB9L5DeTgqw9hBaYag -FmY/2gWDip36ga0WUsAwDQYJKoZIhvcNAQELBQADggEBABywPLJP097Emz6LNeFU -/HvfhaUKv2pgIHf/Kvjs5x78RK9G605THPEHr/TeUjNZ4PBd48WBNVWzyd/8FuOt -r+FsYkRJb9CnrOhZHuCwlcdWXvuY8PiuBmT+xB16BWR5yhYbbiGe4hea0Pf6CfHh -jJoGJw4dQKfgneZOV7IcaWnNTKYawlcZOgxvEwFvj+iZM31WphEPKRAV+N+Tp+ZR -nxlEdjmdbOjqBydlYIEzuFIgxgtnPdK5wqCOWb+z2cARUAO/AkiWrOLTPDc7ydQK -GcfDrSqffHOlwaee08C6STFaJWIcpqxZdXE6Jc+8/85bfPEAG1UepgfnBTqW9RGT -Q3s= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEqDCCA5CgAwIBAgIQFylVHtaOf7Ht9XMA811/1TANBgkqhkiG9w0BAQsFADBE -MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHzAdBgNVBAMMFkFm -ZmlybVRydXN0IENvbW1lcmNpYWwwHhcNMTkwMzIxMjAyNzU0WhcNMzAxMjAyMDQw -MDAwWjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYD -VQQLEyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQD -EyhBZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYxMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuPBMIa9VuXJGAw0MHvieGciPFA11 -b9T49YJ7T+zVpoMMQO+ueUKVHb2l26oeCiwIhXMQ5LquOVcx+rofouzcKXY3wKDZ -zHIOnAkU+23Ucn/3dRH7aHJULsBufZq+NvwgYSgJJEDKfqvIV/c5HiRyZ2H+nAI5 -10Q2xC0UxgSBsufccQ+Fwkg6BAGDlTXrvi8wi75UaGue6jv/qcKLybeVUrgqKE64 -d9oa9PG5/g89QwSdsIQEdVSFzFvFpOG9YhJbJ177Zg6DGCxU0lWwFrVpyH/2vnXl -jhMQScn8UxzCJdDg3EDqjgaV0JH2yoLug+QVYgURPu5BEb5ut9vAdP7cLwIDAQAB -o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz -cC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFNvvZTcL5UfLNdGQHwPBvIjHp+qA -MBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUnZPGU4teyq8/nx4P5ZmV -vCT2lI8wRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8v -d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEkGA1UdHwRCMEAwPqA8oDqG -OGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdENvbW1l -cmNpYWwuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYI -KwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAATH11fMrINGmQGQqQW0ATteVnUG -LrmRSN2OlmRm+dkUwKXhcQQEfYYlEggPqgvxSUpw13fXSOqVHqAcj3BIqF957kh+ -m3DmC0RX9KaEKD165pf77P5nZcRmZpBl9cctvzIxN19uzcminchusYwLyeWhBtTZ -xpER9LbrfMNaQ7GnrgalMx54QvdjOhw/GJs9/SqEzYmPshL+DzgZX/oAzY63rQIh -rBblf6/2talZqci96oFzNst8rGfPy/xQ7lgkki1hwIYbORMfloBhP+vAZJo0mxdM -ipu3Z0ToK+KU2iqnBxXVr2/kod+CpkHnjUHa1wnQuSaefng3XwZ/vqtSL9c= ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 8957382827206547757 (0x7c4f04391cd4992d) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Networking - Validity - Not Before: Jan 29 14:08:24 2010 GMT - Not After : Dec 31 14:08:24 2030 GMT - ------BEGIN CERTIFICATE----- -MIIHGjCCBgKgAwIBAgIQX2vGPaCJ1tS0ncp2OlBMFjANBgkqhkiG9w0BAQsFADCB -gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT -ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp -cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYzMB4XDTI0MDYyODIx -NDU0OVoXDTI1MDcyODIxNDU0OFowgdgxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP -bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW -BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt -aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 -NDA1NDcxKDAmBgNVBAMTH3ZhbGlkbmV0d29ya2luZy5hZmZpcm10cnVzdC5jb20w -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkGknE8kFr+CaIybQrDPRw -z9OKXq77p4CnrkF1/g9w/HiIs6Ps8YqTjsiTKM3wYLbvPA+TbO9DpCSyCP2bVyLf -AjUE617KZSpfy9RqzvGjn/1qH/cBKohhEliMfDj4ZHfY4x+1WYTZPVK/g0Ny5RAP -wz9lJHR2SsVGLvpqXzWaVoxifJ8HZWD7n5z/75WeYko+Hubx3WvzJZcN2Xjn+q6a -7wkDaXPayrvn5uWGPlOLQHqJ5z7wts21jASMTfJAToFyzH6dGwvqxkP3bVJGJ8AF -vtMfqVjcOcjWgmmOEHMPAAqs5QKrYuSLccH6hFTwFEUCdMwVqfloznt2sNUSBoKj -AgMBAAGjggMxMIIDLTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTrE0z4fRyx9P9M -0FfA6VgGkJiYVDAfBgNVHSMEGDAWgBR5HrHJF8cerLHHFNfD6H+8uVCbFTBsBggr -BgEFBQcBAQRgMF4wJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmFmZmlybXRydXN0 -LmNvbTAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5hZmZpcm10cnVzdC5jb20vYWZ0 -ZXYzY2EuY3J0MDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuYWZmaXJtdHJ1 -c3QuY29tL2NybC9hZnRldjNjYS5jcmwwKgYDVR0RBCMwIYIfdmFsaWRuZXR3b3Jr -aW5nLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYI -KwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARPME0wBwYFZ4EMAQEwQgYKKwYBBAGC -jwkCAjA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5hZmZpcm10cnVzdC5jb20v -cmVwb3NpdG9yeTCCAXwGCisGAQQB1nkCBAIEggFsBIIBaAFmAHYADeHyMCvTDcFA -YhIJ6lUu/Ed0fLHX6TDvDkIetH5OqjQAAAGQYM/MjQAABAMARzBFAiBjnehs1mvh -5Xm3uXZ7Bq8gijwiXThwnLSYROQxnWrnbAIhALbgJG+PRZQfzTBbgM/zAwNsBjhe -F5iENnaajJCxzOhaAHUAEvFONL1TckyEBhnDjz96E/jntWKHiJxtMAWE6+WGJjoA -AAGQYM/MgQAABAMARjBEAiAsWOm1IIjaxQP9uaPI9tQmkiJPUOTrBTsTDO+jkgiG -+QIgVNhND82rsFGjrtAAHzzgCVzLDUM3zaHxnP/z3BNuO4QAdQAaBP9J0FQdQK/2 -oMO/8djEZy9O7O4jQGiYaxdALtyJfQAAAZBgz8zLAAAEAwBGMEQCIBIGxtjk7Lw8 -i+oggK7VrPMNTB632t321cwhEm517BbZAiBws3+uytwh59N6qGJUuSFQnOZNPOPj -eQnH2fSdT1J2sDANBgkqhkiG9w0BAQsFAAOCAQEAcSzitESRKlbcUvxvUB7FjK0I -CaBU1Nyu0xDFCoG2pmp7GASJz34wtPYfsiX5+j4hDh/noMcgk7WlD8pzgWYw15Rk -+5kTv2v4U85y/JFjzMOHbz64KjQdGebqhjvC/E/EXxK+AZf4H574/w7rbyJ30vFL -gNvPF9AxS1MuYIO55jXrHMByKnFoQZgPsmAY/x+n+OzMxWOdR18PupypCB5TyJZ8 -pQzwoxmX7qeZHiXyJ8jQUwe1qoQc2SbwfQxfwSPUPSJuQo90N+5nyQMe7vvPBM0Y -/CXaFpfPqh71D4C0Ey+0hYxSt99gYs4P9twUByjIlP0wTyhaoEpt3zw9DdZypQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEqDCCA5CgAwIBAgIQNCSh7Pjwo1/nRrcBHEPoRDANBgkqhkiG9w0BAQsFADBE -MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHzAdBgNVBAMMFkFm -ZmlybVRydXN0IE5ldHdvcmtpbmcwHhcNMTkwMzIxMjAzODU5WhcNMzAxMjAyMDQw -MDAwWjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYD -VQQLEyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQD -EyhBZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYzMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmHDl/3xr1qiHoe0Rzb3AGLw56e9J -l2a3X59+PAfI5wGBHuK9Dl7XsyoH65X6QIC/rXyVpuNgKbbwIGHB+rCSplyHzGyC -WeM3LXa2q1US7VteeFDS959nxJVRFfwATR9xAK6YTUWQ/yWdw0dZSm0lQNmEMBwS -qi0ufWokiWXZUzWHOu7A6driCohu9sFDwe1INJUPH6uIlovmzGvG3UYbUSymJcjs -Ka0fXXX9zukco8exlOIKWRJSNLxKtSSPDVASrGLQ1xi3qkiLTKci3+jKMNDFf1vw -foZN99HhUcWKXfr2KlWfANdjTMlsTKCfuhfWl1OBVNHGRrACAQCXI/ji0wIDAQAB -o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz -cC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFHkesckXxx6ssccU18Pof7y5UJsV -MBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUBx/S55zawm6iQLSwelAQ -UHTEyL0wRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8v -d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEkGA1UdHwRCMEAwPqA8oDqG -OGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdE5ldHdv -cmtpbmcuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYI -KwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAhmE4I56hNpnWXQ2Si8a/TgQUZr -X5Jlv1LDvl3rkDyfEIHNZ8dth17SakJYJBWHExph/iIYjCJ9YmeyhghV5rPqT+wF -4yyE2ngenIusfnWT2bTpT9u2VZbCNeACE5XnN2UHSA0J9idPjfLuthViWEvSZZUh -DJ53bX+exO366nDY4AI7owIyhz8hdsWyhZ/0ST+eD+kbgd8osd+GdxzRmyKcfl84 -D1K1uff01T9w2dyUaZglQsFljkaO6xmeXZJsPnhwCp/HlMHWzhAneUQ7I9FZSOW+ -WiYbt4RitmBpysadBReikWM4knECzJQ/fMT9vC0k9BLlqUYRwCH9vr0UnZo= ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 7893706540734352110 (0x6d8c1446b1a60aee) - Signature Algorithm: sha384WithRSAEncryption - Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Premium - Validity - Not Before: Jan 29 14:10:36 2010 GMT - Not After : Dec 31 14:10:36 2040 GMT - ------BEGIN CERTIFICATE----- -MIIIFjCCBv6gAwIBAgIQQVOTWr7tEAJXmRDkCSxkajANBgkqhkiG9w0BAQsFADCB -gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT -ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp -cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYyMB4XDTI0MDYyODIx -NDgyN1oXDTI1MDcyODIxNDgyNlowgdUxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP -bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW -BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt -aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 -NDA1NDcxJTAjBgNVBAMTHHZhbGlkcHJlbWl1bS5hZmZpcm10cnVzdC5jb20wggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDVRMzwbDq47ivHOKqJdiEJNL2+ -g9Snj/BRctqcQTrIV99RP0pmAh5fHg7vnhVsHqc9sRLVcQWTJk9NuRJ2VnDKWsBa -Xrp5UWaNjS0vaFA4jzCi1gWzTTZgPTQn3VRG3JP1F5CZb405/mtWDaw/CfWkcUqQ -VSilqFlJRsjcPCzQh7ZaXAo+FmzJxNSwjxdP6JSYMeTDRCUpSb3T8PypVI1CEmLZ -jsxrg5oIZn25591g/pzgLE56N0stNY4d3q4YD1t5x46RsqYAJYSkk8rcTN+kHzsY -VSqaRDyPkGbmuCeJUvW24wJ30yQtXQWA+U0dMYLe7LyglJ7dkOzvWNbqrIcvM8My -hxH/wwVH7e4dL/1E58yr1BHENUk7Mp9rzIXj496eLkF5G1lMkNnuVRQqCAOW0rPY -V0rI8yrCMTK52s4mNjQo2J7JOYdTUvAWZ92MKvEjjhQlMH8eK72Km/+mkxpsgGmr -3c6u+Gom7oI5VaLZ+3p2uWaOsutk1tkzWjhzY4L27hwmIdWujfrWMRx8uxcfoJxX -gQ40d1QiSN51BtCPE5UnpLU/YUxMdzWmtUoGUfYIGVqDVToBnunIFMdmFjC0IrNl -hquDQi/OGMpzuOvxX1FoXb+rRwOhhdrcR0BQqUVRTV0U5LlcsDeNMqmqPE9mzGtJ -W69Fsh7crntng/L72wIDAQABo4IDMDCCAywwDAYDVR0TAQH/BAIwADAdBgNVHQ4E -FgQU3PWyi/4usZghgahc/Tj+Q60QLOcwHwYDVR0jBBgwFoAUc3yaOGg8UXxBCP6h -HyoetGHbzTwwbAYIKwYBBQUHAQEEYDBeMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz -cC5hZmZpcm10cnVzdC5jb20wMwYIKwYBBQUHMAKGJ2h0dHA6Ly9haWEuYWZmaXJt -dHJ1c3QuY29tL2FmdGV2MmNhLmNydDA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8v -Y3JsLmFmZmlybXRydXN0LmNvbS9jcmwvYWZ0ZXYyY2EuY3JsMCcGA1UdEQQgMB6C -HHZhbGlkcHJlbWl1bS5hZmZpcm10cnVzdC5jb20wDgYDVR0PAQH/BAQDAgWgMB0G -A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBWBgNVHSAETzBNMAcGBWeBDAEB -MEIGCisGAQQBgo8JAgMwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuYWZmaXJt -dHJ1c3QuY29tL3JlcG9zaXRvcnkwggF+BgorBgEEAdZ5AgQCBIIBbgSCAWoBaAB2 -ABoE/0nQVB1Ar/agw7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDSN7EAAAQDAEcw -RQIgVDWwhv7yG6RNnkMZnVq1YYA7ypn/GSH0ibUKnESHRpYCIQCY8gyCX7VFONUI -QuR8daz7ra2FCUI9TwylrR3eFfIgGgB3AN3cyjSV1+EWBeeVMvrHn/g9HFDf2wA6 -FBJ2Ciysu8gqAAABkGDSN5cAAAQDAEgwRgIhAM1edsSyFUKU0Dj1WxTGwziE6fCW -g2ByfL8kDrP260YXAiEA6YQOpJf04N13Nn263BxAl+laH9Ar0eo03fArlv743TQA -dQAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBg0je+AAAEAwBG -MEQCIExqK4katETAQo+H0+ImuNJCSeFEI9C+9wrjhl6ZnWb9AiBwkC1vpLYOIm/1 -YCLCQIOmTdg2wf8LITlrQNJA8vbBljANBgkqhkiG9w0BAQsFAAOCAQEASOmPu7ot -yl6MoMns19uI6H2KSUjMFh3/fKMcY/ettmEYalgrytexFMrLnD2UniBlD+nJEshp -5/z7o0YDiRoiLhMAs7VqIdX3erNu/ghNh7P2bDnoMWShSoAKxez1XOGL3rRE0NAi -DsWCaNRHH9rnC97275sbGnua7ZYg+8BiF62vpJlqjrxDHjGiej8qAWSjztbB43Af -bwRscpXTxNkMvOBuRFMH+rSxB8CrOV68W+yxmzPuPxVjM7oJH8Qk5BC53NRqFsVz -JhbNfot0+/drj7JT3jlacUVQcD/BzDuC3+qczQlLjLdHgQM2/e4fXsD6C5S6B11d -BDx6ipGpaASofA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFojCCA4qgAwIBAgIQU3HI6weE/VEI5dTz4yPsRjANBgkqhkiG9w0BAQsFADBB -MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHDAaBgNVBAMME0Fm -ZmlybVRydXN0IFByZW1pdW0wHhcNMTkwMzIxMjA0NjM1WhcNMzAxMjAyMDQwMDAw -WjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQL -EyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhB -ZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYyMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvDDZHfxkB1nAGFKdw0VCgV+B/eBtW1o+ -bXzwRcpeFh5saDI+tv1RAMrYFq+AJkXCCJopgMF2Wqfv5myE3JMgxEHuuKUpJz7H -FprrFckVOGCtJKH8Iy9AWPjBwt8lKmxGJF7EZst+QoVt4hMe0qhL0WEKbATFPe41 -DcM7UsyQv6Bvpn424uePy3/1ATIsVL3YmvAbUNR0aqVxYAJzTefvyIet/761bKGc -NyqdOVWFFeTDtr8iL1TBXToAgl0GJ39bFQZsP19VcCpfk9Zj3YHTPRPq5wZOZuUN -F7jiBUEi6DaVOi3Wy4vdySHtWPeBHRYif1I6fcUfdCNORMc4ee6KewIDAQABo4IB -UTCCAU0wNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC5h -ZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFHN8mjhoPFF8QQj+oR8qHrRh2808MBIG -A1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUncBnpgwi2Sb1RaumZVIRJ9hF -rGMwRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8vd3d3 -LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEYGA1UdHwQ/MD0wO6A5oDeGNWh0 -dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdFByZW1pdW0u -Y3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH -AwIwDQYJKoZIhvcNAQELBQADggIBABi64UEwl3l0yIiuSACyVQQIBI60BUmhseac -4BzCAsJrR5tE/2U9QAa2y6JpR1nqm76DJvw1QQgvFcNe+fkwpvoViCaSTbZkGGwD -mQe2xRSYJcDSMQUc/GgzLcX2c1CrexQXE1vwV/q33af1en5s1GzLl915aNS/k1ch -G7EMruJ/D4cuH9j4j2i+b+llmVBzavBwelN5rc693o+Ot9id/1sTWNugwAu3uXGb -VlhETMnjXGIciegOLdWYhWBln0izYlt9IwlDEpjMVaZ0HZlj2JBGaSe4PfEFpJPO -beuPcQpLQGw2XpW2ZMG5JcRYaoKWjixXAGktRA3H9nvVW92jvzx/RX484w2ZM5Rt -E+I1ikAuQLAyWG7clht387e2RuC3NZTtefSyjE3L9gQDOPC+Z9ycwr0WJHRsxFvh -FJQi3JnxgFZf5mc5n2mh3qAgALTNOUHuDiHrerjTOWbpF/1/NJmo/c/YZ63vZIhc -EaER4HuhbBqlpf6z3WOIQdZm1ChwXYHrEcLDgfwm9cXoaVK2HZapkMwQbPffPlT1 -E+AxRFB4YmT1y2WzdaHfhFA9nH6ByUdL5+FfrDoIIUO2e8OLOAcrJsf5+unhAhc0 -v7N48JWdmpstjkXCaCIaidrZLJxS+pikNgHB1dXF/TxokLTiPB9jcYKdGaYs3XHb -YKLdwubu ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 8401224907861490260 (0x7497258ac73f7a54) - Signature Algorithm: ecdsa-with-SHA384 - Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Premium ECC - Validity - Not Before: Jan 29 14:20:24 2010 GMT - Not After : Dec 31 14:20:24 2040 GMT - ------BEGIN CERTIFICATE----- -MIIF0zCCBVmgAwIBAgIQFVwk9nYUM5SYOnBd+IoGtzAKBggqhkjOPQQDAzCBhTEL -MAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJTZWUg -d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTMwMQYDVQQDEypBZmZpcm1U -cnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVZFQzEwHhcNMjQwNjI4MjE0 -OTUwWhcNMjUwNzI4MjE0OTQ4WjCB2DELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09u -dGFyaW8xDzANBgNVBAcTBk90dGF3YTETMBEGCysGAQQBgjc8AgEDEwJDQTEYMBYG -CysGAQQBgjc8AgECEwdPbnRhcmlvMRwwGgYDVQQKExNBZmZpcm10cnVzdCBMaW1p -dGVkMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UEBRMHMjU0 -MDU0NzEoMCYGA1UEAxMfdmFsaWRwcmVtaXVtZWNjLmFmZmlybXRydXN0LmNvbTB2 -MBAGByqGSM49AgEGBSuBBAAiA2IABEkLBzBYSJPRENKDaA1iBPQz+jZUV+OoM9nJ -sr9sMfmHaqr3nlWxAMM99b9/usVfYyUxqyi+YL2Z3ZSxjX2dpyhwMtPpIQkL1pMW -Iv55XBIcYRyl2NjcADS9B06G+nnix6OCAzcwggMzMAwGA1UdEwEB/wQCMAAwHQYD -VR0OBBYEFP+37ywf2YJJ/4CEVy1GY4ioGm1yMB8GA1UdIwQYMBaAFMaQjAKD113j -vjucLtVlfSoQYO7lMG4GCCsGAQUFBwEBBGIwYDAnBggrBgEFBQcwAYYbaHR0cDov -L29jc3AuYWZmaXJtdHJ1c3QuY29tMDUGCCsGAQUFBzAChilodHRwOi8vYWlhLmFm -ZmlybXRydXN0LmNvbS9hZnRldmVjMWNhLmNydDA+BgNVHR8ENzA1MDOgMaAvhi1o -dHRwOi8vY3JsLmFmZmlybXRydXN0LmNvbS9jcmwvYWZ0ZXZlYzFjYS5jcmwwKgYD -VR0RBCMwIYIfdmFsaWRwcmVtaXVtZWNjLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8B -Af8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARP -ME0wBwYFZ4EMAQEwQgYKKwYBBAGCjwkCBDA0MDIGCCsGAQUFBwIBFiZodHRwczov -L3d3dy5hZmZpcm10cnVzdC5jb20vcmVwb3NpdG9yeTCCAX4GCisGAQQB1nkCBAIE -ggFuBIIBagFoAHUA5tIxY0B3jMEQQQbXcbnOwdJA9paEhvu6hzId/R43jlAAAAGQ -YNN5tQAABAMARjBEAiAnainEoBGI9czVh+c9QLPL30S3Rtov8zrnhlXfeKLzZQIg -UGkntBMux0MqHt9Aj60qMsS/C4ZWF7AihVVaUKcrEVgAdgAN4fIwK9MNwUBiEgnq -VS78R3R8sdfpMO8OQh60fk6qNAAAAZBg03m1AAAEAwBHMEUCIGI9kBByoozH4cfS -ECW/O2N/ElkdATkt7EwQ52kcc4ICAiEA9QTh8JlJTb/ytYC1ECX0vQbrYVexg+fu -dw7dfToF9nAAdwAS8U40vVNyTIQGGcOPP3oT+Oe1YoeInG0wBYTr5YYmOgAAAZBg -03ndAAAEAwBIMEYCIQCox5nSCcVB2AfNYXco77zsJnYP7KAU2I4VA2GNL7I4wQIh -AP6WEzyfBoGpYYqFmNnJUavyhKBmeNiR7eNtaFwpSc+UMAoGCCqGSM49BAMDA2gA -MGUCMAGSNMXAAKDRk0ZOtydN95Rkja97+70TatCIIxEAsJD8Hu7lfj2LHCYFQjVY -oaWTrQIxAKUudx7E/JnjsthuL6sNqKVHfD3iLUJyQNK9wE0SVt1xAm7Cu1JXZORE -M64KMKoQFQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDXDCCAuKgAwIBAgIQAgKlhME0Bk3J8y0gfqNymDAKBggqhkjOPQQDAzBFMQsw -CQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxIDAeBgNVBAMMF0FmZmly -bVRydXN0IFByZW1pdW0gRUNDMB4XDTE5MDMyMTIwNTUwN1oXDTMwMTIwMjA0MDAw -MFowgYUxCzAJBgNVBAYTAkNBMRQwEgYDVQQKEwtBZmZpcm1UcnVzdDErMCkGA1UE -CxMiU2VlIHd3dy5hZmZpcm10cnVzdC5jb20vcmVwb3NpdG9yeTEzMDEGA1UEAxMq -QWZmaXJtVHJ1c3QgRXh0ZW5kZWQgVmFsaWRhdGlvbiBDQSAtIEVWRUMxMHYwEAYH -KoZIzj0CAQYFK4EEACIDYgAEu9f5NkumdaVlmaNaxpDB+rBk/S6lhqcUU1zTLcRz -4G0dr4290hezjrvZJxGJ/X15aexpdD2V9cwaPD/yuEJcaaz+rg/qDoqQF3+AFqVc -41jw1E0S59+57XVKLtXI7Xh6o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsG -AQUFBzABhhtodHRwOi8vb2NzcC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFMaQ -jAKD113jvjucLtVlfSoQYO7lMBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgw -FoAUmq8pesARNTUmUTAAw2r+QNWu1jwwRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYI -KwYBBQUHAgEWJmh0dHBzOi8vd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5 -MEkGA1UdHwRCMEAwPqA8oDqGOGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2Ny -bC9BZmZpcm1UcnVzdFByZW1pdW1FQ0MuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNV -HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCgYIKoZIzj0EAwMDaAAwZQIwHJ5g -a6sHvQ51DGr0bWq34awuwlWbybC2grHoNp5uYapcXr/qTJusb/6n+dczqFdaAjEA -7VQY06fE9ifMnTgT9824jc3+H6kfhMk4PoIj9ouWdYfc1DyTBS/low9Hb8liQyFr ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 946069240 (0x3863def8) - Signature Algorithm: sha1WithRSAEncryption - Issuer: O=Entrust.net, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Certification Authority (2048) - Validity - Not Before: Dec 24 17:50:51 1999 GMT - Not After : Jul 24 14:15:12 2029 GMT - ------BEGIN CERTIFICATE----- -MIIGiDCCBXCgAwIBAgIQS5P8oVcgTBT74PnIwDQivjANBgkqhkiG9w0BAQsFADCB -ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT -H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy -MDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG -A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSzAeFw0y -MzEwMDIxOTE4MTBaFw0yNDExMDIxOTE4MDlaMGkxCzAJBgNVBAYTAkNBMRAwDgYD -VQQIEwdPbnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExGDAWBgNVBAoTD0VudHJ1c3Qg -TGltaXRlZDEdMBsGA1UEAxMUMjA0OHRlc3QuZW50cnVzdC5uZXQwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgkrsKoDEHyJjll/fu7mjvtbookb50rzTI -i+jQzvtL8AJOcCfxJL1cVriufc/zRYdSQeRJxkbUb+SqIJkec+27onPpY3xOjJAK -bWdmac1Iv9JPXYMpKJXnOGrooeXEtCcKSKphx4VhHnLA67BGfSNfHLm4JwghX4jY -VpZ8P89gmh8l1eLRP+b3y7OzEkFliwmErALSD8i/bkzE+GxYMnpg/HI2Iw1lakxE -wZOg0ydgl7jHWZUDdnxhAvLS/hfzPVhi9ZwgoXQJiUXUp0JJo6QgVOIC5IztpdZa -3HW1VK7a0eTLhmdFRx39ARn/GbbIyoIqUzLOhAa2cbsGIJjtXjhrAgMBAAGjggLY -MIIC1DAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRHn0CebGnHRqTZTeTYCbPHhiVB -MzAfBgNVHSMEGDAWgBSConB03bxTP8971PfNf6dgxgpMvzBoBggrBgEFBQcBAQRc -MFowIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDMGCCsGAQUF -BzAChidodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wxay1jaGFpbjI1Ni5jZXIwMwYD -VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFrLmNy -bDAfBgNVHREEGDAWghQyMDQ4dGVzdC5lbnRydXN0Lm5ldDAOBgNVHQ8BAf8EBAMC -BaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBMGA1UdIAQMMAowCAYG -Z4EMAQICMIIBfgYKKwYBBAHWeQIEAgSCAW4EggFqAWgAdwA/F0tP1yJHWJQdZRyE -vg0S7ZA3fx+FauvBvyiF7PhkbgAAAYrx05lbAAAEAwBIMEYCIQDbMXKdzSr90jM+ -TekjpqVTEBDDvub7+AEx/kQYzf9gugIhAKPCjJmIh1NZrKkwK8MsOEL4jkN6FJ/h -4kiiJoze3fB/AHYAdv+IPwq2+5VRwmHM9Ye6NLSkzbsp3GhCCp/mZ0xaOnQAAAGK -8dOZVAAABAMARzBFAiAW11p7sV2byjrpk6AMQrMGwV2CuT3AKNuQVyxva7XQPAIh -AP1P7DfYsZ1aR12Tkg2x2BYjFrlsJCl36n5I/565xQk4AHUA2ra/az+1tiKfm8K7 -XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGK8dOZnwAABAMARjBEAiA43NURCcnHNpkH -XggwpVY9QYNIEAjpHEcPmyXJuQ9y8QIgPqx0MnlKXLuJVReuI5Hzc3iFtcYo070d -UYWH2AuVaFwwDQYJKoZIhvcNAQELBQADggEBAIZoSHApNF6DNYvGKHZJX411QkA0 -5zkq3dcm95BFomaqroEp1QeUeQ8e6xofUs84CURzopE9P81JBHX2Qzb/VeBzZOKy -dekaoz4NGW5ZvpMh7HXXaUpHKU/xZ5uUHVSatBU+cnidPhgn1czntqOwjzsgEZNW -/wbPEjqvIrZvAW4DPak/MSwlENys4ty5gX4453S5gwd18b+NFBq44O/FofR8bvWU -3lJ3VcVeONDzTcXPv+Yd1SlyO1/eXdWlFqloYFjkpcQ4wSLbOEeiWWITkZ0xCAxQ -j8uWuDOSyFQLpaPJvEuG1dlho7RZdor0flUIxYfqg2Nr4Svq1ezskwrdQm0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFKjCCBBKgAwIBAgIQLgRRzl0kJMcrXWV2cWUG2DANBgkqhkiG9w0BAQsFADCB -tDEUMBIGA1UEChMLRW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5l -dC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNV -BAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1 -c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw0yMjExMjUy -MTE5NDNaFw0yOTA3MjMwMDAwMDBaMIG6MQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -RW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5ldC9sZWdh -bC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMTIgRW50cnVzdCwgSW5jLiAtIGZvciBh -dXRob3JpemVkIHVzZSBvbmx5MS4wLAYDVQQDEyVFbnRydXN0IENlcnRpZmljYXRp -b24gQXV0aG9yaXR5IC0gTDFLMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA2j+W0E25L0Tn2zlem1DuXKVh2kFnUwmqAJqOV38pa9vH4SEkqjrQjUcj0u1y -FvCRIdJdt7hLqIOPt5EyaM/OJZMssn2XyP7BtBe6CZ4DkJN7fEmDImiKm95HwzGY -ei59QAvS7z7Tsoyqj0ip/wDoKVgG97aTWpRzJiatWA7lQrjV6nN5ZGhTJbiEz5R6 -rgZFDKNrTdDGvuoYpDbwkrK6HIiPOlJ/915tgxyd8B/lw9bdpXiSPbBtLOrJz5RB -GXFEaLpHPATpXbo+8DX3Fbae8i4VHj9HyMg4p3NFXU2wO7GOFyk36t0FASK7lDYq -jVs1/lMZLwhGwSqzGmIdTivZGwIDAQABo4IBLjCCASowEgYDVR0TAQH/BAgwBgEB -/wIBADAdBgNVHQ4EFgQUgqJwdN28Uz/Pe9T3zX+nYMYKTL8wHwYDVR0jBBgwFoAU -VeSB0RGAvtiJuQijMfmhJAkWuXAwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzAB -hhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAyBgNVHR8EKzApMCegJaAjhiFodHRw -Oi8vY3JsLmVudHJ1c3QubmV0LzIwNDhjYS5jcmwwDgYDVR0PAQH/BAQDAgEGMB0G -A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA8BgNVHSAENTAzMDEGBFUdIAAw -KTAnBggrBgEFBQcCARYbaHR0cHM6Ly93d3cuZW50cnVzdC5uZXQvcnBhMA0GCSqG -SIb3DQEBCwUAA4IBAQAuAlHLO8CoKt2a4I23UDkKc7kQI3nUkWqq2RxRh8a/4TEF -C9WSF03EHVBW9JZZcrZ3ZdTDRsNF8vSqmCABz1FLu6vw3D3bEXELonAYlkmeFFV7 -1hiW9AdyMJD92XsXiU0Yr9J76Tk4iknMTTHiZXdZOcPMOXlMwPy++HS5tTIyqO0d -zl1PS8tlCcZrKaNNKbmiIWPhmBUSog9IQt2VKpoAIP8tlvRt5tHf5qW5m7vp7qmG -HF2ou54+qQIXO6jIP8CQ4xWvj0aiLklTNMkvXesaVq0xzNgRkx9ZzhREfbuM6eWc -GQHwG7m+JmfL+u1dCAZhh4Uyn5oLU9gogFM6v4jX ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 1164660820 (0x456b5054) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Entrust, Inc., OU=www.entrust.net/CPS is incorporated by reference, OU=(c) 2006 Entrust, Inc., CN=Entrust Root Certification Authority - Validity - Not Before: Nov 27 20:23:42 2006 GMT - Not After : Nov 27 20:53:42 2026 GMT - ------BEGIN CERTIFICATE----- -MIIHEjCCBfqgAwIBAgIQFhH4VGskTR+tQK3JbN63kTANBgkqhkiG9w0BAQsFADCB -sTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsT -MHd3dy5lbnRydXN0Lm5ldC9ycGEgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5j -ZTEfMB0GA1UECxMWKGMpIDIwMDkgRW50cnVzdCwgSW5jLjEuMCwGA1UEAxMlRW50 -cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxRTAeFw0yNDA2MjgyMTQw -NDVaFw0yNTA3MjgyMTQwNDRaMIHIMQswCQYDVQQGEwJDQTEQMA4GA1UECBMHT250 -YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMTAkNBMRgwFgYL -KwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3QgTGltaXRlZDEd -MBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzE5MTM2MDUx -HDAaBgNVBAMTE3ZhbGlkZXYuZW50cnVzdC5uZXQwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDL2vkrBEZ5qeVdac1C01bcNnoeCU3AVU3Fh1Ifldic9/Gw -xqNVOFYQNzTk8M62FnPUvas4MnXmeBkPhhym+dnjsM22EeS2p6gTlvOGtJFVr+Ix -vq1UAKtqK0gYGriW6SexroSYiG1O0aeqEnKSLlEBHYhmacj2jlbx0ToxMfdBMRRq -4UjnIrh/CBochxt7aKv525tChnZGMT06QKAjx71w2cou0C05v83KJ75EI4EAmTfE -z9sKJeST5pH5MI3WKcP6ZmXynKYSIpIGb4Z8B9Ftp8HdzdR9EafOSlRlbIkEn3lm -nq4UCph48/PsUcJoViBCoY6zDLcPGt3gGQVIjq3vAgMBAAGjggMLMIIDBzAMBgNV -HRMBAf8EAjAAMB0GA1UdDgQWBBRF6MZkqXf3sICXuvbrBH1R9I8bAjAfBgNVHSME -GDAWgBRbQYqyxEPBvb/IVEFVneCWrf+5oTBlBggrBgEFBQcBAQRZMFcwIwYIKwYB -BQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDAGCCsGAQUFBzAChiRodHRw -Oi8vYWlhLmVudHJ1c3QubmV0L2wxZS1jaGFpbi5jZXIwMwYDVR0fBCwwKjAooCag -JIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFlLmNybDAeBgNVHREEFzAV -ghN2YWxpZGV2LmVudHJ1c3QubmV0MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAU -BggrBgEFBQcDAQYIKwYBBQUHAwIwSwYDVR0gBEQwQjAHBgVngQwBATA3BgpghkgB -hvpsCgECMCkwJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3LmVudHJ1c3QubmV0L3Jw -YTCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAEvFONL1TckyEBhnDjz96E/jn -tWKHiJxtMAWE6+WGJjoAAAGQYMsp8gAABAMARjBEAiAL794Fw7wyzricvRl+2AON -FbGf2hwDB3wh8RkGLBRQ7AIgTCarii0atho7ZeUO3h66Ug7s7WxnF9onDZrtoMrH -U9MAdQAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBgyyoMAAAE -AwBGMEQCIFaXc4M9C9mNukrV68Sc2E5lw9srQ80nMBCGseY99nFxAiAppQmR9FKC -TE/ROlgZRfimx61W4k+SaQ52eek4JNWXXwB3ABoE/0nQVB1Ar/agw7/x2MRnL07s -7iNAaJhrF0Au3Il9AAABkGDLKi0AAAQDAEgwRgIhAPFUevU47H5uJqYL5y1ClFS7 -mEve7E8350JKnR1VykGLAiEArn7VAJcmRNNCDAegsHCCLlpasz9PLHFd9XHQAwvL -IFwwDQYJKoZIhvcNAQELBQADggEBAHfMCQP5Y+7IYzqOh5D/81WqHagmWOqkJYsN -33uux44fhVGqiG1O5ImTQsxJpt/HmDuK1qLEjG31Y9q89U91KAqLQauCQ5iMXrBg -TlwK8kzO1XYC5KkpO5ZWanqfjOahM9mkEKHPV9srwj6xTbInCq9DabRwuWyohj3b -EKrmB016TOT0hJ94jCb8PWl15oQJdsGlEfrG7amtDSRuoDHVA3nXJIJqx5LVnErB -glfsAmP8TPkWYY8kuNE2Rjr2M6P5LRLEvtRELCQF3lPuY0+xxGksGVM207YqhYKv -GzMmA8c7tF3ZclbE0rUA2T8FuBuweAV8tnWq2TaeAHWIJ4nY17s= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFHjCCBAagAwIBAgIRAIZmsCrBy1RAAAAAAFHTWJwwDQYJKoZIhvcNAQELBQAw -gbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkwNwYDVQQL -EzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu -Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVu -dHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xOTA2MTkxNjUy -MDhaFw0yNjExMTkxNzIyMDhaMIGxMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNRW50 -cnVzdCwgSW5jLjE5MDcGA1UECxMwd3d3LmVudHJ1c3QubmV0L3JwYSBpcyBpbmNv -cnBvcmF0ZWQgYnkgcmVmZXJlbmNlMR8wHQYDVQQLExYoYykgMjAwOSBFbnRydXN0 -LCBJbmMuMS4wLAYDVQQDEyVFbnRydXN0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -IC0gTDFFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtlsEVHfdDiRm -3Cqh24DMXcdf/VIWWNpflAapuLa5YwxHIILsx5VOi7h3Umo9tYep1uHMdOWmyMDU -Vk+NLtYIPgxMQz7wQZNeRu8559llKgx2UCe9Ww0zMwfg96KpnOERM61m/NIseqqj -cxa+k4V1D9c3jPojt2T440xu7bMFveI223zedkTagnJ2tm7/lKHQhvcQzUpai7B1 -jGZSgE5ITEmDpkDXd4ETTV5yfkhGIqoP4j5llDjhcnH+SnEJujV/VYk9gdW4KAEQ -dzZaEIXSvWCEK0lhlAzeTEBqKsR5YIQkgjJpSphL4lYQugNFUSDTz9qOVBtFtnq6 -l5pa2MbRXwIDAQABo4IBLjCCASowDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG -CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMDMGCCsGAQUF -BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD -VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9yb290Y2ExLmNy -bDA7BgNVHSAENDAyMDAGBFUdIAAwKDAmBggrBgEFBQcCARYaaHR0cDovL3d3dy5l -bnRydXN0Lm5ldC9ycGEwHQYDVR0OBBYEFFtBirLEQ8G9v8hUQVWd4Jat/7mhMB8G -A1UdIwQYMBaAFGiQ5GekplOAx4ZmpPH3S0P7hL1tMA0GCSqGSIb3DQEBCwUAA4IB -AQAPUNBX97sqIXZl/zLu53iv7a0HK7prvD0cVaZM0yRfVptvARgjIZZzTtv32v6X -wSr4fDeRmpLaTWtipBGSqh3fNkTSVT8GGBq6+h1lrPEYv6jnStDf7VLQxVliKt2w -h34JjgRUx9rdia30tk/EpPavkxxPks8vjoLN3f4dbkIY/sfljyZbseqVLx9kl/we -OvqL6jZgaQOapFQLZJze7VwLiPVuUnW8ddK3JIE1a5YCZs0irIW5+96ttznIgPK2 -aUOmHQp/zasi7SFl49HrKGKWtZuyDB9U56e01H6PDTpSSSTPyLsSVg3JALHBPDzS -bBraAU3wuAyc3BQ4OIOmwwnT ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: - a6:8b:79:29:00:00:00:00:50:d0:91:f9 - Signature Algorithm: ecdsa-with-SHA384 - Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2012 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - EC1 - Validity - Not Before: Dec 18 15:25:36 2012 GMT - Not After : Dec 18 15:55:36 2037 GMT - ------BEGIN CERTIFICATE----- -MIIFzDCCBVOgAwIBAgIQcbNJ8XJLeT3fV8DU3QNYSDAKBggqhkjOPQQDAzCBujEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl -ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2 -IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UE -AxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSjAeFw0yNDA2 -MjgyMTM5MzVaFw0yNTA3MjgyMTM5MzRaMIHLMQswCQYDVQQGEwJDQTEQMA4GA1UE -CBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMTAkNB -MRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3QgTGlt -aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUTCjEw -MDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZWMuZW50cnVzdC5uZXQwdjAQBgcqhkjO -PQIBBgUrgQQAIgNiAAS90ZyZ86Gl5Fh1qJ/70UwyQWATu3igiQLeVVvZ4G79SBEG -Xc4TcAn0LzBhfJonAzWFkAS860ARjvFHgUj0otyT+Q2/zC9c8CjOsL3bYp3SNUbC -FWBhIV0vhGGY8NafeXCjggMJMIIDBTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTP -DXJE/iZfi5wUSAo4GN4thBCCHDAfBgNVHSMEGDAWgBTD+UUDvsj5CzxFNfPrcuzn -6OuUmzBjBggrBgEFBQcBAQRXMFUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVu -dHJ1c3QubmV0MC4GCCsGAQUFBzAChiJodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wx -ai1lYzEuY2VyMDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5u -ZXQvbGV2ZWwxai5jcmwwHgYDVR0RBBcwFYITdmFsaWRlYy5lbnRydXN0Lm5ldDAO -BgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMEsG -A1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjApMCcGCCsGAQUFBwIBFhto -dHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF9BgorBgEEAdZ5AgQCBIIBbQSC -AWkBZwB1AA3h8jAr0w3BQGISCepVLvxHdHyx1+kw7w5CHrR+Tqo0AAABkGDKGokA -AAQDAEYwRAIgZwtzml8YzKjqeP86zX+88q8sHOt//2Qmahr2tk97ozUCIFCOM2nF -s1GJVBjKQZEH8QqkivVp+Cai9pC/57TiOmCOAHUAzPsPaoVxCWX+lZtTzumyfCLp -hVwNl422qX5UwP5MDbAAAAGQYMoamAAABAMARjBEAiEA37X8EgQAUzLxn/Ny1Yx3 -uszQF5D85m8vZ0otf8nHzuwCH168zpAxzKS71Fz6CgmDS0QZOfBSYFBD+Pdcm6e1 -ilkAdwAS8U40vVNyTIQGGcOPP3oT+Oe1YoeInG0wBYTr5YYmOgAAAZBgyhq6AAAE -AwBIMEYCIQCljVuYzRe6oQTZPdx0tGhIQSOwM1JbxoMJu2cW+gEGLAIhAMSSJoni -0KT3KavwtsSWuuHsWjt8atv6TpJtLmVxCIdlMAoGCCqGSM49BAMDA2cAMGQCMBPY -1dn1Js8F9b08aVCZ3vqDGFTKuzTXaxArf/y/WhLtcHdZPLaYVifQcAKzp1WCFQIw -MvpE6RDccmnZi5TX88p16s8ev/qkegpbf7Xuw1JQEfy2NRwrXc+NwA422EjXBTti ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID5zCCA2ygAwIBAgIQCoPUgD5+n1EAAAAAUdTB9zAKBggqhkjOPQQDAzCBvzEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl -ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEy -IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UE -AxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4X -DTE2MDQwNTIwMTk1NFoXDTM3MTAwNTIwNDk1NFowgboxCzAJBgNVBAYTAlVTMRYw -FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu -bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNiBFbnRydXN0LCBJbmMu -IC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3QgQ2Vy -dGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowdjAQBgcqhkjOPQIBBgUrgQQAIgNi -AAT14eFXmpQX/dEf7NAxrMH13n0btz1KKvH2S1rROGPAKex2CY8yxznbffK/MbCk -F7ByYXGs1+8kL5xmTysU/c+YmjOZx2mMSAk2DPw30fijJ3tRrwChZ+TBpgtB6+A5 -MsCjggEuMIIBKjAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAz -BggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3Qu -bmV0MDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvZWMx -cm9vdC5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6 -Ly93d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF -BQcDAjAdBgNVHQ4EFgQUw/lFA77I+Qs8RTXz63Ls5+jrlJswHwYDVR0jBBgwFoAU -t2PnGt2N6QimVYOk4GpQQWURQkkwCgYIKoZIzj0EAwMDaQAwZgIxAPnVAOqxKDd7 -v37EBmpPqWCCWBFPKW6HpRx3GUWc9caeQIw8rO2HXYgf92pb/TsJYAIxAJhI0MpR -z5L42xF1R9UIPfQxCMwgsnWBqIqcfMrMO+2DxQy6GIP3cFFj9gRyxguKWw== ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: 1246989352 (0x4a538c28) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2009 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - G2 - Validity - Not Before: Jul 7 17:25:54 2009 GMT - Not After : Dec 7 17:55:54 2030 GMT - ------BEGIN CERTIFICATE----- -MIIHOzCCBiOgAwIBAgIQWFfRPoYcAxEc+S0tOlD+ljANBgkqhkiG9w0BAQsFADCB -ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT -H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy -MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG -A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTTAeFw0y -NDA2MjgyMTQyMTRaFw0yNTA3MjgyMTQyMTNaMIHLMQswCQYDVQQGEwJDQTEQMA4G -A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT -AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3Qg -TGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUT -CjEwMDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZzIuZW50cnVzdC5uZXQwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCZ66eWZS5ytmbHJeHcA9WfnpbGFC04 -Tov7L0NWiStVRPEFrXrGSn6RPriGci6RwrCz5yn47EWjk2AjSD4e5lySDKHwTg+0 -S9pl3lcSd8tQOTbTwVM0EfOxdUlO4IY0jCOSM8rnZUc1JvEIIrXWXWF9AWoDb4BQ -erTefRm/YykFC558PEzn84vU9KoEmDwIP4upWKVutuzBpHWhZW3q9wagg62KifHN -1yaagv4PUGgdkrVkyA1ZO3D7b2RpQjBreOTk+tsTnWtbAkFGtRBOA/2QrEvyqMU7 -eCnpFZMIaj2tKeSLqhIWxzOnrAGUJNp5wLYmVnnhPhHEv1g79pNsZLR3AgMBAAGj -ggMoMIIDJDAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRt85gfkWUjfTKgrLytMp8o -VvOe3zAfBgNVHSMEGDAWgBTD99C1KjCtrw2RIXA5VN28iXDHOjBoBggrBgEFBQcB -AQRcMFowIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDMGCCsG -AQUFBzAChidodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wxbS1jaGFpbjI1Ni5jZXIw -MwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFt -LmNybDA3BgNVHREEMDAughN2YWxpZGcyLmVudHJ1c3QubmV0ghd3d3cudmFsaWRn -Mi5lbnRydXN0Lm5ldDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUH -AwEGCCsGAQUFBwMCMEsGA1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjAp -MCcGCCsGAQUFBwIBFhtodHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF+Bgor -BgEEAdZ5AgQCBIIBbgSCAWoBaAB3ABLxTjS9U3JMhAYZw48/ehP457Vih4icbTAF -hOvlhiY6AAABkGDMhQQAAAQDAEgwRgIhAMzddgbnWlodtosz6EMh2Y89n0JR4eMO -v+W6tUp2gVwYAiEA6UKa2eFlX0KdzuZCvTlPgi8DeK3ZI2wffyV2bYMXtsIAdgAN -4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBgzIURAAAEAwBHMEUC -IQDmVH2NlaV2/Y3OaPMXhH+BT63zA+Bh/5aCfPiYrJ7K2AIgRADPHzpwS7bfvVZI -k8QxUBSCDXFmZQOrpamBaEko6YIAdQDM+w9qhXEJZf6Vm1PO6bJ8IumFXA2Xjbap -flTA/kwNsAAAAZBgzIUGAAAEAwBGMEQCIA1CHfNw7cCcJSb3s7ik9Wflf3irqE9G -QKxZ+Y9BOIx0AiA6CMvw7OHjG519E1tZgr/HFRXzxKchBp80dfsaEKxY9zANBgkq -hkiG9w0BAQsFAAOCAQEAqvn1CTObiV5zKVY6NWjGK49Wqsr9t1ok/h/yfKRmr36O -UZkMTPANj0uhwM4gtieTze9hnNzEkx1ec6G40JyABRiSX+0dtq3n8wiW3d8G1Qj5 -/s8yZ13/ATrdjjr1mlGOvh0sgWTTPaQpl8ijXTy40GYpZIUXXBK09Rm6W0siq+7m -OHNpJR4APWOBBU4QwiWrHHsFq4KvwxiTjNWWizCOnZwVi3awNBoDD/Iwszn+trOA -8U/1SsHGuPBWKajcGorwi2zQ99JxAwJJ8XNBCekynjbPZYx52KkqfR07Fd2Occbl -3lh3wXrepzzU1a6vdyiQpagX8btyIqQpAzytypzaLQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFLTCCBBWgAwIBAgIMYaHn0gAAAABR02amMA0GCSqGSIb3DQEBCwUAMIG+MQsw -CQYDVQQGEwJVUzEWMBQGA1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2Vl -IHd3dy5lbnRydXN0Lm5ldC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMDkg -RW50cnVzdCwgSW5jLiAtIGZvciBhdXRob3JpemVkIHVzZSBvbmx5MTIwMAYDVQQD -EylFbnRydXN0IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjAeFw0x -NDEyMTUxNTI1MDNaFw0zMDEwMTUxNTU1MDNaMIG6MQswCQYDVQQGEwJVUzEWMBQG -A1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5l -dC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMTQgRW50cnVzdCwgSW5jLiAt -IGZvciBhdXRob3JpemVkIHVzZSBvbmx5MS4wLAYDVQQDEyVFbnRydXN0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gTDFNMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEA0IHBOSPCsdHs91fdVSQ2kSAiSPf8ylIKsKs/M7WwhAf23056sPuY -Ij0BrFb7cW2y7rmgD1J3q5iTvjOK64dex6qwymmPQwhqPyK/MzlG1ZTy4kwFItln -gJHxBEoOm3yiydJs/TwJhL39axSagR3nioPvYRZ1R5gTOw2QFpi/iuInMlOZmcP7 -lhw192LtjL1JcdJDQ6Gh4yEqI3CodT2ybEYGYW8YZ+QpfrI8wcVfCR5uRE7sIZlY -FUj0VUgqtzS0BeN8SYwAWN46lsw53GEzVc4qLj/RmWLoquY0djGqr3kplnjLgRSv -adr7BLlZg0SqCU+01CwBnZuUMWstoc/B5QIDAQABo4IBKzCCAScwDgYDVR0PAQH/ -BAQDAgEGMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATASBgNVHRMBAf8E -CDAGAQH/AgEAMDMGCCsGAQUFBwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29j -c3AuZW50cnVzdC5uZXQwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL2NybC5lbnRy -dXN0Lm5ldC9nMmNhLmNybDA7BgNVHSAENDAyMDAGBFUdIAAwKDAmBggrBgEFBQcC -ARYaaHR0cDovL3d3dy5lbnRydXN0Lm5ldC9ycGEwHQYDVR0OBBYEFMP30LUqMK2v -DZEhcDlU3byJcMc6MB8GA1UdIwQYMBaAFGpyJnrQHu995ztpUdRsjZ+QEmarMA0G -CSqGSIb3DQEBCwUAA4IBAQC0h8eEIhopwKR47PVPG7SEl2937tTPWa+oQ5YvHVje -pvMVWy7ZQ5xMQrkXFxGttLFBx2YMIoYFp7Qi+8VoaIqIMthx1hGOjlJ+Qgld2dnA -DizvRGsf2yS89byxqsGK5Wbb0CTz34mmi/5e0FC6m3UAyQhKS3Q/WFOv9rihbISY -Jnz8/DVRZZgeO2x28JkPxLkJ1YXYJKd/KsLak0tkuHB8VCnTglTVz6WUwzOeTTRn -4Dh2ZgCN0C/GqwmqcvrOLzWJ/MDtBgO334wlV/H77yiI2YIowAQPlIFpI+CRKMVe -1QzX1CA778n4wI+nQc1XRG5sZ2L+hN/nYNjvv9QiHg3n ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -Root Certificate: - Version: 3 (0x2) - Serial Number: - d9:b5:43:7f:af:a9:39:0f:00:00:00:00:55:65:ad:58 - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2015 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - G4 - Validity - Not Before: May 27 11:11:16 2015 GMT - Not After : Dec 27 11:41:16 2037 GMT - ------BEGIN CERTIFICATE----- -MIIIIzCCBwugAwIBAgIQDD4I8FgD7+DVcBLMBwa39jANBgkqhkiG9w0BAQsFADCB -ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT -H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy -MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG -A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y -NDA2MjgyMTQzNTRaFw0yNTA3MjgyMTQzNTNaMIHLMQswCQYDVQQGEwJDQTEQMA4G -A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT -AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3Qg -TGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUT -CjEwMDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZzQuZW50cnVzdC5uZXQwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCfUHGdeme0jraIiUzPYtuX1G9rlCU1 -eKDqDbsgp7VIS7rI/VgbsS7oKnE6KHP+qGrXRhYdvFLFDa+REY6fVOWkLuTXhVLb -5C7ym2pi0OUMKvrGtDLUxlHiEAmkmjPDl6TLMTDrLgWOLFMRzyeTcxnZtMrxUnAf -yzSPlqm1bkN/oRp2EOiXvuSbci8UA0QswV6g8EUbRB0qyv6OophoaQYo/+KRwTJT -k6S8YDsEJnlDb8tjEhfIUjp2Md5ThBxf5Ib29aXebZ5HFh2x5VPrzOwDUPk0fVNM -pWFfiX79RW6w5Vei5qtretLohbw6b5aJmaJ1LweAEkIlhy5eUuuG6v8Efm8JSAle -eKMtflTigmayaWMVCd2GeB6LajcflAw7BUU2brRMJwMpaeXXhL/mVpjbev/5TtVD -+H9IlW3PMyQnUJc0YuUVmdi1eOM5qoQaQE4BDPHz2G41eDgT8J9Gb1FX5mT+9l2I -iJD47pwcBIw5tHCn2nuz1+8CDuYpfH2+t2LPFHVI15h1scGotZvzUJ5TzPdQqZI7 -K2LTL49Zs2HsObrGr07Vj28WyzkjIfTrVSV/29hgz1zVjUa0uyTeOzrc3VIg7NTv -RoMTTYuUeUoMSmFQ8z9CSGh7cxFlrhGjFO+66++JFNwakAEp7kS5c2qTLaapY9dM -8UMIr5951z994QIDAQABo4IDEDCCAwwwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU -/EjjpmMa/SepMqPlglXS5AbGcScwHwYDVR0jBBgwFoAU7kfRhXHx/S23P7s+Y1h3 -F0lADpUwaAYIKwYBBQUHAQEEXDBaMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5l -bnRydXN0Lm5ldDAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5lbnRydXN0Lm5ldC9s -MW4tY2hhaW4yNTYuY2VyMDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50 -cnVzdC5uZXQvbGV2ZWwxbi5jcmwwHgYDVR0RBBcwFYITdmFsaWRnNC5lbnRydXN0 -Lm5ldDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF -BwMBMEsGA1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjApMCcGCCsGAQUF -BwIBFhtodHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF/BgorBgEEAdZ5AgQC -BIIBbwSCAWsBaQB2ABLxTjS9U3JMhAYZw48/ehP457Vih4icbTAFhOvlhiY6AAAB -kGDOC9YAAAQDAEcwRQIgWhFWhf2sBQ3ufMH0yubwLDt+3f/b5rScs09o1YEjg6MC -IQDpkgEMWBAM+NV2aCnC8QH+RH6xBqhPPt6JZTm3W+vHkwB3ABoE/0nQVB1Ar/ag -w7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDODBQAAAQDAEgwRgIhAOgp+oas+jBr -9wOBo0QDdVQGmP8KJupfRf/MDKO+kSRjAiEA9JnEHTbFHre2TS9habVJA/3jM/t5 -CKtixwQqdpLXQUAAdgAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAA -AZBgzgwVAAAEAwBHMEUCIBOYI8rl87VepcPQlaGh6AbKhKw1UlbxIf7etR/d2M47 -AiEAkFXOVvzkP6kX/z1yRneYn0mlPbDvAFLsSDghl/gkdtYwDQYJKoZIhvcNAQEL -BQADggEBAJovgoheNHFBUpnodfOiKtpRo8AE6dLuOX1H2uRHiDg0Gza0/w95KkEE -BqjKmJIbJrs2TQJnkM0LjaubHn1TP4XC40qieMXB4ylJzC5FWDZBqMHZmLTvVY01 -irBMyub0On8d1BlEquD2r3KHQFnyUvi/uxzbNJOVbNJYglKhTI+UfcXk7zpHmNG+ -+SbBkpJkuqQ9ujG1K25FRa/01j1p4ZlDrJ3KCT7fDEf10TN0u5VX6moVT9cRVR2U -gX16BV8m/hoJVTD0fBCKIKjtklS//b+Jr49uxWFulrDwlRKyDWmBXLnqsZvpCobi -deDsWiUkcvd+DjNgpDTEHCTrXXjd8tU= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGMjCCBBqgAwIBAgIRAKvsd/8bQQwHAAAAAFVl2AUwDQYJKoZIhvcNAQELBQAw -gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL -Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg -MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw -BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0 -MB4XDTE3MTEyMjIwMDQyMFoXDTMwMTIyMjIwMzQyMFowgboxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1 -c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNCBFbnRydXN0LCBJ -bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3Qg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMU4wggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDcSG+caYQ4xcvf+dt8bgCEHorO0g5j0H1NOtQzRXgUoG8y -QuRbJX9swyKqQZbsc18YvTV8OKA/uSNE46Jvq47TFPojWWTVLbNDqpM07e4EFYKs -A9NFzAUngijnf3ivnXA6iNPAMXaEhXmhY/YFjk8NoM7Y1PFsA0oj5hamKQ06iO/j -gvBScLmnQ1ju9Qj9IGIg18UL5AJNw0frspLUQBYVrLGaqAy5Nl2BUJKaZ4vnSLvP -nk6YrB15mo1phHae10Ba4fx7R3z8IZ/hby4OXTy/KZpu107VEQPAwTuDK8ZXxB5y -0DSzi4vaw27aLrUsq4aFqUo03gEfC31vWW76TNkFAgMBAAGjggErMIIBJzAOBgNV -HQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHSUEFjAUBggrBgEF -BQcDAQYIKwYBBQUHAwIwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEW -Gmh0dHA6Ly93d3cuZW50cnVzdC5uZXQvcnBhMDMGCCsGAQUFBwEBBCcwJTAjBggr -BgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMAYDVR0fBCkwJzAloCOg -IYYfaHR0cDovL2NybC5lbnRydXN0Lm5ldC9nNGNhLmNybDAdBgNVHQ4EFgQU7kfR -hXHx/S23P7s+Y1h3F0lADpUwHwYDVR0jBBgwFoAUnzjEViPDOeigcWzoVEzk6Dqx -v2cwDQYJKoZIhvcNAQELBQADggIBACMeFFgsWmC7h6D1v8DJUkOpm/m5UhVhO0hb -pQMQKMhKkl744Y9SWG4WNmpQy743TTciEJPZFhc7ke2R6VmK8ZJUqro2awOw1RWZ -OtHla59Btf1NQd41vOVdU+qFhs8lFfXg9sK7YHTrfxHtMXLoGnkkamK3xJgn7sXa -/zUvUDBTpDCXcpO9SyHoKIQswmkIPpRyIdPF4biRdR3N+9MYmlfqN/Nk3OEZ73xZ -AUZP6Gu+f9cEiHTA8NdYHCPLJWyFnIHWK+QuTFEnKYnOYxCeroLBNOO64e8JWZ39 -kZ22BBXhHzqOCCczS7JOJTRF+JgvWuxbFwRstj8qf3fE+JndWmq2FC4hTHtpuK5K -ENuiRm5gdkXfsXmB+qB6y5gaajiTIMscGIcZIKTe2YdKrLoicvEz8k+loM7favik -vzFioTNTDHYGx3mkfElBE7ycY8n+jZE3QBBv33k28MeQi7XNgEaMc4tYwoZIdE9A -xVccXTzEQzka82dOkRB1dU0XZId9XAWv+CtNc2TjF6Wgx2seA/c6H8S0IfgQBIV2 -8iN2wZns2QFdawkdy3hMUqPnA++kuGhLW3GemsIY5dP/WxY8rd+OfLb/Ks9T1pCd -28t7PQRcQsgkYmouzrOW9ASBvYqLLdhl4y+fFXff8RkPIKMNoYP06WJvRKmky9R/ -41/nXRas ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, 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 @@ -56,354 +56,495 @@ * * TLS server certificate: * server private key: - * -----BEGIN RSA PRIVATE KEY----- - * Proc-Type: 4,ENCRYPTED - * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A - * - * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e - * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI - * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n - * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb - * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP - * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz - * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF - * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J - * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa - * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH - * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT - * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q - * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A== - * -----END RSA PRIVATE KEY----- - * - * -----BEGIN RSA PRIVATE KEY----- - * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie - * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU - * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB - * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi - * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y - * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo - * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4 - * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51 - * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16 - * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2 - * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC - * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF - * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608= - * -----END RSA PRIVATE KEY----- * - * Private-Key: (1024 bit) + * Private-Key: (2048 bit, 2 primes) * modulus: - * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: - * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: - * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: - * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: - * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: - * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: - * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: - * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: - * 30:05:40:2c:4f:ab:d9:74:89 + * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08: + * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f: + * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53: + * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5: + * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1: + * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70: + * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14: + * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13: + * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3: + * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4: + * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68: + * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a: + * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5: + * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78: + * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b: + * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d: + * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e: + * 98:cd * publicExponent: 65537 (0x10001) * privateExponent: - * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90: - * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82: - * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62: - * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9: - * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77: - * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09: - * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b: - * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3: - * 37:6b:37:59:ed:db:6d:b1 + * 68:87:36:54:a3:c6:d5:5f:f5:0f:4f:76:c8:9c:2b: + * 5b:dc:e2:be:14:12:2f:c7:0a:a9:cb:5e:04:59:ca: + * 35:2f:8d:2b:c4:40:e6:7d:25:1b:4d:07:c3:99:9c: + * 16:4f:a5:dc:de:b0:90:f0:de:22:70:80:f4:a6:70: + * e2:96:3d:18:21:bf:2b:27:a4:2d:d7:ae:2b:12:2f: + * 08:36:ee:99:94:ed:f6:a7:d9:1d:a2:f3:1f:44:a4: + * 28:4b:67:35:d6:a8:1b:f8:84:34:34:84:bd:ec:9e: + * 03:08:3c:93:20:8e:af:15:cb:1f:20:08:97:c4:19: + * 3e:fa:36:c6:ab:0e:2f:e7:b3:c0:a7:bc:e4:e0:a6: + * 08:1c:69:20:4d:78:bd:7a:e5:25:48:60:9e:2e:50: + * 8d:36:1e:07:e9:d5:0d:39:67:41:42:24:db:87:e5: + * 77:76:fd:5e:d5:c6:e5:d3:b0:98:71:48:69:47:4f: + * 46:05:0c:9e:58:45:2e:e2:27:d0:f6:11:05:78:ad: + * 83:5a:5b:ec:d7:2e:26:5a:a5:4f:9e:52:84:2c:1f: + * 59:1a:78:56:0a:44:54:c6:37:64:01:ca:e4:a8:01: + * c7:86:c1:b4:d6:6c:7a:15:9a:65:69:46:9e:fd:f6: + * 08:17:0c:6c:ac:38:bd:c2:cd:da:ef:54:7a:48:92: + * 4d * prime1: - * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a: - * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46: - * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33: - * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7: - * d6:11:4c:99:c7 + * 00:e4:43:cc:51:25:aa:1d:90:41:95:2c:e8:9f:aa: + * 1c:9b:ea:bd:fd:29:e5:68:6b:28:00:ec:31:31:36: + * d0:3d:84:db:c5:5d:32:f6:38:b9:04:4f:45:cb:19: + * f5:88:cd:a8:fc:70:b8:6d:98:68:a6:b4:9e:c1:da: + * fd:db:eb:1a:53:3c:3b:e6:85:d2:6f:03:45:7a:ad: + * 49:8c:c3:96:a7:46:a4:bb:3b:48:d3:d7:1c:b4:3c: + * f7:04:0a:a3:85:9d:94:3e:bd:35:f5:34:21:3d:08: + * 89:df:c5:54:af:cf:90:f7:d8:5c:57:c5:77:5a:c8: + * d1:b3:8f:ee:01:5c:07:13:3f * prime2: - * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e: - * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7: - * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0: - * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc: - * e0:e1:84:ff:2f + * 00:ac:c4:a0:cc:7c:51:db:65:0a:02:da:bc:d8:77: + * 21:8c:d3:30:ae:ec:50:60:4b:b9:39:c7:2d:bd:98: + * aa:4f:9b:44:74:ab:f8:86:de:e2:44:15:73:7a:cd: + * d5:46:f2:03:62:c5:87:9c:6d:91:d5:7a:9a:17:c2: + * c6:2f:29:0e:8a:a4:a9:f4:c2:63:a2:77:97:bf:c6: + * 90:e8:39:70:87:cc:fd:62:4f:d2:3d:e7:47:70:fb: + * f3:bd:bd:5c:9c:77:fe:23:33:7d:83:ef:cb:0e:4e: + * f1:dd:05:47:40:97:f4:da:b6:1f:b9:8d:e2:92:04: + * 09:be:fb:6a:97:29:27:ac:f3 * exponent1: - * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8: - * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1: - * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c: - * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d: - * 12:b7:6e:91 + * 3f:08:1d:b6:56:b1:38:02:aa:a9:77:c2:30:bc:b7: + * b3:b2:49:8e:4b:f0:66:3a:18:cc:d0:6b:f1:0c:12: + * ca:ba:12:39:d8:b7:86:d8:38:f6:e0:b1:04:19:81: + * fc:a9:d5:bd:07:9f:55:dc:1d:21:d3:84:77:41:72: + * 92:34:c4:8b:31:79:d4:f9:25:17:b4:8e:8e:06:a5: + * e5:b1:e8:ba:fe:3d:e4:d9:c5:0d:82:3c:11:e5:37: + * cc:ac:e7:64:b1:13:cb:93:52:00:08:ca:18:e1:6f: + * b9:13:f3:83:ac:cc:7a:34:0b:a3:cd:0a:5d:4e:50: + * e1:c5:9f:d2:4e:48:41:df * exponent2: - * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50: - * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b: - * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72: - * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4: - * 19:7b:b0:de:53 + * 02:c7:fb:8a:af:29:a6:2d:7f:36:c2:8c:ad:b3:65: + * 3f:de:1a:77:86:68:58:d4:7f:3b:d5:df:ff:a0:58: + * 85:85:8b:59:91:77:23:bc:ac:c9:c9:ca:9d:1c:79: + * 25:76:39:e5:ba:26:4f:b7:57:d4:a6:ef:9a:18:51: + * 96:6a:c3:c8:29:94:6e:d3:3e:45:5c:45:7e:19:d5: + * 35:57:cf:5e:f0:46:d7:f1:4f:02:1e:1a:01:50:9d: + * 00:dd:ee:82:ba:4f:c6:03:4b:2e:f7:8a:3e:45:b9: + * 11:04:c7:bb:db:76:5e:9a:f5:f1:c7:bd:f0:f9:cd: + * aa:5c:63:bf:e1:32:b9:4f * coefficient: - * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35: - * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a: - * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df: - * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21: - * 12:d7:eb:4f - * + * 50:4c:e6:1e:23:f3:e2:2b:d6:3f:87:53:fb:19:53: + * 4b:84:21:0b:77:31:ed:8d:c3:0c:ea:31:b0:a6:38: + * a9:e6:44:6e:18:05:53:8f:4a:5f:75:e5:3e:b5:26: + * 9b:46:3d:73:e7:c1:2a:a6:3e:c3:cd:41:b1:a6:55: + * 57:84:11:13:ec:44:92:59:7f:dd:0d:67:30:d3:b7: + * 13:ee:9e:2d:ea:be:b3:ca:4a:f0:6e:4f:22:e8:be: + * 8b:8d:9b:2c:30:a5:ed:2c:2b:13:4c:f7:61:19:64: + * 35:9d:b0:c8:10:85:01:e7:2a:70:13:00:39:c5:73: + * 63:34:fd:28:2d:7f:8d:20 + * -----BEGIN PRIVATE KEY----- + * MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCaDOCPqAJ+Wu/t + * skKtCE6RusKtm3nXmw/90vgVLxmJgBAAAhltJ8KQ16UjU3RuZCh8JKrt6iFZ3KNc + * tclCMU+i3vsJfHPtiAQ08RWtPWDNysUTmdOfm7KScMu6Sz0glq2+klPtVDvFFL3P + * 1A/LBU/9K57gULtlE5LA1r1NAgxwtmXUfbRNw98sCJ7SPmkyRm9vytFzpJQH7xTj + * 2p4vwKwOEDNMaHnzeUDW6TzC5nDgic6geqiEKIUyNwiwz7F/X7wfpT3v1mioFyFf + * h9VLtczueI3dsShqwPtkvbdwAjMDC7i4uwiC9o4FJ9E75sWsTYVboR2jSF0DFXZj + * bHEhPpjNAgMBAAECggEAaIc2VKPG1V/1D092yJwrW9zivhQSL8cKqcteBFnKNS+N + * K8RA5n0lG00Hw5mcFk+l3N6wkPDeInCA9KZw4pY9GCG/KyekLdeuKxIvCDbumZTt + * 9qfZHaLzH0SkKEtnNdaoG/iENDSEveyeAwg8kyCOrxXLHyAIl8QZPvo2xqsOL+ez + * wKe85OCmCBxpIE14vXrlJUhgni5QjTYeB+nVDTlnQUIk24fld3b9XtXG5dOwmHFI + * aUdPRgUMnlhFLuIn0PYRBXitg1pb7NcuJlqlT55ShCwfWRp4VgpEVMY3ZAHK5KgB + * x4bBtNZsehWaZWlGnv32CBcMbKw4vcLN2u9UekiSTQKBgQDkQ8xRJaodkEGVLOif + * qhyb6r39KeVoaygA7DExNtA9hNvFXTL2OLkET0XLGfWIzaj8cLhtmGimtJ7B2v3b + * 6xpTPDvmhdJvA0V6rUmMw5anRqS7O0jT1xy0PPcECqOFnZQ+vTX1NCE9CInfxVSv + * z5D32FxXxXdayNGzj+4BXAcTPwKBgQCsxKDMfFHbZQoC2rzYdyGM0zCu7FBgS7k5 + * xy29mKpPm0R0q/iG3uJEFXN6zdVG8gNixYecbZHVepoXwsYvKQ6KpKn0wmOid5e/ + * xpDoOXCHzP1iT9I950dw+/O9vVycd/4jM32D78sOTvHdBUdAl/Tath+5jeKSBAm+ + * +2qXKSes8wKBgD8IHbZWsTgCqql3wjC8t7OySY5L8GY6GMzQa/EMEsq6EjnYt4bY + * OPbgsQQZgfyp1b0Hn1XcHSHThHdBcpI0xIsxedT5JRe0jo4GpeWx6Lr+PeTZxQ2C + * PBHlN8ys52SxE8uTUgAIyhjhb7kT84OszHo0C6PNCl1OUOHFn9JOSEHfAoGAAsf7 + * iq8ppi1/NsKMrbNlP94ad4ZoWNR/O9Xf/6BYhYWLWZF3I7ysycnKnRx5JXY55bom + * T7dX1KbvmhhRlmrDyCmUbtM+RVxFfhnVNVfPXvBG1/FPAh4aAVCdAN3ugrpPxgNL + * LveKPkW5EQTHu9t2Xpr18ce98PnNqlxjv+EyuU8CgYBQTOYeI/PiK9Y/h1P7GVNL + * hCELdzHtjcMM6jGwpjip5kRuGAVTj0pfdeU+tSabRj1z58Eqpj7DzUGxplVXhBET + * 7ESSWX/dDWcw07cT7p4t6r6zykrwbk8i6L6LjZssMKXtLCsTTPdhGWQ1nbDIEIUB + * 5ypwEwA5xXNjNP0oLX+NIA== + * -----END PRIVATE KEY----- * * server certificate: - * Data: - * Version: 3 (0x2) - * Serial Number: 8 (0x8) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 03:43:04 2008 GMT - * Not After : Aug 25 03:43:04 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: - * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: - * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: - * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: - * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: - * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: - * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: - * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: - * 30:05:40:2c:4f:ab:d9:74:89 - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Basic Constraints: - * CA:FALSE - * X509v3 Key Usage: - * Digital Signature, Non Repudiation, Key Encipherment - * X509v3 Subject Key Identifier: - * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * - * X509v3 Subject Alternative Name: critical - * DNS:localhost - * Signature Algorithm: md5WithRSAEncryption0 - * + * Data: + * Version: 3 (0x2) + * Serial Number: 106315679 (0x6563f9f) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:55 2024 GMT + * Not After : Jul 2 04:16:55 2034 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Server + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08: + * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f: + * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53: + * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5: + * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1: + * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70: + * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14: + * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13: + * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3: + * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4: + * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68: + * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a: + * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5: + * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78: + * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b: + * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d: + * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e: + * 98:cd + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * 5C:AF:44:B1:48:B8:59:9A:64:53:9D:2E:A6:B2:09:D3:0A:92:04:83 + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Authority Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 9d:22:49:5f:56:23:e6:80:35:cc:ab:44:1c:27:bd:c9:8d:89: + * 93:49:58:e8:c1:7a:68:dd:cf:bd:e0:12:76:06:54:cd:2f:62: + * 9b:54:84:f2:bb:90:a0:bb:37:e2:13:1d:f3:df:41:aa:e0:fe: + * c0:ef:46:78:8d:aa:f4:1b:70:ad:a9:16:24:fa:15:4a:c6:0a: + * 8d:e1:99:93:00:a9:d4:b6:08:5d:8e:65:03:dc:d0:95:fc:95: + * 61:a6:ad:b5:ab:4d:a6:e0:05:48:8c:db:42:42:8a:d6:5e:c0: + * 2a:a0:11:15:b8:07:69:5c:3f:99:a0:bd:53:65:db:4e:cf:46: + * 61:93:09:7b:81:40:ff:5c:fe:4c:eb:f4:ac:de:1f:38:ad:b2: + * 60:28:f6:0e:9f:46:e7:07:8f:20:9a:a4:e1:8f:ab:54:99:76: + * 82:d8:9e:70:c4:da:98:85:71:af:3b:54:e4:01:b4:9e:83:d0: + * 7b:c6:8d:1f:ed:25:08:89:05:e9:87:97:76:5a:a3:85:c3:f8: + * 59:d7:bb:3b:5a:db:cb:ed:5d:ff:ac:21:b9:9a:e2:65:0a:bc: + * de:d1:dc:53:94:98:44:97:91:b3:1b:6b:80:0b:9b:57:b3:ae: + * 5c:7c:35:ca:39:71:f7:4e:8f:4a:d7:eb:0b:25:da:b2:1e:17: + * 48:b8:eb:09 * -----BEGIN CERTIFICATE----- - * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD - * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3 - * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6 - * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS - * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw - * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV - * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh - * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac - * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi - * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn - * JqCpf5uZGOo= + * MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx + * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9 + * U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o + * An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q + * IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U + * O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk + * lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W + * aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI + * XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK + * kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T + * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B + * AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE + * 8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ + * lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+ + * TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN + * H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub + * V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ== * -----END CERTIFICATE----- * * * TLS client certificate: * client private key: - * ----BEGIN RSA PRIVATE KEY----- - * Proc-Type: 4,ENCRYPTED - * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390 - * - * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4 - * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf - * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak - * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH - * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat - * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46 - * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++ - * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+ - * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN - * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U - * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO - * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig - * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ= - * -----END RSA PRIVATE KEY----- - * - * -----BEGIN RSA PRIVATE KEY----- - * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4 - * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z - * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB - * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW - * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf - * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6 - * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3 - * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX - * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM - * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1 - * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j - * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY - * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w== - * -----END RSA PRIVATE KEY----- * - * Private-Key: (1024 bit) + * Private-Key: (2048 bit, 2 primes) * modulus: - * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: - * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: - * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: - * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: - * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: - * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: - * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: - * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: - * 75:8d:f5:82:ac:43:92:44:1b + * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f: + * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2: + * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d: + * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24: + * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47: + * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c: + * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0: + * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31: + * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96: + * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58: + * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70: + * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55: + * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2: + * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c: + * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47: + * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19: + * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0: + * 00:4f * publicExponent: 65537 (0x10001) * privateExponent: - * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b: - * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05: - * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96: - * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0: - * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51: - * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef: - * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94: - * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1: - * e5:28:9b:f9:4c:94:c6:b1 + * 62:b2:d6:63:b6:2b:e2:26:5a:31:2b:37:8c:35:60: + * e2:03:ce:93:09:3e:f8:c9:fe:bb:a2:c8:32:0e:6c: + * 8a:7e:0a:c2:13:3b:b8:25:fa:ec:19:95:8e:34:46: + * cf:0e:7b:e4:25:82:1a:7f:21:48:16:44:58:3f:35: + * d8:eb:d8:1a:45:53:0f:9b:84:8a:54:13:33:e4:97: + * 97:f0:48:37:fb:5d:4f:8c:8f:35:63:e1:d9:62:73: + * 1c:8e:d8:cd:2e:1a:e5:4c:b5:05:59:7a:df:f1:68: + * eb:1c:5c:c6:10:44:8c:7d:42:c5:71:8a:e7:1b:aa: + * 17:03:6a:a0:c0:6b:97:50:17:ad:6e:5e:d9:db:6f: + * 3e:e9:3f:35:c3:45:bc:e8:3d:5a:b4:b9:3f:53:80: + * 64:dc:12:24:35:35:bd:98:bb:8d:fa:19:a3:5e:9e: + * ac:70:4a:fc:8d:ae:55:8b:71:81:0e:4d:c8:2f:87: + * b0:44:f7:4f:dc:a8:c8:50:b5:95:24:63:74:13:54: + * 58:de:fc:e0:75:eb:f4:06:58:83:12:4c:56:c4:c4: + * 18:0c:ea:a3:e7:25:a3:de:19:23:a2:5a:2a:b6:56: + * 04:bc:65:ba:7c:0a:f4:91:10:22:88:3f:9d:be:58: + * 43:4c:2e:ad:db:d6:32:cf:8e:b5:05:55:39:8b:e1: + * 01 * prime1: - * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38: - * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f: - * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f: - * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14: - * e2:a0:4d:ab:b5 + * 00:f1:da:c2:8a:e5:66:45:8a:14:fc:08:6e:fb:aa: + * 50:d2:8c:b1:c4:f4:88:26:d4:b8:c4:63:30:ca:e3: + * 0c:6c:50:d4:93:5c:1c:13:37:60:21:11:3b:d1:f1: + * 9f:4c:0d:7b:0e:53:3d:c9:a4:fb:fa:6b:9e:b4:0a: + * 5d:d3:50:88:d7:be:c3:88:b2:b1:8a:6e:7b:d6:70: + * 88:96:a4:fe:90:ef:d1:84:ad:a8:9e:9f:3a:68:3f: + * 3f:82:07:be:c2:44:1e:d5:a1:a9:1a:db:39:d7:7f: + * 0c:6e:35:5b:1d:33:1b:a9:cd:38:2a:64:d1:70:2a: + * fe:b9:c2:b6:ed:59:19:73:b1 * prime2: - * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d: - * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3: - * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4: - * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4: - * 76:7d:ce:32:8f + * 00:d8:b9:3a:38:6c:79:cd:0b:1f:2b:34:74:bf:7a: + * 3d:0c:21:5a:a6:ea:f2:9e:de:68:42:05:7f:ea:a5: + * 00:c9:10:f8:fd:c5:05:8d:03:45:5d:4f:6f:fa:6e: + * 9d:ef:ad:8a:ec:83:d4:ed:57:f3:86:73:15:2f:d2: + * 67:70:d1:62:ef:1d:25:08:59:47:20:62:47:16:35: + * e1:57:38:bf:39:dd:fc:b9:c8:d8:23:53:e2:02:7d: + * 22:31:4c:66:72:96:df:d8:7c:01:2c:71:00:89:18: + * e9:8c:08:44:8c:64:1f:93:9b:7a:97:26:c9:50:d0: + * 87:b2:48:a8:19:71:e1:b3:ff * exponent1: - * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f: - * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b: - * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa: - * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2: - * 4c:de:38:95 + * 23:98:dd:35:70:5a:43:35:f5:ac:ba:d9:0a:f5:a0: + * 7b:bc:f5:95:55:a0:8c:86:96:c3:61:0e:17:6e:9f: + * af:79:9e:30:2a:48:7f:93:90:f4:8d:02:ce:fd:cf: + * 42:74:61:7e:54:46:2d:dd:b8:b0:bd:12:58:d1:85: + * c9:ca:7a:b9:b6:7c:35:2c:87:f1:26:1d:d8:0c:2c: + * 2e:70:0e:7f:ea:ac:5d:e8:e9:7e:9f:55:0b:6e:f3: + * bc:01:c3:d3:f8:0e:c9:c6:c7:8b:0a:65:53:10:82: + * 15:de:88:90:9d:ab:1e:ac:f3:ed:59:75:72:1b:01: + * ee:f9:77:cf:2b:64:11:a1 * exponent2: - * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3: - * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce: - * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3: - * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b: - * 0d:78:df:fd + * 00:9e:29:6f:87:c6:02:8d:d5:54:05:df:de:63:ee: + * fd:a6:60:a1:1b:b7:d3:20:86:07:68:47:43:37:26: + * fc:0f:c0:c7:35:cc:17:64:f5:c2:25:7a:d7:a9:d8: + * 18:82:d6:0f:d0:d3:d5:0c:f1:66:d3:f4:20:be:29: + * bb:3b:e6:53:61:55:cf:b4:ec:12:b0:5b:88:ad:78: + * dc:df:1e:96:cf:d0:65:a3:e0:23:7c:84:b7:28:41: + * d2:36:50:1f:63:f9:1f:9b:89:c4:01:7e:e6:79:27: + * 29:29:fc:ce:a9:f6:57:e5:0d:4e:c6:08:94:5a:da: + * 14:6d:d4:00:79:b1:56:9a:59 * coefficient: - * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31: - * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18: - * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56: - * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da: - * 35:92:f2:e3 + * 6c:73:0d:fe:c7:22:15:5d:8c:a1:91:2b:d1:88:e8: + * 91:f9:d0:3e:d0:ba:c4:74:88:ce:14:20:4e:1e:4b: + * c5:91:8f:c1:56:e9:74:e0:f6:cf:71:91:ed:2c:f5: + * 90:9d:d6:c8:cd:f5:79:dc:6e:b3:83:3e:fa:d6:b4: + * 60:d9:3a:52:12:76:9d:92:fb:db:26:ee:43:33:c4: + * 0b:84:74:1b:91:e0:41:8b:cc:cc:24:da:52:af:2d: + * 42:e7:11:57:0d:aa:66:af:1a:ba:c2:8e:6a:ee:8f: + * 2c:e6:5b:76:38:96:bb:7a:2f:59:fe:de:a1:02:fc: + * 12:3a:aa:9f:3c:0e:a4:78 + * writing RSA key + * -----BEGIN PRIVATE KEY----- + * MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMv5I8pld0H1it + * x2mIb1kyR1BgIuSYSQ4+Hbi64ju2cVv9ZAJtDVB3cm6oPV3UvR92Udya0NY+0DGl + * JFosvnf6iKH6BkHID0dwRySZUFJEWzBiW2U1xCiwXO7QG+s5KwuhrJZI2lZs4OPm + * 491Fy1EzjUBD1/CkMaq1wN9L3ysK7X4QDK4flqIQHmvQ+TeL3w0OAjX4WLxutVcO + * L+og5nOa5WuCcCW7UZp8neJQPc8eJD6SVc8qrQ2Ej6hDJM2tUGR0wnO24ZIcsiuM + * LXuWpkFhXBuPeChRQO1BkM4duCaBR2vjV0F0TiDwWhuXN5GGGcXybQTJeCtaFrz8 + * K3Fb0ABPAgMBAAECggEAYrLWY7Yr4iZaMSs3jDVg4gPOkwk++Mn+u6LIMg5sin4K + * whM7uCX67BmVjjRGzw575CWCGn8hSBZEWD812OvYGkVTD5uEilQTM+SXl/BIN/td + * T4yPNWPh2WJzHI7YzS4a5Uy1BVl63/Fo6xxcxhBEjH1CxXGK5xuqFwNqoMBrl1AX + * rW5e2dtvPuk/NcNFvOg9WrS5P1OAZNwSJDU1vZi7jfoZo16erHBK/I2uVYtxgQ5N + * yC+HsET3T9yoyFC1lSRjdBNUWN784HXr9AZYgxJMVsTEGAzqo+clo94ZI6JaKrZW + * BLxlunwK9JEQIog/nb5YQ0wurdvWMs+OtQVVOYvhAQKBgQDx2sKK5WZFihT8CG77 + * qlDSjLHE9Igm1LjEYzDK4wxsUNSTXBwTN2AhETvR8Z9MDXsOUz3JpPv6a560Cl3T + * UIjXvsOIsrGKbnvWcIiWpP6Q79GEraienzpoPz+CB77CRB7Voaka2znXfwxuNVsd + * MxupzTgqZNFwKv65wrbtWRlzsQKBgQDYuTo4bHnNCx8rNHS/ej0MIVqm6vKe3mhC + * BX/qpQDJEPj9xQWNA0VdT2/6bp3vrYrsg9TtV/OGcxUv0mdw0WLvHSUIWUcgYkcW + * NeFXOL853fy5yNgjU+ICfSIxTGZylt/YfAEscQCJGOmMCESMZB+Tm3qXJslQ0Iey + * SKgZceGz/wKBgCOY3TVwWkM19ay62Qr1oHu89ZVVoIyGlsNhDhdun695njAqSH+T + * kPSNAs79z0J0YX5URi3duLC9EljRhcnKerm2fDUsh/EmHdgMLC5wDn/qrF3o6X6f + * VQtu87wBw9P4DsnGx4sKZVMQghXeiJCdqx6s8+1ZdXIbAe75d88rZBGhAoGBAJ4p + * b4fGAo3VVAXf3mPu/aZgoRu30yCGB2hHQzcm/A/AxzXMF2T1wiV616nYGILWD9DT + * 1QzxZtP0IL4puzvmU2FVz7TsErBbiK143N8els/QZaPgI3yEtyhB0jZQH2P5H5uJ + * xAF+5nknKSn8zqn2V+UNTsYIlFraFG3UAHmxVppZAoGAbHMN/sciFV2MoZEr0Yjo + * kfnQPtC6xHSIzhQgTh5LxZGPwVbpdOD2z3GR7Sz1kJ3WyM31edxus4M++ta0YNk6 + * UhJ2nZL72ybuQzPEC4R0G5HgQYvMzCTaUq8tQucRVw2qZq8ausKOau6PLOZbdjiW + * u3ovWf7eoQL8EjqqnzwOpHg= + * -----END PRIVATE KEY----- * * client certificate: - * Data: - * Version: 3 (0x2) - * Serial Number: 9 (0x9) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 03:43:24 2008 GMT - * Not After : Aug 25 03:43:24 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: - * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: - * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: - * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: - * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: - * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: - * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: - * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: - * 75:8d:f5:82:ac:43:92:44:1b - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Basic Constraints: - * CA:FALSE - * X509v3 Key Usage: - * Digital Signature, Non Repudiation, Key Encipherment - * X509v3 Subject Key Identifier: - * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * - * X509v3 Subject Alternative Name: critical - * DNS:localhost - * Signature Algorithm: md5WithRSAEncryption - * + * Data: + * Version: 3 (0x2) + * Serial Number: 1500699355 (0x5972dadb) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:52 2024 GMT + * Not After : Jul 2 04:16:52 2034 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Client + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f: + * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2: + * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d: + * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24: + * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47: + * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c: + * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0: + * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31: + * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96: + * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58: + * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70: + * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55: + * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2: + * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c: + * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47: + * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19: + * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0: + * 00:4f + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * CD:45:E2:05:92:88:A3:C7:49:28:E7:D3:37:B7:13:92:FB:B1:36:C4 + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Authority Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 23:6e:e9:5d:80:0d:b3:86:c9:cd:17:81:33:bd:5b:aa:c0:65: + * 4c:6b:9f:fa:ee:32:e9:89:e1:d0:c7:1d:5c:43:7e:94:ac:83: + * af:91:90:4c:26:61:8d:fe:6b:1a:aa:6e:61:39:b3:24:4a:dc: + * 92:c8:ca:f2:80:b0:05:41:0c:b3:dd:ed:b7:81:42:9a:1e:4e: + * f2:80:6c:72:62:8b:bd:d4:cd:23:7d:7c:e8:6f:e3:67:89:6a: + * 79:19:dd:f6:57:62:12:fa:eb:cd:66:c3:d2:d8:40:5a:1c:dd: + * 7f:9f:b2:34:e9:2a:d6:14:52:ba:6e:a8:9b:0d:a9:a1:03:bf: + * c4:0d:92:3d:59:e4:a9:8e:20:41:39:99:81:70:9d:d0:68:98: + * fc:5f:49:4a:92:e5:a2:c1:51:61:f6:1e:49:56:0b:b6:8c:57: + * db:08:2a:f0:a3:04:dc:a1:04:a2:5c:d0:90:4f:13:8d:1c:e6: + * 2e:7a:63:9c:32:40:65:59:04:5d:71:90:5a:a8:db:6a:30:42: + * 57:5b:0b:df:ce:a1:1f:fa:23:71:f3:57:12:c4:1c:66:3b:37: + * 77:32:28:a7:fb:ad:ee:86:51:4c:80:2f:dd:c8:5b:9f:a7:15: + * 07:fa:2b:5a:ee:93:00:5f:a6:43:22:1b:40:52:15:66:01:84: + * 32:9e:71:21 * -----BEGIN CERTIFICATE----- - * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD - * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas - * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV - * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq - * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw - * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV - * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh - * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F - * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj - * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN - * cl/epUcHL7E= + * MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx + * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9 + * U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym + * V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ + * 1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja + * Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY + * vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh + * khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4 + * K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7 + * sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T + * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B + * AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ + * TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j + * Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g + * QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj + * nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb + * n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ== * -----END CERTIFICATE----- * * - * * Trusted CA certificate: * Certificate: * Data: - * Version: 3 (0x2) - * Serial Number: 0 (0x0) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 02:43:36 2008 GMT - * Not After : Aug 25 02:43:36 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d: - * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53: - * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9: - * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f: - * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7: - * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee: - * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee: - * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97: - * 89:2a:95:12:4c:d8:09:2a:e9 - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Subject Key Identifier: - * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org - * serial:00 - * - * X509v3 Basic Constraints: - * CA:TRUE - * Signature Algorithm: md5WithRSAEncryption - * + * Version: 3 (0x2) + * Serial Number: 1539881479 (0x5bc8ba07) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:50 2024 GMT + * Not After : Jul 2 04:16:50 2034 GMT + * Subject: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:bc:a6:55:60:3f:17:74:39:ba:71:8c:ef:11:3f: + * 9d:36:47:d5:02:d1:4d:9d:7e:b8:fe:59:b1:2b:f1: + * b7:b0:0c:31:57:eb:9c:9d:13:f5:4c:5f:fc:c4:9e: + * f9:75:09:0f:96:8f:05:77:30:a8:35:48:71:96:e4: + * a5:7d:1a:81:fb:e6:bf:90:80:60:5d:11:20:54:16: + * 0b:6d:df:64:de:18:d5:98:51:38:9d:c9:d6:5f:de: + * 9d:de:fe:a8:5f:d3:25:3d:ad:f3:2b:45:c8:4a:80: + * 97:14:7b:85:9d:cf:59:08:bb:c7:67:ac:8b:29:f3: + * 1e:93:bf:fb:82:53:c5:ae:b4:bc:55:30:15:a8:7e: + * 3f:82:22:59:43:cc:d2:62:e7:65:67:72:ec:10:8a: + * fc:05:90:91:72:dd:e9:6f:e2:9f:0c:ab:a1:83:55: + * 02:23:b7:a3:c3:50:ab:be:0b:bb:51:75:50:d1:a8: + * c9:e5:f5:06:fe:00:09:a6:1b:8a:16:29:0d:ab:00: + * 3e:bc:d2:73:d9:37:d7:d9:9a:58:6e:2d:2a:f6:76: + * ae:f4:ea:6d:70:de:7f:e3:04:43:c0:4f:91:3f:78: + * 58:d7:c2:ad:74:eb:04:9d:d0:7e:82:b8:7a:97:44: + * 61:fa:41:45:a6:ca:7d:a5:2e:fc:f9:a6:cf:61:cd: + * 75:bf + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * X509v3 Basic Constraints: critical + * CA:TRUE + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 1f:89:34:e3:ee:05:33:3b:18:ca:96:13:3d:ad:cd:5a:e6:24: + * 46:94:36:ad:37:a5:36:a9:92:37:f9:ed:07:dd:44:5b:c9:2e: + * 68:f7:82:f3:58:1c:64:ed:64:d0:ad:eb:30:15:e0:04:3a:d7: + * c8:c7:9d:65:76:ae:84:e4:2e:2d:0d:68:09:0d:e5:ae:cc:a7: + * 54:86:ad:ff:00:95:85:01:49:db:5b:8e:c2:6f:e7:19:10:17: + * f7:03:b9:a8:97:21:a2:fc:7f:c0:e0:7a:12:64:b8:70:f5:e8: + * b6:e1:25:f7:eb:32:3e:46:ce:43:55:fc:0b:62:59:90:61:63: + * f9:94:6c:95:63:31:1b:00:59:1f:72:9d:d0:0b:4f:cd:02:eb: + * de:20:4e:60:48:4e:ea:ad:3c:0f:1d:bf:1a:69:3d:a8:3d:8b: + * f5:a2:ae:8c:4f:d7:0e:b3:e1:9b:b3:2c:89:19:18:da:db:e1: + * 6d:d5:ab:c8:b8:48:57:d8:8b:33:01:d4:97:91:d9:da:34:a1: + * ef:36:00:e1:38:19:34:8f:0d:47:af:57:cf:59:d6:8b:0d:9e: + * 89:05:82:3d:3c:f3:45:1d:4a:3f:0e:0f:5a:28:6f:5c:e1:e9: + * 60:72:87:28:b6:97:44:8b:d7:c6:cd:cb:dc:5a:5d:60:f1:b4: + * 37:ee:44:db * -----BEGIN CERTIFICATE----- - * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB - * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX - * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj - * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G - * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ - * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt - * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw - * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA - * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ - * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P - * 6Mvf0r1PNTY2hwTJLJmKtg== - * -----END CERTIFICATE--- + * MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx + * CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A + * MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1 + * TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW + * X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/ + * giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG + * /gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE + * ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ + * 9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF + * AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc + * ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX + * 9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd + * 0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI + * V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp + * YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w== + * */ @@ -427,201 +568,342 @@ */ static String trusedCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" + - "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" + - "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" + - "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" + - "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" + - "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" + - "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" + - "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" + - "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" + - "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" + - "6Mvf0r1PNTY2hwTJLJmKtg==\n" + + "MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx\n" + + "CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" + + "MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1\n" + + "TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW\n" + + "X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/\n" + + "giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG\n" + + "/gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE\n" + + "ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ\n" + + "9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF\n" + + "AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc\n" + + "ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX\n" + + "9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd\n" + + "0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI\n" + + "V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp\n" + + "YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==\n" + "-----END CERTIFICATE-----"; static String serverCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" + - "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" + - "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" + - "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" + - "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + - "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" + - "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + - "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" + - "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" + - "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" + - "JqCpf5uZGOo=\n" + + "MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx\n" + + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" + + "U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o\n" + + "An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q\n" + + "IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U\n" + + "O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk\n" + + "lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W\n" + + "aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI\n" + + "XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK\n" + + "kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" + + "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" + + "AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE\n" + + "8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ\n" + + "lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+\n" + + "TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN\n" + + "H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub\n" + + "V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==\n" + "-----END CERTIFICATE-----"; static String clientCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" + - "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" + - "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" + - "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" + - "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + - "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" + - "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + - "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" + - "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" + - "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" + - "cl/epUcHL7E=\n" + + "MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx\n" + + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" + + "U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym\n" + + "V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ\n" + + "1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja\n" + + "Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY\n" + + "vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh\n" + + "khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4\n" + + "K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7\n" + + "sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" + + "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" + + "AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ\n" + + "TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j\n" + + "Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g\n" + + "QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj\n" + + "nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb\n" + + "n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==\n" + "-----END CERTIFICATE-----"; static byte serverPrivateExponent[] = { - (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83, - (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44, - (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89, - (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60, - (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21, - (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc, - (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e, - (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3, - (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54, - (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf, - (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0, - (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9, - (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29, - (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c, - (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9, - (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6, - (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72, - (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4, - (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76, - (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f, - (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5, - (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71, - (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e, - (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4, - (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a, - (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4, - (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a, - (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18, - (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba, - (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3, - (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59, - (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1 + (byte)0x68, (byte)0x87, (byte)0x36, (byte)0x54, + (byte)0xa3, (byte)0xc6, (byte)0xd5, (byte)0x5f, + (byte)0xf5, (byte)0x0f, (byte)0x4f, (byte)0x76, + (byte)0xc8, (byte)0x9c, (byte)0x2b, (byte)0x5b, + (byte)0xdc, (byte)0xe2, (byte)0xbe, (byte)0x14, + (byte)0x12, (byte)0x2f, (byte)0xc7, (byte)0x0a, + (byte)0xa9, (byte)0xcb, (byte)0x5e, (byte)0x04, + (byte)0x59, (byte)0xca, (byte)0x35, (byte)0x2f, + (byte)0x8d, (byte)0x2b, (byte)0xc4, (byte)0x40, + (byte)0xe6, (byte)0x7d, (byte)0x25, (byte)0x1b, + (byte)0x4d, (byte)0x07, (byte)0xc3, (byte)0x99, + (byte)0x9c, (byte)0x16, (byte)0x4f, (byte)0xa5, + (byte)0xdc, (byte)0xde, (byte)0xb0, (byte)0x90, + (byte)0xf0, (byte)0xde, (byte)0x22, (byte)0x70, + (byte)0x80, (byte)0xf4, (byte)0xa6, (byte)0x70, + (byte)0xe2, (byte)0x96, (byte)0x3d, (byte)0x18, + (byte)0x21, (byte)0xbf, (byte)0x2b, (byte)0x27, + (byte)0xa4, (byte)0x2d, (byte)0xd7, (byte)0xae, + (byte)0x2b, (byte)0x12, (byte)0x2f, (byte)0x08, + (byte)0x36, (byte)0xee, (byte)0x99, (byte)0x94, + (byte)0xed, (byte)0xf6, (byte)0xa7, (byte)0xd9, + (byte)0x1d, (byte)0xa2, (byte)0xf3, (byte)0x1f, + (byte)0x44, (byte)0xa4, (byte)0x28, (byte)0x4b, + (byte)0x67, (byte)0x35, (byte)0xd6, (byte)0xa8, + (byte)0x1b, (byte)0xf8, (byte)0x84, (byte)0x34, + (byte)0x34, (byte)0x84, (byte)0xbd, (byte)0xec, + (byte)0x9e, (byte)0x03, (byte)0x08, (byte)0x3c, + (byte)0x93, (byte)0x20, (byte)0x8e, (byte)0xaf, + (byte)0x15, (byte)0xcb, (byte)0x1f, (byte)0x20, + (byte)0x08, (byte)0x97, (byte)0xc4, (byte)0x19, + (byte)0x3e, (byte)0xfa, (byte)0x36, (byte)0xc6, + (byte)0xab, (byte)0x0e, (byte)0x2f, (byte)0xe7, + (byte)0xb3, (byte)0xc0, (byte)0xa7, (byte)0xbc, + (byte)0xe4, (byte)0xe0, (byte)0xa6, (byte)0x08, + (byte)0x1c, (byte)0x69, (byte)0x20, (byte)0x4d, + (byte)0x78, (byte)0xbd, (byte)0x7a, (byte)0xe5, + (byte)0x25, (byte)0x48, (byte)0x60, (byte)0x9e, + (byte)0x2e, (byte)0x50, (byte)0x8d, (byte)0x36, + (byte)0x1e, (byte)0x07, (byte)0xe9, (byte)0xd5, + (byte)0x0d, (byte)0x39, (byte)0x67, (byte)0x41, + (byte)0x42, (byte)0x24, (byte)0xdb, (byte)0x87, + (byte)0xe5, (byte)0x77, (byte)0x76, (byte)0xfd, + (byte)0x5e, (byte)0xd5, (byte)0xc6, (byte)0xe5, + (byte)0xd3, (byte)0xb0, (byte)0x98, (byte)0x71, + (byte)0x48, (byte)0x69, (byte)0x47, (byte)0x4f, + (byte)0x46, (byte)0x05, (byte)0x0c, (byte)0x9e, + (byte)0x58, (byte)0x45, (byte)0x2e, (byte)0xe2, + (byte)0x27, (byte)0xd0, (byte)0xf6, (byte)0x11, + (byte)0x05, (byte)0x78, (byte)0xad, (byte)0x83, + (byte)0x5a, (byte)0x5b, (byte)0xec, (byte)0xd7, + (byte)0x2e, (byte)0x26, (byte)0x5a, (byte)0xa5, + (byte)0x4f, (byte)0x9e, (byte)0x52, (byte)0x84, + (byte)0x2c, (byte)0x1f, (byte)0x59, (byte)0x1a, + (byte)0x78, (byte)0x56, (byte)0x0a, (byte)0x44, + (byte)0x54, (byte)0xc6, (byte)0x37, (byte)0x64, + (byte)0x01, (byte)0xca, (byte)0xe4, (byte)0xa8, + (byte)0x01, (byte)0xc7, (byte)0x86, (byte)0xc1, + (byte)0xb4, (byte)0xd6, (byte)0x6c, (byte)0x7a, + (byte)0x15, (byte)0x9a, (byte)0x65, (byte)0x69, + (byte)0x46, (byte)0x9e, (byte)0xfd, (byte)0xf6, + (byte)0x08, (byte)0x17, (byte)0x0c, (byte)0x6c, + (byte)0xac, (byte)0x38, (byte)0xbd, (byte)0xc2, + (byte)0xcd, (byte)0xda, (byte)0xef, (byte)0x54, + (byte)0x7a, (byte)0x48, (byte)0x92, (byte)0x4d }; static byte serverModulus[] = { - (byte)0x00, - (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c, - (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99, - (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79, - (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48, - (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84, - (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c, - (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9, - (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39, - (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72, - (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44, - (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc, - (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6, - (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54, - (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc, - (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f, - (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f, - (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2, - (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88, - (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f, - (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53, - (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33, - (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47, - (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea, - (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75, - (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc, - (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9, - (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2, - (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24, - (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03, - (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30, - (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f, - (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89 + (byte)0x00, (byte)0x9a, (byte)0x0c, (byte)0xe0, + (byte)0x8f, (byte)0xa8, (byte)0x02, (byte)0x7e, + (byte)0x5a, (byte)0xef, (byte)0xed, (byte)0xb2, + (byte)0x42, (byte)0xad, (byte)0x08, (byte)0x4e, + (byte)0x91, (byte)0xba, (byte)0xc2, (byte)0xad, + (byte)0x9b, (byte)0x79, (byte)0xd7, (byte)0x9b, + (byte)0x0f, (byte)0xfd, (byte)0xd2, (byte)0xf8, + (byte)0x15, (byte)0x2f, (byte)0x19, (byte)0x89, + (byte)0x80, (byte)0x10, (byte)0x00, (byte)0x02, + (byte)0x19, (byte)0x6d, (byte)0x27, (byte)0xc2, + (byte)0x90, (byte)0xd7, (byte)0xa5, (byte)0x23, + (byte)0x53, (byte)0x74, (byte)0x6e, (byte)0x64, + (byte)0x28, (byte)0x7c, (byte)0x24, (byte)0xaa, + (byte)0xed, (byte)0xea, (byte)0x21, (byte)0x59, + (byte)0xdc, (byte)0xa3, (byte)0x5c, (byte)0xb5, + (byte)0xc9, (byte)0x42, (byte)0x31, (byte)0x4f, + (byte)0xa2, (byte)0xde, (byte)0xfb, (byte)0x09, + (byte)0x7c, (byte)0x73, (byte)0xed, (byte)0x88, + (byte)0x04, (byte)0x34, (byte)0xf1, (byte)0x15, + (byte)0xad, (byte)0x3d, (byte)0x60, (byte)0xcd, + (byte)0xca, (byte)0xc5, (byte)0x13, (byte)0x99, + (byte)0xd3, (byte)0x9f, (byte)0x9b, (byte)0xb2, + (byte)0x92, (byte)0x70, (byte)0xcb, (byte)0xba, + (byte)0x4b, (byte)0x3d, (byte)0x20, (byte)0x96, + (byte)0xad, (byte)0xbe, (byte)0x92, (byte)0x53, + (byte)0xed, (byte)0x54, (byte)0x3b, (byte)0xc5, + (byte)0x14, (byte)0xbd, (byte)0xcf, (byte)0xd4, + (byte)0x0f, (byte)0xcb, (byte)0x05, (byte)0x4f, + (byte)0xfd, (byte)0x2b, (byte)0x9e, (byte)0xe0, + (byte)0x50, (byte)0xbb, (byte)0x65, (byte)0x13, + (byte)0x92, (byte)0xc0, (byte)0xd6, (byte)0xbd, + (byte)0x4d, (byte)0x02, (byte)0x0c, (byte)0x70, + (byte)0xb6, (byte)0x65, (byte)0xd4, (byte)0x7d, + (byte)0xb4, (byte)0x4d, (byte)0xc3, (byte)0xdf, + (byte)0x2c, (byte)0x08, (byte)0x9e, (byte)0xd2, + (byte)0x3e, (byte)0x69, (byte)0x32, (byte)0x46, + (byte)0x6f, (byte)0x6f, (byte)0xca, (byte)0xd1, + (byte)0x73, (byte)0xa4, (byte)0x94, (byte)0x07, + (byte)0xef, (byte)0x14, (byte)0xe3, (byte)0xda, + (byte)0x9e, (byte)0x2f, (byte)0xc0, (byte)0xac, + (byte)0x0e, (byte)0x10, (byte)0x33, (byte)0x4c, + (byte)0x68, (byte)0x79, (byte)0xf3, (byte)0x79, + (byte)0x40, (byte)0xd6, (byte)0xe9, (byte)0x3c, + (byte)0xc2, (byte)0xe6, (byte)0x70, (byte)0xe0, + (byte)0x89, (byte)0xce, (byte)0xa0, (byte)0x7a, + (byte)0xa8, (byte)0x84, (byte)0x28, (byte)0x85, + (byte)0x32, (byte)0x37, (byte)0x08, (byte)0xb0, + (byte)0xcf, (byte)0xb1, (byte)0x7f, (byte)0x5f, + (byte)0xbc, (byte)0x1f, (byte)0xa5, (byte)0x3d, + (byte)0xef, (byte)0xd6, (byte)0x68, (byte)0xa8, + (byte)0x17, (byte)0x21, (byte)0x5f, (byte)0x87, + (byte)0xd5, (byte)0x4b, (byte)0xb5, (byte)0xcc, + (byte)0xee, (byte)0x78, (byte)0x8d, (byte)0xdd, + (byte)0xb1, (byte)0x28, (byte)0x6a, (byte)0xc0, + (byte)0xfb, (byte)0x64, (byte)0xbd, (byte)0xb7, + (byte)0x70, (byte)0x02, (byte)0x33, (byte)0x03, + (byte)0x0b, (byte)0xb8, (byte)0xb8, (byte)0xbb, + (byte)0x08, (byte)0x82, (byte)0xf6, (byte)0x8e, + (byte)0x05, (byte)0x27, (byte)0xd1, (byte)0x3b, + (byte)0xe6, (byte)0xc5, (byte)0xac, (byte)0x4d, + (byte)0x85, (byte)0x5b, (byte)0xa1, (byte)0x1d, + (byte)0xa3, (byte)0x48, (byte)0x5d, (byte)0x03, + (byte)0x15, (byte)0x76, (byte)0x63, (byte)0x6c, + (byte)0x71, (byte)0x21, (byte)0x3e, (byte)0x98, + (byte)0xcd }; static byte clientPrivateExponent[] = { - (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36, - (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce, - (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84, - (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25, - (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4, - (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a, - (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19, - (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2, - (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77, - (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84, - (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41, - (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8, - (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71, - (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a, - (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0, - (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6, - (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39, - (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e, - (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a, - (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88, - (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89, - (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d, - (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a, - (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69, - (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37, - (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7, - (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27, - (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8, - (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8, - (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1, - (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9, - (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1 + (byte)0x62, (byte)0xb2, (byte)0xd6, (byte)0x63, + (byte)0xb6, (byte)0x2b, (byte)0xe2, (byte)0x26, + (byte)0x5a, (byte)0x31, (byte)0x2b, (byte)0x37, + (byte)0x8c, (byte)0x35, (byte)0x60, (byte)0xe2, + (byte)0x03, (byte)0xce, (byte)0x93, (byte)0x09, + (byte)0x3e, (byte)0xf8, (byte)0xc9, (byte)0xfe, + (byte)0xbb, (byte)0xa2, (byte)0xc8, (byte)0x32, + (byte)0x0e, (byte)0x6c, (byte)0x8a, (byte)0x7e, + (byte)0x0a, (byte)0xc2, (byte)0x13, (byte)0x3b, + (byte)0xb8, (byte)0x25, (byte)0xfa, (byte)0xec, + (byte)0x19, (byte)0x95, (byte)0x8e, (byte)0x34, + (byte)0x46, (byte)0xcf, (byte)0x0e, (byte)0x7b, + (byte)0xe4, (byte)0x25, (byte)0x82, (byte)0x1a, + (byte)0x7f, (byte)0x21, (byte)0x48, (byte)0x16, + (byte)0x44, (byte)0x58, (byte)0x3f, (byte)0x35, + (byte)0xd8, (byte)0xeb, (byte)0xd8, (byte)0x1a, + (byte)0x45, (byte)0x53, (byte)0x0f, (byte)0x9b, + (byte)0x84, (byte)0x8a, (byte)0x54, (byte)0x13, + (byte)0x33, (byte)0xe4, (byte)0x97, (byte)0x97, + (byte)0xf0, (byte)0x48, (byte)0x37, (byte)0xfb, + (byte)0x5d, (byte)0x4f, (byte)0x8c, (byte)0x8f, + (byte)0x35, (byte)0x63, (byte)0xe1, (byte)0xd9, + (byte)0x62, (byte)0x73, (byte)0x1c, (byte)0x8e, + (byte)0xd8, (byte)0xcd, (byte)0x2e, (byte)0x1a, + (byte)0xe5, (byte)0x4c, (byte)0xb5, (byte)0x05, + (byte)0x59, (byte)0x7a, (byte)0xdf, (byte)0xf1, + (byte)0x68, (byte)0xeb, (byte)0x1c, (byte)0x5c, + (byte)0xc6, (byte)0x10, (byte)0x44, (byte)0x8c, + (byte)0x7d, (byte)0x42, (byte)0xc5, (byte)0x71, + (byte)0x8a, (byte)0xe7, (byte)0x1b, (byte)0xaa, + (byte)0x17, (byte)0x03, (byte)0x6a, (byte)0xa0, + (byte)0xc0, (byte)0x6b, (byte)0x97, (byte)0x50, + (byte)0x17, (byte)0xad, (byte)0x6e, (byte)0x5e, + (byte)0xd9, (byte)0xdb, (byte)0x6f, (byte)0x3e, + (byte)0xe9, (byte)0x3f, (byte)0x35, (byte)0xc3, + (byte)0x45, (byte)0xbc, (byte)0xe8, (byte)0x3d, + (byte)0x5a, (byte)0xb4, (byte)0xb9, (byte)0x3f, + (byte)0x53, (byte)0x80, (byte)0x64, (byte)0xdc, + (byte)0x12, (byte)0x24, (byte)0x35, (byte)0x35, + (byte)0xbd, (byte)0x98, (byte)0xbb, (byte)0x8d, + (byte)0xfa, (byte)0x19, (byte)0xa3, (byte)0x5e, + (byte)0x9e, (byte)0xac, (byte)0x70, (byte)0x4a, + (byte)0xfc, (byte)0x8d, (byte)0xae, (byte)0x55, + (byte)0x8b, (byte)0x71, (byte)0x81, (byte)0x0e, + (byte)0x4d, (byte)0xc8, (byte)0x2f, (byte)0x87, + (byte)0xb0, (byte)0x44, (byte)0xf7, (byte)0x4f, + (byte)0xdc, (byte)0xa8, (byte)0xc8, (byte)0x50, + (byte)0xb5, (byte)0x95, (byte)0x24, (byte)0x63, + (byte)0x74, (byte)0x13, (byte)0x54, (byte)0x58, + (byte)0xde, (byte)0xfc, (byte)0xe0, (byte)0x75, + (byte)0xeb, (byte)0xf4, (byte)0x06, (byte)0x58, + (byte)0x83, (byte)0x12, (byte)0x4c, (byte)0x56, + (byte)0xc4, (byte)0xc4, (byte)0x18, (byte)0x0c, + (byte)0xea, (byte)0xa3, (byte)0xe7, (byte)0x25, + (byte)0xa3, (byte)0xde, (byte)0x19, (byte)0x23, + (byte)0xa2, (byte)0x5a, (byte)0x2a, (byte)0xb6, + (byte)0x56, (byte)0x04, (byte)0xbc, (byte)0x65, + (byte)0xba, (byte)0x7c, (byte)0x0a, (byte)0xf4, + (byte)0x91, (byte)0x10, (byte)0x22, (byte)0x88, + (byte)0x3f, (byte)0x9d, (byte)0xbe, (byte)0x58, + (byte)0x43, (byte)0x4c, (byte)0x2e, (byte)0xad, + (byte)0xdb, (byte)0xd6, (byte)0x32, (byte)0xcf, + (byte)0x8e, (byte)0xb5, (byte)0x05, (byte)0x55, + (byte)0x39, (byte)0x8b, (byte)0xe1, (byte)0x01 }; static byte clientModulus[] = { - (byte)0x00, - (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36, - (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e, - (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00, - (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f, - (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93, - (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1, - (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8, - (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99, - (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f, - (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24, - (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7, - (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44, - (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2, - (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c, - (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d, - (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a, - (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6, - (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f, - (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97, - (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05, - (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf, - (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3, - (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c, - (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf, - (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56, - (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9, - (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf, - (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab, - (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1, - (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75, - (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac, - (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b + (byte)0x00, (byte)0xcc, (byte)0xbf, (byte)0x92, + (byte)0x3c, (byte)0xa6, (byte)0x57, (byte)0x74, + (byte)0x1f, (byte)0x58, (byte)0xad, (byte)0xc7, + (byte)0x69, (byte)0x88, (byte)0x6f, (byte)0x59, + (byte)0x32, (byte)0x47, (byte)0x50, (byte)0x60, + (byte)0x22, (byte)0xe4, (byte)0x98, (byte)0x49, + (byte)0x0e, (byte)0x3e, (byte)0x1d, (byte)0xb8, + (byte)0xba, (byte)0xe2, (byte)0x3b, (byte)0xb6, + (byte)0x71, (byte)0x5b, (byte)0xfd, (byte)0x64, + (byte)0x02, (byte)0x6d, (byte)0x0d, (byte)0x50, + (byte)0x77, (byte)0x72, (byte)0x6e, (byte)0xa8, + (byte)0x3d, (byte)0x5d, (byte)0xd4, (byte)0xbd, + (byte)0x1f, (byte)0x76, (byte)0x51, (byte)0xdc, + (byte)0x9a, (byte)0xd0, (byte)0xd6, (byte)0x3e, + (byte)0xd0, (byte)0x31, (byte)0xa5, (byte)0x24, + (byte)0x5a, (byte)0x2c, (byte)0xbe, (byte)0x77, + (byte)0xfa, (byte)0x88, (byte)0xa1, (byte)0xfa, + (byte)0x06, (byte)0x41, (byte)0xc8, (byte)0x0f, + (byte)0x47, (byte)0x70, (byte)0x47, (byte)0x24, + (byte)0x99, (byte)0x50, (byte)0x52, (byte)0x44, + (byte)0x5b, (byte)0x30, (byte)0x62, (byte)0x5b, + (byte)0x65, (byte)0x35, (byte)0xc4, (byte)0x28, + (byte)0xb0, (byte)0x5c, (byte)0xee, (byte)0xd0, + (byte)0x1b, (byte)0xeb, (byte)0x39, (byte)0x2b, + (byte)0x0b, (byte)0xa1, (byte)0xac, (byte)0x96, + (byte)0x48, (byte)0xda, (byte)0x56, (byte)0x6c, + (byte)0xe0, (byte)0xe3, (byte)0xe6, (byte)0xe3, + (byte)0xdd, (byte)0x45, (byte)0xcb, (byte)0x51, + (byte)0x33, (byte)0x8d, (byte)0x40, (byte)0x43, + (byte)0xd7, (byte)0xf0, (byte)0xa4, (byte)0x31, + (byte)0xaa, (byte)0xb5, (byte)0xc0, (byte)0xdf, + (byte)0x4b, (byte)0xdf, (byte)0x2b, (byte)0x0a, + (byte)0xed, (byte)0x7e, (byte)0x10, (byte)0x0c, + (byte)0xae, (byte)0x1f, (byte)0x96, (byte)0xa2, + (byte)0x10, (byte)0x1e, (byte)0x6b, (byte)0xd0, + (byte)0xf9, (byte)0x37, (byte)0x8b, (byte)0xdf, + (byte)0x0d, (byte)0x0e, (byte)0x02, (byte)0x35, + (byte)0xf8, (byte)0x58, (byte)0xbc, (byte)0x6e, + (byte)0xb5, (byte)0x57, (byte)0x0e, (byte)0x2f, + (byte)0xea, (byte)0x20, (byte)0xe6, (byte)0x73, + (byte)0x9a, (byte)0xe5, (byte)0x6b, (byte)0x82, + (byte)0x70, (byte)0x25, (byte)0xbb, (byte)0x51, + (byte)0x9a, (byte)0x7c, (byte)0x9d, (byte)0xe2, + (byte)0x50, (byte)0x3d, (byte)0xcf, (byte)0x1e, + (byte)0x24, (byte)0x3e, (byte)0x92, (byte)0x55, + (byte)0xcf, (byte)0x2a, (byte)0xad, (byte)0x0d, + (byte)0x84, (byte)0x8f, (byte)0xa8, (byte)0x43, + (byte)0x24, (byte)0xcd, (byte)0xad, (byte)0x50, + (byte)0x64, (byte)0x74, (byte)0xc2, (byte)0x73, + (byte)0xb6, (byte)0xe1, (byte)0x92, (byte)0x1c, + (byte)0xb2, (byte)0x2b, (byte)0x8c, (byte)0x2d, + (byte)0x7b, (byte)0x96, (byte)0xa6, (byte)0x41, + (byte)0x61, (byte)0x5c, (byte)0x1b, (byte)0x8f, + (byte)0x78, (byte)0x28, (byte)0x51, (byte)0x40, + (byte)0xed, (byte)0x41, (byte)0x90, (byte)0xce, + (byte)0x1d, (byte)0xb8, (byte)0x26, (byte)0x81, + (byte)0x47, (byte)0x6b, (byte)0xe3, (byte)0x57, + (byte)0x41, (byte)0x74, (byte)0x4e, (byte)0x20, + (byte)0xf0, (byte)0x5a, (byte)0x1b, (byte)0x97, + (byte)0x37, (byte)0x91, (byte)0x86, (byte)0x19, + (byte)0xc5, (byte)0xf2, (byte)0x6d, (byte)0x04, + (byte)0xc9, (byte)0x78, (byte)0x2b, (byte)0x5a, + (byte)0x16, (byte)0xbc, (byte)0xfc, (byte)0x2b, + (byte)0x71, (byte)0x5b, (byte)0xd0, (byte)0x00, + (byte)0x4f }; static char passphrase[] = "passphrase".toCharArray(); @@ -808,26 +1090,26 @@ } static Test[] tests = { - // MD5 is used in this test case, don't disable MD5 algorithm. + // SHA1 is used in this test case, don't disable SHA1 algorithm. new Test( "SSLv3, RC4, DH keySize < 768", "MD2, RSA keySize < 1024", false), - // Disable MD5 but only if cert chains back to public root CA, should - // pass because the MD5 cert in this test case is issued by test CA + // Disable SHA1 but only if cert chains back to public root CA, should + // pass because the SHA1 cert in this test case is issued by test CA new Test( "SSLv3, RC4, DH keySize < 768", - "MD2, MD5 jdkCA, RSA keySize < 1024", + "MD2, SHA1 jdkCA, RSA keySize < 1024", false), - // Disable MD5 alg via TLS property and expect failure + // Disable SHA1 alg via TLS property and expect failure new Test( - "SSLv3, MD5, RC4, DH keySize < 768", + "SSLv3, SHA1, RC4, DH keySize < 768", "MD2, RSA keySize < 1024", true), - // Disable MD5 alg via certpath property and expect failure + // Disable SHA1 alg via certpath property and expect failure new Test( "SSLv3, RC4, DH keySize < 768", - "MD2, MD5, RSA keySize < 1024", + "MD2, SHA1, RSA keySize < 1024", true), }; @@ -850,7 +1132,7 @@ try { new PKIXExtendedTM(); if (test.fail) { - throw new Exception("Expected MD5 certificate to be blocked"); + throw new Exception("Expected SHA1 certificate to be blocked"); } } catch (Exception e) { if (test.fail) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,357 +52,497 @@ * * TLS server certificate: * server private key: - * -----BEGIN RSA PRIVATE KEY----- - * Proc-Type: 4,ENCRYPTED - * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A - * - * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e - * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI - * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n - * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb - * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP - * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz - * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF - * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J - * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa - * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH - * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT - * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q - * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A== - * -----END RSA PRIVATE KEY----- - * - * -----BEGIN RSA PRIVATE KEY----- - * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie - * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU - * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB - * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi - * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y - * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo - * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4 - * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51 - * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16 - * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2 - * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC - * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF - * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608= - * -----END RSA PRIVATE KEY----- * - * Private-Key: (1024 bit) + * Private-Key: (2048 bit, 2 primes) * modulus: - * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: - * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: - * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: - * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: - * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: - * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: - * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: - * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: - * 30:05:40:2c:4f:ab:d9:74:89 + * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08: + * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f: + * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53: + * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5: + * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1: + * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70: + * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14: + * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13: + * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3: + * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4: + * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68: + * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a: + * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5: + * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78: + * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b: + * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d: + * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e: + * 98:cd * publicExponent: 65537 (0x10001) * privateExponent: - * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90: - * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82: - * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62: - * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9: - * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77: - * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09: - * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b: - * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3: - * 37:6b:37:59:ed:db:6d:b1 + * 68:87:36:54:a3:c6:d5:5f:f5:0f:4f:76:c8:9c:2b: + * 5b:dc:e2:be:14:12:2f:c7:0a:a9:cb:5e:04:59:ca: + * 35:2f:8d:2b:c4:40:e6:7d:25:1b:4d:07:c3:99:9c: + * 16:4f:a5:dc:de:b0:90:f0:de:22:70:80:f4:a6:70: + * e2:96:3d:18:21:bf:2b:27:a4:2d:d7:ae:2b:12:2f: + * 08:36:ee:99:94:ed:f6:a7:d9:1d:a2:f3:1f:44:a4: + * 28:4b:67:35:d6:a8:1b:f8:84:34:34:84:bd:ec:9e: + * 03:08:3c:93:20:8e:af:15:cb:1f:20:08:97:c4:19: + * 3e:fa:36:c6:ab:0e:2f:e7:b3:c0:a7:bc:e4:e0:a6: + * 08:1c:69:20:4d:78:bd:7a:e5:25:48:60:9e:2e:50: + * 8d:36:1e:07:e9:d5:0d:39:67:41:42:24:db:87:e5: + * 77:76:fd:5e:d5:c6:e5:d3:b0:98:71:48:69:47:4f: + * 46:05:0c:9e:58:45:2e:e2:27:d0:f6:11:05:78:ad: + * 83:5a:5b:ec:d7:2e:26:5a:a5:4f:9e:52:84:2c:1f: + * 59:1a:78:56:0a:44:54:c6:37:64:01:ca:e4:a8:01: + * c7:86:c1:b4:d6:6c:7a:15:9a:65:69:46:9e:fd:f6: + * 08:17:0c:6c:ac:38:bd:c2:cd:da:ef:54:7a:48:92: + * 4d * prime1: - * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a: - * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46: - * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33: - * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7: - * d6:11:4c:99:c7 + * 00:e4:43:cc:51:25:aa:1d:90:41:95:2c:e8:9f:aa: + * 1c:9b:ea:bd:fd:29:e5:68:6b:28:00:ec:31:31:36: + * d0:3d:84:db:c5:5d:32:f6:38:b9:04:4f:45:cb:19: + * f5:88:cd:a8:fc:70:b8:6d:98:68:a6:b4:9e:c1:da: + * fd:db:eb:1a:53:3c:3b:e6:85:d2:6f:03:45:7a:ad: + * 49:8c:c3:96:a7:46:a4:bb:3b:48:d3:d7:1c:b4:3c: + * f7:04:0a:a3:85:9d:94:3e:bd:35:f5:34:21:3d:08: + * 89:df:c5:54:af:cf:90:f7:d8:5c:57:c5:77:5a:c8: + * d1:b3:8f:ee:01:5c:07:13:3f * prime2: - * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e: - * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7: - * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0: - * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc: - * e0:e1:84:ff:2f + * 00:ac:c4:a0:cc:7c:51:db:65:0a:02:da:bc:d8:77: + * 21:8c:d3:30:ae:ec:50:60:4b:b9:39:c7:2d:bd:98: + * aa:4f:9b:44:74:ab:f8:86:de:e2:44:15:73:7a:cd: + * d5:46:f2:03:62:c5:87:9c:6d:91:d5:7a:9a:17:c2: + * c6:2f:29:0e:8a:a4:a9:f4:c2:63:a2:77:97:bf:c6: + * 90:e8:39:70:87:cc:fd:62:4f:d2:3d:e7:47:70:fb: + * f3:bd:bd:5c:9c:77:fe:23:33:7d:83:ef:cb:0e:4e: + * f1:dd:05:47:40:97:f4:da:b6:1f:b9:8d:e2:92:04: + * 09:be:fb:6a:97:29:27:ac:f3 * exponent1: - * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8: - * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1: - * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c: - * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d: - * 12:b7:6e:91 + * 3f:08:1d:b6:56:b1:38:02:aa:a9:77:c2:30:bc:b7: + * b3:b2:49:8e:4b:f0:66:3a:18:cc:d0:6b:f1:0c:12: + * ca:ba:12:39:d8:b7:86:d8:38:f6:e0:b1:04:19:81: + * fc:a9:d5:bd:07:9f:55:dc:1d:21:d3:84:77:41:72: + * 92:34:c4:8b:31:79:d4:f9:25:17:b4:8e:8e:06:a5: + * e5:b1:e8:ba:fe:3d:e4:d9:c5:0d:82:3c:11:e5:37: + * cc:ac:e7:64:b1:13:cb:93:52:00:08:ca:18:e1:6f: + * b9:13:f3:83:ac:cc:7a:34:0b:a3:cd:0a:5d:4e:50: + * e1:c5:9f:d2:4e:48:41:df * exponent2: - * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50: - * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b: - * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72: - * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4: - * 19:7b:b0:de:53 + * 02:c7:fb:8a:af:29:a6:2d:7f:36:c2:8c:ad:b3:65: + * 3f:de:1a:77:86:68:58:d4:7f:3b:d5:df:ff:a0:58: + * 85:85:8b:59:91:77:23:bc:ac:c9:c9:ca:9d:1c:79: + * 25:76:39:e5:ba:26:4f:b7:57:d4:a6:ef:9a:18:51: + * 96:6a:c3:c8:29:94:6e:d3:3e:45:5c:45:7e:19:d5: + * 35:57:cf:5e:f0:46:d7:f1:4f:02:1e:1a:01:50:9d: + * 00:dd:ee:82:ba:4f:c6:03:4b:2e:f7:8a:3e:45:b9: + * 11:04:c7:bb:db:76:5e:9a:f5:f1:c7:bd:f0:f9:cd: + * aa:5c:63:bf:e1:32:b9:4f * coefficient: - * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35: - * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a: - * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df: - * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21: - * 12:d7:eb:4f - * + * 50:4c:e6:1e:23:f3:e2:2b:d6:3f:87:53:fb:19:53: + * 4b:84:21:0b:77:31:ed:8d:c3:0c:ea:31:b0:a6:38: + * a9:e6:44:6e:18:05:53:8f:4a:5f:75:e5:3e:b5:26: + * 9b:46:3d:73:e7:c1:2a:a6:3e:c3:cd:41:b1:a6:55: + * 57:84:11:13:ec:44:92:59:7f:dd:0d:67:30:d3:b7: + * 13:ee:9e:2d:ea:be:b3:ca:4a:f0:6e:4f:22:e8:be: + * 8b:8d:9b:2c:30:a5:ed:2c:2b:13:4c:f7:61:19:64: + * 35:9d:b0:c8:10:85:01:e7:2a:70:13:00:39:c5:73: + * 63:34:fd:28:2d:7f:8d:20 + * -----BEGIN PRIVATE KEY----- + * MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCaDOCPqAJ+Wu/t + * skKtCE6RusKtm3nXmw/90vgVLxmJgBAAAhltJ8KQ16UjU3RuZCh8JKrt6iFZ3KNc + * tclCMU+i3vsJfHPtiAQ08RWtPWDNysUTmdOfm7KScMu6Sz0glq2+klPtVDvFFL3P + * 1A/LBU/9K57gULtlE5LA1r1NAgxwtmXUfbRNw98sCJ7SPmkyRm9vytFzpJQH7xTj + * 2p4vwKwOEDNMaHnzeUDW6TzC5nDgic6geqiEKIUyNwiwz7F/X7wfpT3v1mioFyFf + * h9VLtczueI3dsShqwPtkvbdwAjMDC7i4uwiC9o4FJ9E75sWsTYVboR2jSF0DFXZj + * bHEhPpjNAgMBAAECggEAaIc2VKPG1V/1D092yJwrW9zivhQSL8cKqcteBFnKNS+N + * K8RA5n0lG00Hw5mcFk+l3N6wkPDeInCA9KZw4pY9GCG/KyekLdeuKxIvCDbumZTt + * 9qfZHaLzH0SkKEtnNdaoG/iENDSEveyeAwg8kyCOrxXLHyAIl8QZPvo2xqsOL+ez + * wKe85OCmCBxpIE14vXrlJUhgni5QjTYeB+nVDTlnQUIk24fld3b9XtXG5dOwmHFI + * aUdPRgUMnlhFLuIn0PYRBXitg1pb7NcuJlqlT55ShCwfWRp4VgpEVMY3ZAHK5KgB + * x4bBtNZsehWaZWlGnv32CBcMbKw4vcLN2u9UekiSTQKBgQDkQ8xRJaodkEGVLOif + * qhyb6r39KeVoaygA7DExNtA9hNvFXTL2OLkET0XLGfWIzaj8cLhtmGimtJ7B2v3b + * 6xpTPDvmhdJvA0V6rUmMw5anRqS7O0jT1xy0PPcECqOFnZQ+vTX1NCE9CInfxVSv + * z5D32FxXxXdayNGzj+4BXAcTPwKBgQCsxKDMfFHbZQoC2rzYdyGM0zCu7FBgS7k5 + * xy29mKpPm0R0q/iG3uJEFXN6zdVG8gNixYecbZHVepoXwsYvKQ6KpKn0wmOid5e/ + * xpDoOXCHzP1iT9I950dw+/O9vVycd/4jM32D78sOTvHdBUdAl/Tath+5jeKSBAm+ + * +2qXKSes8wKBgD8IHbZWsTgCqql3wjC8t7OySY5L8GY6GMzQa/EMEsq6EjnYt4bY + * OPbgsQQZgfyp1b0Hn1XcHSHThHdBcpI0xIsxedT5JRe0jo4GpeWx6Lr+PeTZxQ2C + * PBHlN8ys52SxE8uTUgAIyhjhb7kT84OszHo0C6PNCl1OUOHFn9JOSEHfAoGAAsf7 + * iq8ppi1/NsKMrbNlP94ad4ZoWNR/O9Xf/6BYhYWLWZF3I7ysycnKnRx5JXY55bom + * T7dX1KbvmhhRlmrDyCmUbtM+RVxFfhnVNVfPXvBG1/FPAh4aAVCdAN3ugrpPxgNL + * LveKPkW5EQTHu9t2Xpr18ce98PnNqlxjv+EyuU8CgYBQTOYeI/PiK9Y/h1P7GVNL + * hCELdzHtjcMM6jGwpjip5kRuGAVTj0pfdeU+tSabRj1z58Eqpj7DzUGxplVXhBET + * 7ESSWX/dDWcw07cT7p4t6r6zykrwbk8i6L6LjZssMKXtLCsTTPdhGWQ1nbDIEIUB + * 5ypwEwA5xXNjNP0oLX+NIA== + * -----END PRIVATE KEY----- * * server certificate: - * Data: - * Version: 3 (0x2) - * Serial Number: 8 (0x8) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 03:43:04 2008 GMT - * Not After : Aug 25 03:43:04 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: - * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: - * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: - * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: - * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: - * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: - * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: - * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: - * 30:05:40:2c:4f:ab:d9:74:89 - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Basic Constraints: - * CA:FALSE - * X509v3 Key Usage: - * Digital Signature, Non Repudiation, Key Encipherment - * X509v3 Subject Key Identifier: - * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * - * X509v3 Subject Alternative Name: critical - * DNS:localhost - * Signature Algorithm: md5WithRSAEncryption0 - * + * Data: + * Version: 3 (0x2) + * Serial Number: 106315679 (0x6563f9f) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:55 2024 GMT + * Not After : Jul 2 04:16:55 2034 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Server + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08: + * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f: + * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53: + * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5: + * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1: + * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70: + * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14: + * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13: + * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3: + * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4: + * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68: + * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a: + * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5: + * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78: + * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b: + * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d: + * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e: + * 98:cd + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * 5C:AF:44:B1:48:B8:59:9A:64:53:9D:2E:A6:B2:09:D3:0A:92:04:83 + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Authority Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 9d:22:49:5f:56:23:e6:80:35:cc:ab:44:1c:27:bd:c9:8d:89: + * 93:49:58:e8:c1:7a:68:dd:cf:bd:e0:12:76:06:54:cd:2f:62: + * 9b:54:84:f2:bb:90:a0:bb:37:e2:13:1d:f3:df:41:aa:e0:fe: + * c0:ef:46:78:8d:aa:f4:1b:70:ad:a9:16:24:fa:15:4a:c6:0a: + * 8d:e1:99:93:00:a9:d4:b6:08:5d:8e:65:03:dc:d0:95:fc:95: + * 61:a6:ad:b5:ab:4d:a6:e0:05:48:8c:db:42:42:8a:d6:5e:c0: + * 2a:a0:11:15:b8:07:69:5c:3f:99:a0:bd:53:65:db:4e:cf:46: + * 61:93:09:7b:81:40:ff:5c:fe:4c:eb:f4:ac:de:1f:38:ad:b2: + * 60:28:f6:0e:9f:46:e7:07:8f:20:9a:a4:e1:8f:ab:54:99:76: + * 82:d8:9e:70:c4:da:98:85:71:af:3b:54:e4:01:b4:9e:83:d0: + * 7b:c6:8d:1f:ed:25:08:89:05:e9:87:97:76:5a:a3:85:c3:f8: + * 59:d7:bb:3b:5a:db:cb:ed:5d:ff:ac:21:b9:9a:e2:65:0a:bc: + * de:d1:dc:53:94:98:44:97:91:b3:1b:6b:80:0b:9b:57:b3:ae: + * 5c:7c:35:ca:39:71:f7:4e:8f:4a:d7:eb:0b:25:da:b2:1e:17: + * 48:b8:eb:09 * -----BEGIN CERTIFICATE----- - * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD - * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3 - * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6 - * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS - * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw - * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV - * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh - * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac - * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi - * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn - * JqCpf5uZGOo= + * MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx + * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9 + * U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o + * An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q + * IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U + * O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk + * lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W + * aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI + * XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK + * kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T + * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B + * AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE + * 8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ + * lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+ + * TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN + * H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub + * V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ== * -----END CERTIFICATE----- * * * TLS client certificate: * client private key: - * ----BEGIN RSA PRIVATE KEY----- - * Proc-Type: 4,ENCRYPTED - * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390 - * - * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4 - * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf - * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak - * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH - * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat - * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46 - * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++ - * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+ - * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN - * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U - * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO - * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig - * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ= - * -----END RSA PRIVATE KEY----- - * - * -----BEGIN RSA PRIVATE KEY----- - * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4 - * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z - * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB - * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW - * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf - * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6 - * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3 - * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX - * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM - * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1 - * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j - * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY - * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w== - * -----END RSA PRIVATE KEY----- * - * Private-Key: (1024 bit) + * Private-Key: (2048 bit, 2 primes) * modulus: - * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: - * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: - * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: - * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: - * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: - * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: - * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: - * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: - * 75:8d:f5:82:ac:43:92:44:1b + * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f: + * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2: + * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d: + * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24: + * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47: + * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c: + * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0: + * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31: + * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96: + * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58: + * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70: + * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55: + * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2: + * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c: + * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47: + * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19: + * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0: + * 00:4f * publicExponent: 65537 (0x10001) * privateExponent: - * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b: - * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05: - * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96: - * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0: - * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51: - * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef: - * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94: - * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1: - * e5:28:9b:f9:4c:94:c6:b1 + * 62:b2:d6:63:b6:2b:e2:26:5a:31:2b:37:8c:35:60: + * e2:03:ce:93:09:3e:f8:c9:fe:bb:a2:c8:32:0e:6c: + * 8a:7e:0a:c2:13:3b:b8:25:fa:ec:19:95:8e:34:46: + * cf:0e:7b:e4:25:82:1a:7f:21:48:16:44:58:3f:35: + * d8:eb:d8:1a:45:53:0f:9b:84:8a:54:13:33:e4:97: + * 97:f0:48:37:fb:5d:4f:8c:8f:35:63:e1:d9:62:73: + * 1c:8e:d8:cd:2e:1a:e5:4c:b5:05:59:7a:df:f1:68: + * eb:1c:5c:c6:10:44:8c:7d:42:c5:71:8a:e7:1b:aa: + * 17:03:6a:a0:c0:6b:97:50:17:ad:6e:5e:d9:db:6f: + * 3e:e9:3f:35:c3:45:bc:e8:3d:5a:b4:b9:3f:53:80: + * 64:dc:12:24:35:35:bd:98:bb:8d:fa:19:a3:5e:9e: + * ac:70:4a:fc:8d:ae:55:8b:71:81:0e:4d:c8:2f:87: + * b0:44:f7:4f:dc:a8:c8:50:b5:95:24:63:74:13:54: + * 58:de:fc:e0:75:eb:f4:06:58:83:12:4c:56:c4:c4: + * 18:0c:ea:a3:e7:25:a3:de:19:23:a2:5a:2a:b6:56: + * 04:bc:65:ba:7c:0a:f4:91:10:22:88:3f:9d:be:58: + * 43:4c:2e:ad:db:d6:32:cf:8e:b5:05:55:39:8b:e1: + * 01 * prime1: - * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38: - * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f: - * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f: - * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14: - * e2:a0:4d:ab:b5 + * 00:f1:da:c2:8a:e5:66:45:8a:14:fc:08:6e:fb:aa: + * 50:d2:8c:b1:c4:f4:88:26:d4:b8:c4:63:30:ca:e3: + * 0c:6c:50:d4:93:5c:1c:13:37:60:21:11:3b:d1:f1: + * 9f:4c:0d:7b:0e:53:3d:c9:a4:fb:fa:6b:9e:b4:0a: + * 5d:d3:50:88:d7:be:c3:88:b2:b1:8a:6e:7b:d6:70: + * 88:96:a4:fe:90:ef:d1:84:ad:a8:9e:9f:3a:68:3f: + * 3f:82:07:be:c2:44:1e:d5:a1:a9:1a:db:39:d7:7f: + * 0c:6e:35:5b:1d:33:1b:a9:cd:38:2a:64:d1:70:2a: + * fe:b9:c2:b6:ed:59:19:73:b1 * prime2: - * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d: - * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3: - * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4: - * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4: - * 76:7d:ce:32:8f + * 00:d8:b9:3a:38:6c:79:cd:0b:1f:2b:34:74:bf:7a: + * 3d:0c:21:5a:a6:ea:f2:9e:de:68:42:05:7f:ea:a5: + * 00:c9:10:f8:fd:c5:05:8d:03:45:5d:4f:6f:fa:6e: + * 9d:ef:ad:8a:ec:83:d4:ed:57:f3:86:73:15:2f:d2: + * 67:70:d1:62:ef:1d:25:08:59:47:20:62:47:16:35: + * e1:57:38:bf:39:dd:fc:b9:c8:d8:23:53:e2:02:7d: + * 22:31:4c:66:72:96:df:d8:7c:01:2c:71:00:89:18: + * e9:8c:08:44:8c:64:1f:93:9b:7a:97:26:c9:50:d0: + * 87:b2:48:a8:19:71:e1:b3:ff * exponent1: - * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f: - * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b: - * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa: - * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2: - * 4c:de:38:95 + * 23:98:dd:35:70:5a:43:35:f5:ac:ba:d9:0a:f5:a0: + * 7b:bc:f5:95:55:a0:8c:86:96:c3:61:0e:17:6e:9f: + * af:79:9e:30:2a:48:7f:93:90:f4:8d:02:ce:fd:cf: + * 42:74:61:7e:54:46:2d:dd:b8:b0:bd:12:58:d1:85: + * c9:ca:7a:b9:b6:7c:35:2c:87:f1:26:1d:d8:0c:2c: + * 2e:70:0e:7f:ea:ac:5d:e8:e9:7e:9f:55:0b:6e:f3: + * bc:01:c3:d3:f8:0e:c9:c6:c7:8b:0a:65:53:10:82: + * 15:de:88:90:9d:ab:1e:ac:f3:ed:59:75:72:1b:01: + * ee:f9:77:cf:2b:64:11:a1 * exponent2: - * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3: - * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce: - * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3: - * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b: - * 0d:78:df:fd + * 00:9e:29:6f:87:c6:02:8d:d5:54:05:df:de:63:ee: + * fd:a6:60:a1:1b:b7:d3:20:86:07:68:47:43:37:26: + * fc:0f:c0:c7:35:cc:17:64:f5:c2:25:7a:d7:a9:d8: + * 18:82:d6:0f:d0:d3:d5:0c:f1:66:d3:f4:20:be:29: + * bb:3b:e6:53:61:55:cf:b4:ec:12:b0:5b:88:ad:78: + * dc:df:1e:96:cf:d0:65:a3:e0:23:7c:84:b7:28:41: + * d2:36:50:1f:63:f9:1f:9b:89:c4:01:7e:e6:79:27: + * 29:29:fc:ce:a9:f6:57:e5:0d:4e:c6:08:94:5a:da: + * 14:6d:d4:00:79:b1:56:9a:59 * coefficient: - * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31: - * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18: - * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56: - * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da: - * 35:92:f2:e3 + * 6c:73:0d:fe:c7:22:15:5d:8c:a1:91:2b:d1:88:e8: + * 91:f9:d0:3e:d0:ba:c4:74:88:ce:14:20:4e:1e:4b: + * c5:91:8f:c1:56:e9:74:e0:f6:cf:71:91:ed:2c:f5: + * 90:9d:d6:c8:cd:f5:79:dc:6e:b3:83:3e:fa:d6:b4: + * 60:d9:3a:52:12:76:9d:92:fb:db:26:ee:43:33:c4: + * 0b:84:74:1b:91:e0:41:8b:cc:cc:24:da:52:af:2d: + * 42:e7:11:57:0d:aa:66:af:1a:ba:c2:8e:6a:ee:8f: + * 2c:e6:5b:76:38:96:bb:7a:2f:59:fe:de:a1:02:fc: + * 12:3a:aa:9f:3c:0e:a4:78 + * writing RSA key + * -----BEGIN PRIVATE KEY----- + * MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMv5I8pld0H1it + * x2mIb1kyR1BgIuSYSQ4+Hbi64ju2cVv9ZAJtDVB3cm6oPV3UvR92Udya0NY+0DGl + * JFosvnf6iKH6BkHID0dwRySZUFJEWzBiW2U1xCiwXO7QG+s5KwuhrJZI2lZs4OPm + * 491Fy1EzjUBD1/CkMaq1wN9L3ysK7X4QDK4flqIQHmvQ+TeL3w0OAjX4WLxutVcO + * L+og5nOa5WuCcCW7UZp8neJQPc8eJD6SVc8qrQ2Ej6hDJM2tUGR0wnO24ZIcsiuM + * LXuWpkFhXBuPeChRQO1BkM4duCaBR2vjV0F0TiDwWhuXN5GGGcXybQTJeCtaFrz8 + * K3Fb0ABPAgMBAAECggEAYrLWY7Yr4iZaMSs3jDVg4gPOkwk++Mn+u6LIMg5sin4K + * whM7uCX67BmVjjRGzw575CWCGn8hSBZEWD812OvYGkVTD5uEilQTM+SXl/BIN/td + * T4yPNWPh2WJzHI7YzS4a5Uy1BVl63/Fo6xxcxhBEjH1CxXGK5xuqFwNqoMBrl1AX + * rW5e2dtvPuk/NcNFvOg9WrS5P1OAZNwSJDU1vZi7jfoZo16erHBK/I2uVYtxgQ5N + * yC+HsET3T9yoyFC1lSRjdBNUWN784HXr9AZYgxJMVsTEGAzqo+clo94ZI6JaKrZW + * BLxlunwK9JEQIog/nb5YQ0wurdvWMs+OtQVVOYvhAQKBgQDx2sKK5WZFihT8CG77 + * qlDSjLHE9Igm1LjEYzDK4wxsUNSTXBwTN2AhETvR8Z9MDXsOUz3JpPv6a560Cl3T + * UIjXvsOIsrGKbnvWcIiWpP6Q79GEraienzpoPz+CB77CRB7Voaka2znXfwxuNVsd + * MxupzTgqZNFwKv65wrbtWRlzsQKBgQDYuTo4bHnNCx8rNHS/ej0MIVqm6vKe3mhC + * BX/qpQDJEPj9xQWNA0VdT2/6bp3vrYrsg9TtV/OGcxUv0mdw0WLvHSUIWUcgYkcW + * NeFXOL853fy5yNgjU+ICfSIxTGZylt/YfAEscQCJGOmMCESMZB+Tm3qXJslQ0Iey + * SKgZceGz/wKBgCOY3TVwWkM19ay62Qr1oHu89ZVVoIyGlsNhDhdun695njAqSH+T + * kPSNAs79z0J0YX5URi3duLC9EljRhcnKerm2fDUsh/EmHdgMLC5wDn/qrF3o6X6f + * VQtu87wBw9P4DsnGx4sKZVMQghXeiJCdqx6s8+1ZdXIbAe75d88rZBGhAoGBAJ4p + * b4fGAo3VVAXf3mPu/aZgoRu30yCGB2hHQzcm/A/AxzXMF2T1wiV616nYGILWD9DT + * 1QzxZtP0IL4puzvmU2FVz7TsErBbiK143N8els/QZaPgI3yEtyhB0jZQH2P5H5uJ + * xAF+5nknKSn8zqn2V+UNTsYIlFraFG3UAHmxVppZAoGAbHMN/sciFV2MoZEr0Yjo + * kfnQPtC6xHSIzhQgTh5LxZGPwVbpdOD2z3GR7Sz1kJ3WyM31edxus4M++ta0YNk6 + * UhJ2nZL72ybuQzPEC4R0G5HgQYvMzCTaUq8tQucRVw2qZq8ausKOau6PLOZbdjiW + * u3ovWf7eoQL8EjqqnzwOpHg= + * -----END PRIVATE KEY----- * * client certificate: - * Data: - * Version: 3 (0x2) - * Serial Number: 9 (0x9) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 03:43:24 2008 GMT - * Not After : Aug 25 03:43:24 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: - * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: - * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: - * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: - * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: - * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: - * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: - * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: - * 75:8d:f5:82:ac:43:92:44:1b - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Basic Constraints: - * CA:FALSE - * X509v3 Key Usage: - * Digital Signature, Non Repudiation, Key Encipherment - * X509v3 Subject Key Identifier: - * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * - * X509v3 Subject Alternative Name: critical - * DNS:localhost - * Signature Algorithm: md5WithRSAEncryption - * + * Data: + * Version: 3 (0x2) + * Serial Number: 1500699355 (0x5972dadb) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:52 2024 GMT + * Not After : Jul 2 04:16:52 2034 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Client + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f: + * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2: + * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d: + * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24: + * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47: + * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c: + * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0: + * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31: + * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96: + * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58: + * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70: + * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55: + * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2: + * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c: + * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47: + * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19: + * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0: + * 00:4f + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * CD:45:E2:05:92:88:A3:C7:49:28:E7:D3:37:B7:13:92:FB:B1:36:C4 + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Authority Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 23:6e:e9:5d:80:0d:b3:86:c9:cd:17:81:33:bd:5b:aa:c0:65: + * 4c:6b:9f:fa:ee:32:e9:89:e1:d0:c7:1d:5c:43:7e:94:ac:83: + * af:91:90:4c:26:61:8d:fe:6b:1a:aa:6e:61:39:b3:24:4a:dc: + * 92:c8:ca:f2:80:b0:05:41:0c:b3:dd:ed:b7:81:42:9a:1e:4e: + * f2:80:6c:72:62:8b:bd:d4:cd:23:7d:7c:e8:6f:e3:67:89:6a: + * 79:19:dd:f6:57:62:12:fa:eb:cd:66:c3:d2:d8:40:5a:1c:dd: + * 7f:9f:b2:34:e9:2a:d6:14:52:ba:6e:a8:9b:0d:a9:a1:03:bf: + * c4:0d:92:3d:59:e4:a9:8e:20:41:39:99:81:70:9d:d0:68:98: + * fc:5f:49:4a:92:e5:a2:c1:51:61:f6:1e:49:56:0b:b6:8c:57: + * db:08:2a:f0:a3:04:dc:a1:04:a2:5c:d0:90:4f:13:8d:1c:e6: + * 2e:7a:63:9c:32:40:65:59:04:5d:71:90:5a:a8:db:6a:30:42: + * 57:5b:0b:df:ce:a1:1f:fa:23:71:f3:57:12:c4:1c:66:3b:37: + * 77:32:28:a7:fb:ad:ee:86:51:4c:80:2f:dd:c8:5b:9f:a7:15: + * 07:fa:2b:5a:ee:93:00:5f:a6:43:22:1b:40:52:15:66:01:84: + * 32:9e:71:21 * -----BEGIN CERTIFICATE----- - * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD - * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas - * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV - * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq - * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw - * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV - * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh - * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F - * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj - * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN - * cl/epUcHL7E= + * MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx + * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9 + * U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym + * V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ + * 1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja + * Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY + * vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh + * khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4 + * K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7 + * sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T + * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B + * AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ + * TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j + * Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g + * QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj + * nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb + * n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ== * -----END CERTIFICATE----- * * - * * Trusted CA certificate: * Certificate: * Data: - * Version: 3 (0x2) - * Serial Number: 0 (0x0) - * Signature Algorithm: md5WithRSAEncryption - * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Validity - * Not Before: Dec 8 02:43:36 2008 GMT - * Not After : Aug 25 02:43:36 2028 GMT - * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org - * Subject Public Key Info: - * Public Key Algorithm: rsaEncryption - * RSA Public Key: (1024 bit) - * Modulus (1024 bit): - * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d: - * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53: - * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9: - * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f: - * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7: - * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee: - * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee: - * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97: - * 89:2a:95:12:4c:d8:09:2a:e9 - * Exponent: 65537 (0x10001) - * X509v3 extensions: - * X509v3 Subject Key Identifier: - * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * X509v3 Authority Key Identifier: - * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 - * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org - * serial:00 - * - * X509v3 Basic Constraints: - * CA:TRUE - * Signature Algorithm: md5WithRSAEncryption - * + * Version: 3 (0x2) + * Serial Number: 1539881479 (0x5bc8ba07) + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Jul 1 04:16:50 2024 GMT + * Not After : Jul 2 04:16:50 2034 GMT + * Subject: C=Us, ST=Some-State, L=Some-City, O=Some-Org + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * Public-Key: (2048 bit) + * Modulus: + * 00:bc:a6:55:60:3f:17:74:39:ba:71:8c:ef:11:3f: + * 9d:36:47:d5:02:d1:4d:9d:7e:b8:fe:59:b1:2b:f1: + * b7:b0:0c:31:57:eb:9c:9d:13:f5:4c:5f:fc:c4:9e: + * f9:75:09:0f:96:8f:05:77:30:a8:35:48:71:96:e4: + * a5:7d:1a:81:fb:e6:bf:90:80:60:5d:11:20:54:16: + * 0b:6d:df:64:de:18:d5:98:51:38:9d:c9:d6:5f:de: + * 9d:de:fe:a8:5f:d3:25:3d:ad:f3:2b:45:c8:4a:80: + * 97:14:7b:85:9d:cf:59:08:bb:c7:67:ac:8b:29:f3: + * 1e:93:bf:fb:82:53:c5:ae:b4:bc:55:30:15:a8:7e: + * 3f:82:22:59:43:cc:d2:62:e7:65:67:72:ec:10:8a: + * fc:05:90:91:72:dd:e9:6f:e2:9f:0c:ab:a1:83:55: + * 02:23:b7:a3:c3:50:ab:be:0b:bb:51:75:50:d1:a8: + * c9:e5:f5:06:fe:00:09:a6:1b:8a:16:29:0d:ab:00: + * 3e:bc:d2:73:d9:37:d7:d9:9a:58:6e:2d:2a:f6:76: + * ae:f4:ea:6d:70:de:7f:e3:04:43:c0:4f:91:3f:78: + * 58:d7:c2:ad:74:eb:04:9d:d0:7e:82:b8:7a:97:44: + * 61:fa:41:45:a6:ca:7d:a5:2e:fc:f9:a6:cf:61:cd: + * 75:bf + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40 + * X509v3 Basic Constraints: critical + * CA:TRUE + * Signature Algorithm: sha1WithRSAEncryption + * Signature Value: + * 1f:89:34:e3:ee:05:33:3b:18:ca:96:13:3d:ad:cd:5a:e6:24: + * 46:94:36:ad:37:a5:36:a9:92:37:f9:ed:07:dd:44:5b:c9:2e: + * 68:f7:82:f3:58:1c:64:ed:64:d0:ad:eb:30:15:e0:04:3a:d7: + * c8:c7:9d:65:76:ae:84:e4:2e:2d:0d:68:09:0d:e5:ae:cc:a7: + * 54:86:ad:ff:00:95:85:01:49:db:5b:8e:c2:6f:e7:19:10:17: + * f7:03:b9:a8:97:21:a2:fc:7f:c0:e0:7a:12:64:b8:70:f5:e8: + * b6:e1:25:f7:eb:32:3e:46:ce:43:55:fc:0b:62:59:90:61:63: + * f9:94:6c:95:63:31:1b:00:59:1f:72:9d:d0:0b:4f:cd:02:eb: + * de:20:4e:60:48:4e:ea:ad:3c:0f:1d:bf:1a:69:3d:a8:3d:8b: + * f5:a2:ae:8c:4f:d7:0e:b3:e1:9b:b3:2c:89:19:18:da:db:e1: + * 6d:d5:ab:c8:b8:48:57:d8:8b:33:01:d4:97:91:d9:da:34:a1: + * ef:36:00:e1:38:19:34:8f:0d:47:af:57:cf:59:d6:8b:0d:9e: + * 89:05:82:3d:3c:f3:45:1d:4a:3f:0e:0f:5a:28:6f:5c:e1:e9: + * 60:72:87:28:b6:97:44:8b:d7:c6:cd:cb:dc:5a:5d:60:f1:b4: + * 37:ee:44:db * -----BEGIN CERTIFICATE----- - * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET - * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK - * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ - * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp - * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB - * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX - * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj - * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G - * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ - * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt - * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw - * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA - * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ - * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P - * 6Mvf0r1PNTY2hwTJLJmKtg== + * MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV + * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD + * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx + * CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l + * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A + * MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1 + * TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW + * X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/ + * giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG + * /gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE + * ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ + * 9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF + * AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc + * ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX + * 9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd + * 0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI + * V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp + * YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w== * -----END CERTIFICATE--- */ - public class SunX509ExtendedTM { /* @@ -423,201 +563,342 @@ */ static String trusedCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" + - "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" + - "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" + - "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" + - "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" + - "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" + - "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" + - "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" + - "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" + - "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" + - "6Mvf0r1PNTY2hwTJLJmKtg==\n" + + "MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx\n" + + "CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" + + "MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1\n" + + "TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW\n" + + "X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/\n" + + "giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG\n" + + "/gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE\n" + + "ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ\n" + + "9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF\n" + + "AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc\n" + + "ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX\n" + + "9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd\n" + + "0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI\n" + + "V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp\n" + + "YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==\n" + "-----END CERTIFICATE-----"; static String serverCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" + - "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" + - "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" + - "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" + - "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + - "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" + - "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + - "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" + - "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" + - "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" + - "JqCpf5uZGOo=\n" + + "MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx\n" + + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" + + "U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o\n" + + "An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q\n" + + "IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U\n" + + "O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk\n" + + "lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W\n" + + "aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI\n" + + "XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK\n" + + "kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" + + "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" + + "AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE\n" + + "8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ\n" + + "lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+\n" + + "TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN\n" + + "H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub\n" + + "V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==\n" + "-----END CERTIFICATE-----"; static String clientCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + - "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + - "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" + - "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + - "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" + - "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" + - "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" + - "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" + - "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + - "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" + - "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + - "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" + - "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" + - "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" + - "cl/epUcHL7E=\n" + + "MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" + + "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" + + "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx\n" + + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" + + "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" + + "U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym\n" + + "V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ\n" + + "1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja\n" + + "Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY\n" + + "vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh\n" + + "khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4\n" + + "K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7\n" + + "sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" + + "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" + + "AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ\n" + + "TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j\n" + + "Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g\n" + + "QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj\n" + + "nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb\n" + + "n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==\n" + "-----END CERTIFICATE-----"; static byte serverPrivateExponent[] = { - (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83, - (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44, - (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89, - (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60, - (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21, - (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc, - (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e, - (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3, - (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54, - (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf, - (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0, - (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9, - (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29, - (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c, - (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9, - (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6, - (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72, - (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4, - (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76, - (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f, - (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5, - (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71, - (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e, - (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4, - (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a, - (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4, - (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a, - (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18, - (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba, - (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3, - (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59, - (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1 + (byte)0x68, (byte)0x87, (byte)0x36, (byte)0x54, + (byte)0xa3, (byte)0xc6, (byte)0xd5, (byte)0x5f, + (byte)0xf5, (byte)0x0f, (byte)0x4f, (byte)0x76, + (byte)0xc8, (byte)0x9c, (byte)0x2b, (byte)0x5b, + (byte)0xdc, (byte)0xe2, (byte)0xbe, (byte)0x14, + (byte)0x12, (byte)0x2f, (byte)0xc7, (byte)0x0a, + (byte)0xa9, (byte)0xcb, (byte)0x5e, (byte)0x04, + (byte)0x59, (byte)0xca, (byte)0x35, (byte)0x2f, + (byte)0x8d, (byte)0x2b, (byte)0xc4, (byte)0x40, + (byte)0xe6, (byte)0x7d, (byte)0x25, (byte)0x1b, + (byte)0x4d, (byte)0x07, (byte)0xc3, (byte)0x99, + (byte)0x9c, (byte)0x16, (byte)0x4f, (byte)0xa5, + (byte)0xdc, (byte)0xde, (byte)0xb0, (byte)0x90, + (byte)0xf0, (byte)0xde, (byte)0x22, (byte)0x70, + (byte)0x80, (byte)0xf4, (byte)0xa6, (byte)0x70, + (byte)0xe2, (byte)0x96, (byte)0x3d, (byte)0x18, + (byte)0x21, (byte)0xbf, (byte)0x2b, (byte)0x27, + (byte)0xa4, (byte)0x2d, (byte)0xd7, (byte)0xae, + (byte)0x2b, (byte)0x12, (byte)0x2f, (byte)0x08, + (byte)0x36, (byte)0xee, (byte)0x99, (byte)0x94, + (byte)0xed, (byte)0xf6, (byte)0xa7, (byte)0xd9, + (byte)0x1d, (byte)0xa2, (byte)0xf3, (byte)0x1f, + (byte)0x44, (byte)0xa4, (byte)0x28, (byte)0x4b, + (byte)0x67, (byte)0x35, (byte)0xd6, (byte)0xa8, + (byte)0x1b, (byte)0xf8, (byte)0x84, (byte)0x34, + (byte)0x34, (byte)0x84, (byte)0xbd, (byte)0xec, + (byte)0x9e, (byte)0x03, (byte)0x08, (byte)0x3c, + (byte)0x93, (byte)0x20, (byte)0x8e, (byte)0xaf, + (byte)0x15, (byte)0xcb, (byte)0x1f, (byte)0x20, + (byte)0x08, (byte)0x97, (byte)0xc4, (byte)0x19, + (byte)0x3e, (byte)0xfa, (byte)0x36, (byte)0xc6, + (byte)0xab, (byte)0x0e, (byte)0x2f, (byte)0xe7, + (byte)0xb3, (byte)0xc0, (byte)0xa7, (byte)0xbc, + (byte)0xe4, (byte)0xe0, (byte)0xa6, (byte)0x08, + (byte)0x1c, (byte)0x69, (byte)0x20, (byte)0x4d, + (byte)0x78, (byte)0xbd, (byte)0x7a, (byte)0xe5, + (byte)0x25, (byte)0x48, (byte)0x60, (byte)0x9e, + (byte)0x2e, (byte)0x50, (byte)0x8d, (byte)0x36, + (byte)0x1e, (byte)0x07, (byte)0xe9, (byte)0xd5, + (byte)0x0d, (byte)0x39, (byte)0x67, (byte)0x41, + (byte)0x42, (byte)0x24, (byte)0xdb, (byte)0x87, + (byte)0xe5, (byte)0x77, (byte)0x76, (byte)0xfd, + (byte)0x5e, (byte)0xd5, (byte)0xc6, (byte)0xe5, + (byte)0xd3, (byte)0xb0, (byte)0x98, (byte)0x71, + (byte)0x48, (byte)0x69, (byte)0x47, (byte)0x4f, + (byte)0x46, (byte)0x05, (byte)0x0c, (byte)0x9e, + (byte)0x58, (byte)0x45, (byte)0x2e, (byte)0xe2, + (byte)0x27, (byte)0xd0, (byte)0xf6, (byte)0x11, + (byte)0x05, (byte)0x78, (byte)0xad, (byte)0x83, + (byte)0x5a, (byte)0x5b, (byte)0xec, (byte)0xd7, + (byte)0x2e, (byte)0x26, (byte)0x5a, (byte)0xa5, + (byte)0x4f, (byte)0x9e, (byte)0x52, (byte)0x84, + (byte)0x2c, (byte)0x1f, (byte)0x59, (byte)0x1a, + (byte)0x78, (byte)0x56, (byte)0x0a, (byte)0x44, + (byte)0x54, (byte)0xc6, (byte)0x37, (byte)0x64, + (byte)0x01, (byte)0xca, (byte)0xe4, (byte)0xa8, + (byte)0x01, (byte)0xc7, (byte)0x86, (byte)0xc1, + (byte)0xb4, (byte)0xd6, (byte)0x6c, (byte)0x7a, + (byte)0x15, (byte)0x9a, (byte)0x65, (byte)0x69, + (byte)0x46, (byte)0x9e, (byte)0xfd, (byte)0xf6, + (byte)0x08, (byte)0x17, (byte)0x0c, (byte)0x6c, + (byte)0xac, (byte)0x38, (byte)0xbd, (byte)0xc2, + (byte)0xcd, (byte)0xda, (byte)0xef, (byte)0x54, + (byte)0x7a, (byte)0x48, (byte)0x92, (byte)0x4d }; static byte serverModulus[] = { - (byte)0x00, - (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c, - (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99, - (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79, - (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48, - (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84, - (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c, - (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9, - (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39, - (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72, - (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44, - (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc, - (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6, - (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54, - (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc, - (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f, - (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f, - (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2, - (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88, - (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f, - (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53, - (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33, - (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47, - (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea, - (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75, - (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc, - (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9, - (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2, - (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24, - (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03, - (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30, - (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f, - (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89 + (byte)0x00, (byte)0x9a, (byte)0x0c, (byte)0xe0, + (byte)0x8f, (byte)0xa8, (byte)0x02, (byte)0x7e, + (byte)0x5a, (byte)0xef, (byte)0xed, (byte)0xb2, + (byte)0x42, (byte)0xad, (byte)0x08, (byte)0x4e, + (byte)0x91, (byte)0xba, (byte)0xc2, (byte)0xad, + (byte)0x9b, (byte)0x79, (byte)0xd7, (byte)0x9b, + (byte)0x0f, (byte)0xfd, (byte)0xd2, (byte)0xf8, + (byte)0x15, (byte)0x2f, (byte)0x19, (byte)0x89, + (byte)0x80, (byte)0x10, (byte)0x00, (byte)0x02, + (byte)0x19, (byte)0x6d, (byte)0x27, (byte)0xc2, + (byte)0x90, (byte)0xd7, (byte)0xa5, (byte)0x23, + (byte)0x53, (byte)0x74, (byte)0x6e, (byte)0x64, + (byte)0x28, (byte)0x7c, (byte)0x24, (byte)0xaa, + (byte)0xed, (byte)0xea, (byte)0x21, (byte)0x59, + (byte)0xdc, (byte)0xa3, (byte)0x5c, (byte)0xb5, + (byte)0xc9, (byte)0x42, (byte)0x31, (byte)0x4f, + (byte)0xa2, (byte)0xde, (byte)0xfb, (byte)0x09, + (byte)0x7c, (byte)0x73, (byte)0xed, (byte)0x88, + (byte)0x04, (byte)0x34, (byte)0xf1, (byte)0x15, + (byte)0xad, (byte)0x3d, (byte)0x60, (byte)0xcd, + (byte)0xca, (byte)0xc5, (byte)0x13, (byte)0x99, + (byte)0xd3, (byte)0x9f, (byte)0x9b, (byte)0xb2, + (byte)0x92, (byte)0x70, (byte)0xcb, (byte)0xba, + (byte)0x4b, (byte)0x3d, (byte)0x20, (byte)0x96, + (byte)0xad, (byte)0xbe, (byte)0x92, (byte)0x53, + (byte)0xed, (byte)0x54, (byte)0x3b, (byte)0xc5, + (byte)0x14, (byte)0xbd, (byte)0xcf, (byte)0xd4, + (byte)0x0f, (byte)0xcb, (byte)0x05, (byte)0x4f, + (byte)0xfd, (byte)0x2b, (byte)0x9e, (byte)0xe0, + (byte)0x50, (byte)0xbb, (byte)0x65, (byte)0x13, + (byte)0x92, (byte)0xc0, (byte)0xd6, (byte)0xbd, + (byte)0x4d, (byte)0x02, (byte)0x0c, (byte)0x70, + (byte)0xb6, (byte)0x65, (byte)0xd4, (byte)0x7d, + (byte)0xb4, (byte)0x4d, (byte)0xc3, (byte)0xdf, + (byte)0x2c, (byte)0x08, (byte)0x9e, (byte)0xd2, + (byte)0x3e, (byte)0x69, (byte)0x32, (byte)0x46, + (byte)0x6f, (byte)0x6f, (byte)0xca, (byte)0xd1, + (byte)0x73, (byte)0xa4, (byte)0x94, (byte)0x07, + (byte)0xef, (byte)0x14, (byte)0xe3, (byte)0xda, + (byte)0x9e, (byte)0x2f, (byte)0xc0, (byte)0xac, + (byte)0x0e, (byte)0x10, (byte)0x33, (byte)0x4c, + (byte)0x68, (byte)0x79, (byte)0xf3, (byte)0x79, + (byte)0x40, (byte)0xd6, (byte)0xe9, (byte)0x3c, + (byte)0xc2, (byte)0xe6, (byte)0x70, (byte)0xe0, + (byte)0x89, (byte)0xce, (byte)0xa0, (byte)0x7a, + (byte)0xa8, (byte)0x84, (byte)0x28, (byte)0x85, + (byte)0x32, (byte)0x37, (byte)0x08, (byte)0xb0, + (byte)0xcf, (byte)0xb1, (byte)0x7f, (byte)0x5f, + (byte)0xbc, (byte)0x1f, (byte)0xa5, (byte)0x3d, + (byte)0xef, (byte)0xd6, (byte)0x68, (byte)0xa8, + (byte)0x17, (byte)0x21, (byte)0x5f, (byte)0x87, + (byte)0xd5, (byte)0x4b, (byte)0xb5, (byte)0xcc, + (byte)0xee, (byte)0x78, (byte)0x8d, (byte)0xdd, + (byte)0xb1, (byte)0x28, (byte)0x6a, (byte)0xc0, + (byte)0xfb, (byte)0x64, (byte)0xbd, (byte)0xb7, + (byte)0x70, (byte)0x02, (byte)0x33, (byte)0x03, + (byte)0x0b, (byte)0xb8, (byte)0xb8, (byte)0xbb, + (byte)0x08, (byte)0x82, (byte)0xf6, (byte)0x8e, + (byte)0x05, (byte)0x27, (byte)0xd1, (byte)0x3b, + (byte)0xe6, (byte)0xc5, (byte)0xac, (byte)0x4d, + (byte)0x85, (byte)0x5b, (byte)0xa1, (byte)0x1d, + (byte)0xa3, (byte)0x48, (byte)0x5d, (byte)0x03, + (byte)0x15, (byte)0x76, (byte)0x63, (byte)0x6c, + (byte)0x71, (byte)0x21, (byte)0x3e, (byte)0x98, + (byte)0xcd }; static byte clientPrivateExponent[] = { - (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36, - (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce, - (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84, - (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25, - (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4, - (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a, - (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19, - (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2, - (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77, - (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84, - (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41, - (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8, - (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71, - (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a, - (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0, - (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6, - (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39, - (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e, - (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a, - (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88, - (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89, - (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d, - (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a, - (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69, - (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37, - (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7, - (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27, - (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8, - (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8, - (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1, - (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9, - (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1 + (byte)0x62, (byte)0xb2, (byte)0xd6, (byte)0x63, + (byte)0xb6, (byte)0x2b, (byte)0xe2, (byte)0x26, + (byte)0x5a, (byte)0x31, (byte)0x2b, (byte)0x37, + (byte)0x8c, (byte)0x35, (byte)0x60, (byte)0xe2, + (byte)0x03, (byte)0xce, (byte)0x93, (byte)0x09, + (byte)0x3e, (byte)0xf8, (byte)0xc9, (byte)0xfe, + (byte)0xbb, (byte)0xa2, (byte)0xc8, (byte)0x32, + (byte)0x0e, (byte)0x6c, (byte)0x8a, (byte)0x7e, + (byte)0x0a, (byte)0xc2, (byte)0x13, (byte)0x3b, + (byte)0xb8, (byte)0x25, (byte)0xfa, (byte)0xec, + (byte)0x19, (byte)0x95, (byte)0x8e, (byte)0x34, + (byte)0x46, (byte)0xcf, (byte)0x0e, (byte)0x7b, + (byte)0xe4, (byte)0x25, (byte)0x82, (byte)0x1a, + (byte)0x7f, (byte)0x21, (byte)0x48, (byte)0x16, + (byte)0x44, (byte)0x58, (byte)0x3f, (byte)0x35, + (byte)0xd8, (byte)0xeb, (byte)0xd8, (byte)0x1a, + (byte)0x45, (byte)0x53, (byte)0x0f, (byte)0x9b, + (byte)0x84, (byte)0x8a, (byte)0x54, (byte)0x13, + (byte)0x33, (byte)0xe4, (byte)0x97, (byte)0x97, + (byte)0xf0, (byte)0x48, (byte)0x37, (byte)0xfb, + (byte)0x5d, (byte)0x4f, (byte)0x8c, (byte)0x8f, + (byte)0x35, (byte)0x63, (byte)0xe1, (byte)0xd9, + (byte)0x62, (byte)0x73, (byte)0x1c, (byte)0x8e, + (byte)0xd8, (byte)0xcd, (byte)0x2e, (byte)0x1a, + (byte)0xe5, (byte)0x4c, (byte)0xb5, (byte)0x05, + (byte)0x59, (byte)0x7a, (byte)0xdf, (byte)0xf1, + (byte)0x68, (byte)0xeb, (byte)0x1c, (byte)0x5c, + (byte)0xc6, (byte)0x10, (byte)0x44, (byte)0x8c, + (byte)0x7d, (byte)0x42, (byte)0xc5, (byte)0x71, + (byte)0x8a, (byte)0xe7, (byte)0x1b, (byte)0xaa, + (byte)0x17, (byte)0x03, (byte)0x6a, (byte)0xa0, + (byte)0xc0, (byte)0x6b, (byte)0x97, (byte)0x50, + (byte)0x17, (byte)0xad, (byte)0x6e, (byte)0x5e, + (byte)0xd9, (byte)0xdb, (byte)0x6f, (byte)0x3e, + (byte)0xe9, (byte)0x3f, (byte)0x35, (byte)0xc3, + (byte)0x45, (byte)0xbc, (byte)0xe8, (byte)0x3d, + (byte)0x5a, (byte)0xb4, (byte)0xb9, (byte)0x3f, + (byte)0x53, (byte)0x80, (byte)0x64, (byte)0xdc, + (byte)0x12, (byte)0x24, (byte)0x35, (byte)0x35, + (byte)0xbd, (byte)0x98, (byte)0xbb, (byte)0x8d, + (byte)0xfa, (byte)0x19, (byte)0xa3, (byte)0x5e, + (byte)0x9e, (byte)0xac, (byte)0x70, (byte)0x4a, + (byte)0xfc, (byte)0x8d, (byte)0xae, (byte)0x55, + (byte)0x8b, (byte)0x71, (byte)0x81, (byte)0x0e, + (byte)0x4d, (byte)0xc8, (byte)0x2f, (byte)0x87, + (byte)0xb0, (byte)0x44, (byte)0xf7, (byte)0x4f, + (byte)0xdc, (byte)0xa8, (byte)0xc8, (byte)0x50, + (byte)0xb5, (byte)0x95, (byte)0x24, (byte)0x63, + (byte)0x74, (byte)0x13, (byte)0x54, (byte)0x58, + (byte)0xde, (byte)0xfc, (byte)0xe0, (byte)0x75, + (byte)0xeb, (byte)0xf4, (byte)0x06, (byte)0x58, + (byte)0x83, (byte)0x12, (byte)0x4c, (byte)0x56, + (byte)0xc4, (byte)0xc4, (byte)0x18, (byte)0x0c, + (byte)0xea, (byte)0xa3, (byte)0xe7, (byte)0x25, + (byte)0xa3, (byte)0xde, (byte)0x19, (byte)0x23, + (byte)0xa2, (byte)0x5a, (byte)0x2a, (byte)0xb6, + (byte)0x56, (byte)0x04, (byte)0xbc, (byte)0x65, + (byte)0xba, (byte)0x7c, (byte)0x0a, (byte)0xf4, + (byte)0x91, (byte)0x10, (byte)0x22, (byte)0x88, + (byte)0x3f, (byte)0x9d, (byte)0xbe, (byte)0x58, + (byte)0x43, (byte)0x4c, (byte)0x2e, (byte)0xad, + (byte)0xdb, (byte)0xd6, (byte)0x32, (byte)0xcf, + (byte)0x8e, (byte)0xb5, (byte)0x05, (byte)0x55, + (byte)0x39, (byte)0x8b, (byte)0xe1, (byte)0x01 }; static byte clientModulus[] = { - (byte)0x00, - (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36, - (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e, - (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00, - (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f, - (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93, - (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1, - (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8, - (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99, - (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f, - (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24, - (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7, - (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44, - (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2, - (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c, - (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d, - (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a, - (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6, - (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f, - (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97, - (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05, - (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf, - (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3, - (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c, - (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf, - (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56, - (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9, - (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf, - (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab, - (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1, - (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75, - (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac, - (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b + (byte)0x00, (byte)0xcc, (byte)0xbf, (byte)0x92, + (byte)0x3c, (byte)0xa6, (byte)0x57, (byte)0x74, + (byte)0x1f, (byte)0x58, (byte)0xad, (byte)0xc7, + (byte)0x69, (byte)0x88, (byte)0x6f, (byte)0x59, + (byte)0x32, (byte)0x47, (byte)0x50, (byte)0x60, + (byte)0x22, (byte)0xe4, (byte)0x98, (byte)0x49, + (byte)0x0e, (byte)0x3e, (byte)0x1d, (byte)0xb8, + (byte)0xba, (byte)0xe2, (byte)0x3b, (byte)0xb6, + (byte)0x71, (byte)0x5b, (byte)0xfd, (byte)0x64, + (byte)0x02, (byte)0x6d, (byte)0x0d, (byte)0x50, + (byte)0x77, (byte)0x72, (byte)0x6e, (byte)0xa8, + (byte)0x3d, (byte)0x5d, (byte)0xd4, (byte)0xbd, + (byte)0x1f, (byte)0x76, (byte)0x51, (byte)0xdc, + (byte)0x9a, (byte)0xd0, (byte)0xd6, (byte)0x3e, + (byte)0xd0, (byte)0x31, (byte)0xa5, (byte)0x24, + (byte)0x5a, (byte)0x2c, (byte)0xbe, (byte)0x77, + (byte)0xfa, (byte)0x88, (byte)0xa1, (byte)0xfa, + (byte)0x06, (byte)0x41, (byte)0xc8, (byte)0x0f, + (byte)0x47, (byte)0x70, (byte)0x47, (byte)0x24, + (byte)0x99, (byte)0x50, (byte)0x52, (byte)0x44, + (byte)0x5b, (byte)0x30, (byte)0x62, (byte)0x5b, + (byte)0x65, (byte)0x35, (byte)0xc4, (byte)0x28, + (byte)0xb0, (byte)0x5c, (byte)0xee, (byte)0xd0, + (byte)0x1b, (byte)0xeb, (byte)0x39, (byte)0x2b, + (byte)0x0b, (byte)0xa1, (byte)0xac, (byte)0x96, + (byte)0x48, (byte)0xda, (byte)0x56, (byte)0x6c, + (byte)0xe0, (byte)0xe3, (byte)0xe6, (byte)0xe3, + (byte)0xdd, (byte)0x45, (byte)0xcb, (byte)0x51, + (byte)0x33, (byte)0x8d, (byte)0x40, (byte)0x43, + (byte)0xd7, (byte)0xf0, (byte)0xa4, (byte)0x31, + (byte)0xaa, (byte)0xb5, (byte)0xc0, (byte)0xdf, + (byte)0x4b, (byte)0xdf, (byte)0x2b, (byte)0x0a, + (byte)0xed, (byte)0x7e, (byte)0x10, (byte)0x0c, + (byte)0xae, (byte)0x1f, (byte)0x96, (byte)0xa2, + (byte)0x10, (byte)0x1e, (byte)0x6b, (byte)0xd0, + (byte)0xf9, (byte)0x37, (byte)0x8b, (byte)0xdf, + (byte)0x0d, (byte)0x0e, (byte)0x02, (byte)0x35, + (byte)0xf8, (byte)0x58, (byte)0xbc, (byte)0x6e, + (byte)0xb5, (byte)0x57, (byte)0x0e, (byte)0x2f, + (byte)0xea, (byte)0x20, (byte)0xe6, (byte)0x73, + (byte)0x9a, (byte)0xe5, (byte)0x6b, (byte)0x82, + (byte)0x70, (byte)0x25, (byte)0xbb, (byte)0x51, + (byte)0x9a, (byte)0x7c, (byte)0x9d, (byte)0xe2, + (byte)0x50, (byte)0x3d, (byte)0xcf, (byte)0x1e, + (byte)0x24, (byte)0x3e, (byte)0x92, (byte)0x55, + (byte)0xcf, (byte)0x2a, (byte)0xad, (byte)0x0d, + (byte)0x84, (byte)0x8f, (byte)0xa8, (byte)0x43, + (byte)0x24, (byte)0xcd, (byte)0xad, (byte)0x50, + (byte)0x64, (byte)0x74, (byte)0xc2, (byte)0x73, + (byte)0xb6, (byte)0xe1, (byte)0x92, (byte)0x1c, + (byte)0xb2, (byte)0x2b, (byte)0x8c, (byte)0x2d, + (byte)0x7b, (byte)0x96, (byte)0xa6, (byte)0x41, + (byte)0x61, (byte)0x5c, (byte)0x1b, (byte)0x8f, + (byte)0x78, (byte)0x28, (byte)0x51, (byte)0x40, + (byte)0xed, (byte)0x41, (byte)0x90, (byte)0xce, + (byte)0x1d, (byte)0xb8, (byte)0x26, (byte)0x81, + (byte)0x47, (byte)0x6b, (byte)0xe3, (byte)0x57, + (byte)0x41, (byte)0x74, (byte)0x4e, (byte)0x20, + (byte)0xf0, (byte)0x5a, (byte)0x1b, (byte)0x97, + (byte)0x37, (byte)0x91, (byte)0x86, (byte)0x19, + (byte)0xc5, (byte)0xf2, (byte)0x6d, (byte)0x04, + (byte)0xc9, (byte)0x78, (byte)0x2b, (byte)0x5a, + (byte)0x16, (byte)0xbc, (byte)0xfc, (byte)0x2b, + (byte)0x71, (byte)0x5b, (byte)0xd0, (byte)0x00, + (byte)0x4f }; static char passphrase[] = "passphrase".toCharArray(); @@ -795,11 +1076,11 @@ volatile Exception clientException = null; public static void main(String args[]) throws Exception { - // MD5 is used in this test case, don't disable MD5 algorithm. + // SHA1 is used in this test case, don't disable SHA1 algorithm. Security.setProperty("jdk.certpath.disabledAlgorithms", - "MD2, RSA keySize < 1024"); + "MD2, MD5, RSA keySize < 1024"); Security.setProperty("jdk.tls.disabledAlgorithms", - "SSLv3, RC4, DH keySize < 768"); + "SSLv3, RC4, MD5withRSA, DH keySize < 768"); if (debug) System.setProperty("javax.net.debug", "all"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.security.cert.*; -import java.time.*; -import java.util.*; -import javax.net.ssl.*; -import sun.security.validator.Validator; -import sun.security.validator.ValidatorException; - -import jdk.test.lib.security.SecurityUtils; - -/** - * @test - * @bug 8207258 8216280 - * @summary Check that TLS Server certificates chaining back to distrusted - * Symantec roots are invalid - * @library /test/lib - * @modules java.base/sun.security.validator - * @run main/othervm Distrust after policyOn invalid - * @run main/othervm Distrust after policyOff valid - * @run main/othervm Distrust before policyOn valid - * @run main/othervm Distrust before policyOff valid - */ - -public class Distrust { - - private static final String TEST_SRC = System.getProperty("test.src", "."); - private static CertificateFactory cf; - - // Each of the roots have a test certificate chain stored in a file - // named "-chain.pem". - private static String[] rootsToTest = new String[] { - "geotrustprimarycag2", "geotrustprimarycag3", - "geotrustuniversalca", "thawteprimaryrootca", "thawteprimaryrootcag2", - "thawteprimaryrootcag3", "verisignclass3g3ca", "verisignclass3g4ca", - "verisignclass3g5ca", "verisignuniversalrootca" }; - - // Each of the subCAs with a delayed distrust date have a test certificate - // chain stored in a file named "-chain.pem". - private static String[] subCAsToTest = new String[]{"appleistca8g1"}; - - // A date that is after the restrictions take affect - private static final Date APRIL_17_2019 = - Date.from(LocalDate.of(2019, 4, 17) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the restrictions take affect - private static final Date BEFORE_APRIL_17_2019 = - Date.from(LocalDate.of(2019, 4, 17) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - // A date that is after the subCA restrictions take affect - private static final Date JANUARY_1_2020 = - Date.from(LocalDate.of(2020, 1, 1) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the subCA restrictions take affect - private static final Date BEFORE_JANUARY_1_2020 = - Date.from(LocalDate.of(2020, 1, 1) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - public static void main(String[] args) throws Exception { - - cf = CertificateFactory.getInstance("X.509"); - - boolean before = args[0].equals("before"); - boolean policyOn = args[1].equals("policyOn"); - boolean isValid = args[2].equals("valid"); - - if (!policyOn) { - // disable policy (default is on) - Security.setProperty("jdk.security.caDistrustPolicies", ""); - } - - Date notBefore = before ? BEFORE_APRIL_17_2019 : APRIL_17_2019; - - X509TrustManager pkixTM = getTMF("PKIX", null); - X509TrustManager sunX509TM = getTMF("SunX509", null); - for (String test : rootsToTest) { - System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); - - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); - } - - // test chain if params are passed to TrustManager - System.err.println("Testing verisignuniversalrootca with params"); - testTM(getTMF("PKIX", getParams()), - loadCertificateChain("verisignuniversalrootca"), - notBefore, isValid); - - // test code-signing chain (should be valid as restrictions don't apply) - System.err.println("Testing verisignclass3g5ca code-signing chain"); - Validator v = Validator.getInstance(Validator.TYPE_PKIX, - Validator.VAR_CODE_SIGNING, - getParams()); - // set validation date so this will still pass when cert expires - v.setValidationDate(new Date(1544197375493l)); - v.validate(loadCertificateChain("verisignclass3g5ca-codesigning")); - - // test chains issued through subCAs - notBefore = before ? BEFORE_JANUARY_1_2020 : JANUARY_1_2020; - for (String test : subCAsToTest) { - System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); - - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); - } - } - - private static X509TrustManager getTMF(String type, - PKIXBuilderParameters params) throws Exception { - TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); - if (params == null) { - tmf.init((KeyStore)null); - } else { - tmf.init(new CertPathTrustManagerParameters(params)); - } - TrustManager[] tms = tmf.getTrustManagers(); - for (TrustManager tm : tms) { - X509TrustManager xtm = (X509TrustManager)tm; - return xtm; - } - throw new Exception("No TrustManager for " + type); - } - - private static PKIXBuilderParameters getParams() throws Exception { - PKIXBuilderParameters pbp = - new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), - new X509CertSelector()); - pbp.setRevocationEnabled(false); - return pbp; - } - - private static void testTM(X509TrustManager xtm, X509Certificate[] chain, - Date notBefore, boolean valid) throws Exception { - // Check if TLS Server certificate (the first element of the chain) - // is issued after the specified notBefore date (should be rejected - // unless distrust property is false). To do this, we need to - // fake the notBefore date since none of the test certs are issued - // after then. - chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); - - try { - xtm.checkServerTrusted(chain, "ECDHE_RSA"); - if (!valid) { - throw new Exception("chain should be invalid"); - } - } catch (CertificateException ce) { - // expired TLS certificates should not be treated as failure - if (expired(ce)) { - System.err.println("Test is N/A, chain is expired"); - return; - } - if (valid) { - throw new Exception("Unexpected exception, chain " + - "should be valid", ce); - } - if (ce instanceof ValidatorException) { - ValidatorException ve = (ValidatorException)ce; - if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { - ce.printStackTrace(System.err); - throw new Exception("Unexpected exception: " + ce); - } - } else { - throw new Exception("Unexpected exception: " + ce); - } - } - } - - // check if a cause of exception is an expired cert - private static boolean expired(CertificateException ce) { - if (ce instanceof CertificateExpiredException) { - return true; - } - Throwable t = ce.getCause(); - while (t != null) { - if (t instanceof CertificateExpiredException) { - return true; - } - t = t.getCause(); - } - return false; - } - - private static X509Certificate[] loadCertificateChain(String name) - throws Exception { - try (InputStream in = new FileInputStream(TEST_SRC + File.separator + - name + "-chain.pem")) { - Collection certs = - (Collection)cf.generateCertificates(in); - return certs.toArray(new X509Certificate[0]); - } - } - - private static class DistrustedTLSServerCert extends X509Certificate { - private final X509Certificate cert; - private final Date notBefore; - DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { - this.cert = cert; - this.notBefore = notBefore; - } - public Set getCriticalExtensionOIDs() { - return cert.getCriticalExtensionOIDs(); - } - public byte[] getExtensionValue(String oid) { - return cert.getExtensionValue(oid); - } - public Set getNonCriticalExtensionOIDs() { - return cert.getNonCriticalExtensionOIDs(); - } - public boolean hasUnsupportedCriticalExtension() { - return cert.hasUnsupportedCriticalExtension(); - } - public void checkValidity() throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public void checkValidity(Date date) throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public int getVersion() { return cert.getVersion(); } - public BigInteger getSerialNumber() { return cert.getSerialNumber(); } - public Principal getIssuerDN() { return cert.getIssuerDN(); } - public Principal getSubjectDN() { return cert.getSubjectDN(); } - public Date getNotBefore() { return notBefore; } - public Date getNotAfter() { return cert.getNotAfter(); } - public byte[] getTBSCertificate() throws CertificateEncodingException { - return cert.getTBSCertificate(); - } - public byte[] getSignature() { return cert.getSignature(); } - public String getSigAlgName() { return cert.getSigAlgName(); } - public String getSigAlgOID() { return cert.getSigAlgOID(); } - public byte[] getSigAlgParams() { return cert.getSigAlgParams(); } - public boolean[] getIssuerUniqueID() { - return cert.getIssuerUniqueID(); - } - public boolean[] getSubjectUniqueID() { - return cert.getSubjectUniqueID(); - } - public boolean[] getKeyUsage() { return cert.getKeyUsage(); } - public int getBasicConstraints() { return cert.getBasicConstraints(); } - public byte[] getEncoded() throws CertificateEncodingException { - return cert.getEncoded(); - } - public void verify(PublicKey key) throws CertificateException, - InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key); - } - public void verify(PublicKey key, String sigProvider) throws - CertificateException, InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key, sigProvider); - } - public PublicKey getPublicKey() { return cert.getPublicKey(); } - public String toString() { return cert.toString(); } - } -} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIElDCCBDqgAwIBAgIIWax3IY1ByGIwCgYIKoZIzj0EAwIwYjEcMBoGA1UEAwwT -QXBwbGUgSVNUIENBIDggLSBHMTEgMB4GA1UECwwXQ2VydGlmaWNhdGlvbiBBdXRo -b3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE5MDEw -ODIxMTAyNFoXDTIwMDgwODIxMjAwMFowga0xTTBLBgNVBAMMRGFjdGl2ZS5nZW90 -cnVzdC1nbG9iYWwtY2EtZzIudGVzdC1wYWdlcy5jZXJ0aWZpY2F0ZW1hbmFnZXIu -YXBwbGUuY29tMSUwIwYDVQQLDBxtYW5hZ2VtZW50OmlkbXMuZ3JvdXAuODY0ODU5 -MRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMQswCQYD -VQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABN4oxNLGzmOIfgFRxDaU -SaOYTQVZCc7a7MXlK1L4/KgN22stgSkrg47aOWviMuzb9Q9hDA/Tn19o9Zr8G5ON -pYijggKMMIICiDAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFMPEpFgFY9eDBrqW -jdyyjzL2u7dBMH4GCCsGAQUFBwEBBHIwcDA0BggrBgEFBQcwAoYoaHR0cDovL2Nl -cnRzLmFwcGxlLmNvbS9hcHBsZWlzdGNhOGcxLmRlcjA4BggrBgEFBQcwAYYsaHR0 -cDovL29jc3AuYXBwbGUuY29tL29jc3AwMy1hcHBsZWlzdGNhOGcxMDEwTwYDVR0R -BEgwRoJEYWN0aXZlLmdlb3RydXN0LWdsb2JhbC1jYS1nMi50ZXN0LXBhZ2VzLmNl -cnRpZmljYXRlbWFuYWdlci5hcHBsZS5jb20wgf4GA1UdIASB9jCB8zCB8AYKKoZI -hvdjZAULBDCB4TCBpAYIKwYBBQUHAgIwgZcMgZRSZWxpYW5jZSBvbiB0aGlzIGNl -cnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgYW55 -IGFwcGxpY2FibGUgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlIGFuZC9vciBj -ZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDgGCCsGAQUFBwICMCwM -Kmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmljYXRlYXV0aG9yaXR5LzAdBgNV -HSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwNwYDVR0fBDAwLjAsoCqgKIYmaHR0 -cDovL2NybC5hcHBsZS5jb20vYXBwbGVpc3RjYThnMS5jcmwwHQYDVR0OBBYEFCQy -hU8U00tcIz6L0MCT6EGVho0EMA4GA1UdDwEB/wQEAwIDiDAKBggqhkjOPQQDAgNI -ADBFAiAl5nGHi2u8V0aJSp4o1i3TlK7ao8WvxwBuHKfuKibSLAIhAN8PZqhESS9u -V7Dr6qzs88yn/1z6oeqPwDsntFpUFtWG ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDVDCCAtugAwIBAgIQE1Iuv8HdXOEe8nZAdR/n3zAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTE2MDYwOTAwMDAwMFoXDTMxMDYwODIzNTk1OVowYjEcMBoGA1UE -AwwTQXBwbGUgSVNUIENBIDggLSBHMTEgMB4GA1UECwwXQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYH -KoZIzj0CAQYIKoZIzj0DAQcDQgAELVSOaLAQE+/0LdvYCbJD6J1lmW40uNSXyY7J -1qgiNzLIcWDusPHyxWT2ukdf/OYHeDIt9sqAIMn9cPhykyGIRaOCATowggE2MBIG -A1UdEwEB/wQIMAYBAf8CAQAwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2cuc3lt -Y2IuY29tL0dlb1RydXN0UENBLUcyLmNybDAOBgNVHQ8BAf8EBAMCAQYwLgYIKwYB -BQUHAQEEIjAgMB4GCCsGAQUFBzABhhJodHRwOi8vZy5zeW1jZC5jb20wSQYDVR0g -BEIwQDA+BgZngQwBAgIwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2VvdHJ1 -c3QuY29tL3Jlc291cmNlcy9jcHMwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF -BwMCMB0GA1UdDgQWBBTDxKRYBWPXgwa6lo3cso8y9ru3QTAfBgNVHSMEGDAWgBQV -XzVXUVX7JbKtA2n8AaP6vhFV1TAKBggqhkjOPQQDAwNnADBkAjBH2jMNybjCk3Ts -OidXxJX9YDPMd5S3KDCv8vyTdJGhtoly7fQJRNv5rnVz+6YGfsMCMEp6wyheL7NK -mqavsduix2R+j1B3wRjelzJYgXzgM3nwhQKKlJWxpF7IGHuva1taxg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw -NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV -BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL -So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal -tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG -CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT -qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz -rD6ogRLQy7rQkgu2npaqBA+K ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFcDCCBRegAwIBAgIQHw+Lyn4UTWqRF8/JM7DH+zAKBggqhkjOPQQDAjBHMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xHzAdBgNVBAMTFkdl -b1RydXN0IEVDQyBFViBTU0wgQ0EwHhcNMTcwNTExMDAwMDAwWhcNMTkwNTAzMjM1 -OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECDAhE -ZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNV -BAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9u -MRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEYMBYG -A1UECwwPUm9vdCAxMiAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTIuZ2Vv -dHJ1c3QuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbvbmcvKl4MkBRBNY -7EOQ7ugwPIPPCp73W++hAcbFPqiDmupl/fqfrbjL06FImeWzDY7cQOhLbv0Ha8Yq -UrL8HKOCAzcwggMzMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG -AQUFBwMCMA4GA1UdDwEB/wQEAwIFoDCBqQYDVR0gBIGhMIGeMIGSBgkrBgEEAfAi -AQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNv -dXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggrBgEFBQcCAjA1DDNodHRwczovL3d3 -dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3JlcG9zaXRvcnkvbGVnYWwwBwYFZ4EM -AQEwKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL2ZlLnN5bWNiLmNvbS9mZS5jcmww -VwYIKwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8vZmUuc3ltY2QuY29t -MCYGCCsGAQUFBzAChhpodHRwOi8vZmUuc3ltY2IuY29tL2ZlLmNydDAkBgNVHREE -HTAbghl2YWxpZC1yb290MTIuZ2VvdHJ1c3QuY29tMB8GA1UdIwQYMBaAFABLH5GB -DgtDzgRzu5abgh1mY608MIIBfAYKKwYBBAHWeQIEAgSCAWwEggFoAWYAdQDd6x0r -eg1PpiCLga2BaHB+Lo6dAdVciI09EcTNtuy+zAAAAVv4eJwGAAAEAwBGMEQCIBSx -ZdTP+tDh1rstAJ7vyIPNH7HBE6mCRj9W41ccUwbGAiA7p0ljgNoO/ldknmgTiZdI -FlgEy1KgPQiHYvNS+9MHYwB1AKS5CZC0GFgUh7sTosxncAo8NZgE+RvfuON3zQ7I -DdwQAAABW/h4nDMAAAQDAEYwRAIgWf4vMQ9lrM5xKD+iEVXkC7g5CB3fmuxP7fNp -7qX7PB8CIDNe8HT3262gw3D13MGQccxfUhf7dZ9aCRgk7UEDimsJAHYA7ku9t3XO -YLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFb+Hid8wAABAMARzBFAiAxSFtr -/dpMd53ZSC4N9FomEZhoNnARnYe7cWnTAdKVHAIhALEz0JaOqgYTf0k9yYPuNW4E -Bo26yneH6KtdkMV7/gRoMAoGCCqGSM49BAMCA0cAMEQCIBPb1wYt8d6EdjLXiAZp -UfKGFdQF/oexd5GCB1TU0juDAiBWPRPVggfYfc4gLOkYSqIPvPRmEmEhyY8fqsM6 -3YJgDg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDyDCCA06gAwIBAgIQDww3Kf30lVv4ZevF7vQy/DAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTE2MDEwNzAwMDAwMFoXDTI2MDEwNjIzNTk1OVowRzELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDkdlb1RydXN0LCBJbmMuMR8wHQYDVQQDExZHZW9UcnVz -dCBFQ0MgRVYgU1NMIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEF136Fo2A -bY7q0YbhVBTL4HNFaJyTdoU3y+o8YdhxQuw1SrpQT9EwLTyx8Xzf/LNPeoalIKNu -U/3LQgNct6Fk9aOCAcgwggHEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHSUEFjAUBggr -BgEFBQcDAQYIKwYBBQUHAwIwLgYIKwYBBQUHAQEEIjAgMB4GCCsGAQUFBzABhhJo -dHRwOi8vZy5zeW1jZC5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADCBqQYDVR0gBIGh -MIGeMAcGBWeBDAEBMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBz -Oi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBB -BggrBgEFBQcCAjA1GjNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2Vz -L3JlcG9zaXRvcnkvbGVnYWwwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2cuc3lt -Y2IuY29tL0dlb1RydXN0UENBLUcyLmNybDArBgNVHREEJDAipCAwHjEcMBoGA1UE -AxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMjAdBgNVHQ4EFgQUAEsfkYEOC0POBHO7lpuC -HWZjrTwwHwYDVR0jBBgwFoAUFV81V1FV+yWyrQNp/AGj+r4RVdUwCgYIKoZIzj0E -AwMDaAAwZQIweZGj+Ar54cOBtC1I6rkfdNOtxSg77WBAvvsEv1+knWbbu8Acroz1 -Q9xqHnHLXpgRAjEAxNA5KzWxutl/kVj/7bUCYtvSWLfmb2ZTTsvof7VjjWlRnPje -wLtx+yN5EV7LPWDi ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIG6jCCBdKgAwIBAgIQZfxPPcDd0zSbl2UQK6dtRzANBgkqhkiG9w0BAQsFADBG -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEfMB0GA1UEAxMW -R2VvVHJ1c3QgU0hBMjU2IFNTTCBDQTAeFw0xNzAyMDEwMDAwMDBaFw0yMDAzMDIy -MzU5NTlaMHgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD -VQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQKDBRTeW1hbnRlYyBDb3Jwb3JhdGlv -bjEdMBsGA1UEAwwUc3NsdGVzdDEzLmJidGVzdC5uZXQwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDV734wSAESareltMadza6jJ0SVi6bLb/Q23La5v5Z/ -rFCdPzSRrMMKj08NfAA/i1k+TF/d7NZ+rrFvCIN33kfDzSLvIQiJh7NZ/yivA9DY -eH7RAuVXfrsqhsqpgHVNSmMXxaGxOIJ4RcEx0RB3vbb3frm46lCLMH0uCavJ7Txo -gDJpAG6AP/hF524IVJcIcHxhJqZo1pQO/iwb/uNGkqwRuAeL9zKhv0tYyiHKNqyW -AXk51Nzm+TQq0flw0nw7EC9f+VNrquiO5j76JKeL+DaxpUtftTpzL5b5oM/LXwDt -62VUMujOyVuKPIj1ieQVdhETSDvf340tQI7MB4qFrHlFAgMBAAGjggOgMIIDnDAf -BgNVHREEGDAWghRzc2x0ZXN0MTMuYmJ0ZXN0Lm5ldDAJBgNVHRMEAjAAMA4GA1Ud -DwEB/wQEAwIFoDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vZ2ouc3ltY2IuY29t -L2dqLmNybDCBnQYDVR0gBIGVMIGSMIGPBgZngQwBAgIwgYQwPwYIKwYBBQUHAgEW -M2h0dHBzOi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9s -ZWdhbDBBBggrBgEFBQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVz -b3VyY2VzL3JlcG9zaXRvcnkvbGVnYWwwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG -AQUFBwMCMB8GA1UdIwQYMBaAFBRnju2DT9YenUAEDARGoXA0sg9yMFcGCCsGAQUF -BwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2dqLnN5bWNkLmNvbTAmBggrBgEF -BQcwAoYaaHR0cDovL2dqLnN5bWNiLmNvbS9nai5jcnQwggH2BgorBgEEAdZ5AgQC -BIIB5gSCAeIB4AB1AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAAB -WfvjZWcAAAQDAEYwRAIgIxFLEWNCRmGQl2o+3psXrWAd88rz9G1JbxbAgHFpXmAC -IFxZpWwuj1Aq4Yx6VrBBqvA+K/GlNY2OcThPaeoj3jdfAHYApLkJkLQYWBSHuxOi -zGdwCjw1mAT5G9+443fNDsgN3BAAAAFZ++NlpAAABAMARzBFAiB+iko2tw6USdc2 -E956ZIpXy9TTUiVtpKHzKFhuR7mdwwIhAMwTisbIGh6UTdjXnPktWPFcWhfxQOPB -U41c/v7zuFV9AHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFZ -++NnWwAABAMASDBGAiEAmqY4AhQPt/tU1iR0LvrlpIjKlc0IArbxENVkVbNTYwcC -IQCPlJZQb7mmlPwjy//aJMyOtEeVFb6DzfM4uhJiSrU9WAB2ALx44d/F9jxoRkkz -TaEPoV8JeWkgCcCBtPP2kX8+2bilAAABWfvjZmgAAAQDAEcwRQIgMcV63d6G3RHm -rN34V1zDiAbKG1k/pDEErcfZ+8Y0GdwCIQCcuqmKjnpUYs8ps4/NSx78U2ssNuLA -+QDpYuH1XKHCUTANBgkqhkiG9w0BAQsFAAOCAQEAjYdQJYtrhPJTIHcsyksTWGHS -cpIt7y1bzp+t06KYn6x+ax+09sTJQzr7L2BA3h24blgMWr2yEH0mvQdVncBFt8xr -9O8jeg5dHSeJknnDlXOA23Z2NJLanX7m29/713DxZ+HJXFx0Wiz5mtuTo7Q6FpQF -SI44v0fbUTb7LV81fFpyriroZTlpiMI01NLWGldyCchC795fEYiibSvr1uidjp9i -+MKppG3t3YXb1/Wu2A21b6Z4akgl021A5cJcg8/Q3wjYMqQTtuUEezsBl2jLoey1 -pa/ag3epMe19zTq4iqS3Z4r+2jrZ4IjnKmkDKo4uKvTAfUX2Yu2+Lm3E6Vfdow== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIExzCCA6+gAwIBAgIQQYISfRLZxrMhOUMSVmQAuDANBgkqhkiG9w0BAQsFADCB -mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT -MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eSAtIEczMB4XDTEzMDUyMzAwMDAwMFoXDTIzMDUyMjIzNTk1OVowRjELMAkG -A1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHzAdBgNVBAMTFkdlb1Ry -dXN0IFNIQTI1NiBTU0wgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQDGqQtdF6V9xs8q78Zm0UIeX4N4aJGv5qeL8B1EAQoZypzUix3hoZCjwVu011tq -i/wOSR7CYin+gBU5i4EqJ7X7EqgFIgvFLPXZmN0WLztm52KiQzKsj7WFyFIGLFzA -d/pn94PoXgWNyKuhFjKK0kDshjocI6mNtQDecr2FVf4GAWBdrbPgZXOlkhSelFZv -k+6vqTowJUqOCYTvt9LV15tJzenAXmdxIqxQkEMgXaGjFYP9/Kc5vGtlSBJg/90j -szqq9J+cN1NBokeTgTMJ5SLGyBxJoW6NzIOzms3qQ/IZ0yTLqCmuUsz0CCewhOrO -J7XhNBNzklyHhirGsGg2rcsJAgMBAAGjggFcMIIBWDA7BggrBgEFBQcBAQQvMC0w -KwYIKwYBBQUHMAGGH2h0dHA6Ly9wY2EtZzMtb2NzcC5nZW90cnVzdC5jb20wEgYD -VR0TAQH/BAgwBgEB/wIBADBMBgNVHSAERTBDMEEGCmCGSAGG+EUBBzYwMzAxBggr -BgEFBQcCARYlaHR0cDovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL2NwczA7 -BgNVHR8ENDAyMDCgLqAshipodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9HZW9UcnVz -dFBDQS1HMy5jcmwwDgYDVR0PAQH/BAQDAgEGMCoGA1UdEQQjMCGkHzAdMRswGQYD -VQQDExJWZXJpU2lnbk1QS0ktMi00MTYwHQYDVR0OBBYEFBRnju2DT9YenUAEDARG -oXA0sg9yMB8GA1UdIwQYMBaAFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3 -DQEBCwUAA4IBAQAQEOryENYIRuLBjz42WcgrD/5N7OP4tlYxeCXUdvII3e8/zYsc -fqp//AuoI2RRs4fWCfoi+scKUejOuPYDcOAbWrmxspMREPmXBQcpbG1XJVTo+Wab -Dvvbn+6Wb2XLH9hVzjH6zwL00H9QZv8veZulwt/Wz8gVg5aEmLJG1F8TqD6nNJwF -ONrP1mmVqSaHdgHXslEPgWlGJhyZtoNY4ztYj9y0ccC5v0KcHAOe5Eao6rnBzfZb -qTyW+3mkM3Onnni5cNxydMQyyAAbye9I0/s6m/r+eppAaRzI2ig3C9OjuX6WzCso -w1Zsb+nbUrH6mvvnr7WXpiLDxaiTsQDJB7J9 ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIHATCCBemgAwIBAgIQJmVwMHBfVctB6q6UbCC4eDANBgkqhkiG9w0BAQsFADBH -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMX -R2VvVHJ1c3QgRVYgU1NMIENBIC0gRzYwHhcNMTcwNTA5MDAwMDAwWhcNMTkwNTAz -MjM1OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgEC -DAhEZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAU -BgNVBAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0 -aW9uMRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEY -MBYGA1UECwwPUm9vdCAxNCAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTQu -Z2VvdHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAua4C -iQ+Sk3VXblrh9xI6DqxELgjGxLOxORgayEM1/x4lKC5Dah5Ey9jeDhy6eDLJRXce -JHjR5FYFNpjRpp8w58SzmosAQk7tgRy6HGPtVUUXCVkfUDJ6LIcZE1UcwKO3CUdh -2Dn3naVCNImdqqoUTCr4H/8iIy+1l4aUDnukiAsTV6M2Len0UQpD8MY2KyVmWNJz -GLGzZKXKwU42CZwK8hR+xUH/BSEcWvfU2bFShVGIY1CCpJ5vdhi0QMaRfDzpAXVw -3gvO5bN7RvDD8tABtLUjpnm0P7HzxkVkEO+BGg0P+qpw4bflu+TE7die+pFY1Skz -1rEFOvMEVOCqoinanwIDAQABo4IDOzCCAzcwJAYDVR0RBB0wG4IZdmFsaWQtcm9v -dDE0Lmdlb3RydXN0LmNvbTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDCBqQYD -VR0gBIGhMIGeMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8v -d3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggr -BgEFBQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3Jl -cG9zaXRvcnkvbGVnYWwwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG -AQUFBwMCMFcGCCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2ZpLnN5 -bWNkLmNvbTAmBggrBgEFBQcwAoYaaHR0cDovL2ZpLnN5bWNiLmNvbS9maS5jcnQw -KwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL2ZpLnN5bWNiLmNvbS9maS5jcmwwHwYD -VR0jBBgwFoAUvpmWhYTv5p/5H+H8ZmdbVqX6i1MwggGABgorBgEEAdZ5AgQCBIIB -cASCAWwBagB3AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAABW/fm -zy4AAAQDAEgwRgIhALUgY0DrJaqjpgv19bbS434UDMpUfIfZ7qyxz30M1LiQAiEA -4dXlkRJLc3i+DcFUNSjRh8dKPLZMC3DhD4bm7tDQaWwAdgCkuQmQtBhYFIe7E6LM -Z3AKPDWYBPkb37jjd80OyA3cEAAAAVvuRpVUAAAEAwBHMEUCIGUbCcQ2agQi+sWo -zudL0F2rSS4elFAgHy/nSzGb/fl0AiEA5zLqvTsn8ioQ89KycY3HocNCLAPtqDqe -t9+6pcJnVFsAdwDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAVvu -RpV3AAAEAwBIMEYCIQDrKkvy08fPVx4vbVO4wBYw7tpqkmrWTaKCIs7Tx9utYwIh -ANuH3S2ngCM7WzCebmbLFVDmaNxQki3kmZbCOp358sRvMA0GCSqGSIb3DQEBCwUA -A4IBAQAOEMVj7HwG97PurqFqoa9JI2adgj8er1hc70dIGkTt21OKLWvWp0Yafcjx -qqEByFjzkF0/yreVmbxl1zf7utUMfWslmv7ElXDvS79lZ2UWO6vptyaZM6VSJ2s+ -pmGHJaQgw3AbDmu5yLmUPlHwOttv//AOuaZvrQISzrwmMs60sHn+pS7qtSdL3lYa -PtqhCBQNJoLDstn57B/aLBUYx5rSqhK68CCxY4ZcA1i02RakZJIhGbOAOy4x5pZH -uZiiRFTxgZRGNNUDjrhmVVk7cQDu3eDRDkUKD9m7796GJ+aFDZlvzmORaNW5GYjv -0qIRajIKmohnwumn+xaJFpmDEuw+ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFUjCCAzqgAwIBAgIQAQAZ9apyafiMHhwSEeyNTzANBgkqhkiG9w0BAQsFADBF -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMV -R2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTE3MDUwMTE0MTcxNloXDTI3MDQyOTE0 -MTcxNlowRzELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xIDAe -BgNVBAMTF0dlb1RydXN0IEVWIFNTTCBDQSAtIEc2MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEArvBCvG8ORCUSTiERfNmMdtEvKhvmnV8MrSLOw6t3q24c -+r/y69NGdUJArGmBv8crE5Vxd5mYlecmflrJtyuh08HDFc4Mr4yh2xcGmeKA7Uz5 -Q/Wpfropvop1cFB3r/8BwpfxortVi2jkawQ89TDo3l0RacJrjM29dq+rQwqIWvfK -dHuU58t54CsXzvJrqDnhL4v+LQ2mqZMbAfh1Mhh8MftEH5UfOSgY2uXwnu5vERYI -3cl0nakgoJOyUlb187iFd/TrSrYGquv8dYAKTKOTd44YNwxb43iKk/esqxOTiqW8 -rAFv6/E6aOmHwqyP9l7LMtLzVE27ra1wESMR70JttwIDAQABo4IBOjCCATYwHwYD -VR0jBBgwFoAU2rsuqrAMuIgmUXRcbQPTwNiPetYwHQYDVR0OBBYEFL6ZloWE7+af -+R/h/GZnW1al+otTMA4GA1UdDwEB/wQEAwIBBjAuBggrBgEFBQcBAQQiMCAwHgYI -KwYBBQUHMAGGEmh0dHA6Ly9nLnN5bWNkLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEA -MB8GA1UdIAQYMBYwBwYFZ4EMAQEwCwYJKwYBBAHwIgEGMDUGA1UdHwQuMCwwKqAo -oCaGJGh0dHA6Ly9nLnN5bWNiLmNvbS9jcmxzL2d0dW5pY2ExLmNybDAdBgNVHSUE -FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwKQYDVR0RBCIwIKQeMBwxGjAYBgNVBAMT -EVN5bWFudGVjUEtJLTItNzU3MA0GCSqGSIb3DQEBCwUAA4ICAQA8iM9XJ01hEzSM -iATIdK/z+F1Vtm9hHjp0FzkOvVYkp7v6LIkazg299fyAy2+A/tpSzKyMIzy5B2R/ -sjbWykIK+3vtOlgUNilP7EoudiCjR/692THUtJ/QjPNzFYhO9apU2Wpc33ZYMH0Q -YKUPmAd7eBmsdVKHNLENcMjjCjnkjXnYtxq/jv2R4QhD83tbFnvBoKjxi2vAfDXG -xN8aItVg/FSdScZCMhe0w/HLzcN6N3NCGDBn2PjF0o3QLJa9yVSrvJ9Nh3my6rUb -gMhlfFEQXTmLxucqL5/n5lXyUWd0kTxFv++TalTeqYf3G/oeu5kcpfjUJREp/9ed -gQqhDEGIuJFrMm4qi+sNDrq0OkLBHCqefFArTz2ApiI9zd9pcKfjS3f/EB87AVmW -3m1lfqPeS+w+vBg7VCGNY9gGNUe+w4juTEBiwIjnp7I+aBVnIwxV9PdJoj1ZaLCx -U8AEN6tXD8IcCquLxs3fBsF85svvUfK8qh3ufKB3I3RHGq5Asmtvc5URcyeuA+d2 -zPQ1qAXH5m3DLkb0KdAvJ5E6mQ2S2aqwJPXtpqx2J40C1Qx+uUsHG2vDoT3ZTazt -LPBIIqF2YJr1hr760yXM3Jf14eyc+RXPrjA1mc/CKNbv6SvU5MvlYj+Vvx70y+k8 -U5ev+YdiYoYu0wQtDJQCJjM+eavqxQ== ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIG/TCCBeWgAwIBAgIQfVQyuY0yb1Q+TZDQHtRC8TANBgkqhkiG9w0BAQsFADBH -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMX -R2VvVHJ1c3QgRVYgU1NMIENBIC0gRzQwHhcNMTcwNTAzMDAwMDAwWhcNMTkwNTAz -MjM1OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgEC -DAhEZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAU -BgNVBAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0 -aW9uMRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEY -MBYGA1UECwwPUm9vdCAxMSAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTEu -Z2VvdHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy5Wn -8CUYyHQnisa3ihcezpRBrKNF9OGb9ye9G4mUFRAHoFlNdwVP3qxBtEo7N6ylZ7G0 -tMcLwqy+cdMZlyCw0qPQrJQXqp5AEL034IMeckSvR9I2RyR7DUW3kVtKRsDiAUo9 -4r8h/5ZT96OW/jtdE2WPr0Wt5r0DyG8xzUbUdh5tYFwlxMJLeHgomqsG1WXBEDvS -cTJk9JMZpH5d1FYux+T0BkJsYyj0NRcDnQuc6P4QIkpim3wsOBKMa7beEiCanmcK -dSBrBfl2iep67VfOEYfjYTDOwqwaknSfb2H33e0lpunI76Rwv1uZkr/4ciDyaNZS -IsLh1i57eKvWqn+G9wIDAQABo4IDNzCCAzMwJAYDVR0RBB0wG4IZdmFsaWQtcm9v -dDExLmdlb3RydXN0LmNvbTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDArBgNV -HR8EJDAiMCCgHqAchhpodHRwOi8vZ20uc3ltY2IuY29tL2dtLmNybDCBqQYDVR0g -BIGhMIGeMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8vd3d3 -Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggrBgEF -BQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3JlcG9z -aXRvcnkvbGVnYWwwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF -BwMCMB8GA1UdIwQYMBaAFN7PXFC3rgIfFReqFugNtSidalrzMFcGCCsGAQUFBwEB -BEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2dtLnN5bWNkLmNvbTAmBggrBgEFBQcw -AoYaaHR0cDovL2dtLnN5bWNiLmNvbS9nbS5jcnQwggF8BgorBgEEAdZ5AgQCBIIB -bASCAWgBZgB1AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAABW8/Y -RIwAAAQDAEYwRAIgWDLmmEUz8FyqMxfyweXN18EAYitvP3XPnU3XkJzRSrQCIB5y -KErRbSiDkj43iFWQVodPA70HtcgdIzk4X3KA7thOAHYApLkJkLQYWBSHuxOizGdw -Cjw1mAT5G9+443fNDsgN3BAAAAFbz9hEtwAABAMARzBFAiAjTCcAEJDj9M/xY7a/ -pysTrl0MrE6rMzpotNZ5kik1PgIhAMTAYXIUeA7LqKhYlvOvW/cH+uB+8329J8cy -xMF8dmEJAHUA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFbz9hE -3gAABAMARjBEAiA7UGcNzFIEVvXeJRuWPfhA8t0JOjl//7ZuLYgdnt6/jAIgIHyH -QHLo2q5o99msj2s8o1BaTmxxnSF4TZPm8iZGLywwDQYJKoZIhvcNAQELBQADggEB -AGBUtaCjWXpAPSc7ypv6f+IJGYfGHR7NLBLLjTytKHcIx5Hb0YT14TFWnXacaSHk -XL/vY3v3CrdGqn6UZb4UEdyB54juG6J7DLQF/l8oeG0GzPQLlSOt0ZU4Cq9DayO0 -OFS6jD7K7FqalSiBzvFnDFmWqLXZQaO/dFPHvZVIdhfO6Vl/3yH+nkphrc8AiHqV -0LkFaoki3RUJMqPvb1pyZ41MzMVsS/LMPoxS0JUl+YKAhL5H1JS1OPMY1B++k2hs -BoScopXAC1xsOkpQWg+U2+mMnAebcCeFWtKrjVUIA+lzaAr6jbBOK9dLSschRXBe -R9xGJ3I9J4t0pKD5lFr9+fQ= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEbjCCA1agAwIBAgIQboqQ68/wRIpyDQgF0IKlRDANBgkqhkiG9w0BAQsFADBY -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo -R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xMzEw -MzEwMDAwMDBaFw0yMzEwMzAyMzU5NTlaMEcxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMSAwHgYDVQQDExdHZW9UcnVzdCBFViBTU0wgQ0EgLSBH -NDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANm0BfI4Zw8J53z1Yyrl -uV6oEa51cdlMhGetiV38KD0qsKXV1OYwCoTU5BjLhTfFRnHrHHtp22VpjDAFPgfh -bzzBC2HmOET8vIwvTnVX9ZaZfD6HHw+QS3DDPzlFOzpry7t7QFTRi0uhctIE6eBy -GpMRei/xq52cmFiuLOp3Xy8uh6+4a+Pi4j/WPeCWRN8RVWNSL/QmeMQPIE0KwGhw -FYY47rd2iKsYj081HtSMydt+PUTUNozBN7VZW4f56fHUxSi9HdzMlnLReqGnILW4 -r/hupWB7K40f7vQr1mnNr8qAWCnoTAAgikkKbo6MqNEAEoS2xeKVosA7pGvwgtCW -XSUCAwEAAaOCAUMwggE/MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD -AgEGMC8GCCsGAQUFBwEBBCMwITAfBggrBgEFBQcwAYYTaHR0cDovL2cyLnN5bWNi -LmNvbTBHBgNVHSAEQDA+MDwGBFUdIAAwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93 -d3cuZ2VvdHJ1c3QuY29tL3Jlc291cmNlcy9jcHMwNAYDVR0fBC0wKzApoCegJYYj -aHR0cDovL2cxLnN5bWNiLmNvbS9HZW9UcnVzdFBDQS5jcmwwKQYDVR0RBCIwIKQe -MBwxGjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTM4MB0GA1UdDgQWBBTez1xQt64C -HxUXqhboDbUonWpa8zAfBgNVHSMEGDAWgBQs1VBBlxWL8I82YVtK+2vZmckzkjAN -BgkqhkiG9w0BAQsFAAOCAQEAtI69B7mahew7Z70HYGHmhNHU7+sbuguCS5VktmZT -I723hN3ke40J2s+y9fHDv4eEvk6mqMLnEjkoNOCkVkRADJ+IoxXT6NNe4xwEYPtp -Nk9qfgwqKMHzqlgObM4dB8NKwJyNw3SxroLwGuH5Tim9Rt63Hfl929kPhMuSRcwc -sxj2oM9xbwwum9Its5mTg0SsFaqbLmfsT4hpBVZ7i7JDqTpsHBMzJRv9qMhXAvsc -4NG9O1ZEZcNj9Rvv7DDZ424uE+k5CCoMcvOazPYnKYTT70zHhBFlH8bjgQPbh8x4 -97Wdlj5qf7wRhXp15kF9Dc/55YVpJY/HjQct+GkPy0FTAA== ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFNjCCBN2gAwIBAgIQWCw1fnWLWedosJcJlxQbhDAKBggqhkjOPQQDAjBDMQsw -CQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMR0wGwYDVQQDExR0aGF3 -dGUgRUNDIEVWIFNTTCBDQTAeFw0xNzA1MTEwMDAwMDBaFw0xOTA1MDgyMzU5NTla -MIHsMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIMCERlbGF3 -YXJlMRUwEwYDVQQKDAxUaGF3dGUsIEluYy4xCzAJBgNVBAYTAlVTMRMwEQYDVQQI -DApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQPExRQ -cml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UEBRMHMzg5ODI2MTEXMBUGA1UECwwO -Um9vdCA4IC0gVkFMSUQxHzAdBgNVBAMMFnZhbGlkLXJvb3Q4LnRoYXd0ZS5jb20w -WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATVxsOfZ4/2K7l7FYl6ejjp5aNuX1J9 -gqfb8WdGQdmKW8TVlhzM9p3BQ61hcISHVW01ZzR2PgYQ5aALzTaZ/Vt9o4IDBzCC -AwMwCQYDVR0TBAIwADB8BgNVHSAEdTBzMGgGC2CGSAGG+EUBBzABMFkwJgYIKwYB -BQUHAgEWGmh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vY3BzMC8GCCsGAQUFBwICMCMM -IWh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vcmVwb3NpdG9yeTAHBgVngQwBATArBgNV -HR8EJDAiMCCgHqAchhpodHRwOi8vdHEuc3ltY2IuY29tL3RxLmNybDAdBgNVHSUE -FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH/BAQDAgWgMFcGCCsGAQUF -BwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3RxLnN5bWNkLmNvbTAmBggrBgEF -BQcwAoYaaHR0cDovL3RxLnN5bWNiLmNvbS90cS5jcnQwIQYDVR0RBBowGIIWdmFs -aWQtcm9vdDgudGhhd3RlLmNvbTAfBgNVHSMEGDAWgBRbM681oBoZN0INV+a8vWtj -IMKWATCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHYA3esdK3oNT6Ygi4GtgWhw -fi6OnQHVXIiNPRHEzbbsvswAAAFb+KihvQAABAMARzBFAiBghdkYlqbxNHmxETaN -TKTcLlmD8amIlOWP7KnL9/WrBAIhANAssLlY1gvBLJ61ULFbdrVTMi1dqMXPBec8 -LfKdwER4AHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFb+Kih -ywAABAMARzBFAiAW4sOV17H0V1n4pwnfeeKflHLmr1t4pB9KBCYGh0NaEgIhAMUI -rLg1SuTCV2pXxRvWkzIAiifaJcPbxPhEp4DGz2d5AHUA7ku9t3XOYLrhQmkfq+Ge -ZqMPfl+wctiDAMR7iXqo/csAAAFb+Kih/AAABAMARjBEAiA1u/TczjmZ5EDB4Jue -TYEUyFHFDj3ytCItXk6vzcVPYgIgT6Yc1ugrgocOLqpDsRoQ7Jll/5PIi7QFg5N8 -//OhX+kwCgYIKoZIzj0EAwIDRwAwRAIgCK09KwyaiPsZZMtkjCec9zeVx7YRk8oh -PvV2UnQf6sQCIAfYgjH7ZQeIKCMi4ctdTja1ng/lU8ibnkpU5NDZGaTN ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDgDCCAwagAwIBAgIQH/L8vGMmqr0oZpOZH0PsITAKBggqhkjOPQQDAzCBhDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp -IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi -BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0xNjAxMDcwMDAw -MDBaFw0yNjAxMDYyMzU5NTlaMEMxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3 -dGUsIEluYy4xHTAbBgNVBAMTFHRoYXd0ZSBFQ0MgRVYgU1NMIENBMFkwEwYHKoZI -zj0CAQYIKoZIzj0DAQcDQgAEmcXM1zsNS0E2+7pcpYHdwqumr+KIIt3jEJA6jBBm -1SoBGgZESt6OKROJBt2sZJhUl4oU0q5kINTS/bG+eYTTlqOCAZgwggGUMA4GA1Ud -DwEB/wQEAwIBBjAuBggrBgEFBQcBAQQiMCAwHgYIKwYBBQUHMAGGEmh0dHA6Ly90 -LnN5bWNkLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMHwGA1UdIAR1MHMwBwYFZ4EM -AQEwaAYLYIZIAYb4RQEHMAEwWTAmBggrBgEFBQcCARYaaHR0cHM6Ly93d3cudGhh -d3RlLmNvbS9jcHMwLwYIKwYBBQUHAgIwIxohaHR0cHM6Ly93d3cudGhhd3RlLmNv -bS9yZXBvc2l0b3J5MDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly90LnN5bWNiLmNv -bS9UaGF3dGVQQ0EtRzIuY3JsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD -AjArBgNVHREEJDAipCAwHjEcMBoGA1UEAxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMTAd -BgNVHQ4EFgQUWzOvNaAaGTdCDVfmvL1rYyDClgEwHwYDVR0jBBgwFoAUmtgAMADn -a3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaAAwZQIwMMf+C0NMBVt58Of4YvVO -mVS0OYfzEiB4AOz8QF9pmEyaCAelGeOmq2pOLDEsQbKzAjEA2WTDVMhnnJI3NSnD -itmCtBQnW6NEAohvLUsB4iVehDAJK3mNY8FbYafl4LjFzA4V ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIG2TCCBcGgAwIBAgIQdS+C2M35zv3l1EWcCL2MfTANBgkqhkiG9w0BAQsFADBX -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMTEwLwYDVQQDEyh0 -aGF3dGUgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTSEEyNTYgU1NMIENBMB4XDTE3MDUw -ODAwMDAwMFoXDTE5MDUwODIzNTk1OVowgewxEzARBgsrBgEEAYI3PAIBAxMCVVMx -GTAXBgsrBgEEAYI3PAIBAgwIRGVsYXdhcmUxFTATBgNVBAoMDFRoYXd0ZSwgSW5j -LjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1v -dW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRAwDgYD -VQQFEwczODk4MjYxMRcwFQYDVQQLDA5Sb290IDkgLSBWQUxJRDEfMB0GA1UEAwwW -dmFsaWQtcm9vdDkudGhhd3RlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAMGMwXWgvpsjK9b7JwFIs8Ch6EORhDfWRMk16KGdnO0jeIh1D4NRi1GL -g0WcHiW06dFOF9UaT/Lg66mJLjHguftTHSoi9/cuMHcy0gbbWR+j+6RMxr7RwI6S -eC8VesPWxM+5xW6bI+QBWq678ZK8JYr/cALXX+8ekDhY8vswIdzkUp7qHekkoja6 -4ki2JyJO4Q/uf/gWfohsGc88fEiMAQi3qhyZlHm7QzjeUoB0WgPC+CVB+vxSmZip -6rkfjgPeKPlM1tqIAPjQWnQbdi2AvYCOUT0ZvVPPmsbINp7IMdAZmv9yF5qoW36A -oFtBL3wLNe7w+lm5ZnZ15DHB2b2gDAECAwEAAaOCAwkwggMFMCEGA1UdEQQaMBiC -FnZhbGlkLXJvb3Q5LnRoYXd0ZS5jb20wCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMC -BaAwKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3RmLnN5bWNiLmNvbS90Zi5jcmww -fAYDVR0gBHUwczBoBgtghkgBhvhFAQcwATBZMCYGCCsGAQUFBwIBFhpodHRwczov -L3d3dy50aGF3dGUuY29tL2NwczAvBggrBgEFBQcCAjAjDCFodHRwczovL3d3dy50 -aGF3dGUuY29tL3JlcG9zaXRvcnkwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUH -AwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFDskyDGgt1rQarjSygd0zB4k1MTcMFcG -CCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3RmLnN5bWNkLmNvbTAm -BggrBgEFBQcwAoYaaHR0cDovL3RmLnN5bWNiLmNvbS90Zi5jcnQwggF/BgorBgEE -AdZ5AgQCBIIBbwSCAWsBaQB2AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM22 -7L7MAAABW+pl8UMAAAQDAEcwRQIhAMdGpN45mO8sPe9cyqC2vxeA7kwbpPL4Ie1Z -qP8A8YSmAiB+O2TOyUyg9TE31kCYyimqMS5tycpG8qTusAi6VClvAAB2AKS5CZC0 -GFgUh7sTosxncAo8NZgE+RvfuON3zQ7IDdwQAAABW+pl8i4AAAQDAEcwRQIhALoI -UwV2CIRu4MVgjNYTnVdKI6ZeklPdb9IQzEYBLI5OAiAgR+WX0RgWiOmn0Khon7ck -QEQ0H+j9VSFAuTqxFNWzXwB3AO5Lvbd1zmC64UJpH6vhnmajD35fsHLYgwDEe4l6 -qP3LAAABW+pl8ZMAAAQDAEgwRgIhAO/SefmFUyrtfsa1WjfN3WRG2pVSRCqaSxc7 -8pbqk7ynAiEA12r243Cr4IWKQdp6IoTqeULQZfZEGGnIUQxVG9yRzdcwDQYJKoZI -hvcNAQELBQADggEBALcczMzw4qLLwR1hbM2qnzs+Ng4ByHPaDcwIZzGlxLCTOjZc -AaVc8TA/MRUQBFxWto2fLmVIoFNS9EceKOx9VWcNK+9gYKkLl0K4amLTWWW+uShT -DooJSdkP2fX2QB1jNsD1jH+44aG6Ll94HEgz88ziVeUH5T0yM3Fou1axDVI1ADKE -Z0UsdhlTIDKcTndv3Wk6HZz2wxtvt3Z3Eenr/6TQuipGCBpfRccVRVhrpIsylVtp -9UkD0UpX0VRgyrQOIXmtbL0WmPodfxB8crczcd6C0Yy2A77torg72fAyUtKmaBBZ -ajj05MMBn8QmmnAZ0pXxvFTnD8MhOZ0nBccJnQM= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE0DCCA7igAwIBAgIQCkieiFN+iqZFTW4sSyrrIDANBgkqhkiG9w0BAQsFADCB -rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV -BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0xMzA0MDkwMDAwMDBa -Fw0yMzA0MDgyMzU5NTlaMFcxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3dGUs -IEluYy4xMTAvBgNVBAMTKHRoYXd0ZSBFeHRlbmRlZCBWYWxpZGF0aW9uIFNIQTI1 -NiBTU0wgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDyxLx06CX2 -AGIo40zouN8Tn4sHN+9iSvFXCfaC6HXwCqknz5M77DaJpW4d1lTzuASXcrRpJczR -Qg5b1Rx/omBusVIa25MvuwsNZFMWyxwJJJUpIrSKGACJ/vcfcsjoXC8aG6IYuO8Y -XMu12zpO2w+u38R54x6qXKOk5axhmzeFj0h1G7nVaJbpJ3lwVyMau2yTkMdF1xfS -Nyp2s82CqU/AA3vhPXp+W7iF8vUV+3CpvfVQZRad47ZrYW6hep7oDRz3Ko5pfkMw -jnjO7mUeO5uHHkkc+DJGXShGeSpOJ10XWKg3/qgTqWkV3zYiiXW6ygFALu2d1wyq -Mc4nrlfV0lH7AgMBAAGjggE+MIIBOjASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1Ud -DwEB/wQEAwIBBjAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9v -Y3NwLnRoYXd0ZS5jb20wOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEW -Gmh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vY3BzMDcGA1UdHwQwMC4wLKAqoCiGJmh0 -dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQQ0EtRzMuY3JsMCoGA1UdEQQjMCGk -HzAdMRswGQYDVQQDExJWZXJpU2lnbk1QS0ktMi0zNzQwHQYDVR0OBBYEFDskyDGg -t1rQarjSygd0zB4k1MTcMB8GA1UdIwQYMBaAFK1sqpRgnO3k//o+CnQrYwP3tlm/ -MA0GCSqGSIb3DQEBCwUAA4IBAQBomCaq1DPJunVw1J9JrdbBVNzuqlYfeKfwoaTu -C/kSr9+muO7DyzUTalkq+MnpTC+8sbwrwgIw4cO+wvCBjJl3iVgAo8x/owJMU7Ju -Nk/+34d2sz/sWmJQtgBFWPKHrHfm0CBQY8XksnAVGJAFe3uvK0a+a04fU/yEJ66D -0o1HU6cOH2O1utsW2GoJJVV9jz1KwYP5s7mnBFrI8xEEkVMw2VKHyzkAnOxTwwIJ -fqc2jnIhLyO7TMZHpaHuZ8QvXDpHOGHiwx43kp7IL2v679LDzSmNmPhSF+21Uzzf -r8kbYq3fAu5dNPZBS8vDVa+xy9qcc9UCqC2nrPzh5QfQUeg1 ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIHIDCCBgigAwIBAgIQS0wGL8U0T0yVa8wAE4DBqjANBgkqhkiG9w0BAQsFADB+ -MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd -BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVj -IENsYXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MB4XDTE3MDUwMTAwMDAwMFoX -DTIwMDQzMDIzNTk1OVowgaExCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y -bmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQKDBRTeW1hbnRlYyBD -b3Jwb3JhdGlvbjEXMBUGA1UECwwOUm9vdCA0IC0gVkFMSUQxLTArBgNVBAMMJHZh -bGlkLXJvb3Q0LndlYnNlY3VyaXR5LnN5bWFudGVjLmNvbTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBALll3Mb7Fu0CAWPMWpSbr6RHdAl10hwmMaDr8ENk -hAv3offJxsUmgS+vqCC+xQNiS5ClDeOLyf5QeltArLuaYNjUaXEy00EEuXFQO5kj -HjTdsWeEkOxzmt2thAJx8eMbskvvtqnHHali2LFIOuMXuyS9mpkk7cG1yk85LvgZ -Ov1xrpBCuB+ppir0MhhXRLmcZ9QMgVUzfjrmQoQWHE0Qu69Mci6mk7fuBboqaPe0 -v0s2KsA1tLSknn39HrXE3d5D1AOoLJP1RiHU+RFQIOJ0oiXPZSH0bdiWhO0xcyuo -vXY+0vaQPO1Uwrj/VdpL7bs65dgdFqXpTdqvMURu5WoDumUCAwEAAaOCA3QwggNw -MC8GA1UdEQQoMCaCJHZhbGlkLXJvb3Q0LndlYnNlY3VyaXR5LnN5bWFudGVjLmNv -bTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcD -AQYIKwYBBQUHAwIwYQYDVR0gBFowWDBWBgZngQwBAgIwTDAjBggrBgEFBQcCARYX -aHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGQwXaHR0cHM6Ly9k -LnN5bWNiLmNvbS9ycGEwHwYDVR0jBBgwFoAUX2DPYZBV34RDFIpgKrL1evRDGO8w -KwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3NzLnN5bWNiLmNvbS9zcy5jcmwwVwYI -KwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8vc3Muc3ltY2QuY29tMCYG -CCsGAQUFBzAChhpodHRwOi8vc3Muc3ltY2IuY29tL3NzLmNydDCCAfcGCisGAQQB -1nkCBAIEggHnBIIB4wHhAHYA3esdK3oNT6Ygi4GtgWhwfi6OnQHVXIiNPRHEzbbs -vswAAAFbxYEdRwAABAMARzBFAiEAurXvGE124ya7O5ZjYZckdJ7OU64A4fEAszhI -UG3OqMACIGbAqoQLGMr9sMYBqS3cPxtD6EIK8BXzBaYHOe3pGhcXAHYApLkJkLQY -WBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFbxYEdagAABAMARzBFAiBY4mXZ -w8zBWrVURFxwmQGf046/oaidgJQ3Wf9+AlJ+7AIhANWkGBd6nlwE8V/dzQvkjnTz -2edJKGy2NqgyxinZMAbWAHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo -/csAAAFbxYEfSwAABAMASDBGAiEAltQbZJ9+Gt1M+YV4YBJVR63aPhk1dFIyKdQL -yjYdBh0CIQDUGxHmR2KVW8N6wHnAGFlUhcwlBJFoiTqaSRP/1Yk0wAB2ALx44d/F -9jxoRkkzTaEPoV8JeWkgCcCBtPP2kX8+2bilAAABW8WBHkcAAAQDAEcwRQIgFqqM -DTAo3RKfwU9gwkD53Zr1HXPJuoI/MhwHQgc8nvkCIQDbwhd3gOdRJhtMyGqxGqr7 -sbD43D/fkyH3BNWOhff04TANBgkqhkiG9w0BAQsFAAOCAQEAQkWtNshWRmFY1t1Y -pH3Ztxd891f4VYLtBzrpapejHIe5ijlZES2d+x4+aCilVUo6sDs0RUgy5Jk9eU5I -6vOh+NkZ1THFqod+w5FKPgDaDuHHryvRaiGdcpn9x5R7zkpgKQ1WqgvcbzAmZkAr -YxpvXfTLhcgbQhPedxbS5YyU1y1QCi8MUrxTwejcFDhAQXGOW3cTMpGsXtRvQVE0 -iI93jCPb3Djpqus9SS7ggzkfJe3bQpl72bv2agn5peBJa0sC1PqRXIT/cWUQe9ez -rKSDoqdPNjTmIcJjql50T+WceNF5nxNPCq+jhMOcmKXJUF3H6yYc8pjLuDDBAFFz -uxAuxw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFFTCCA/2gAwIBAgIQKC4nkXkzkuQo8iGnTsk3rjANBgkqhkiG9w0BAQsFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMTk5OSBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzMwHhcNMTMxMDMxMDAwMDAwWhcNMjMxMDMwMjM1OTU5WjB+MQsw -CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV -BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVjIENs -YXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAstgFyhx0LbUXVjnFSlIJluhL2AzxaJ+aQihiw6UwU35VEYJb -A3oNL+F5BMm0lncZgQGUWfm893qZJ4Itt4PdWid/sgN6nFMl6UgfRk/InSn4vnlW -9vf92Tpo2otLgjNBEsPIPMzWlnqEIRoiBAMnF4scaGGTDw5RgDMdtLXO637QYqzu -s3sBdO9pNevK1T2p7peYyo2qRA4lmUoVlqTObQJUHypqJuIGOmNIrLRM0XWTUP8T -L9ba4cYY9Z/JJV3zADreJk20KQnNDz0jbxZKgRb78oMQw7jW2FUyPfG9D72MUpVK -Fpd6UiFjdS8W+cRmvvW1Cdj/JwDNRHxvSz+w9wIDAQABo4IBQDCCATwwHQYDVR0O -BBYEFF9gz2GQVd+EQxSKYCqy9Xr0QxjvMBIGA1UdEwEB/wQIMAYBAf8CAQAwawYD -VR0gBGQwYjBgBgpghkgBhvhFAQc2MFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cu -c3ltYXV0aC5jb20vY3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0 -aC5jb20vcnBhMC8GA1UdHwQoMCYwJKAioCCGHmh0dHA6Ly9zLnN5bWNiLmNvbS9w -Y2EzLWczLmNybDAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwxGjAYBgNV -BAMTEVN5bWFudGVjUEtJLTEtNTM0MC4GCCsGAQUFBwEBBCIwIDAeBggrBgEFBQcw -AYYSaHR0cDovL3Muc3ltY2QuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBbF1K+1lZ7 -9Pc0CUuWysf2IdBpgO/nmhnoJOJ/2S9h3RPrWmXk4WqQy04q6YoW51KN9kMbRwUN -gKOomv4p07wdKNWlStRxPA91xQtzPwBIZXkNq2oeJQzAAt5mrL1LBmuaV4oqgX5n -m7pSYHPEFfe7wVDJCKW6V0o6GxBzHOF7tpQDS65RsIJAOloknO4NWF2uuil6yjOe -soHCL47BJ89A8AShP/U3wsr8rFNtqVNpT+F2ZAwlgak3A/I5czTSwXx4GByoaxbn -5+CdKa/Y5Gk5eZVpuXtcXQGc1PfzSEUTZJXXCm5y2kMiJG8+WnDcwJLgLeVX+OQr -J+71/xuzAYN6 ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFxDCCBWmgAwIBAgIQZMjAlhAdRd/Im/aYbmgO8DAKBggqhkjOPQQDAjCBizEL -MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD -VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTwwOgYDVQQDEzNTeW1hbnRlYyBD -bGFzcyAzIEVDQyAyNTYgYml0IEV4dGVuZGVkIFZhbGlkYXRpb24gQ0EwHhcNMTcw -NTAxMDAwMDAwWhcNMTkwNTAxMjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMC -VVMxGTAXBgsrBgEEAYI3PAIBAgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUg -T3JnYW5pemF0aW9uMRAwDgYDVQQFEwcyMTU4MTEzMQswCQYDVQQGEwJVUzEOMAwG -A1UEEQwFOTQwNDMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50 -YWluIFZpZXcxGTAXBgNVBAkMEDM1MCBFbGxpcyBTdHJlZXQxHTAbBgNVBAoMFFN5 -bWFudGVjIENvcnBvcmF0aW9uMRcwFQYDVQQLDA5Sb290IDMgLSBWQUxJRDEtMCsG -A1UEAwwkdmFsaWQtcm9vdDMud2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMFkwEwYH -KoZIzj0CAQYIKoZIzj0DAQcDQgAERAIBieoafYh/yFaVSP+vyzoxzZ/zKy4tx7o0 -R1gugD5SArEcRar0oodVQ99eJkT63Xn910gGKx4cP+CM+jZfJqOCAwgwggMEMC8G -A1UdEQQoMCaCJHZhbGlkLXJvb3QzLndlYnNlY3VyaXR5LnN5bWFudGVjLmNvbTAJ -BgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIHgDAdBgNVHSUEFjAUBggrBgEFBQcDAQYI -KwYBBQUHAwIwbwYDVR0gBGgwZjBbBgtghkgBhvhFAQcXBjBMMCMGCCsGAQUFBwIB -FhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcCAjAZDBdodHRwczov -L2Quc3ltY2IuY29tL3JwYTAHBgVngQwBATAfBgNVHSMEGDAWgBRIE2UXlOyeFioq -dFzoUy20+4PrjjArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vc24uc3ltY2IuY29t -L3NuLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9zbi5z -eW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9zbi5zeW1jYi5jb20vc24uY3J0 -MIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgDd6x0reg1PpiCLga2BaHB+Lo6d -AdVciI09EcTNtuy+zAAAAVvFgWTjAAAEAwBHMEUCIF7mhfWFvkMauS0jlQz7t/fO -nDXX+VeHwI7YIHU3Wvg5AiEA97a9fZzAjALA1VTaXOv/WSDyEzA/X9YPesI4Aq+4 -da8AdQCkuQmQtBhYFIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAVvFgWUIAAAE -AwBGMEQCIAM5H16X3/vPGds9N8b7Q3+H8cFe7woTT9ddKPfUyLZJAiAF8FivrVBd -wJ5rjxxJOwPSrlkRV2vhbKfSbJH0lDq1XQB2AO5Lvbd1zmC64UJpH6vhnmajD35f -sHLYgwDEe4l6qP3LAAABW8WBZRoAAAQDAEcwRQIgRpro/bdvZbK5eW5FTbTqGUTi -W5RSpjcFW2Gd27Ql6bACIQCgow7825ZtJ31KRYJ2fiTlqvc6jyZ+u67hFT4qs/1Q -oDAKBggqhkjOPQQDAgNJADBGAiEAl565i7SXROFdn7y+hM0AgChi/75FGmaokJaj -h9jhmiMCIQCqIZZ4SuOgBbkt7bMOSI1sOtFqhlsGVXwZKjzSaIFSYA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID4zCCA2qgAwIBAgIQTZVdIK+FxJ9pJfurfGZfiTAKBggqhkjOPQQDAzCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzQwHhcNMTIxMjIwMDAwMDAwWhcNMjIxMjE5MjM1OTU5WjCBizELMAkG -A1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQL -ExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTwwOgYDVQQDEzNTeW1hbnRlYyBDbGFz -cyAzIEVDQyAyNTYgYml0IEV4dGVuZGVkIFZhbGlkYXRpb24gQ0EwWTATBgcqhkjO -PQIBBggqhkjOPQMBBwNCAATdBD2y8pCTl8bpu7yR21Hwo4bt+8bThZMyBUngBINh -llH/VyGuC9oO5wShf9sqHL3KmDXFcXNAzehqq1SEQybio4IBbTCCAWkwEgYDVR0T -AQH/BAgwBgEB/wIBADA3BgNVHR8EMDAuMCygKqAohiZodHRwOi8vY3JsLndzLnN5 -bWFudGVjLmNvbS9wY2EzLWc0LmNybDAOBgNVHQ8BAf8EBAMCAQYwNwYIKwYBBQUH -AQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC53cy5zeW1hbnRlYy5jb20w -ZQYDVR0gBF4wXDBaBgRVHSAAMFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuc3lt -YXV0aC5jb20vY3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0aC5j -b20vcnBhMCoGA1UdEQQjMCGkHzAdMRswGQYDVQQDExJTWU1DLUVDQy1DQS1wMjU2 -LTMwHQYDVR0OBBYEFEgTZReU7J4WKip0XOhTLbT7g+uOMB8GA1UdIwQYMBaAFLMW -kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2cAMGQCMFyb7oOjdk2MLQVM -gjS6s77Oj+jDNIH7QHfoNGxbFys7rdWno9LzZsJPsrDIdpiPvwIwT8IvzpLFqb3O -fU7UGztmJOpOzYKvVEqI7+O/OpNjVCF9EjDSMs2ryYGwpxFDe0Vm ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIHOTCCBiGgAwIBAgIQCBmps2cB8a6CGTXUyg9ZzjANBgkqhkiG9w0BAQsFADB3 -MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd -BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj -IENsYXNzIDMgRVYgU1NMIENBIC0gRzMwHhcNMTcwNDI4MDAwMDAwWhcNMTkwNDI4 -MjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMCVVMxGTAXBgsrBgEEAYI3PAIB -AgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRAwDgYD -VQQFEwcyMTU4MTEzMQswCQYDVQQGEwJVUzEOMAwGA1UEEQwFOTQwNDMxEzARBgNV -BAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxGTAXBgNVBAkM -EDM1MCBFbGxpcyBTdHJlZXQxHTAbBgNVBAoMFFN5bWFudGVjIENvcnBvcmF0aW9u -MRcwFQYDVQQLDA5Sb290IDEgLSBWQUxJRDEtMCsGA1UEAwwkdmFsaWQtcm9vdDEu -d2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEApbJSThUcOfpFWl6PyOeFqED399DWeBcBoAMdXkPfatQ+uJPeRryZ -4UfC1iuQWQM6agDrMhDmnc+IiBiltbF0PVEHkQXxfR6x6TFF1doWDxVfOgl2y9Pz -ilRgdBdGmnQsWbYqaKlCBS3aZ2jCZMUAKmQce8WNLEf8qDjQcHRT1vI2k5AW3+L0 -FccXRSFXx2wZUAh9qxa2gKxEjnUF+qy42WEgh/mXD4smbhtEf+pCUXPYuODlxOaA -ZCy9SeBrKb5Nl3C9UzBhchONPQLUgzlk8d0M17pFLYKLfa8MvBcKRVyTk7/XXdTj -OmW5OO7f4epmXNlN5fHnGZlA5FE/4candwIDAQABo4IDBzCCAwMwLwYDVR0RBCgw -JoIkdmFsaWQtcm9vdDEud2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMAkGA1UdEwQC -MAAwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD -AjBvBgNVHSAEaDBmMFsGC2CGSAGG+EUBBxcGMEwwIwYIKwYBBQUHAgEWF2h0dHBz -Oi8vZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkMF2h0dHBzOi8vZC5zeW1j -Yi5jb20vcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFAFZq+fdOgtZpmRj1s8gB1fV -kedqMCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9zci5zeW1jYi5jb20vc3IuY3Js -MFcGCCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3NyLnN5bWNkLmNv -bTAmBggrBgEFBQcwAoYaaHR0cDovL3NyLnN5bWNiLmNvbS9zci5jcnQwggF8Bgor -BgEEAdZ5AgQCBIIBbASCAWgBZgB2AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0R -xM227L7MAAABW7a3ZxAAAAQDAEcwRQIgeoFObGH+PGc5LRj+f1yzoG3TGHrPQA/z -nRsNG1MXNXACIQCVd5wZWbP1+hp4kaE1sYgUnSiRFN3kfMf5uUQysYvkSwB1AKS5 -CZC0GFgUh7sTosxncAo8NZgE+RvfuON3zQ7IDdwQAAABW7a3Z1AAAAQDAEYwRAIg -MRBDGE2dq1xzPDJ9tKzDTwKP5rC4DrjHZbmtYiZZh3sCIDCMlTV8bpEeeq2evzna -Xq/930hOaclzf4pXEwUHmW/HAHUA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7 -iXqo/csAAAFbtrdpDwAABAMARjBEAiBQpNfvWoFAkIraeupW8zM804c8XvlLIbX4 -6kCYS04HbQIgOmEunrjYREwtG5Rdk1Vd01Fp7lR42AgJ/LQFn7DmXigwDQYJKoZI -hvcNAQELBQADggEBAKlkTQil8u0sfwLdpfFmtUvFexhx4C8gTsZwZeN/40n+S4xR -b6U3rEHIKlFAelipc5EzeYIsJKHGP5qHSs7m7jPKBrf0KsoryvZrSfhMfXDHvrJF -RpF0Rs1VODoK2l/1CosUZ9rTqEjQcv7kUvFvgZpNIoV++k/Y2TsoBsLliRdXKpL8 -SQADr18BlEt1Y8A7E77lJFMmgD4bFN1jJWkEJoAGkrYqsF6i8fAHiESjSLy85Bcs -DGXgP4z8Nifje78wGVygI/4NYgYiFClsk8epBHXOveEV5HRO42XzPG0Zn0BMWCSI -0P08Lq3dwSQSQarkID6iRuhgt4GZvm3zh6MdfrA= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFKzCCBBOgAwIBAgIQfuFKb2/v8tN/P61lTTratDANBgkqhkiG9w0BAQsFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMTMxMDMxMDAwMDAwWhcNMjMxMDMwMjM1OTU5WjB3MQsw -CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV -BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVjIENs -YXNzIDMgRVYgU1NMIENBIC0gRzMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQDYoWV0I+grZOIy1zM3PY71NBZI3U9/hxz4RCMTjvsR2ERaGHGOYBYmkpv9 -FwvhcXBC/r/6HMCqo6e1cej/GIP23xAKE2LIPZyn3i4/DNkd5y77Ks7Imn+Hv9hM -BBUyydHMlXGgTihPhNk1++OGb5RT5nKKY2cuvmn2926OnGAE6yn6xEdC0niY4+wL -pZLct5q9gGQrOHw4CVtm9i2VeoayNC6FnpAOX7ddpFFyRnATv2fytqdNFB5suVPu -IxpOjUhVQ0GxiXVqQCjFfd3SbtICGS97JJRL6/EaqZvjI5rq+jOrCiy39GAI3Z8c -zd0tAWaAr7MvKR0juIrhoXAHDDQPAgMBAAGjggFdMIIBWTAvBggrBgEFBQcBAQQj -MCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9zMi5zeW1jYi5jb20wEgYDVR0TAQH/BAgw -BgEB/wIBADBlBgNVHSAEXjBcMFoGBFUdIAAwUjAmBggrBgEFBQcCARYaaHR0cDov -L3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIwHBoaaHR0cDovL3d3dy5z -eW1hdXRoLmNvbS9ycGEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3MxLnN5bWNi -LmNvbS9wY2EzLWc1LmNybDAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwx -GjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTMzMB0GA1UdDgQWBBQBWavn3ToLWaZk -Y9bPIAdX1ZHnajAfBgNVHSMEGDAWgBR/02Wnwt3su/AwCfNDOfoCrzMxMzANBgkq -hkiG9w0BAQsFAAOCAQEAQgFVe9AWGl1Y6LubqE3X89frE5SG1n8hC0e8V5uSXU8F -nzikEHzPg74GQ0aNCLxq1xCm+quvL2GoY/Jl339MiBKIT7Np2f8nwAqXkY9W+4nE -qLuSLRtzsMarNvSWbCAI7woeZiRFT2cAQMgHVHQzO6atuyOfZu2iRHA0+w7qAf3P -eHTfp61Vt19N9tY/4IbOJMdCqRMURDVLtt/JYKwMf9mTIUvunORJApjTYHtcvNUw -LwfORELEC5n+5p/8sHiGUW3RLJ3GlvuFgrsEL/digO9i2n/2DqyQuFa9eT/ygG6j -2bkPXToHHZGThkspTOHcteHgM52zyzaRS/6htO7w+Q== ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -Signer #1: - -Signature: - -Certificate owner: CN="Oracle America, Inc.", OU=Software Engineering, O="Oracle America, Inc.", L=Redwood City, ST=California, C=US - ------BEGIN CERTIFICATE----- -MIIE4DCCA8igAwIBAgIQMJBKmqOhTgIuAsUw5l33hTANBgkqhkiG9w0BAQsFADB/ -MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd -BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxMDAuBgNVBAMTJ1N5bWFudGVj -IENsYXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQTAeFw0xNzEyMjEwMDAwMDBa -Fw0yMDAyMDEyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZv -cm5pYTEVMBMGA1UEBwwMUmVkd29vZCBDaXR5MR0wGwYDVQQKDBRPcmFjbGUgQW1l -cmljYSwgSW5jLjEdMBsGA1UECwwUU29mdHdhcmUgRW5naW5lZXJpbmcxHTAbBgNV -BAMMFE9yYWNsZSBBbWVyaWNhLCBJbmMuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxrxa5UAMwofgt7m++glHqMSYP3nlTDxRnWu14FtVtQiaacn20u3w -T5d+5mkoezHXNU3g1sgwkr/Ovf4YVSwz9wtqZWTbK3/r6Ctb9eRxb2th64N4AuDI -R9C/LU2J7ruXsu7FpEhXMIdNLxR4ihfkBA5ndpNqmXmIG9HvFQkd8APsSFRpMQh7 -Com1YlbkySgMyjBwYfAw74bqNrClBmLNAVfq7JSqjJ8EJtlq6lEJWHXEYysZfRIf -StxZ0XtKD3wtADeowBHs1DRnXrkgD/q3kWX5LF75nfHtRWEtHxWKk7/R452pweIv -ZZYXsvSrRA3vC+jbbhtZiRYRk2QCXsUxrQIDAQABo4IBPjCCATowCQYDVR0TBAIw -ADAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwYQYDVR0gBFow -WDBWBgZngQwBBAEwTDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9j -cHMwJQYIKwYBBQUHAgIwGQwXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwHwYDVR0j -BBgwFoAUljtT8Hkzl699g+8uK8zKt4YecmYwKwYDVR0fBCQwIjAgoB6gHIYaaHR0 -cDovL3N2LnN5bWNiLmNvbS9zdi5jcmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUF -BzABhhNodHRwOi8vc3Yuc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8vc3Yu -c3ltY2IuY29tL3N2LmNydDANBgkqhkiG9w0BAQsFAAOCAQEAQcZqmjMAuBgnaQZ5 -JsP3+Rzaa5FrukVVk2brqrJFnqt/79khvfCf95pBafHHCqdndB0T4xuzBL4fk2ZW -Z48ACgq3U6oNP9Ci4pcDuTqU/vZHwh7ICkSWLhGzpErfwby7zZV9ZeIK0AB5vJCK -qgL4DetXgqGOm29gAjTKcXa67jP9lX6tAdh9TcQDbBbGny3NHGAiCderJxTOYhid -9+4v+p+lt2OPxlxmZMPnT/9U2Yp3OzH//OYgQysnwy/UkSVCa2DuMPbL4LTxwV65 -nwEU3jT0Iq7io+oEcjW5FTZDgVC2A7lDVVrNlbAW/f5QoKcmyw8hDLo7TH6tDv8n -hhKFDg== ------END CERTIFICATE----- - -Certificate owner: CN=Symantec Class 3 SHA256 Code Signing CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US - ------BEGIN CERTIFICATE----- -MIIFWTCCBEGgAwIBAgIQPXjX+XZJYLJhffTwHsqGKjANBgkqhkiG9w0BAQsFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMTMxMjEwMDAwMDAwWhcNMjMxMjA5MjM1OTU5WjB/MQsw -CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV -BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxMDAuBgNVBAMTJ1N5bWFudGVjIENs -YXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAJeDHgAWryyx0gjE12iTUWAecfbiR7TbWE0jYmq0v1obUfej -DRh3aLvYNqsvIVDanvPnXydOC8KXyAlwk6naXA1OpA2RoLTsFM6RclQuzqPbROlS -Gz9BPMpK5KrA6DmrU8wh0MzPf5vmwsxYaoIV7j02zxzFlwckjvF7vjEtPW7ctZlC -n0thlV8ccO4XfduL5WGJeMdoG68ReBqYrsRVR1PZszLWoQ5GQMWXkorRU6eZW4U1 -V9Pqk2JhIArHMHckEU1ig7a6e2iCMe5lyt/51Y2yNdyMK29qclxghJzyDJRewFZS -AEjM0/ilfd4v1xPkOKiE1Ua4E4bCG53qWjjdm9sCAwEAAaOCAYMwggF/MC8GCCsG -AQUFBwEBBCMwITAfBggrBgEFBQcwAYYTaHR0cDovL3MyLnN5bWNiLmNvbTASBgNV -HRMBAf8ECDAGAQH/AgEAMGwGA1UdIARlMGMwYQYLYIZIAYb4RQEHFwMwUjAmBggr -BgEFBQcCARYaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIw -HBoaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9ycGEwMAYDVR0fBCkwJzAloCOgIYYf -aHR0cDovL3MxLnN5bWNiLmNvbS9wY2EzLWc1LmNybDAdBgNVHSUEFjAUBggrBgEF -BQcDAgYIKwYBBQUHAwMwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRow -GAYDVQQDExFTeW1hbnRlY1BLSS0xLTU2NzAdBgNVHQ4EFgQUljtT8Hkzl699g+8u -K8zKt4YecmYwHwYDVR0jBBgwFoAUf9Nlp8Ld7LvwMAnzQzn6Aq8zMTMwDQYJKoZI -hvcNAQELBQADggEBABOFGh5pqTf3oL2kr34dYVP+nYxeDKZ1HngXI9397BoDVTn7 -cZXHZVqnjjDSRFph23Bv2iEFwi5zuknx0ZP+XcnNXgPgiZ4/dB7X9ziLqdbPuzUv -M1ioklbRyE07guZ5hBb8KLCxR/Mdoj7uh9mmf6RWpT+thC4p3ny8qKqjPQQB6rqT -og5QIikXTIfkOhFf1qQliZsFay+0yQFMJ3sLrBkFIqBgFT/ayftNTI/7cmd3/SeU -x7o1DohJ/o39KK9KEr0Ns5cF3kQMFfo2KwPcwVAB8aERXRTl4r0nS1S+K4ReD6bD -dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE= ------END CERTIFICATE----- - -Certificate owner: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US - ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 -nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex -t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz -SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG -BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ -rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ -NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E -BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH -BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv -MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE -p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y -5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK -WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ -4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N -hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -Timestamp: - -Certificate owner: CN=Symantec SHA256 TimeStamping Signer - G2, OU=Symantec Trust Network, O=Symantec Corporation, C=US - ------BEGIN CERTIFICATE----- -MIIFSzCCBDOgAwIBAgIQVFjyqtdB1kS8hKl7oJZS5jANBgkqhkiG9w0BAQsFADB3 -MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd -BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj -IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMTcwMTAyMDAwMDAwWhcNMjgwNDAx -MjM1OTU5WjCBgDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBv -cmF0aW9uMR8wHQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTEwLwYDVQQD -EyhTeW1hbnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIFNpZ25lciAtIEcyMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmfP82AQJA4b511ymk8BCfOp8Y89d -AOKO88CQ348p9RjqlLeS5dewoHOB6OkKm0p8Af+dj6Q5pw7qRfQiDDpw7TlFi+TF -G1zwRWhGJAVjdpsc/J5sKrFW5Yp/UnGu8jXVRiMGHM9ILR20zbjZdiOOHP8+v7sG -XGkHpmUO+F6ufS7tTa4178nXAEL9KJUOn11yQgm8w9pE0u3MR4Tk/MotrFi+rveu -2UQNCLfCd9YaQ3DRbgPeUpLEEAhx2boiVfIfvO2bnTviXh1Mg/+XD3sL51WDTtIN -677X7K5uR7mf36XWUbwEVe3/J3BMye0qSxPhsblMD8kB7lVlX2kCeGbLPwIDAQAB -o4IBxzCCAcMwDAYDVR0TAQH/BAIwADBmBgNVHSAEXzBdMFsGC2CGSAGG+EUBBxcD -MEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8vZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUF -BwICMBkaF2h0dHBzOi8vZC5zeW1jYi5jb20vcnBhMEAGA1UdHwQ5MDcwNaAzoDGG -L2h0dHA6Ly90cy1jcmwud3Muc3ltYW50ZWMuY29tL3NoYTI1Ni10c3MtY2EuY3Js -MBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMIMA4GA1UdDwEB/wQEAwIHgDB3BggrBgEF -BQcBAQRrMGkwKgYIKwYBBQUHMAGGHmh0dHA6Ly90cy1vY3NwLndzLnN5bWFudGVj -LmNvbTA7BggrBgEFBQcwAoYvaHR0cDovL3RzLWFpYS53cy5zeW1hbnRlYy5jb20v -c2hhMjU2LXRzcy1jYS5jZXIwKAYDVR0RBCEwH6QdMBsxGTAXBgNVBAMTEFRpbWVT -dGFtcC0yMDQ4LTUwHQYDVR0OBBYEFAm1wf6WcpcpQ5rJ4AK6rvj9L7r2MB8GA1Ud -IwQYMBaAFK9j1sqjToVy4Ke8QfMpojh/gHViMA0GCSqGSIb3DQEBCwUAA4IBAQAX -swqI6VxaXiBrOwoVsmzFqYoyh9Ox9BxTroW+P5v/17y3lIW0x1J+lOi97WGy1KeZ -5MPJk8E1PQvoaApdVpi9sSI70UR617/wbVEyitUj3zgBN/biUyt6KxGPt01sejMD -G3xrCZQXu+TbWNQhE2Xn7NElyix1mpx//Mm7KmirxH20z6PJbKfZxACciQp3kfRN -ovsxO4Zu9uYfUAOGm7/LQqvmdptyWhEBisbvpW+V592uuuYiZfAYWRsRyc2At9iX -Rx9CCPiscR+wRlOz1LLVo6tQdUgSF4Ktz+BBTzJ+zZUcv5GKCD2kp2cClt8kTKXQ -QcCCYKOKFzJL07zPpLSM ------END CERTIFICATE----- - -Certificate owner: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US - ------BEGIN CERTIFICATE----- -MIIFODCCBCCgAwIBAgIQewWx1EloUUT3yYnSnBmdEjANBgkqhkiG9w0BAQsFADCB -vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W -ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0xNjAxMTIwMDAwMDBaFw0zMTAxMTEyMzU5NTlaMHcxCzAJBgNVBAYTAlVTMR0w -GwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMg -VHJ1c3QgTmV0d29yazEoMCYGA1UEAxMfU3ltYW50ZWMgU0hBMjU2IFRpbWVTdGFt -cGluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtZnVlVT52M -cl0agaLrVfOwAa08cawyjwVrhponADKXak3JZBRLKbvC2Sm5Luxjs+HPPwtWkPhi -G37rpgfi3n9ebUA41JEG50F8eRzLy60bv9iVkfPw7mz4rZY5Ln/BJ7h4OcWEpe3t -r4eOzo3HberSmLU6Hx45ncP0mqj0hOHE0XxxxgYptD/kgw0mw3sIPk35CrczSf/K -O9T1sptL4YiZGvXA6TMU1t/HgNuR7v68kldyd/TNqMz+CfWTN76ViGrF3PSxS9TO -6AmRX7WEeTWKeKwZMo8jwTJBG1kOqT6xzPnWK++32OTVHW0ROpL2k8mc40juu1MO -1DaXhnjFoTcCAwEAAaOCAXcwggFzMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8E -CDAGAQH/AgEAMGYGA1UdIARfMF0wWwYLYIZIAYb4RQEHFwMwTDAjBggrBgEFBQcC -ARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoXaHR0cHM6 -Ly9kLnN5bWNiLmNvbS9ycGEwLgYIKwYBBQUHAQEEIjAgMB4GCCsGAQUFBzABhhJo -dHRwOi8vcy5zeW1jZC5jb20wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3Muc3lt -Y2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUEDDAKBggrBgEFBQcDCDAo -BgNVHREEITAfpB0wGzEZMBcGA1UEAxMQVGltZVN0YW1wLTIwNDgtMzAdBgNVHQ4E -FgQUr2PWyqNOhXLgp7xB8ymiOH+AdWIwHwYDVR0jBBgwFoAUtnf6aUhHn1MS1cLq -BzJ2B9GXBxkwDQYJKoZIhvcNAQELBQADggEBAHXqsC3VNBlcMkX+DuHUT6Z4wW/X -6t3cT/OhyIGI96ePFeZAKa3mXfSi2VZkhHEwKt0eYRdmIFYGmBmNXXHy+Je8Cf0c -kUfJ4uiNA/vMkC/WCmxOM+zWtJPITJBjSDlAIcTd1m6JmDy1mJfoqQa3CcmPU1dB -kC/hHk1O3MoQeGxCbvC2xfhhXFL1TvZrjfdKer7zzf0D19n2A6gP41P3CnXsxnUu -qmaFBJm3+AZX4cYO9uiv2uybGB+queM6AL/OipTLAduexzi7D1Kr0eOUA2AKTaD+ -J20UMvw/l0Dhv5mJ2+Q5FL3a5NPD6itas5VYVQR9x5rsIwONhSrS/66pYYE= ------END CERTIFICATE----- - diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIHTzCCBjegAwIBAgIQPYH1xfKSpwYMrTEqOxG4OzANBgkqhkiG9w0BAQsFADCB -ijELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8w -HQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTswOQYDVQQDEzJTeW1hbnRl -YyBDbGFzcyAzIEV4dGVuZGVkIFZhbGlkYXRpb24gU0hBMjU2IFNTTCBDQTAeFw0x -NzA1MDEwMDAwMDBaFw0xOTA1MDEyMzU5NTlaMIIBLTETMBEGCysGAQQBgjc8AgED -EwJVUzEZMBcGCysGAQQBgjc8AgECDAhEZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0 -ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzIxNTgxMTMxCzAJBgNVBAYTAlVTMQ4w -DAYDVQQRDAU5NDA0MzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 -bnRhaW4gVmlldzEZMBcGA1UECQwQMzUwIEVsbGlzIFN0cmVldDEdMBsGA1UECgwU -U3ltYW50ZWMgQ29ycG9yYXRpb24xFzAVBgNVBAsMDlJvb3QgMiAtIFZBTElEMS0w -KwYDVQQDDCR2YWxpZC1yb290Mi53ZWJzZWN1cml0eS5zeW1hbnRlYy5jb20wggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDjQDZuIKKgrjmO0+0ty8WIlFZk -HcvIGX/kIAxByd/XA19h0Zk6kjFLgZaRtsUdRotG40DST72Ki8Vmy7nX3w/cqpFg -0x0nl7ZORE/L1EjEOUApqEpaA5GtcMaznu/SVVp2mZgoOWhn4EAvocT6GKQWaKi1 -/tCh6UiieHRz6L29CrN6/JWT6OXv6TGePkGcVKSjJrZoNMiNzoTFyCdvVpYutZiv -YsMzcRJ+KxTepwFM1imssBGc5WM2Wit+Z3kWJhYe0IdOIdqmuR6WxwLGb7nrY44R -dPy+h0n71GJvjbEzI+Qb/ehc8HjOGba0sh/+x/p14t7PplDZyicxzaC/tpTnAgMB -AAGjggMJMIIDBTAvBgNVHREEKDAmgiR2YWxpZC1yb290Mi53ZWJzZWN1cml0eS5z -eW1hbnRlYy5jb20wCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw -FAYIKwYBBQUHAwEGCCsGAQUFBwMCMG8GA1UdIARoMGYwWwYLYIZIAYb4RQEHFwYw -TDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUH -AgIwGQwXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwBwYFZ4EMAQEwHwYDVR0jBBgw -FoAUsm3j5BQPjDxzQqZamRrTFHW2htswKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDov -L3NoLnN5bWNiLmNvbS9zaC5jcmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUFBzAB -hhNodHRwOi8vc2guc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8vc2guc3lt -Y2IuY29tL3NoLmNydDCCAX4GCisGAQQB1nkCBAIEggFuBIIBagFoAHYA3esdK3oN -T6Ygi4GtgWhwfi6OnQHVXIiNPRHEzbbsvswAAAFbxYHx8wAABAMARzBFAiEAoZAV -7qASZQXq7visy9vw4552zDWP/+K/8FmgvPpFHuACICl4k+7Omje9NoIRTwnPs4fm -fqW4rDXzK+HKIGNfEmQ4AHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN -3BAAAAFbxYHyLgAABAMARzBFAiAuvBGEqgabzmMmG2Tzv1KjGR0nTtEz1R1XluNc -w8NrnAIhAOBL9OgiJfN4SRq6Gmfesx8BJGFr7pDfpDKECGOT1uqZAHYA7ku9t3XO -YLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFbxYHz8gAABAMARzBFAiEA2/T1 -kmfJQ/F0SrRDPozVMhaQW/ydrynOQovjsNJM3M0CIEN0T1ac8FsiatIVoxv690J3 -sIfanWlSX7UvPVShVGg2MA0GCSqGSIb3DQEBCwUAA4IBAQB4unTd5lxCGKsEyViE -m1AZpxTwISBdxuixpXoskuHwCw5LApp8WbaO0W4h4ZLfL+P2cAKx7awvfsaLKQ0i -tnmhyCZitwI9cfmRs8wwU3WgVH/CiIWv96R9mqA8AQ0pMRUp240idzd/VkLYc2RL -CFECQOdsgflyp95PqWyFD1aGdMmwCW5nFUYkbA18cJER5VG9nquBNROzM14z73Wa -PelMX56on9fk+KgryPQIMJFQxqwWbiszby6UaWLQ3ZDKiNwdJsmZWvQ/Gw05NTtp -J1gOExSwrDQM0X5gxMaSxTDU7zEWQz2kjYWjdtdtiq8AtRjQ8DlqXseTpHOUB8iW -5vWY ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFSTCCBDGgAwIBAgIQCbdJ/X8LSRbKBVZWz/bZgjANBgkqhkiG9w0BAQsFADCB -vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W -ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0xMzA0MDkwMDAwMDBaFw0yMzA0MDgyMzU5NTlaMIGKMQswCQYDVQQGEwJVUzEd -MBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVj -IFRydXN0IE5ldHdvcmsxOzA5BgNVBAMTMlN5bWFudGVjIENsYXNzIDMgRXh0ZW5k -ZWQgVmFsaWRhdGlvbiBTSEEyNTYgU1NMIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAwUo5gP1SVSC5FK9OwhPfSgNKsGXFaGaKJJxyi63peok7gyXs -LFcSKSb3qHD0Y+AGVTyD8cPxY0sypzk9D/exa/G+Xxua5KoXZUbBpue3YXWKmCYZ -HqcPo8eypoUnOQR0G8YHFiqSqOjpm8RaIIoby0YJUeSi5CGDM9UnyXvbqOF2hljp -4b0TV2vgGq9xA7MV8EQB5WFk9fIRmVLs7ej1PRNrISfCxgPA8g/VWH/17yql/yjq -jeWOdt8sZmSbNb9j/Z9KSJ8whT7VsvH+yESoWC6gnWC9Cs7BJQgcTfK0w+tcOLfY -1JslzuMzFs/JL8wocPpjdNXExxEVpZnyKSLABQIDAQABo4IBdDCCAXAwNwYIKwYB -BQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC53cy5zeW1hbnRlYy5j -b20wEgYDVR0TAQH/BAgwBgEB/wIBADBlBgNVHSAEXjBcMFoGBFUdIAAwUjAmBggr -BgEFBQcCARYaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIw -HBoaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9ycGEwPgYDVR0fBDcwNTAzoDGgL4Yt -aHR0cDovL2NybC53cy5zeW1hbnRlYy5jb20vdW5pdmVyc2FsLXJvb3QuY3JsMA4G -A1UdDwEB/wQEAwIBBjAqBgNVHREEIzAhpB8wHTEbMBkGA1UEAxMSVmVyaVNpZ25N -UEtJLTItMzcyMB0GA1UdDgQWBBSybePkFA+MPHNCplqZGtMUdbaG2zAfBgNVHSME -GDAWgBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEAdJ3d -mGjc+GgcDYkNvwlH3cWvtjX7EqazxfQGSbmJcnB0fKn1cxQh6wAW9VOsKBq0salx -V6wBS/SYJMULRSKRRtL+1rYIRPMbgwUcFMBo34qHylbm72/zlBO0W4VPrVe68Ow7 -gOeiAV+7ZYUARJc0uNiuIW+Xva9zHMVw3Mb3x2sgh6oEYmnI9sPzpHSPG1VPKrsH -NUZlCdqof2NXVfDrn0kVlVeqf8tER1EAWVaDHUCRLdgd0l9x7ibBbkUNxU0SP7+R -5TYnB2qysmYrhf8nQaKSs8pOAY371fbh5FTWa8ySae7kOY6dNM4Us/CAauNW7mW0 -zB9UpGiJBN2YLL3Pow== ------END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.*; +import java.math.BigInteger; +import java.security.*; +import java.security.cert.*; +import java.time.ZonedDateTime; +import java.util.*; +import javax.net.ssl.*; +import sun.security.validator.Validator; +import sun.security.validator.ValidatorException; + +import jdk.test.lib.security.SecurityUtils; + +/** + * Helper class that provides methods to facilitate testing of distrusted roots. + */ +public final class Distrust { + + private static final String TEST_SRC = System.getProperty("test.src", "."); + private static CertificateFactory cf; + + private final boolean before; + private final boolean policyOn; + private final boolean isValid; + + public Distrust(String[] args) { + before = args[0].equals("before"); + policyOn = args[1].equals("policyOn"); + isValid = args[2].equals("valid"); + + if (!policyOn) { + // disable policy (default is on) + Security.setProperty("jdk.security.caDistrustPolicies", ""); + } + } + + public Date getNotBefore(ZonedDateTime distrustDate) { + ZonedDateTime notBefore = before ? distrustDate.minusSeconds(1) : distrustDate; + return Date.from(notBefore.toInstant()); + } + + public void testCodeSigningChain(String certPath, String name, Date validationDate) + throws Exception { + System.err.println("Testing " + name + " code-signing chain"); + Validator v = Validator.getInstance(Validator.TYPE_PKIX, + Validator.VAR_CODE_SIGNING, + getParams()); + // set validation date so this will still pass when cert expires + v.setValidationDate(validationDate); + v.validate(loadCertificateChain(certPath, name)); + } + + public void testCertificateChain(String certPath, Date notBefore, X509TrustManager[] tms, + String... tests) throws Exception { + for (String test : tests) { + System.err.println("Testing " + test); + X509Certificate[] chain = loadCertificateChain(certPath, test); + + for (X509TrustManager tm : tms) { + testTM(tm, chain, notBefore, isValid); + } + } + } + + public X509TrustManager getTMF(String type, PKIXBuilderParameters params) throws Exception { + TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); + if (params == null) { + tmf.init((KeyStore) null); + } else { + tmf.init(new CertPathTrustManagerParameters(params)); + } + TrustManager[] tms = tmf.getTrustManagers(); + for (TrustManager tm : tms) { + return (X509TrustManager) tm; + } + throw new RuntimeException("No TrustManager for " + type); + } + + public PKIXBuilderParameters getParams() throws Exception { + PKIXBuilderParameters pbp = + new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), + new X509CertSelector()); + pbp.setRevocationEnabled(false); + return pbp; + } + + public void testTM(X509TrustManager xtm, X509Certificate[] chain, + Date notBefore, boolean valid) { + // Check if TLS Server certificate (the first element of the chain) + // is issued after the specified notBefore date (should be rejected + // unless distrust property is false). To do this, we need to + // fake the notBefore date since none of the test certs are issued + // after then. + chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); + + // Wrap the intermediate and root CA certs in NonExpiringTLSServerCert + // so it will never throw a CertificateExpiredException + for (int i = 1; i < chain.length; i++) { + chain[i] = new NonExpiringTLSServerCert(chain[i]); + } + + try { + xtm.checkServerTrusted(chain, "ECDHE_RSA"); + if (!valid) { + throw new RuntimeException("chain should be invalid"); + } + } catch (CertificateException ce) { + if (valid) { + throw new RuntimeException("Unexpected exception, chain " + + "should be valid", ce); + } + if (ce instanceof ValidatorException) { + ValidatorException ve = (ValidatorException) ce; + if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { + ce.printStackTrace(System.err); + throw new RuntimeException("Unexpected exception: " + ce); + } + } else { + throw new RuntimeException(ce); + } + } + } + + private X509Certificate[] loadCertificateChain(String certPath, String name) + throws Exception { + if (cf == null) { + cf = CertificateFactory.getInstance("X.509"); + } + try (InputStream in = new FileInputStream(TEST_SRC + File.separator + certPath + + File.separator + name + "-chain.pem")) { + Collection certs = + (Collection) cf.generateCertificates(in); + return certs.toArray(new X509Certificate[0]); + } + } + + private static class NonExpiringTLSServerCert extends X509Certificate { + private final X509Certificate cert; + NonExpiringTLSServerCert(X509Certificate cert) { + this.cert = cert; + } + public Set getCriticalExtensionOIDs() { + return cert.getCriticalExtensionOIDs(); + } + public byte[] getExtensionValue(String oid) { + return cert.getExtensionValue(oid); + } + public Set getNonCriticalExtensionOIDs() { + return cert.getNonCriticalExtensionOIDs(); + } + public boolean hasUnsupportedCriticalExtension() { + return cert.hasUnsupportedCriticalExtension(); + } + public void checkValidity() { + // always pass + } + public void checkValidity(Date date) { + // always pass + } + public int getVersion() { return cert.getVersion(); } + public BigInteger getSerialNumber() { return cert.getSerialNumber(); } + public Principal getIssuerDN() { return cert.getIssuerDN(); } + public Principal getSubjectDN() { return cert.getSubjectDN(); } + public Date getNotBefore() { return cert.getNotBefore(); } + public Date getNotAfter() { return cert.getNotAfter(); } + public byte[] getTBSCertificate() throws CertificateEncodingException { + return cert.getTBSCertificate(); + } + public byte[] getSignature() { return cert.getSignature(); } + public String getSigAlgName() { return cert.getSigAlgName(); } + public String getSigAlgOID() { return cert.getSigAlgOID(); } + public byte[] getSigAlgParams() { return cert.getSigAlgParams(); } + public boolean[] getIssuerUniqueID() { + return cert.getIssuerUniqueID(); + } + public boolean[] getSubjectUniqueID() { + return cert.getSubjectUniqueID(); + } + public boolean[] getKeyUsage() { return cert.getKeyUsage(); } + public int getBasicConstraints() { return cert.getBasicConstraints(); } + public byte[] getEncoded() throws CertificateEncodingException { + return cert.getEncoded(); + } + public void verify(PublicKey key) throws CertificateException, + InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { + cert.verify(key); + } + public void verify(PublicKey key, String sigProvider) throws + CertificateException, InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { + cert.verify(key, sigProvider); + } + public PublicKey getPublicKey() { return cert.getPublicKey(); } + public String toString() { return cert.toString(); } + } + + private static class DistrustedTLSServerCert extends NonExpiringTLSServerCert { + private final Date notBefore; + DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { + super(cert); + this.notBefore = notBefore; + } + public Date getNotBefore() { return notBefore; } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024, 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.time.*; +import java.util.*; +import javax.net.ssl.*; + +/** + * @test + * @bug 8337664 8341059 + * @summary Check that TLS Server certificates chaining back to distrusted + * Entrust roots are invalid + * @library /test/lib + * @modules java.base/sun.security.validator + * @run main/othervm Entrust after policyOn invalid + * @run main/othervm Entrust after policyOff valid + * @run main/othervm Entrust before policyOn valid + * @run main/othervm Entrust before policyOff valid + */ + +public class Entrust { + + private static final String certPath = "chains" + File.separator + "entrust"; + + // Each of the roots have a test certificate chain stored in a file + // named "-chain.pem". + private static String[] rootsToTest = new String[]{ + "entrustevca", "entrustrootcaec1", "entrustrootcag2", "entrustrootcag4", + "entrust2048ca", "affirmtrustcommercialca", "affirmtrustnetworkingca", + "affirmtrustpremiumca", "affirmtrustpremiumeccca"}; + + // Date when the restrictions take effect + private static final ZonedDateTime DISTRUST_DATE = + LocalDate.of(2024, 11, 12).atStartOfDay(ZoneOffset.UTC); + + public static void main(String[] args) throws Exception { + Distrust distrust = new Distrust(args); + + X509TrustManager[] tms = new X509TrustManager[]{ + distrust.getTMF("PKIX", null), + distrust.getTMF("SunX509", null) + }; + + Date notBefore = distrust.getNotBefore(DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, rootsToTest); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018, 2024, 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.net.ssl.X509TrustManager; +import java.io.File; +import java.time.*; +import java.util.*; + + +/** + * @test + * @bug 8207258 8216280 + * @summary Check that TLS Server certificates chaining back to distrusted + * Symantec roots are invalid + * @library /test/lib + * @modules java.base/sun.security.validator + * @run main/othervm Symantec after policyOn invalid + * @run main/othervm Symantec after policyOff valid + * @run main/othervm Symantec before policyOn valid + * @run main/othervm Symantec before policyOff valid + */ + +public class Symantec { + + private static final String certPath = "chains" + File.separator + "symantec"; + + // Each of the roots have a test certificate chain stored in a file + // named "-chain.pem". + private static final String[] rootsToTest = new String[]{ + "geotrustprimarycag2", "geotrustprimarycag3", "geotrustuniversalca", + "thawteprimaryrootca", "thawteprimaryrootcag2", "thawteprimaryrootcag3", + "verisignclass3g3ca", "verisignclass3g4ca", "verisignclass3g5ca", + "verisignuniversalrootca" + }; + + // Each of the subCAs with a delayed distrust date have a test certificate + // chain stored in a file named "-chain.pem". + private static String[] subCAsToTest = new String[]{"appleistca8g1"}; + + // Date when the restrictions take effect + private static final ZonedDateTime ROOTS_DISTRUST_DATE = + LocalDate.of(2019, 4, 17).atStartOfDay(ZoneOffset.UTC); + + // Date when the subCA restrictions take effect + private static final ZonedDateTime SUBCA_DISTRUST_DATE = + LocalDate.of(2020, 1, 1).atStartOfDay(ZoneOffset.UTC); + + public static void main(String[] args) throws Exception { + Distrust distrust = new Distrust(args); + X509TrustManager[] tms = new X509TrustManager[]{ + distrust.getTMF("PKIX", null), + distrust.getTMF("SunX509", null) + }; + + // test chains issued through roots + Date notBefore = distrust.getNotBefore(ROOTS_DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, rootsToTest); + + // test chain if params are passed to TrustManager + System.err.println("Testing verisignuniversalrootca with params"); + X509TrustManager[] tmsParams = new X509TrustManager[]{ + distrust.getTMF("PKIX", distrust.getParams()) + }; + distrust.testCertificateChain(certPath, notBefore, tmsParams, + "verisignuniversalrootca"); + + // test code-signing chain (should be valid as restrictions don't apply) + Date validationDate = new Date(1544197375493L); + distrust.testCodeSigningChain(certPath, "verisignclass3g5ca-codesigning", validationDate); + + // test chains issued through subCAs + notBefore = distrust.getNotBefore(SUBCA_DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, subCAsToTest); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,77 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 8608355977964138876 (0x7777062726a9b17c) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Commercial + Validity + Not Before: Jan 29 14:06:06 2010 GMT + Not After : Dec 31 14:06:06 2030 GMT + +-----BEGIN CERTIFICATE----- +MIIHHjCCBgagAwIBAgIQAWZjFOyCvT00u/gtkCvS2TANBgkqhkiG9w0BAQsFADCB +gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT +ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp +cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYxMB4XDTI0MDYyODIx +MzgwNVoXDTI1MDcyODIxMzgwNFowgdgxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP +bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW +BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt +aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 +NDA1NDcxKDAmBgNVBAMTH3ZhbGlkY29tbWVyY2lhbC5hZmZpcm10cnVzdC5jb20w +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDeIT2XO0hJ5wDSbIiIcMvs +P3NpQc7O7v5DqldpME6+Qn2sF5b9hc6j72hgTXREa77uUcP5u1JcMWCSWwYQHMpJ +kFzmIzijhS60wW1epb5QyTgM3ZYh1WKvttFCbHUcrTtd+LoPFYsjw9ZK//K9tPp+ +ddn06/ivWvUO5y5vn0wrCaB9tuLdDn4RCQzK2XoZdDuqhPlBBogJX0vM6lsXjgLy +EbvE+/sKYps/In6VtRvCoYavg3OqaIMeaA7gTiYTb1ZGFOAiltnq7fcp6SZUohK3 +QNihv1DadVc+n8LnEUKKDkgG2YgWEFczaE3qwG3ef6L3MzLGrkgVY+qGHyyv2IE7 +AgMBAAGjggM1MIIDMTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBT4ARNL47hAsOpa +96VMgKEY3sLIAjAfBgNVHSMEGDAWgBTb72U3C+VHyzXRkB8DwbyIx6fqgDBsBggr +BgEFBQcBAQRgMF4wJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmFmZmlybXRydXN0 +LmNvbTAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5hZmZpcm10cnVzdC5jb20vYWZ0 +ZXYxY2EuY3J0MDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuYWZmaXJtdHJ1 +c3QuY29tL2NybC9hZnRldjFjYS5jcmwwKgYDVR0RBCMwIYIfdmFsaWRjb21tZXJj +aWFsLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYI +KwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARPME0wBwYFZ4EMAQEwQgYKKwYBBAGC +jwkCATA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5hZmZpcm10cnVzdC5jb20v +cmVwb3NpdG9yeTCCAYAGCisGAQQB1nkCBAIEggFwBIIBbAFqAHcAEvFONL1TckyE +BhnDjz96E/jntWKHiJxtMAWE6+WGJjoAAAGQYMi3wQAABAMASDBGAiEAjvdsU4G2 +o4BZSOOjaH6gOp7zhKtXQByQUvfHfsi2ePcCIQDnnIO2qlHBm+sskUDlXfR0lCUW +yFPVr9nFZ0L9YPpozgB2AA3h8jAr0w3BQGISCepVLvxHdHyx1+kw7w5CHrR+Tqo0 +AAABkGDIt9MAAAQDAEcwRQIhANh1zS3Qeo9yKF+j3G52JhmDRYBS+1TM0wykoXCY +llpxAiAG+LAlKSbwwgrboUSTDDXWNeoRYZ7fKbU72kKfHrpZvwB3ABoE/0nQVB1A +r/agw7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDIt9sAAAQDAEgwRgIhAN8OoC4I +zw8bFJy8ACgK40c9ZfsIfFhePTc9CyrL5uDsAiEA4Jn/IqBB9L5DeTgqw9hBaYag +FmY/2gWDip36ga0WUsAwDQYJKoZIhvcNAQELBQADggEBABywPLJP097Emz6LNeFU +/HvfhaUKv2pgIHf/Kvjs5x78RK9G605THPEHr/TeUjNZ4PBd48WBNVWzyd/8FuOt +r+FsYkRJb9CnrOhZHuCwlcdWXvuY8PiuBmT+xB16BWR5yhYbbiGe4hea0Pf6CfHh +jJoGJw4dQKfgneZOV7IcaWnNTKYawlcZOgxvEwFvj+iZM31WphEPKRAV+N+Tp+ZR +nxlEdjmdbOjqBydlYIEzuFIgxgtnPdK5wqCOWb+z2cARUAO/AkiWrOLTPDc7ydQK +GcfDrSqffHOlwaee08C6STFaJWIcpqxZdXE6Jc+8/85bfPEAG1UepgfnBTqW9RGT +Q3s= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEqDCCA5CgAwIBAgIQFylVHtaOf7Ht9XMA811/1TANBgkqhkiG9w0BAQsFADBE +MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHzAdBgNVBAMMFkFm +ZmlybVRydXN0IENvbW1lcmNpYWwwHhcNMTkwMzIxMjAyNzU0WhcNMzAxMjAyMDQw +MDAwWjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYD +VQQLEyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQD +EyhBZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYxMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuPBMIa9VuXJGAw0MHvieGciPFA11 +b9T49YJ7T+zVpoMMQO+ueUKVHb2l26oeCiwIhXMQ5LquOVcx+rofouzcKXY3wKDZ +zHIOnAkU+23Ucn/3dRH7aHJULsBufZq+NvwgYSgJJEDKfqvIV/c5HiRyZ2H+nAI5 +10Q2xC0UxgSBsufccQ+Fwkg6BAGDlTXrvi8wi75UaGue6jv/qcKLybeVUrgqKE64 +d9oa9PG5/g89QwSdsIQEdVSFzFvFpOG9YhJbJ177Zg6DGCxU0lWwFrVpyH/2vnXl +jhMQScn8UxzCJdDg3EDqjgaV0JH2yoLug+QVYgURPu5BEb5ut9vAdP7cLwIDAQAB +o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz +cC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFNvvZTcL5UfLNdGQHwPBvIjHp+qA +MBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUnZPGU4teyq8/nx4P5ZmV +vCT2lI8wRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8v +d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEkGA1UdHwRCMEAwPqA8oDqG +OGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdENvbW1l +cmNpYWwuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYI +KwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAATH11fMrINGmQGQqQW0ATteVnUG +LrmRSN2OlmRm+dkUwKXhcQQEfYYlEggPqgvxSUpw13fXSOqVHqAcj3BIqF957kh+ +m3DmC0RX9KaEKD165pf77P5nZcRmZpBl9cctvzIxN19uzcminchusYwLyeWhBtTZ +xpER9LbrfMNaQ7GnrgalMx54QvdjOhw/GJs9/SqEzYmPshL+DzgZX/oAzY63rQIh +rBblf6/2talZqci96oFzNst8rGfPy/xQ7lgkki1hwIYbORMfloBhP+vAZJo0mxdM +ipu3Z0ToK+KU2iqnBxXVr2/kod+CpkHnjUHa1wnQuSaefng3XwZ/vqtSL9c= +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,76 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 8957382827206547757 (0x7c4f04391cd4992d) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Networking + Validity + Not Before: Jan 29 14:08:24 2010 GMT + Not After : Dec 31 14:08:24 2030 GMT + +-----BEGIN CERTIFICATE----- +MIIHGjCCBgKgAwIBAgIQX2vGPaCJ1tS0ncp2OlBMFjANBgkqhkiG9w0BAQsFADCB +gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT +ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp +cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYzMB4XDTI0MDYyODIx +NDU0OVoXDTI1MDcyODIxNDU0OFowgdgxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP +bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW +BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt +aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 +NDA1NDcxKDAmBgNVBAMTH3ZhbGlkbmV0d29ya2luZy5hZmZpcm10cnVzdC5jb20w +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkGknE8kFr+CaIybQrDPRw +z9OKXq77p4CnrkF1/g9w/HiIs6Ps8YqTjsiTKM3wYLbvPA+TbO9DpCSyCP2bVyLf +AjUE617KZSpfy9RqzvGjn/1qH/cBKohhEliMfDj4ZHfY4x+1WYTZPVK/g0Ny5RAP +wz9lJHR2SsVGLvpqXzWaVoxifJ8HZWD7n5z/75WeYko+Hubx3WvzJZcN2Xjn+q6a +7wkDaXPayrvn5uWGPlOLQHqJ5z7wts21jASMTfJAToFyzH6dGwvqxkP3bVJGJ8AF +vtMfqVjcOcjWgmmOEHMPAAqs5QKrYuSLccH6hFTwFEUCdMwVqfloznt2sNUSBoKj +AgMBAAGjggMxMIIDLTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTrE0z4fRyx9P9M +0FfA6VgGkJiYVDAfBgNVHSMEGDAWgBR5HrHJF8cerLHHFNfD6H+8uVCbFTBsBggr +BgEFBQcBAQRgMF4wJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmFmZmlybXRydXN0 +LmNvbTAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5hZmZpcm10cnVzdC5jb20vYWZ0 +ZXYzY2EuY3J0MDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuYWZmaXJtdHJ1 +c3QuY29tL2NybC9hZnRldjNjYS5jcmwwKgYDVR0RBCMwIYIfdmFsaWRuZXR3b3Jr +aW5nLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYI +KwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARPME0wBwYFZ4EMAQEwQgYKKwYBBAGC +jwkCAjA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5hZmZpcm10cnVzdC5jb20v +cmVwb3NpdG9yeTCCAXwGCisGAQQB1nkCBAIEggFsBIIBaAFmAHYADeHyMCvTDcFA +YhIJ6lUu/Ed0fLHX6TDvDkIetH5OqjQAAAGQYM/MjQAABAMARzBFAiBjnehs1mvh +5Xm3uXZ7Bq8gijwiXThwnLSYROQxnWrnbAIhALbgJG+PRZQfzTBbgM/zAwNsBjhe +F5iENnaajJCxzOhaAHUAEvFONL1TckyEBhnDjz96E/jntWKHiJxtMAWE6+WGJjoA +AAGQYM/MgQAABAMARjBEAiAsWOm1IIjaxQP9uaPI9tQmkiJPUOTrBTsTDO+jkgiG ++QIgVNhND82rsFGjrtAAHzzgCVzLDUM3zaHxnP/z3BNuO4QAdQAaBP9J0FQdQK/2 +oMO/8djEZy9O7O4jQGiYaxdALtyJfQAAAZBgz8zLAAAEAwBGMEQCIBIGxtjk7Lw8 +i+oggK7VrPMNTB632t321cwhEm517BbZAiBws3+uytwh59N6qGJUuSFQnOZNPOPj +eQnH2fSdT1J2sDANBgkqhkiG9w0BAQsFAAOCAQEAcSzitESRKlbcUvxvUB7FjK0I +CaBU1Nyu0xDFCoG2pmp7GASJz34wtPYfsiX5+j4hDh/noMcgk7WlD8pzgWYw15Rk ++5kTv2v4U85y/JFjzMOHbz64KjQdGebqhjvC/E/EXxK+AZf4H574/w7rbyJ30vFL +gNvPF9AxS1MuYIO55jXrHMByKnFoQZgPsmAY/x+n+OzMxWOdR18PupypCB5TyJZ8 +pQzwoxmX7qeZHiXyJ8jQUwe1qoQc2SbwfQxfwSPUPSJuQo90N+5nyQMe7vvPBM0Y +/CXaFpfPqh71D4C0Ey+0hYxSt99gYs4P9twUByjIlP0wTyhaoEpt3zw9DdZypQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEqDCCA5CgAwIBAgIQNCSh7Pjwo1/nRrcBHEPoRDANBgkqhkiG9w0BAQsFADBE +MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHzAdBgNVBAMMFkFm +ZmlybVRydXN0IE5ldHdvcmtpbmcwHhcNMTkwMzIxMjAzODU5WhcNMzAxMjAyMDQw +MDAwWjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYD +VQQLEyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQD +EyhBZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYzMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmHDl/3xr1qiHoe0Rzb3AGLw56e9J +l2a3X59+PAfI5wGBHuK9Dl7XsyoH65X6QIC/rXyVpuNgKbbwIGHB+rCSplyHzGyC +WeM3LXa2q1US7VteeFDS959nxJVRFfwATR9xAK6YTUWQ/yWdw0dZSm0lQNmEMBwS +qi0ufWokiWXZUzWHOu7A6driCohu9sFDwe1INJUPH6uIlovmzGvG3UYbUSymJcjs +Ka0fXXX9zukco8exlOIKWRJSNLxKtSSPDVASrGLQ1xi3qkiLTKci3+jKMNDFf1vw +foZN99HhUcWKXfr2KlWfANdjTMlsTKCfuhfWl1OBVNHGRrACAQCXI/ji0wIDAQAB +o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz +cC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFHkesckXxx6ssccU18Pof7y5UJsV +MBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUBx/S55zawm6iQLSwelAQ +UHTEyL0wRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8v +d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEkGA1UdHwRCMEAwPqA8oDqG +OGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdE5ldHdv +cmtpbmcuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYI +KwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAhmE4I56hNpnWXQ2Si8a/TgQUZr +X5Jlv1LDvl3rkDyfEIHNZ8dth17SakJYJBWHExph/iIYjCJ9YmeyhghV5rPqT+wF +4yyE2ngenIusfnWT2bTpT9u2VZbCNeACE5XnN2UHSA0J9idPjfLuthViWEvSZZUh +DJ53bX+exO366nDY4AI7owIyhz8hdsWyhZ/0ST+eD+kbgd8osd+GdxzRmyKcfl84 +D1K1uff01T9w2dyUaZglQsFljkaO6xmeXZJsPnhwCp/HlMHWzhAneUQ7I9FZSOW+ +WiYbt4RitmBpysadBReikWM4knECzJQ/fMT9vC0k9BLlqUYRwCH9vr0UnZo= +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,88 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 7893706540734352110 (0x6d8c1446b1a60aee) + Signature Algorithm: sha384WithRSAEncryption + Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Premium + Validity + Not Before: Jan 29 14:10:36 2010 GMT + Not After : Dec 31 14:10:36 2040 GMT + +-----BEGIN CERTIFICATE----- +MIIIFjCCBv6gAwIBAgIQQVOTWr7tEAJXmRDkCSxkajANBgkqhkiG9w0BAQsFADCB +gzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJT +ZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhBZmZp +cm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYyMB4XDTI0MDYyODIx +NDgyN1oXDTI1MDcyODIxNDgyNlowgdUxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP +bnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExEzARBgsrBgEEAYI3PAIBAxMCQ0ExGDAW +BgsrBgEEAYI3PAIBAhMHT250YXJpbzEcMBoGA1UEChMTQWZmaXJtdHJ1c3QgTGlt +aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzI1 +NDA1NDcxJTAjBgNVBAMTHHZhbGlkcHJlbWl1bS5hZmZpcm10cnVzdC5jb20wggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDVRMzwbDq47ivHOKqJdiEJNL2+ +g9Snj/BRctqcQTrIV99RP0pmAh5fHg7vnhVsHqc9sRLVcQWTJk9NuRJ2VnDKWsBa +Xrp5UWaNjS0vaFA4jzCi1gWzTTZgPTQn3VRG3JP1F5CZb405/mtWDaw/CfWkcUqQ +VSilqFlJRsjcPCzQh7ZaXAo+FmzJxNSwjxdP6JSYMeTDRCUpSb3T8PypVI1CEmLZ +jsxrg5oIZn25591g/pzgLE56N0stNY4d3q4YD1t5x46RsqYAJYSkk8rcTN+kHzsY +VSqaRDyPkGbmuCeJUvW24wJ30yQtXQWA+U0dMYLe7LyglJ7dkOzvWNbqrIcvM8My +hxH/wwVH7e4dL/1E58yr1BHENUk7Mp9rzIXj496eLkF5G1lMkNnuVRQqCAOW0rPY +V0rI8yrCMTK52s4mNjQo2J7JOYdTUvAWZ92MKvEjjhQlMH8eK72Km/+mkxpsgGmr +3c6u+Gom7oI5VaLZ+3p2uWaOsutk1tkzWjhzY4L27hwmIdWujfrWMRx8uxcfoJxX +gQ40d1QiSN51BtCPE5UnpLU/YUxMdzWmtUoGUfYIGVqDVToBnunIFMdmFjC0IrNl +hquDQi/OGMpzuOvxX1FoXb+rRwOhhdrcR0BQqUVRTV0U5LlcsDeNMqmqPE9mzGtJ +W69Fsh7crntng/L72wIDAQABo4IDMDCCAywwDAYDVR0TAQH/BAIwADAdBgNVHQ4E +FgQU3PWyi/4usZghgahc/Tj+Q60QLOcwHwYDVR0jBBgwFoAUc3yaOGg8UXxBCP6h +HyoetGHbzTwwbAYIKwYBBQUHAQEEYDBeMCcGCCsGAQUFBzABhhtodHRwOi8vb2Nz +cC5hZmZpcm10cnVzdC5jb20wMwYIKwYBBQUHMAKGJ2h0dHA6Ly9haWEuYWZmaXJt +dHJ1c3QuY29tL2FmdGV2MmNhLmNydDA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8v +Y3JsLmFmZmlybXRydXN0LmNvbS9jcmwvYWZ0ZXYyY2EuY3JsMCcGA1UdEQQgMB6C +HHZhbGlkcHJlbWl1bS5hZmZpcm10cnVzdC5jb20wDgYDVR0PAQH/BAQDAgWgMB0G +A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBWBgNVHSAETzBNMAcGBWeBDAEB +MEIGCisGAQQBgo8JAgMwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuYWZmaXJt +dHJ1c3QuY29tL3JlcG9zaXRvcnkwggF+BgorBgEEAdZ5AgQCBIIBbgSCAWoBaAB2 +ABoE/0nQVB1Ar/agw7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDSN7EAAAQDAEcw +RQIgVDWwhv7yG6RNnkMZnVq1YYA7ypn/GSH0ibUKnESHRpYCIQCY8gyCX7VFONUI +QuR8daz7ra2FCUI9TwylrR3eFfIgGgB3AN3cyjSV1+EWBeeVMvrHn/g9HFDf2wA6 +FBJ2Ciysu8gqAAABkGDSN5cAAAQDAEgwRgIhAM1edsSyFUKU0Dj1WxTGwziE6fCW +g2ByfL8kDrP260YXAiEA6YQOpJf04N13Nn263BxAl+laH9Ar0eo03fArlv743TQA +dQAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBg0je+AAAEAwBG +MEQCIExqK4katETAQo+H0+ImuNJCSeFEI9C+9wrjhl6ZnWb9AiBwkC1vpLYOIm/1 +YCLCQIOmTdg2wf8LITlrQNJA8vbBljANBgkqhkiG9w0BAQsFAAOCAQEASOmPu7ot +yl6MoMns19uI6H2KSUjMFh3/fKMcY/ettmEYalgrytexFMrLnD2UniBlD+nJEshp +5/z7o0YDiRoiLhMAs7VqIdX3erNu/ghNh7P2bDnoMWShSoAKxez1XOGL3rRE0NAi +DsWCaNRHH9rnC97275sbGnua7ZYg+8BiF62vpJlqjrxDHjGiej8qAWSjztbB43Af +bwRscpXTxNkMvOBuRFMH+rSxB8CrOV68W+yxmzPuPxVjM7oJH8Qk5BC53NRqFsVz +JhbNfot0+/drj7JT3jlacUVQcD/BzDuC3+qczQlLjLdHgQM2/e4fXsD6C5S6B11d +BDx6ipGpaASofA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFojCCA4qgAwIBAgIQU3HI6weE/VEI5dTz4yPsRjANBgkqhkiG9w0BAQsFADBB +MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxHDAaBgNVBAMME0Fm +ZmlybVRydXN0IFByZW1pdW0wHhcNMTkwMzIxMjA0NjM1WhcNMzAxMjAyMDQwMDAw +WjCBgzELMAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQL +EyJTZWUgd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTEwLwYDVQQDEyhB +ZmZpcm1UcnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVYyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvDDZHfxkB1nAGFKdw0VCgV+B/eBtW1o+ +bXzwRcpeFh5saDI+tv1RAMrYFq+AJkXCCJopgMF2Wqfv5myE3JMgxEHuuKUpJz7H +FprrFckVOGCtJKH8Iy9AWPjBwt8lKmxGJF7EZst+QoVt4hMe0qhL0WEKbATFPe41 +DcM7UsyQv6Bvpn424uePy3/1ATIsVL3YmvAbUNR0aqVxYAJzTefvyIet/761bKGc +NyqdOVWFFeTDtr8iL1TBXToAgl0GJ39bFQZsP19VcCpfk9Zj3YHTPRPq5wZOZuUN +F7jiBUEi6DaVOi3Wy4vdySHtWPeBHRYif1I6fcUfdCNORMc4ee6KewIDAQABo4IB +UTCCAU0wNwYIKwYBBQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC5h +ZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFHN8mjhoPFF8QQj+oR8qHrRh2808MBIG +A1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUncBnpgwi2Sb1RaumZVIRJ9hF +rGMwRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8vd3d3 +LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MEYGA1UdHwQ/MD0wO6A5oDeGNWh0 +dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2NybC9BZmZpcm1UcnVzdFByZW1pdW0u +Y3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH +AwIwDQYJKoZIhvcNAQELBQADggIBABi64UEwl3l0yIiuSACyVQQIBI60BUmhseac +4BzCAsJrR5tE/2U9QAa2y6JpR1nqm76DJvw1QQgvFcNe+fkwpvoViCaSTbZkGGwD +mQe2xRSYJcDSMQUc/GgzLcX2c1CrexQXE1vwV/q33af1en5s1GzLl915aNS/k1ch +G7EMruJ/D4cuH9j4j2i+b+llmVBzavBwelN5rc693o+Ot9id/1sTWNugwAu3uXGb +VlhETMnjXGIciegOLdWYhWBln0izYlt9IwlDEpjMVaZ0HZlj2JBGaSe4PfEFpJPO +beuPcQpLQGw2XpW2ZMG5JcRYaoKWjixXAGktRA3H9nvVW92jvzx/RX484w2ZM5Rt +E+I1ikAuQLAyWG7clht387e2RuC3NZTtefSyjE3L9gQDOPC+Z9ycwr0WJHRsxFvh +FJQi3JnxgFZf5mc5n2mh3qAgALTNOUHuDiHrerjTOWbpF/1/NJmo/c/YZ63vZIhc +EaER4HuhbBqlpf6z3WOIQdZm1ChwXYHrEcLDgfwm9cXoaVK2HZapkMwQbPffPlT1 +E+AxRFB4YmT1y2WzdaHfhFA9nH6ByUdL5+FfrDoIIUO2e8OLOAcrJsf5+unhAhc0 +v7N48JWdmpstjkXCaCIaidrZLJxS+pikNgHB1dXF/TxokLTiPB9jcYKdGaYs3XHb +YKLdwubu +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,63 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 8401224907861490260 (0x7497258ac73f7a54) + Signature Algorithm: ecdsa-with-SHA384 + Issuer: C=US, O=AffirmTrust, CN=AffirmTrust Premium ECC + Validity + Not Before: Jan 29 14:20:24 2010 GMT + Not After : Dec 31 14:20:24 2040 GMT + +-----BEGIN CERTIFICATE----- +MIIF0zCCBVmgAwIBAgIQFVwk9nYUM5SYOnBd+IoGtzAKBggqhkjOPQQDAzCBhTEL +MAkGA1UEBhMCQ0ExFDASBgNVBAoTC0FmZmlybVRydXN0MSswKQYDVQQLEyJTZWUg +d3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5MTMwMQYDVQQDEypBZmZpcm1U +cnVzdCBFeHRlbmRlZCBWYWxpZGF0aW9uIENBIC0gRVZFQzEwHhcNMjQwNjI4MjE0 +OTUwWhcNMjUwNzI4MjE0OTQ4WjCB2DELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09u +dGFyaW8xDzANBgNVBAcTBk90dGF3YTETMBEGCysGAQQBgjc8AgEDEwJDQTEYMBYG +CysGAQQBgjc8AgECEwdPbnRhcmlvMRwwGgYDVQQKExNBZmZpcm10cnVzdCBMaW1p +dGVkMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UEBRMHMjU0 +MDU0NzEoMCYGA1UEAxMfdmFsaWRwcmVtaXVtZWNjLmFmZmlybXRydXN0LmNvbTB2 +MBAGByqGSM49AgEGBSuBBAAiA2IABEkLBzBYSJPRENKDaA1iBPQz+jZUV+OoM9nJ +sr9sMfmHaqr3nlWxAMM99b9/usVfYyUxqyi+YL2Z3ZSxjX2dpyhwMtPpIQkL1pMW +Iv55XBIcYRyl2NjcADS9B06G+nnix6OCAzcwggMzMAwGA1UdEwEB/wQCMAAwHQYD +VR0OBBYEFP+37ywf2YJJ/4CEVy1GY4ioGm1yMB8GA1UdIwQYMBaAFMaQjAKD113j +vjucLtVlfSoQYO7lMG4GCCsGAQUFBwEBBGIwYDAnBggrBgEFBQcwAYYbaHR0cDov +L29jc3AuYWZmaXJtdHJ1c3QuY29tMDUGCCsGAQUFBzAChilodHRwOi8vYWlhLmFm +ZmlybXRydXN0LmNvbS9hZnRldmVjMWNhLmNydDA+BgNVHR8ENzA1MDOgMaAvhi1o +dHRwOi8vY3JsLmFmZmlybXRydXN0LmNvbS9jcmwvYWZ0ZXZlYzFjYS5jcmwwKgYD +VR0RBCMwIYIfdmFsaWRwcmVtaXVtZWNjLmFmZmlybXRydXN0LmNvbTAOBgNVHQ8B +Af8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMFYGA1UdIARP +ME0wBwYFZ4EMAQEwQgYKKwYBBAGCjwkCBDA0MDIGCCsGAQUFBwIBFiZodHRwczov +L3d3dy5hZmZpcm10cnVzdC5jb20vcmVwb3NpdG9yeTCCAX4GCisGAQQB1nkCBAIE +ggFuBIIBagFoAHUA5tIxY0B3jMEQQQbXcbnOwdJA9paEhvu6hzId/R43jlAAAAGQ +YNN5tQAABAMARjBEAiAnainEoBGI9czVh+c9QLPL30S3Rtov8zrnhlXfeKLzZQIg +UGkntBMux0MqHt9Aj60qMsS/C4ZWF7AihVVaUKcrEVgAdgAN4fIwK9MNwUBiEgnq +VS78R3R8sdfpMO8OQh60fk6qNAAAAZBg03m1AAAEAwBHMEUCIGI9kBByoozH4cfS +ECW/O2N/ElkdATkt7EwQ52kcc4ICAiEA9QTh8JlJTb/ytYC1ECX0vQbrYVexg+fu +dw7dfToF9nAAdwAS8U40vVNyTIQGGcOPP3oT+Oe1YoeInG0wBYTr5YYmOgAAAZBg +03ndAAAEAwBIMEYCIQCox5nSCcVB2AfNYXco77zsJnYP7KAU2I4VA2GNL7I4wQIh +AP6WEzyfBoGpYYqFmNnJUavyhKBmeNiR7eNtaFwpSc+UMAoGCCqGSM49BAMDA2gA +MGUCMAGSNMXAAKDRk0ZOtydN95Rkja97+70TatCIIxEAsJD8Hu7lfj2LHCYFQjVY +oaWTrQIxAKUudx7E/JnjsthuL6sNqKVHfD3iLUJyQNK9wE0SVt1xAm7Cu1JXZORE +M64KMKoQFQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDXDCCAuKgAwIBAgIQAgKlhME0Bk3J8y0gfqNymDAKBggqhkjOPQQDAzBFMQsw +CQYDVQQGEwJVUzEUMBIGA1UECgwLQWZmaXJtVHJ1c3QxIDAeBgNVBAMMF0FmZmly +bVRydXN0IFByZW1pdW0gRUNDMB4XDTE5MDMyMTIwNTUwN1oXDTMwMTIwMjA0MDAw +MFowgYUxCzAJBgNVBAYTAkNBMRQwEgYDVQQKEwtBZmZpcm1UcnVzdDErMCkGA1UE +CxMiU2VlIHd3dy5hZmZpcm10cnVzdC5jb20vcmVwb3NpdG9yeTEzMDEGA1UEAxMq +QWZmaXJtVHJ1c3QgRXh0ZW5kZWQgVmFsaWRhdGlvbiBDQSAtIEVWRUMxMHYwEAYH +KoZIzj0CAQYFK4EEACIDYgAEu9f5NkumdaVlmaNaxpDB+rBk/S6lhqcUU1zTLcRz +4G0dr4290hezjrvZJxGJ/X15aexpdD2V9cwaPD/yuEJcaaz+rg/qDoqQF3+AFqVc +41jw1E0S59+57XVKLtXI7Xh6o4IBVDCCAVAwNwYIKwYBBQUHAQEEKzApMCcGCCsG +AQUFBzABhhtodHRwOi8vb2NzcC5hZmZpcm10cnVzdC5jb20wHQYDVR0OBBYEFMaQ +jAKD113jvjucLtVlfSoQYO7lMBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgw +FoAUmq8pesARNTUmUTAAw2r+QNWu1jwwRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYI +KwYBBQUHAgEWJmh0dHBzOi8vd3d3LmFmZmlybXRydXN0LmNvbS9yZXBvc2l0b3J5 +MEkGA1UdHwRCMEAwPqA8oDqGOGh0dHA6Ly9jcmwuYWZmaXJtdHJ1c3QuY29tL2Ny +bC9BZmZpcm1UcnVzdFByZW1pdW1FQ0MuY3JsMA4GA1UdDwEB/wQEAwIBhjAdBgNV +HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCgYIKoZIzj0EAwMDaAAwZQIwHJ5g +a6sHvQ51DGr0bWq34awuwlWbybC2grHoNp5uYapcXr/qTJusb/6n+dczqFdaAjEA +7VQY06fE9ifMnTgT9824jc3+H6kfhMk4PoIj9ouWdYfc1DyTBS/low9Hb8liQyFr +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,76 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 946069240 (0x3863def8) + Signature Algorithm: sha1WithRSAEncryption + Issuer: O=Entrust.net, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Certification Authority (2048) + Validity + Not Before: Dec 24 17:50:51 1999 GMT + Not After : Jul 24 14:15:12 2029 GMT + +-----BEGIN CERTIFICATE----- +MIIGiDCCBXCgAwIBAgIQS5P8oVcgTBT74PnIwDQivjANBgkqhkiG9w0BAQsFADCB +ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT +H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy +MDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG +A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSzAeFw0y +MzEwMDIxOTE4MTBaFw0yNDExMDIxOTE4MDlaMGkxCzAJBgNVBAYTAkNBMRAwDgYD +VQQIEwdPbnRhcmlvMQ8wDQYDVQQHEwZPdHRhd2ExGDAWBgNVBAoTD0VudHJ1c3Qg +TGltaXRlZDEdMBsGA1UEAxMUMjA0OHRlc3QuZW50cnVzdC5uZXQwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgkrsKoDEHyJjll/fu7mjvtbookb50rzTI +i+jQzvtL8AJOcCfxJL1cVriufc/zRYdSQeRJxkbUb+SqIJkec+27onPpY3xOjJAK +bWdmac1Iv9JPXYMpKJXnOGrooeXEtCcKSKphx4VhHnLA67BGfSNfHLm4JwghX4jY +VpZ8P89gmh8l1eLRP+b3y7OzEkFliwmErALSD8i/bkzE+GxYMnpg/HI2Iw1lakxE +wZOg0ydgl7jHWZUDdnxhAvLS/hfzPVhi9ZwgoXQJiUXUp0JJo6QgVOIC5IztpdZa +3HW1VK7a0eTLhmdFRx39ARn/GbbIyoIqUzLOhAa2cbsGIJjtXjhrAgMBAAGjggLY +MIIC1DAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRHn0CebGnHRqTZTeTYCbPHhiVB +MzAfBgNVHSMEGDAWgBSConB03bxTP8971PfNf6dgxgpMvzBoBggrBgEFBQcBAQRc +MFowIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDMGCCsGAQUF +BzAChidodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wxay1jaGFpbjI1Ni5jZXIwMwYD +VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFrLmNy +bDAfBgNVHREEGDAWghQyMDQ4dGVzdC5lbnRydXN0Lm5ldDAOBgNVHQ8BAf8EBAMC +BaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBMGA1UdIAQMMAowCAYG +Z4EMAQICMIIBfgYKKwYBBAHWeQIEAgSCAW4EggFqAWgAdwA/F0tP1yJHWJQdZRyE +vg0S7ZA3fx+FauvBvyiF7PhkbgAAAYrx05lbAAAEAwBIMEYCIQDbMXKdzSr90jM+ +TekjpqVTEBDDvub7+AEx/kQYzf9gugIhAKPCjJmIh1NZrKkwK8MsOEL4jkN6FJ/h +4kiiJoze3fB/AHYAdv+IPwq2+5VRwmHM9Ye6NLSkzbsp3GhCCp/mZ0xaOnQAAAGK +8dOZVAAABAMARzBFAiAW11p7sV2byjrpk6AMQrMGwV2CuT3AKNuQVyxva7XQPAIh +AP1P7DfYsZ1aR12Tkg2x2BYjFrlsJCl36n5I/565xQk4AHUA2ra/az+1tiKfm8K7 +XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGK8dOZnwAABAMARjBEAiA43NURCcnHNpkH +XggwpVY9QYNIEAjpHEcPmyXJuQ9y8QIgPqx0MnlKXLuJVReuI5Hzc3iFtcYo070d +UYWH2AuVaFwwDQYJKoZIhvcNAQELBQADggEBAIZoSHApNF6DNYvGKHZJX411QkA0 +5zkq3dcm95BFomaqroEp1QeUeQ8e6xofUs84CURzopE9P81JBHX2Qzb/VeBzZOKy +dekaoz4NGW5ZvpMh7HXXaUpHKU/xZ5uUHVSatBU+cnidPhgn1czntqOwjzsgEZNW +/wbPEjqvIrZvAW4DPak/MSwlENys4ty5gX4453S5gwd18b+NFBq44O/FofR8bvWU +3lJ3VcVeONDzTcXPv+Yd1SlyO1/eXdWlFqloYFjkpcQ4wSLbOEeiWWITkZ0xCAxQ +j8uWuDOSyFQLpaPJvEuG1dlho7RZdor0flUIxYfqg2Nr4Svq1ezskwrdQm0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFKjCCBBKgAwIBAgIQLgRRzl0kJMcrXWV2cWUG2DANBgkqhkiG9w0BAQsFADCB +tDEUMBIGA1UEChMLRW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5l +dC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNV +BAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1 +c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw0yMjExMjUy +MTE5NDNaFw0yOTA3MjMwMDAwMDBaMIG6MQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +RW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5ldC9sZWdh +bC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMTIgRW50cnVzdCwgSW5jLiAtIGZvciBh +dXRob3JpemVkIHVzZSBvbmx5MS4wLAYDVQQDEyVFbnRydXN0IENlcnRpZmljYXRp +b24gQXV0aG9yaXR5IC0gTDFLMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA2j+W0E25L0Tn2zlem1DuXKVh2kFnUwmqAJqOV38pa9vH4SEkqjrQjUcj0u1y +FvCRIdJdt7hLqIOPt5EyaM/OJZMssn2XyP7BtBe6CZ4DkJN7fEmDImiKm95HwzGY +ei59QAvS7z7Tsoyqj0ip/wDoKVgG97aTWpRzJiatWA7lQrjV6nN5ZGhTJbiEz5R6 +rgZFDKNrTdDGvuoYpDbwkrK6HIiPOlJ/915tgxyd8B/lw9bdpXiSPbBtLOrJz5RB +GXFEaLpHPATpXbo+8DX3Fbae8i4VHj9HyMg4p3NFXU2wO7GOFyk36t0FASK7lDYq +jVs1/lMZLwhGwSqzGmIdTivZGwIDAQABo4IBLjCCASowEgYDVR0TAQH/BAgwBgEB +/wIBADAdBgNVHQ4EFgQUgqJwdN28Uz/Pe9T3zX+nYMYKTL8wHwYDVR0jBBgwFoAU +VeSB0RGAvtiJuQijMfmhJAkWuXAwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzAB +hhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAyBgNVHR8EKzApMCegJaAjhiFodHRw +Oi8vY3JsLmVudHJ1c3QubmV0LzIwNDhjYS5jcmwwDgYDVR0PAQH/BAQDAgEGMB0G +A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA8BgNVHSAENTAzMDEGBFUdIAAw +KTAnBggrBgEFBQcCARYbaHR0cHM6Ly93d3cuZW50cnVzdC5uZXQvcnBhMA0GCSqG +SIb3DQEBCwUAA4IBAQAuAlHLO8CoKt2a4I23UDkKc7kQI3nUkWqq2RxRh8a/4TEF +C9WSF03EHVBW9JZZcrZ3ZdTDRsNF8vSqmCABz1FLu6vw3D3bEXELonAYlkmeFFV7 +1hiW9AdyMJD92XsXiU0Yr9J76Tk4iknMTTHiZXdZOcPMOXlMwPy++HS5tTIyqO0d +zl1PS8tlCcZrKaNNKbmiIWPhmBUSog9IQt2VKpoAIP8tlvRt5tHf5qW5m7vp7qmG +HF2ou54+qQIXO6jIP8CQ4xWvj0aiLklTNMkvXesaVq0xzNgRkx9ZzhREfbuM6eWc +GQHwG7m+JmfL+u1dCAZhh4Uyn5oLU9gogFM6v4jX +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,79 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 1164660820 (0x456b5054) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, O=Entrust, Inc., OU=www.entrust.net/CPS is incorporated by reference, OU=(c) 2006 Entrust, Inc., CN=Entrust Root Certification Authority + Validity + Not Before: Nov 27 20:23:42 2006 GMT + Not After : Nov 27 20:53:42 2026 GMT + +-----BEGIN CERTIFICATE----- +MIIHEjCCBfqgAwIBAgIQFhH4VGskTR+tQK3JbN63kTANBgkqhkiG9w0BAQsFADCB +sTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsT +MHd3dy5lbnRydXN0Lm5ldC9ycGEgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5j +ZTEfMB0GA1UECxMWKGMpIDIwMDkgRW50cnVzdCwgSW5jLjEuMCwGA1UEAxMlRW50 +cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxRTAeFw0yNDA2MjgyMTQw +NDVaFw0yNTA3MjgyMTQwNDRaMIHIMQswCQYDVQQGEwJDQTEQMA4GA1UECBMHT250 +YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMTAkNBMRgwFgYL +KwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3QgTGltaXRlZDEd +MBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzE5MTM2MDUx +HDAaBgNVBAMTE3ZhbGlkZXYuZW50cnVzdC5uZXQwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQDL2vkrBEZ5qeVdac1C01bcNnoeCU3AVU3Fh1Ifldic9/Gw +xqNVOFYQNzTk8M62FnPUvas4MnXmeBkPhhym+dnjsM22EeS2p6gTlvOGtJFVr+Ix +vq1UAKtqK0gYGriW6SexroSYiG1O0aeqEnKSLlEBHYhmacj2jlbx0ToxMfdBMRRq +4UjnIrh/CBochxt7aKv525tChnZGMT06QKAjx71w2cou0C05v83KJ75EI4EAmTfE +z9sKJeST5pH5MI3WKcP6ZmXynKYSIpIGb4Z8B9Ftp8HdzdR9EafOSlRlbIkEn3lm +nq4UCph48/PsUcJoViBCoY6zDLcPGt3gGQVIjq3vAgMBAAGjggMLMIIDBzAMBgNV +HRMBAf8EAjAAMB0GA1UdDgQWBBRF6MZkqXf3sICXuvbrBH1R9I8bAjAfBgNVHSME +GDAWgBRbQYqyxEPBvb/IVEFVneCWrf+5oTBlBggrBgEFBQcBAQRZMFcwIwYIKwYB +BQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDAGCCsGAQUFBzAChiRodHRw +Oi8vYWlhLmVudHJ1c3QubmV0L2wxZS1jaGFpbi5jZXIwMwYDVR0fBCwwKjAooCag +JIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFlLmNybDAeBgNVHREEFzAV +ghN2YWxpZGV2LmVudHJ1c3QubmV0MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAU +BggrBgEFBQcDAQYIKwYBBQUHAwIwSwYDVR0gBEQwQjAHBgVngQwBATA3BgpghkgB +hvpsCgECMCkwJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3LmVudHJ1c3QubmV0L3Jw +YTCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAEvFONL1TckyEBhnDjz96E/jn +tWKHiJxtMAWE6+WGJjoAAAGQYMsp8gAABAMARjBEAiAL794Fw7wyzricvRl+2AON +FbGf2hwDB3wh8RkGLBRQ7AIgTCarii0atho7ZeUO3h66Ug7s7WxnF9onDZrtoMrH +U9MAdQAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBgyyoMAAAE +AwBGMEQCIFaXc4M9C9mNukrV68Sc2E5lw9srQ80nMBCGseY99nFxAiAppQmR9FKC +TE/ROlgZRfimx61W4k+SaQ52eek4JNWXXwB3ABoE/0nQVB1Ar/agw7/x2MRnL07s +7iNAaJhrF0Au3Il9AAABkGDLKi0AAAQDAEgwRgIhAPFUevU47H5uJqYL5y1ClFS7 +mEve7E8350JKnR1VykGLAiEArn7VAJcmRNNCDAegsHCCLlpasz9PLHFd9XHQAwvL +IFwwDQYJKoZIhvcNAQELBQADggEBAHfMCQP5Y+7IYzqOh5D/81WqHagmWOqkJYsN +33uux44fhVGqiG1O5ImTQsxJpt/HmDuK1qLEjG31Y9q89U91KAqLQauCQ5iMXrBg +TlwK8kzO1XYC5KkpO5ZWanqfjOahM9mkEKHPV9srwj6xTbInCq9DabRwuWyohj3b +EKrmB016TOT0hJ94jCb8PWl15oQJdsGlEfrG7amtDSRuoDHVA3nXJIJqx5LVnErB +glfsAmP8TPkWYY8kuNE2Rjr2M6P5LRLEvtRELCQF3lPuY0+xxGksGVM207YqhYKv +GzMmA8c7tF3ZclbE0rUA2T8FuBuweAV8tnWq2TaeAHWIJ4nY17s= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFHjCCBAagAwIBAgIRAIZmsCrBy1RAAAAAAFHTWJwwDQYJKoZIhvcNAQELBQAw +gbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkwNwYDVQQL +EzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVu +dHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xOTA2MTkxNjUy +MDhaFw0yNjExMTkxNzIyMDhaMIGxMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNRW50 +cnVzdCwgSW5jLjE5MDcGA1UECxMwd3d3LmVudHJ1c3QubmV0L3JwYSBpcyBpbmNv +cnBvcmF0ZWQgYnkgcmVmZXJlbmNlMR8wHQYDVQQLExYoYykgMjAwOSBFbnRydXN0 +LCBJbmMuMS4wLAYDVQQDEyVFbnRydXN0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gTDFFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtlsEVHfdDiRm +3Cqh24DMXcdf/VIWWNpflAapuLa5YwxHIILsx5VOi7h3Umo9tYep1uHMdOWmyMDU +Vk+NLtYIPgxMQz7wQZNeRu8559llKgx2UCe9Ww0zMwfg96KpnOERM61m/NIseqqj +cxa+k4V1D9c3jPojt2T440xu7bMFveI223zedkTagnJ2tm7/lKHQhvcQzUpai7B1 +jGZSgE5ITEmDpkDXd4ETTV5yfkhGIqoP4j5llDjhcnH+SnEJujV/VYk9gdW4KAEQ +dzZaEIXSvWCEK0lhlAzeTEBqKsR5YIQkgjJpSphL4lYQugNFUSDTz9qOVBtFtnq6 +l5pa2MbRXwIDAQABo4IBLjCCASowDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG +CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMDMGCCsGAQUF +BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD +VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9yb290Y2ExLmNy +bDA7BgNVHSAENDAyMDAGBFUdIAAwKDAmBggrBgEFBQcCARYaaHR0cDovL3d3dy5l +bnRydXN0Lm5ldC9ycGEwHQYDVR0OBBYEFFtBirLEQ8G9v8hUQVWd4Jat/7mhMB8G +A1UdIwQYMBaAFGiQ5GekplOAx4ZmpPH3S0P7hL1tMA0GCSqGSIb3DQEBCwUAA4IB +AQAPUNBX97sqIXZl/zLu53iv7a0HK7prvD0cVaZM0yRfVptvARgjIZZzTtv32v6X +wSr4fDeRmpLaTWtipBGSqh3fNkTSVT8GGBq6+h1lrPEYv6jnStDf7VLQxVliKt2w +h34JjgRUx9rdia30tk/EpPavkxxPks8vjoLN3f4dbkIY/sfljyZbseqVLx9kl/we +OvqL6jZgaQOapFQLZJze7VwLiPVuUnW8ddK3JIE1a5YCZs0irIW5+96ttznIgPK2 +aUOmHQp/zasi7SFl49HrKGKWtZuyDB9U56e01H6PDTpSSSTPyLsSVg3JALHBPDzS +bBraAU3wuAyc3BQ4OIOmwwnT +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,66 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: + a6:8b:79:29:00:00:00:00:50:d0:91:f9 + Signature Algorithm: ecdsa-with-SHA384 + Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2012 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - EC1 + Validity + Not Before: Dec 18 15:25:36 2012 GMT + Not After : Dec 18 15:55:36 2037 GMT + +-----BEGIN CERTIFICATE----- +MIIFzDCCBVOgAwIBAgIQcbNJ8XJLeT3fV8DU3QNYSDAKBggqhkjOPQQDAzCBujEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl +ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2 +IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UE +AxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSjAeFw0yNDA2 +MjgyMTM5MzVaFw0yNTA3MjgyMTM5MzRaMIHLMQswCQYDVQQGEwJDQTEQMA4GA1UE +CBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMTAkNB +MRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3QgTGlt +aXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUTCjEw +MDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZWMuZW50cnVzdC5uZXQwdjAQBgcqhkjO +PQIBBgUrgQQAIgNiAAS90ZyZ86Gl5Fh1qJ/70UwyQWATu3igiQLeVVvZ4G79SBEG +Xc4TcAn0LzBhfJonAzWFkAS860ARjvFHgUj0otyT+Q2/zC9c8CjOsL3bYp3SNUbC +FWBhIV0vhGGY8NafeXCjggMJMIIDBTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTP +DXJE/iZfi5wUSAo4GN4thBCCHDAfBgNVHSMEGDAWgBTD+UUDvsj5CzxFNfPrcuzn +6OuUmzBjBggrBgEFBQcBAQRXMFUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVu +dHJ1c3QubmV0MC4GCCsGAQUFBzAChiJodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wx +ai1lYzEuY2VyMDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5u +ZXQvbGV2ZWwxai5jcmwwHgYDVR0RBBcwFYITdmFsaWRlYy5lbnRydXN0Lm5ldDAO +BgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMEsG +A1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjApMCcGCCsGAQUFBwIBFhto +dHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF9BgorBgEEAdZ5AgQCBIIBbQSC +AWkBZwB1AA3h8jAr0w3BQGISCepVLvxHdHyx1+kw7w5CHrR+Tqo0AAABkGDKGokA +AAQDAEYwRAIgZwtzml8YzKjqeP86zX+88q8sHOt//2Qmahr2tk97ozUCIFCOM2nF +s1GJVBjKQZEH8QqkivVp+Cai9pC/57TiOmCOAHUAzPsPaoVxCWX+lZtTzumyfCLp +hVwNl422qX5UwP5MDbAAAAGQYMoamAAABAMARjBEAiEA37X8EgQAUzLxn/Ny1Yx3 +uszQF5D85m8vZ0otf8nHzuwCH168zpAxzKS71Fz6CgmDS0QZOfBSYFBD+Pdcm6e1 +ilkAdwAS8U40vVNyTIQGGcOPP3oT+Oe1YoeInG0wBYTr5YYmOgAAAZBgyhq6AAAE +AwBIMEYCIQCljVuYzRe6oQTZPdx0tGhIQSOwM1JbxoMJu2cW+gEGLAIhAMSSJoni +0KT3KavwtsSWuuHsWjt8atv6TpJtLmVxCIdlMAoGCCqGSM49BAMDA2cAMGQCMBPY +1dn1Js8F9b08aVCZ3vqDGFTKuzTXaxArf/y/WhLtcHdZPLaYVifQcAKzp1WCFQIw +MvpE6RDccmnZi5TX88p16s8ev/qkegpbf7Xuw1JQEfy2NRwrXc+NwA422EjXBTti +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID5zCCA2ygAwIBAgIQCoPUgD5+n1EAAAAAUdTB9zAKBggqhkjOPQQDAzCBvzEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl +ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEy +IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UE +AxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4X +DTE2MDQwNTIwMTk1NFoXDTM3MTAwNTIwNDk1NFowgboxCzAJBgNVBAYTAlVTMRYw +FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu +bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNiBFbnRydXN0LCBJbmMu +IC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3QgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowdjAQBgcqhkjOPQIBBgUrgQQAIgNi +AAT14eFXmpQX/dEf7NAxrMH13n0btz1KKvH2S1rROGPAKex2CY8yxznbffK/MbCk +F7ByYXGs1+8kL5xmTysU/c+YmjOZx2mMSAk2DPw30fijJ3tRrwChZ+TBpgtB6+A5 +MsCjggEuMIIBKjAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAz +BggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3Qu +bmV0MDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvZWMx +cm9vdC5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6 +Ly93d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF +BQcDAjAdBgNVHQ4EFgQUw/lFA77I+Qs8RTXz63Ls5+jrlJswHwYDVR0jBBgwFoAU +t2PnGt2N6QimVYOk4GpQQWURQkkwCgYIKoZIzj0EAwMDaQAwZgIxAPnVAOqxKDd7 +v37EBmpPqWCCWBFPKW6HpRx3GUWc9caeQIw8rO2HXYgf92pb/TsJYAIxAJhI0MpR +z5L42xF1R9UIPfQxCMwgsnWBqIqcfMrMO+2DxQy6GIP3cFFj9gRyxguKWw== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,80 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: 1246989352 (0x4a538c28) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2009 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - G2 + Validity + Not Before: Jul 7 17:25:54 2009 GMT + Not After : Dec 7 17:55:54 2030 GMT + +-----BEGIN CERTIFICATE----- +MIIHOzCCBiOgAwIBAgIQWFfRPoYcAxEc+S0tOlD+ljANBgkqhkiG9w0BAQsFADCB +ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT +H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy +MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG +A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTTAeFw0y +NDA2MjgyMTQyMTRaFw0yNTA3MjgyMTQyMTNaMIHLMQswCQYDVQQGEwJDQTEQMA4G +A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT +AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3Qg +TGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUT +CjEwMDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZzIuZW50cnVzdC5uZXQwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCZ66eWZS5ytmbHJeHcA9WfnpbGFC04 +Tov7L0NWiStVRPEFrXrGSn6RPriGci6RwrCz5yn47EWjk2AjSD4e5lySDKHwTg+0 +S9pl3lcSd8tQOTbTwVM0EfOxdUlO4IY0jCOSM8rnZUc1JvEIIrXWXWF9AWoDb4BQ +erTefRm/YykFC558PEzn84vU9KoEmDwIP4upWKVutuzBpHWhZW3q9wagg62KifHN +1yaagv4PUGgdkrVkyA1ZO3D7b2RpQjBreOTk+tsTnWtbAkFGtRBOA/2QrEvyqMU7 +eCnpFZMIaj2tKeSLqhIWxzOnrAGUJNp5wLYmVnnhPhHEv1g79pNsZLR3AgMBAAGj +ggMoMIIDJDAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRt85gfkWUjfTKgrLytMp8o +VvOe3zAfBgNVHSMEGDAWgBTD99C1KjCtrw2RIXA5VN28iXDHOjBoBggrBgEFBQcB +AQRcMFowIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDMGCCsG +AQUFBzAChidodHRwOi8vYWlhLmVudHJ1c3QubmV0L2wxbS1jaGFpbjI1Ni5jZXIw +MwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFt +LmNybDA3BgNVHREEMDAughN2YWxpZGcyLmVudHJ1c3QubmV0ghd3d3cudmFsaWRn +Mi5lbnRydXN0Lm5ldDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUH +AwEGCCsGAQUFBwMCMEsGA1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjAp +MCcGCCsGAQUFBwIBFhtodHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF+Bgor +BgEEAdZ5AgQCBIIBbgSCAWoBaAB3ABLxTjS9U3JMhAYZw48/ehP457Vih4icbTAF +hOvlhiY6AAABkGDMhQQAAAQDAEgwRgIhAMzddgbnWlodtosz6EMh2Y89n0JR4eMO +v+W6tUp2gVwYAiEA6UKa2eFlX0KdzuZCvTlPgi8DeK3ZI2wffyV2bYMXtsIAdgAN +4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAAAZBgzIURAAAEAwBHMEUC +IQDmVH2NlaV2/Y3OaPMXhH+BT63zA+Bh/5aCfPiYrJ7K2AIgRADPHzpwS7bfvVZI +k8QxUBSCDXFmZQOrpamBaEko6YIAdQDM+w9qhXEJZf6Vm1PO6bJ8IumFXA2Xjbap +flTA/kwNsAAAAZBgzIUGAAAEAwBGMEQCIA1CHfNw7cCcJSb3s7ik9Wflf3irqE9G +QKxZ+Y9BOIx0AiA6CMvw7OHjG519E1tZgr/HFRXzxKchBp80dfsaEKxY9zANBgkq +hkiG9w0BAQsFAAOCAQEAqvn1CTObiV5zKVY6NWjGK49Wqsr9t1ok/h/yfKRmr36O +UZkMTPANj0uhwM4gtieTze9hnNzEkx1ec6G40JyABRiSX+0dtq3n8wiW3d8G1Qj5 +/s8yZ13/ATrdjjr1mlGOvh0sgWTTPaQpl8ijXTy40GYpZIUXXBK09Rm6W0siq+7m +OHNpJR4APWOBBU4QwiWrHHsFq4KvwxiTjNWWizCOnZwVi3awNBoDD/Iwszn+trOA +8U/1SsHGuPBWKajcGorwi2zQ99JxAwJJ8XNBCekynjbPZYx52KkqfR07Fd2Occbl +3lh3wXrepzzU1a6vdyiQpagX8btyIqQpAzytypzaLQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFLTCCBBWgAwIBAgIMYaHn0gAAAABR02amMA0GCSqGSIb3DQEBCwUAMIG+MQsw +CQYDVQQGEwJVUzEWMBQGA1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2Vl +IHd3dy5lbnRydXN0Lm5ldC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMDkg +RW50cnVzdCwgSW5jLiAtIGZvciBhdXRob3JpemVkIHVzZSBvbmx5MTIwMAYDVQQD +EylFbnRydXN0IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjAeFw0x +NDEyMTUxNTI1MDNaFw0zMDEwMTUxNTU1MDNaMIG6MQswCQYDVQQGEwJVUzEWMBQG +A1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5l +dC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMTQgRW50cnVzdCwgSW5jLiAt +IGZvciBhdXRob3JpemVkIHVzZSBvbmx5MS4wLAYDVQQDEyVFbnRydXN0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gTDFNMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEA0IHBOSPCsdHs91fdVSQ2kSAiSPf8ylIKsKs/M7WwhAf23056sPuY +Ij0BrFb7cW2y7rmgD1J3q5iTvjOK64dex6qwymmPQwhqPyK/MzlG1ZTy4kwFItln +gJHxBEoOm3yiydJs/TwJhL39axSagR3nioPvYRZ1R5gTOw2QFpi/iuInMlOZmcP7 +lhw192LtjL1JcdJDQ6Gh4yEqI3CodT2ybEYGYW8YZ+QpfrI8wcVfCR5uRE7sIZlY +FUj0VUgqtzS0BeN8SYwAWN46lsw53GEzVc4qLj/RmWLoquY0djGqr3kplnjLgRSv +adr7BLlZg0SqCU+01CwBnZuUMWstoc/B5QIDAQABo4IBKzCCAScwDgYDVR0PAQH/ +BAQDAgEGMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATASBgNVHRMBAf8E +CDAGAQH/AgEAMDMGCCsGAQUFBwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29j +c3AuZW50cnVzdC5uZXQwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL2NybC5lbnRy +dXN0Lm5ldC9nMmNhLmNybDA7BgNVHSAENDAyMDAGBFUdIAAwKDAmBggrBgEFBQcC +ARYaaHR0cDovL3d3dy5lbnRydXN0Lm5ldC9ycGEwHQYDVR0OBBYEFMP30LUqMK2v +DZEhcDlU3byJcMc6MB8GA1UdIwQYMBaAFGpyJnrQHu995ztpUdRsjZ+QEmarMA0G +CSqGSIb3DQEBCwUAA4IBAQC0h8eEIhopwKR47PVPG7SEl2937tTPWa+oQ5YvHVje +pvMVWy7ZQ5xMQrkXFxGttLFBx2YMIoYFp7Qi+8VoaIqIMthx1hGOjlJ+Qgld2dnA +DizvRGsf2yS89byxqsGK5Wbb0CTz34mmi/5e0FC6m3UAyQhKS3Q/WFOv9rihbISY +Jnz8/DVRZZgeO2x28JkPxLkJ1YXYJKd/KsLak0tkuHB8VCnTglTVz6WUwzOeTTRn +4Dh2ZgCN0C/GqwmqcvrOLzWJ/MDtBgO334wlV/H77yiI2YIowAQPlIFpI+CRKMVe +1QzX1CA778n4wI+nQc1XRG5sZ2L+hN/nYNjvv9QiHg3n +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,92 @@ +Root Certificate: + Version: 3 (0x2) + Serial Number: + d9:b5:43:7f:af:a9:39:0f:00:00:00:00:55:65:ad:58 + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2015 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - G4 + Validity + Not Before: May 27 11:11:16 2015 GMT + Not After : Dec 27 11:41:16 2037 GMT + +-----BEGIN CERTIFICATE----- +MIIIIzCCBwugAwIBAgIQDD4I8FgD7+DVcBLMBwa39jANBgkqhkiG9w0BAQsFADCB +ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT +H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy +MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG +A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y +NDA2MjgyMTQzNTRaFw0yNTA3MjgyMTQzNTNaMIHLMQswCQYDVQQGEwJDQTEQMA4G +A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT +AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xGDAWBgNVBAoTD0VudHJ1c3Qg +TGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzARBgNVBAUT +CjEwMDA0OTI4NzkxHDAaBgNVBAMTE3ZhbGlkZzQuZW50cnVzdC5uZXQwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCfUHGdeme0jraIiUzPYtuX1G9rlCU1 +eKDqDbsgp7VIS7rI/VgbsS7oKnE6KHP+qGrXRhYdvFLFDa+REY6fVOWkLuTXhVLb +5C7ym2pi0OUMKvrGtDLUxlHiEAmkmjPDl6TLMTDrLgWOLFMRzyeTcxnZtMrxUnAf +yzSPlqm1bkN/oRp2EOiXvuSbci8UA0QswV6g8EUbRB0qyv6OophoaQYo/+KRwTJT +k6S8YDsEJnlDb8tjEhfIUjp2Md5ThBxf5Ib29aXebZ5HFh2x5VPrzOwDUPk0fVNM +pWFfiX79RW6w5Vei5qtretLohbw6b5aJmaJ1LweAEkIlhy5eUuuG6v8Efm8JSAle +eKMtflTigmayaWMVCd2GeB6LajcflAw7BUU2brRMJwMpaeXXhL/mVpjbev/5TtVD ++H9IlW3PMyQnUJc0YuUVmdi1eOM5qoQaQE4BDPHz2G41eDgT8J9Gb1FX5mT+9l2I +iJD47pwcBIw5tHCn2nuz1+8CDuYpfH2+t2LPFHVI15h1scGotZvzUJ5TzPdQqZI7 +K2LTL49Zs2HsObrGr07Vj28WyzkjIfTrVSV/29hgz1zVjUa0uyTeOzrc3VIg7NTv +RoMTTYuUeUoMSmFQ8z9CSGh7cxFlrhGjFO+66++JFNwakAEp7kS5c2qTLaapY9dM +8UMIr5951z994QIDAQABo4IDEDCCAwwwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU +/EjjpmMa/SepMqPlglXS5AbGcScwHwYDVR0jBBgwFoAU7kfRhXHx/S23P7s+Y1h3 +F0lADpUwaAYIKwYBBQUHAQEEXDBaMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5l +bnRydXN0Lm5ldDAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5lbnRydXN0Lm5ldC9s +MW4tY2hhaW4yNTYuY2VyMDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50 +cnVzdC5uZXQvbGV2ZWwxbi5jcmwwHgYDVR0RBBcwFYITdmFsaWRnNC5lbnRydXN0 +Lm5ldDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF +BwMBMEsGA1UdIAREMEIwBwYFZ4EMAQEwNwYKYIZIAYb6bAoBAjApMCcGCCsGAQUF +BwIBFhtodHRwczovL3d3dy5lbnRydXN0Lm5ldC9ycGEwggF/BgorBgEEAdZ5AgQC +BIIBbwSCAWsBaQB2ABLxTjS9U3JMhAYZw48/ehP457Vih4icbTAFhOvlhiY6AAAB +kGDOC9YAAAQDAEcwRQIgWhFWhf2sBQ3ufMH0yubwLDt+3f/b5rScs09o1YEjg6MC +IQDpkgEMWBAM+NV2aCnC8QH+RH6xBqhPPt6JZTm3W+vHkwB3ABoE/0nQVB1Ar/ag +w7/x2MRnL07s7iNAaJhrF0Au3Il9AAABkGDODBQAAAQDAEgwRgIhAOgp+oas+jBr +9wOBo0QDdVQGmP8KJupfRf/MDKO+kSRjAiEA9JnEHTbFHre2TS9habVJA/3jM/t5 +CKtixwQqdpLXQUAAdgAN4fIwK9MNwUBiEgnqVS78R3R8sdfpMO8OQh60fk6qNAAA +AZBgzgwVAAAEAwBHMEUCIBOYI8rl87VepcPQlaGh6AbKhKw1UlbxIf7etR/d2M47 +AiEAkFXOVvzkP6kX/z1yRneYn0mlPbDvAFLsSDghl/gkdtYwDQYJKoZIhvcNAQEL +BQADggEBAJovgoheNHFBUpnodfOiKtpRo8AE6dLuOX1H2uRHiDg0Gza0/w95KkEE +BqjKmJIbJrs2TQJnkM0LjaubHn1TP4XC40qieMXB4ylJzC5FWDZBqMHZmLTvVY01 +irBMyub0On8d1BlEquD2r3KHQFnyUvi/uxzbNJOVbNJYglKhTI+UfcXk7zpHmNG+ ++SbBkpJkuqQ9ujG1K25FRa/01j1p4ZlDrJ3KCT7fDEf10TN0u5VX6moVT9cRVR2U +gX16BV8m/hoJVTD0fBCKIKjtklS//b+Jr49uxWFulrDwlRKyDWmBXLnqsZvpCobi +deDsWiUkcvd+DjNgpDTEHCTrXXjd8tU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGMjCCBBqgAwIBAgIRAKvsd/8bQQwHAAAAAFVl2AUwDQYJKoZIhvcNAQELBQAw +gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL +Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg +MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw +BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0 +MB4XDTE3MTEyMjIwMDQyMFoXDTMwMTIyMjIwMzQyMFowgboxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1 +c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNCBFbnRydXN0LCBJ +bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMU4wggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQDcSG+caYQ4xcvf+dt8bgCEHorO0g5j0H1NOtQzRXgUoG8y +QuRbJX9swyKqQZbsc18YvTV8OKA/uSNE46Jvq47TFPojWWTVLbNDqpM07e4EFYKs +A9NFzAUngijnf3ivnXA6iNPAMXaEhXmhY/YFjk8NoM7Y1PFsA0oj5hamKQ06iO/j +gvBScLmnQ1ju9Qj9IGIg18UL5AJNw0frspLUQBYVrLGaqAy5Nl2BUJKaZ4vnSLvP +nk6YrB15mo1phHae10Ba4fx7R3z8IZ/hby4OXTy/KZpu107VEQPAwTuDK8ZXxB5y +0DSzi4vaw27aLrUsq4aFqUo03gEfC31vWW76TNkFAgMBAAGjggErMIIBJzAOBgNV +HQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHSUEFjAUBggrBgEF +BQcDAQYIKwYBBQUHAwIwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEW +Gmh0dHA6Ly93d3cuZW50cnVzdC5uZXQvcnBhMDMGCCsGAQUFBwEBBCcwJTAjBggr +BgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMAYDVR0fBCkwJzAloCOg +IYYfaHR0cDovL2NybC5lbnRydXN0Lm5ldC9nNGNhLmNybDAdBgNVHQ4EFgQU7kfR +hXHx/S23P7s+Y1h3F0lADpUwHwYDVR0jBBgwFoAUnzjEViPDOeigcWzoVEzk6Dqx +v2cwDQYJKoZIhvcNAQELBQADggIBACMeFFgsWmC7h6D1v8DJUkOpm/m5UhVhO0hb +pQMQKMhKkl744Y9SWG4WNmpQy743TTciEJPZFhc7ke2R6VmK8ZJUqro2awOw1RWZ +OtHla59Btf1NQd41vOVdU+qFhs8lFfXg9sK7YHTrfxHtMXLoGnkkamK3xJgn7sXa +/zUvUDBTpDCXcpO9SyHoKIQswmkIPpRyIdPF4biRdR3N+9MYmlfqN/Nk3OEZ73xZ +AUZP6Gu+f9cEiHTA8NdYHCPLJWyFnIHWK+QuTFEnKYnOYxCeroLBNOO64e8JWZ39 +kZ22BBXhHzqOCCczS7JOJTRF+JgvWuxbFwRstj8qf3fE+JndWmq2FC4hTHtpuK5K +ENuiRm5gdkXfsXmB+qB6y5gaajiTIMscGIcZIKTe2YdKrLoicvEz8k+loM7favik +vzFioTNTDHYGx3mkfElBE7ycY8n+jZE3QBBv33k28MeQi7XNgEaMc4tYwoZIdE9A +xVccXTzEQzka82dOkRB1dU0XZId9XAWv+CtNc2TjF6Wgx2seA/c6H8S0IfgQBIV2 +8iN2wZns2QFdawkdy3hMUqPnA++kuGhLW3GemsIY5dP/WxY8rd+OfLb/Ks9T1pCd +28t7PQRcQsgkYmouzrOW9ASBvYqLLdhl4y+fFXff8RkPIKMNoYP06WJvRKmky9R/ +41/nXRas +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,64 @@ +-----BEGIN CERTIFICATE----- +MIIElDCCBDqgAwIBAgIIWax3IY1ByGIwCgYIKoZIzj0EAwIwYjEcMBoGA1UEAwwT +QXBwbGUgSVNUIENBIDggLSBHMTEgMB4GA1UECwwXQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE5MDEw +ODIxMTAyNFoXDTIwMDgwODIxMjAwMFowga0xTTBLBgNVBAMMRGFjdGl2ZS5nZW90 +cnVzdC1nbG9iYWwtY2EtZzIudGVzdC1wYWdlcy5jZXJ0aWZpY2F0ZW1hbmFnZXIu +YXBwbGUuY29tMSUwIwYDVQQLDBxtYW5hZ2VtZW50OmlkbXMuZ3JvdXAuODY0ODU5 +MRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMQswCQYD +VQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABN4oxNLGzmOIfgFRxDaU +SaOYTQVZCc7a7MXlK1L4/KgN22stgSkrg47aOWviMuzb9Q9hDA/Tn19o9Zr8G5ON +pYijggKMMIICiDAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFMPEpFgFY9eDBrqW +jdyyjzL2u7dBMH4GCCsGAQUFBwEBBHIwcDA0BggrBgEFBQcwAoYoaHR0cDovL2Nl +cnRzLmFwcGxlLmNvbS9hcHBsZWlzdGNhOGcxLmRlcjA4BggrBgEFBQcwAYYsaHR0 +cDovL29jc3AuYXBwbGUuY29tL29jc3AwMy1hcHBsZWlzdGNhOGcxMDEwTwYDVR0R +BEgwRoJEYWN0aXZlLmdlb3RydXN0LWdsb2JhbC1jYS1nMi50ZXN0LXBhZ2VzLmNl +cnRpZmljYXRlbWFuYWdlci5hcHBsZS5jb20wgf4GA1UdIASB9jCB8zCB8AYKKoZI +hvdjZAULBDCB4TCBpAYIKwYBBQUHAgIwgZcMgZRSZWxpYW5jZSBvbiB0aGlzIGNl +cnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgYW55 +IGFwcGxpY2FibGUgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlIGFuZC9vciBj +ZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDgGCCsGAQUFBwICMCwM +Kmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmljYXRlYXV0aG9yaXR5LzAdBgNV +HSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwNwYDVR0fBDAwLjAsoCqgKIYmaHR0 +cDovL2NybC5hcHBsZS5jb20vYXBwbGVpc3RjYThnMS5jcmwwHQYDVR0OBBYEFCQy +hU8U00tcIz6L0MCT6EGVho0EMA4GA1UdDwEB/wQEAwIDiDAKBggqhkjOPQQDAgNI +ADBFAiAl5nGHi2u8V0aJSp4o1i3TlK7ao8WvxwBuHKfuKibSLAIhAN8PZqhESS9u +V7Dr6qzs88yn/1z6oeqPwDsntFpUFtWG +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVDCCAtugAwIBAgIQE1Iuv8HdXOEe8nZAdR/n3zAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTE2MDYwOTAwMDAwMFoXDTMxMDYwODIzNTk1OVowYjEcMBoGA1UE +AwwTQXBwbGUgSVNUIENBIDggLSBHMTEgMB4GA1UECwwXQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYH +KoZIzj0CAQYIKoZIzj0DAQcDQgAELVSOaLAQE+/0LdvYCbJD6J1lmW40uNSXyY7J +1qgiNzLIcWDusPHyxWT2ukdf/OYHeDIt9sqAIMn9cPhykyGIRaOCATowggE2MBIG +A1UdEwEB/wQIMAYBAf8CAQAwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2cuc3lt +Y2IuY29tL0dlb1RydXN0UENBLUcyLmNybDAOBgNVHQ8BAf8EBAMCAQYwLgYIKwYB +BQUHAQEEIjAgMB4GCCsGAQUFBzABhhJodHRwOi8vZy5zeW1jZC5jb20wSQYDVR0g +BEIwQDA+BgZngQwBAgIwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2VvdHJ1 +c3QuY29tL3Jlc291cmNlcy9jcHMwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF +BwMCMB0GA1UdDgQWBBTDxKRYBWPXgwa6lo3cso8y9ru3QTAfBgNVHSMEGDAWgBQV +XzVXUVX7JbKtA2n8AaP6vhFV1TAKBggqhkjOPQQDAwNnADBkAjBH2jMNybjCk3Ts +OidXxJX9YDPMd5S3KDCv8vyTdJGhtoly7fQJRNv5rnVz+6YGfsMCMEp6wyheL7NK +mqavsduix2R+j1B3wRjelzJYgXzgM3nwhQKKlJWxpF7IGHuva1taxg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw +NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV +BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,55 @@ +-----BEGIN CERTIFICATE----- +MIIFcDCCBRegAwIBAgIQHw+Lyn4UTWqRF8/JM7DH+zAKBggqhkjOPQQDAjBHMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xHzAdBgNVBAMTFkdl +b1RydXN0IEVDQyBFViBTU0wgQ0EwHhcNMTcwNTExMDAwMDAwWhcNMTkwNTAzMjM1 +OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECDAhE +ZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNV +BAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9u +MRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEYMBYG +A1UECwwPUm9vdCAxMiAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTIuZ2Vv +dHJ1c3QuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbvbmcvKl4MkBRBNY +7EOQ7ugwPIPPCp73W++hAcbFPqiDmupl/fqfrbjL06FImeWzDY7cQOhLbv0Ha8Yq +UrL8HKOCAzcwggMzMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG +AQUFBwMCMA4GA1UdDwEB/wQEAwIFoDCBqQYDVR0gBIGhMIGeMIGSBgkrBgEEAfAi +AQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNv +dXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggrBgEFBQcCAjA1DDNodHRwczovL3d3 +dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3JlcG9zaXRvcnkvbGVnYWwwBwYFZ4EM +AQEwKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL2ZlLnN5bWNiLmNvbS9mZS5jcmww +VwYIKwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8vZmUuc3ltY2QuY29t +MCYGCCsGAQUFBzAChhpodHRwOi8vZmUuc3ltY2IuY29tL2ZlLmNydDAkBgNVHREE +HTAbghl2YWxpZC1yb290MTIuZ2VvdHJ1c3QuY29tMB8GA1UdIwQYMBaAFABLH5GB +DgtDzgRzu5abgh1mY608MIIBfAYKKwYBBAHWeQIEAgSCAWwEggFoAWYAdQDd6x0r +eg1PpiCLga2BaHB+Lo6dAdVciI09EcTNtuy+zAAAAVv4eJwGAAAEAwBGMEQCIBSx +ZdTP+tDh1rstAJ7vyIPNH7HBE6mCRj9W41ccUwbGAiA7p0ljgNoO/ldknmgTiZdI +FlgEy1KgPQiHYvNS+9MHYwB1AKS5CZC0GFgUh7sTosxncAo8NZgE+RvfuON3zQ7I +DdwQAAABW/h4nDMAAAQDAEYwRAIgWf4vMQ9lrM5xKD+iEVXkC7g5CB3fmuxP7fNp +7qX7PB8CIDNe8HT3262gw3D13MGQccxfUhf7dZ9aCRgk7UEDimsJAHYA7ku9t3XO +YLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFb+Hid8wAABAMARzBFAiAxSFtr +/dpMd53ZSC4N9FomEZhoNnARnYe7cWnTAdKVHAIhALEz0JaOqgYTf0k9yYPuNW4E +Bo26yneH6KtdkMV7/gRoMAoGCCqGSM49BAMCA0cAMEQCIBPb1wYt8d6EdjLXiAZp +UfKGFdQF/oexd5GCB1TU0juDAiBWPRPVggfYfc4gLOkYSqIPvPRmEmEhyY8fqsM6 +3YJgDg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDyDCCA06gAwIBAgIQDww3Kf30lVv4ZevF7vQy/DAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTE2MDEwNzAwMDAwMFoXDTI2MDEwNjIzNTk1OVowRzELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDkdlb1RydXN0LCBJbmMuMR8wHQYDVQQDExZHZW9UcnVz +dCBFQ0MgRVYgU1NMIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEF136Fo2A +bY7q0YbhVBTL4HNFaJyTdoU3y+o8YdhxQuw1SrpQT9EwLTyx8Xzf/LNPeoalIKNu +U/3LQgNct6Fk9aOCAcgwggHEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHSUEFjAUBggr +BgEFBQcDAQYIKwYBBQUHAwIwLgYIKwYBBQUHAQEEIjAgMB4GCCsGAQUFBzABhhJo +dHRwOi8vZy5zeW1jZC5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADCBqQYDVR0gBIGh +MIGeMAcGBWeBDAEBMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBz +Oi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBB +BggrBgEFBQcCAjA1GjNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2Vz +L3JlcG9zaXRvcnkvbGVnYWwwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2cuc3lt +Y2IuY29tL0dlb1RydXN0UENBLUcyLmNybDArBgNVHREEJDAipCAwHjEcMBoGA1UE +AxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMjAdBgNVHQ4EFgQUAEsfkYEOC0POBHO7lpuC +HWZjrTwwHwYDVR0jBBgwFoAUFV81V1FV+yWyrQNp/AGj+r4RVdUwCgYIKoZIzj0E +AwMDaAAwZQIweZGj+Ar54cOBtC1I6rkfdNOtxSg77WBAvvsEv1+knWbbu8Acroz1 +Q9xqHnHLXpgRAjEAxNA5KzWxutl/kVj/7bUCYtvSWLfmb2ZTTsvof7VjjWlRnPje +wLtx+yN5EV7LPWDi +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,67 @@ +-----BEGIN CERTIFICATE----- +MIIG6jCCBdKgAwIBAgIQZfxPPcDd0zSbl2UQK6dtRzANBgkqhkiG9w0BAQsFADBG +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEfMB0GA1UEAxMW +R2VvVHJ1c3QgU0hBMjU2IFNTTCBDQTAeFw0xNzAyMDEwMDAwMDBaFw0yMDAzMDIy +MzU5NTlaMHgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD +VQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQKDBRTeW1hbnRlYyBDb3Jwb3JhdGlv +bjEdMBsGA1UEAwwUc3NsdGVzdDEzLmJidGVzdC5uZXQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDV734wSAESareltMadza6jJ0SVi6bLb/Q23La5v5Z/ +rFCdPzSRrMMKj08NfAA/i1k+TF/d7NZ+rrFvCIN33kfDzSLvIQiJh7NZ/yivA9DY +eH7RAuVXfrsqhsqpgHVNSmMXxaGxOIJ4RcEx0RB3vbb3frm46lCLMH0uCavJ7Txo +gDJpAG6AP/hF524IVJcIcHxhJqZo1pQO/iwb/uNGkqwRuAeL9zKhv0tYyiHKNqyW +AXk51Nzm+TQq0flw0nw7EC9f+VNrquiO5j76JKeL+DaxpUtftTpzL5b5oM/LXwDt +62VUMujOyVuKPIj1ieQVdhETSDvf340tQI7MB4qFrHlFAgMBAAGjggOgMIIDnDAf +BgNVHREEGDAWghRzc2x0ZXN0MTMuYmJ0ZXN0Lm5ldDAJBgNVHRMEAjAAMA4GA1Ud +DwEB/wQEAwIFoDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vZ2ouc3ltY2IuY29t +L2dqLmNybDCBnQYDVR0gBIGVMIGSMIGPBgZngQwBAgIwgYQwPwYIKwYBBQUHAgEW +M2h0dHBzOi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9s +ZWdhbDBBBggrBgEFBQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVz +b3VyY2VzL3JlcG9zaXRvcnkvbGVnYWwwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG +AQUFBwMCMB8GA1UdIwQYMBaAFBRnju2DT9YenUAEDARGoXA0sg9yMFcGCCsGAQUF +BwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2dqLnN5bWNkLmNvbTAmBggrBgEF +BQcwAoYaaHR0cDovL2dqLnN5bWNiLmNvbS9nai5jcnQwggH2BgorBgEEAdZ5AgQC +BIIB5gSCAeIB4AB1AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAAB +WfvjZWcAAAQDAEYwRAIgIxFLEWNCRmGQl2o+3psXrWAd88rz9G1JbxbAgHFpXmAC +IFxZpWwuj1Aq4Yx6VrBBqvA+K/GlNY2OcThPaeoj3jdfAHYApLkJkLQYWBSHuxOi +zGdwCjw1mAT5G9+443fNDsgN3BAAAAFZ++NlpAAABAMARzBFAiB+iko2tw6USdc2 +E956ZIpXy9TTUiVtpKHzKFhuR7mdwwIhAMwTisbIGh6UTdjXnPktWPFcWhfxQOPB +U41c/v7zuFV9AHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFZ +++NnWwAABAMASDBGAiEAmqY4AhQPt/tU1iR0LvrlpIjKlc0IArbxENVkVbNTYwcC +IQCPlJZQb7mmlPwjy//aJMyOtEeVFb6DzfM4uhJiSrU9WAB2ALx44d/F9jxoRkkz +TaEPoV8JeWkgCcCBtPP2kX8+2bilAAABWfvjZmgAAAQDAEcwRQIgMcV63d6G3RHm +rN34V1zDiAbKG1k/pDEErcfZ+8Y0GdwCIQCcuqmKjnpUYs8ps4/NSx78U2ssNuLA ++QDpYuH1XKHCUTANBgkqhkiG9w0BAQsFAAOCAQEAjYdQJYtrhPJTIHcsyksTWGHS +cpIt7y1bzp+t06KYn6x+ax+09sTJQzr7L2BA3h24blgMWr2yEH0mvQdVncBFt8xr +9O8jeg5dHSeJknnDlXOA23Z2NJLanX7m29/713DxZ+HJXFx0Wiz5mtuTo7Q6FpQF +SI44v0fbUTb7LV81fFpyriroZTlpiMI01NLWGldyCchC795fEYiibSvr1uidjp9i ++MKppG3t3YXb1/Wu2A21b6Z4akgl021A5cJcg8/Q3wjYMqQTtuUEezsBl2jLoey1 +pa/ag3epMe19zTq4iqS3Z4r+2jrZ4IjnKmkDKo4uKvTAfUX2Yu2+Lm3E6Vfdow== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIExzCCA6+gAwIBAgIQQYISfRLZxrMhOUMSVmQAuDANBgkqhkiG9w0BAQsFADCB +mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT +MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEczMB4XDTEzMDUyMzAwMDAwMFoXDTIzMDUyMjIzNTk1OVowRjELMAkG +A1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHzAdBgNVBAMTFkdlb1Ry +dXN0IFNIQTI1NiBTU0wgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDGqQtdF6V9xs8q78Zm0UIeX4N4aJGv5qeL8B1EAQoZypzUix3hoZCjwVu011tq +i/wOSR7CYin+gBU5i4EqJ7X7EqgFIgvFLPXZmN0WLztm52KiQzKsj7WFyFIGLFzA +d/pn94PoXgWNyKuhFjKK0kDshjocI6mNtQDecr2FVf4GAWBdrbPgZXOlkhSelFZv +k+6vqTowJUqOCYTvt9LV15tJzenAXmdxIqxQkEMgXaGjFYP9/Kc5vGtlSBJg/90j +szqq9J+cN1NBokeTgTMJ5SLGyBxJoW6NzIOzms3qQ/IZ0yTLqCmuUsz0CCewhOrO +J7XhNBNzklyHhirGsGg2rcsJAgMBAAGjggFcMIIBWDA7BggrBgEFBQcBAQQvMC0w +KwYIKwYBBQUHMAGGH2h0dHA6Ly9wY2EtZzMtb2NzcC5nZW90cnVzdC5jb20wEgYD +VR0TAQH/BAgwBgEB/wIBADBMBgNVHSAERTBDMEEGCmCGSAGG+EUBBzYwMzAxBggr +BgEFBQcCARYlaHR0cDovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL2NwczA7 +BgNVHR8ENDAyMDCgLqAshipodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9HZW9UcnVz +dFBDQS1HMy5jcmwwDgYDVR0PAQH/BAQDAgEGMCoGA1UdEQQjMCGkHzAdMRswGQYD +VQQDExJWZXJpU2lnbk1QS0ktMi00MTYwHQYDVR0OBBYEFBRnju2DT9YenUAEDARG +oXA0sg9yMB8GA1UdIwQYMBaAFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3 +DQEBCwUAA4IBAQAQEOryENYIRuLBjz42WcgrD/5N7OP4tlYxeCXUdvII3e8/zYsc +fqp//AuoI2RRs4fWCfoi+scKUejOuPYDcOAbWrmxspMREPmXBQcpbG1XJVTo+Wab +Dvvbn+6Wb2XLH9hVzjH6zwL00H9QZv8veZulwt/Wz8gVg5aEmLJG1F8TqD6nNJwF +ONrP1mmVqSaHdgHXslEPgWlGJhyZtoNY4ztYj9y0ccC5v0KcHAOe5Eao6rnBzfZb +qTyW+3mkM3Onnni5cNxydMQyyAAbye9I0/s6m/r+eppAaRzI2ig3C9OjuX6WzCso +w1Zsb+nbUrH6mvvnr7WXpiLDxaiTsQDJB7J9 +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIHATCCBemgAwIBAgIQJmVwMHBfVctB6q6UbCC4eDANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMX +R2VvVHJ1c3QgRVYgU1NMIENBIC0gRzYwHhcNMTcwNTA5MDAwMDAwWhcNMTkwNTAz +MjM1OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgEC +DAhEZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAU +BgNVBAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0 +aW9uMRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEY +MBYGA1UECwwPUm9vdCAxNCAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTQu +Z2VvdHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAua4C +iQ+Sk3VXblrh9xI6DqxELgjGxLOxORgayEM1/x4lKC5Dah5Ey9jeDhy6eDLJRXce +JHjR5FYFNpjRpp8w58SzmosAQk7tgRy6HGPtVUUXCVkfUDJ6LIcZE1UcwKO3CUdh +2Dn3naVCNImdqqoUTCr4H/8iIy+1l4aUDnukiAsTV6M2Len0UQpD8MY2KyVmWNJz +GLGzZKXKwU42CZwK8hR+xUH/BSEcWvfU2bFShVGIY1CCpJ5vdhi0QMaRfDzpAXVw +3gvO5bN7RvDD8tABtLUjpnm0P7HzxkVkEO+BGg0P+qpw4bflu+TE7die+pFY1Skz +1rEFOvMEVOCqoinanwIDAQABo4IDOzCCAzcwJAYDVR0RBB0wG4IZdmFsaWQtcm9v +dDE0Lmdlb3RydXN0LmNvbTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDCBqQYD +VR0gBIGhMIGeMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8v +d3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggr +BgEFBQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3Jl +cG9zaXRvcnkvbGVnYWwwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG +AQUFBwMCMFcGCCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2ZpLnN5 +bWNkLmNvbTAmBggrBgEFBQcwAoYaaHR0cDovL2ZpLnN5bWNiLmNvbS9maS5jcnQw +KwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL2ZpLnN5bWNiLmNvbS9maS5jcmwwHwYD +VR0jBBgwFoAUvpmWhYTv5p/5H+H8ZmdbVqX6i1MwggGABgorBgEEAdZ5AgQCBIIB +cASCAWwBagB3AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAABW/fm +zy4AAAQDAEgwRgIhALUgY0DrJaqjpgv19bbS434UDMpUfIfZ7qyxz30M1LiQAiEA +4dXlkRJLc3i+DcFUNSjRh8dKPLZMC3DhD4bm7tDQaWwAdgCkuQmQtBhYFIe7E6LM +Z3AKPDWYBPkb37jjd80OyA3cEAAAAVvuRpVUAAAEAwBHMEUCIGUbCcQ2agQi+sWo +zudL0F2rSS4elFAgHy/nSzGb/fl0AiEA5zLqvTsn8ioQ89KycY3HocNCLAPtqDqe +t9+6pcJnVFsAdwDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAVvu +RpV3AAAEAwBIMEYCIQDrKkvy08fPVx4vbVO4wBYw7tpqkmrWTaKCIs7Tx9utYwIh +ANuH3S2ngCM7WzCebmbLFVDmaNxQki3kmZbCOp358sRvMA0GCSqGSIb3DQEBCwUA +A4IBAQAOEMVj7HwG97PurqFqoa9JI2adgj8er1hc70dIGkTt21OKLWvWp0Yafcjx +qqEByFjzkF0/yreVmbxl1zf7utUMfWslmv7ElXDvS79lZ2UWO6vptyaZM6VSJ2s+ +pmGHJaQgw3AbDmu5yLmUPlHwOttv//AOuaZvrQISzrwmMs60sHn+pS7qtSdL3lYa +PtqhCBQNJoLDstn57B/aLBUYx5rSqhK68CCxY4ZcA1i02RakZJIhGbOAOy4x5pZH +uZiiRFTxgZRGNNUDjrhmVVk7cQDu3eDRDkUKD9m7796GJ+aFDZlvzmORaNW5GYjv +0qIRajIKmohnwumn+xaJFpmDEuw+ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFUjCCAzqgAwIBAgIQAQAZ9apyafiMHhwSEeyNTzANBgkqhkiG9w0BAQsFADBF +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMV +R2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTE3MDUwMTE0MTcxNloXDTI3MDQyOTE0 +MTcxNlowRzELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xIDAe +BgNVBAMTF0dlb1RydXN0IEVWIFNTTCBDQSAtIEc2MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArvBCvG8ORCUSTiERfNmMdtEvKhvmnV8MrSLOw6t3q24c ++r/y69NGdUJArGmBv8crE5Vxd5mYlecmflrJtyuh08HDFc4Mr4yh2xcGmeKA7Uz5 +Q/Wpfropvop1cFB3r/8BwpfxortVi2jkawQ89TDo3l0RacJrjM29dq+rQwqIWvfK +dHuU58t54CsXzvJrqDnhL4v+LQ2mqZMbAfh1Mhh8MftEH5UfOSgY2uXwnu5vERYI +3cl0nakgoJOyUlb187iFd/TrSrYGquv8dYAKTKOTd44YNwxb43iKk/esqxOTiqW8 +rAFv6/E6aOmHwqyP9l7LMtLzVE27ra1wESMR70JttwIDAQABo4IBOjCCATYwHwYD +VR0jBBgwFoAU2rsuqrAMuIgmUXRcbQPTwNiPetYwHQYDVR0OBBYEFL6ZloWE7+af ++R/h/GZnW1al+otTMA4GA1UdDwEB/wQEAwIBBjAuBggrBgEFBQcBAQQiMCAwHgYI +KwYBBQUHMAGGEmh0dHA6Ly9nLnN5bWNkLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEA +MB8GA1UdIAQYMBYwBwYFZ4EMAQEwCwYJKwYBBAHwIgEGMDUGA1UdHwQuMCwwKqAo +oCaGJGh0dHA6Ly9nLnN5bWNiLmNvbS9jcmxzL2d0dW5pY2ExLmNybDAdBgNVHSUE +FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwKQYDVR0RBCIwIKQeMBwxGjAYBgNVBAMT +EVN5bWFudGVjUEtJLTItNzU3MA0GCSqGSIb3DQEBCwUAA4ICAQA8iM9XJ01hEzSM +iATIdK/z+F1Vtm9hHjp0FzkOvVYkp7v6LIkazg299fyAy2+A/tpSzKyMIzy5B2R/ +sjbWykIK+3vtOlgUNilP7EoudiCjR/692THUtJ/QjPNzFYhO9apU2Wpc33ZYMH0Q +YKUPmAd7eBmsdVKHNLENcMjjCjnkjXnYtxq/jv2R4QhD83tbFnvBoKjxi2vAfDXG +xN8aItVg/FSdScZCMhe0w/HLzcN6N3NCGDBn2PjF0o3QLJa9yVSrvJ9Nh3my6rUb +gMhlfFEQXTmLxucqL5/n5lXyUWd0kTxFv++TalTeqYf3G/oeu5kcpfjUJREp/9ed +gQqhDEGIuJFrMm4qi+sNDrq0OkLBHCqefFArTz2ApiI9zd9pcKfjS3f/EB87AVmW +3m1lfqPeS+w+vBg7VCGNY9gGNUe+w4juTEBiwIjnp7I+aBVnIwxV9PdJoj1ZaLCx +U8AEN6tXD8IcCquLxs3fBsF85svvUfK8qh3ufKB3I3RHGq5Asmtvc5URcyeuA+d2 +zPQ1qAXH5m3DLkb0KdAvJ5E6mQ2S2aqwJPXtpqx2J40C1Qx+uUsHG2vDoT3ZTazt +LPBIIqF2YJr1hr760yXM3Jf14eyc+RXPrjA1mc/CKNbv6SvU5MvlYj+Vvx70y+k8 +U5ev+YdiYoYu0wQtDJQCJjM+eavqxQ== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,66 @@ +-----BEGIN CERTIFICATE----- +MIIG/TCCBeWgAwIBAgIQfVQyuY0yb1Q+TZDQHtRC8TANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMX +R2VvVHJ1c3QgRVYgU1NMIENBIC0gRzQwHhcNMTcwNTAzMDAwMDAwWhcNMTkwNTAz +MjM1OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgEC +DAhEZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAU +BgNVBAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0 +aW9uMRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEY +MBYGA1UECwwPUm9vdCAxMSAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTEu +Z2VvdHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy5Wn +8CUYyHQnisa3ihcezpRBrKNF9OGb9ye9G4mUFRAHoFlNdwVP3qxBtEo7N6ylZ7G0 +tMcLwqy+cdMZlyCw0qPQrJQXqp5AEL034IMeckSvR9I2RyR7DUW3kVtKRsDiAUo9 +4r8h/5ZT96OW/jtdE2WPr0Wt5r0DyG8xzUbUdh5tYFwlxMJLeHgomqsG1WXBEDvS +cTJk9JMZpH5d1FYux+T0BkJsYyj0NRcDnQuc6P4QIkpim3wsOBKMa7beEiCanmcK +dSBrBfl2iep67VfOEYfjYTDOwqwaknSfb2H33e0lpunI76Rwv1uZkr/4ciDyaNZS +IsLh1i57eKvWqn+G9wIDAQABo4IDNzCCAzMwJAYDVR0RBB0wG4IZdmFsaWQtcm9v +dDExLmdlb3RydXN0LmNvbTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDArBgNV +HR8EJDAiMCCgHqAchhpodHRwOi8vZ20uc3ltY2IuY29tL2dtLmNybDCBqQYDVR0g +BIGhMIGeMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBzOi8vd3d3 +Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBBBggrBgEF +BQcCAjA1DDNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2VzL3JlcG9z +aXRvcnkvbGVnYWwwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF +BwMCMB8GA1UdIwQYMBaAFN7PXFC3rgIfFReqFugNtSidalrzMFcGCCsGAQUFBwEB +BEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2dtLnN5bWNkLmNvbTAmBggrBgEFBQcw +AoYaaHR0cDovL2dtLnN5bWNiLmNvbS9nbS5jcnQwggF8BgorBgEEAdZ5AgQCBIIB +bASCAWgBZgB1AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAABW8/Y +RIwAAAQDAEYwRAIgWDLmmEUz8FyqMxfyweXN18EAYitvP3XPnU3XkJzRSrQCIB5y +KErRbSiDkj43iFWQVodPA70HtcgdIzk4X3KA7thOAHYApLkJkLQYWBSHuxOizGdw +Cjw1mAT5G9+443fNDsgN3BAAAAFbz9hEtwAABAMARzBFAiAjTCcAEJDj9M/xY7a/ +pysTrl0MrE6rMzpotNZ5kik1PgIhAMTAYXIUeA7LqKhYlvOvW/cH+uB+8329J8cy +xMF8dmEJAHUA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFbz9hE +3gAABAMARjBEAiA7UGcNzFIEVvXeJRuWPfhA8t0JOjl//7ZuLYgdnt6/jAIgIHyH +QHLo2q5o99msj2s8o1BaTmxxnSF4TZPm8iZGLywwDQYJKoZIhvcNAQELBQADggEB +AGBUtaCjWXpAPSc7ypv6f+IJGYfGHR7NLBLLjTytKHcIx5Hb0YT14TFWnXacaSHk +XL/vY3v3CrdGqn6UZb4UEdyB54juG6J7DLQF/l8oeG0GzPQLlSOt0ZU4Cq9DayO0 +OFS6jD7K7FqalSiBzvFnDFmWqLXZQaO/dFPHvZVIdhfO6Vl/3yH+nkphrc8AiHqV +0LkFaoki3RUJMqPvb1pyZ41MzMVsS/LMPoxS0JUl+YKAhL5H1JS1OPMY1B++k2hs +BoScopXAC1xsOkpQWg+U2+mMnAebcCeFWtKrjVUIA+lzaAr6jbBOK9dLSschRXBe +R9xGJ3I9J4t0pKD5lFr9+fQ= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEbjCCA1agAwIBAgIQboqQ68/wRIpyDQgF0IKlRDANBgkqhkiG9w0BAQsFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xMzEw +MzEwMDAwMDBaFw0yMzEwMzAyMzU5NTlaMEcxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMSAwHgYDVQQDExdHZW9UcnVzdCBFViBTU0wgQ0EgLSBH +NDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANm0BfI4Zw8J53z1Yyrl +uV6oEa51cdlMhGetiV38KD0qsKXV1OYwCoTU5BjLhTfFRnHrHHtp22VpjDAFPgfh +bzzBC2HmOET8vIwvTnVX9ZaZfD6HHw+QS3DDPzlFOzpry7t7QFTRi0uhctIE6eBy +GpMRei/xq52cmFiuLOp3Xy8uh6+4a+Pi4j/WPeCWRN8RVWNSL/QmeMQPIE0KwGhw +FYY47rd2iKsYj081HtSMydt+PUTUNozBN7VZW4f56fHUxSi9HdzMlnLReqGnILW4 +r/hupWB7K40f7vQr1mnNr8qAWCnoTAAgikkKbo6MqNEAEoS2xeKVosA7pGvwgtCW +XSUCAwEAAaOCAUMwggE/MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD +AgEGMC8GCCsGAQUFBwEBBCMwITAfBggrBgEFBQcwAYYTaHR0cDovL2cyLnN5bWNi +LmNvbTBHBgNVHSAEQDA+MDwGBFUdIAAwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93 +d3cuZ2VvdHJ1c3QuY29tL3Jlc291cmNlcy9jcHMwNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2cxLnN5bWNiLmNvbS9HZW9UcnVzdFBDQS5jcmwwKQYDVR0RBCIwIKQe +MBwxGjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTM4MB0GA1UdDgQWBBTez1xQt64C +HxUXqhboDbUonWpa8zAfBgNVHSMEGDAWgBQs1VBBlxWL8I82YVtK+2vZmckzkjAN +BgkqhkiG9w0BAQsFAAOCAQEAtI69B7mahew7Z70HYGHmhNHU7+sbuguCS5VktmZT +I723hN3ke40J2s+y9fHDv4eEvk6mqMLnEjkoNOCkVkRADJ+IoxXT6NNe4xwEYPtp +Nk9qfgwqKMHzqlgObM4dB8NKwJyNw3SxroLwGuH5Tim9Rt63Hfl929kPhMuSRcwc +sxj2oM9xbwwum9Its5mTg0SsFaqbLmfsT4hpBVZ7i7JDqTpsHBMzJRv9qMhXAvsc +4NG9O1ZEZcNj9Rvv7DDZ424uE+k5CCoMcvOazPYnKYTT70zHhBFlH8bjgQPbh8x4 +97Wdlj5qf7wRhXp15kF9Dc/55YVpJY/HjQct+GkPy0FTAA== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,51 @@ +-----BEGIN CERTIFICATE----- +MIIFNjCCBN2gAwIBAgIQWCw1fnWLWedosJcJlxQbhDAKBggqhkjOPQQDAjBDMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMR0wGwYDVQQDExR0aGF3 +dGUgRUNDIEVWIFNTTCBDQTAeFw0xNzA1MTEwMDAwMDBaFw0xOTA1MDgyMzU5NTla +MIHsMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIMCERlbGF3 +YXJlMRUwEwYDVQQKDAxUaGF3dGUsIEluYy4xCzAJBgNVBAYTAlVTMRMwEQYDVQQI +DApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQPExRQ +cml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UEBRMHMzg5ODI2MTEXMBUGA1UECwwO +Um9vdCA4IC0gVkFMSUQxHzAdBgNVBAMMFnZhbGlkLXJvb3Q4LnRoYXd0ZS5jb20w +WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATVxsOfZ4/2K7l7FYl6ejjp5aNuX1J9 +gqfb8WdGQdmKW8TVlhzM9p3BQ61hcISHVW01ZzR2PgYQ5aALzTaZ/Vt9o4IDBzCC +AwMwCQYDVR0TBAIwADB8BgNVHSAEdTBzMGgGC2CGSAGG+EUBBzABMFkwJgYIKwYB +BQUHAgEWGmh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vY3BzMC8GCCsGAQUFBwICMCMM +IWh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vcmVwb3NpdG9yeTAHBgVngQwBATArBgNV +HR8EJDAiMCCgHqAchhpodHRwOi8vdHEuc3ltY2IuY29tL3RxLmNybDAdBgNVHSUE +FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH/BAQDAgWgMFcGCCsGAQUF +BwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3RxLnN5bWNkLmNvbTAmBggrBgEF +BQcwAoYaaHR0cDovL3RxLnN5bWNiLmNvbS90cS5jcnQwIQYDVR0RBBowGIIWdmFs +aWQtcm9vdDgudGhhd3RlLmNvbTAfBgNVHSMEGDAWgBRbM681oBoZN0INV+a8vWtj +IMKWATCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHYA3esdK3oNT6Ygi4GtgWhw +fi6OnQHVXIiNPRHEzbbsvswAAAFb+KihvQAABAMARzBFAiBghdkYlqbxNHmxETaN +TKTcLlmD8amIlOWP7KnL9/WrBAIhANAssLlY1gvBLJ61ULFbdrVTMi1dqMXPBec8 +LfKdwER4AHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFb+Kih +ywAABAMARzBFAiAW4sOV17H0V1n4pwnfeeKflHLmr1t4pB9KBCYGh0NaEgIhAMUI +rLg1SuTCV2pXxRvWkzIAiifaJcPbxPhEp4DGz2d5AHUA7ku9t3XOYLrhQmkfq+Ge +ZqMPfl+wctiDAMR7iXqo/csAAAFb+Kih/AAABAMARjBEAiA1u/TczjmZ5EDB4Jue +TYEUyFHFDj3ytCItXk6vzcVPYgIgT6Yc1ugrgocOLqpDsRoQ7Jll/5PIi7QFg5N8 +//OhX+kwCgYIKoZIzj0EAwIDRwAwRAIgCK09KwyaiPsZZMtkjCec9zeVx7YRk8oh +PvV2UnQf6sQCIAfYgjH7ZQeIKCMi4ctdTja1ng/lU8ibnkpU5NDZGaTN +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDgDCCAwagAwIBAgIQH/L8vGMmqr0oZpOZH0PsITAKBggqhkjOPQQDAzCBhDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp +IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi +BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0xNjAxMDcwMDAw +MDBaFw0yNjAxMDYyMzU5NTlaMEMxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3 +dGUsIEluYy4xHTAbBgNVBAMTFHRoYXd0ZSBFQ0MgRVYgU1NMIENBMFkwEwYHKoZI +zj0CAQYIKoZIzj0DAQcDQgAEmcXM1zsNS0E2+7pcpYHdwqumr+KIIt3jEJA6jBBm +1SoBGgZESt6OKROJBt2sZJhUl4oU0q5kINTS/bG+eYTTlqOCAZgwggGUMA4GA1Ud +DwEB/wQEAwIBBjAuBggrBgEFBQcBAQQiMCAwHgYIKwYBBQUHMAGGEmh0dHA6Ly90 +LnN5bWNkLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMHwGA1UdIAR1MHMwBwYFZ4EM +AQEwaAYLYIZIAYb4RQEHMAEwWTAmBggrBgEFBQcCARYaaHR0cHM6Ly93d3cudGhh +d3RlLmNvbS9jcHMwLwYIKwYBBQUHAgIwIxohaHR0cHM6Ly93d3cudGhhd3RlLmNv +bS9yZXBvc2l0b3J5MDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly90LnN5bWNiLmNv +bS9UaGF3dGVQQ0EtRzIuY3JsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD +AjArBgNVHREEJDAipCAwHjEcMBoGA1UEAxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMTAd +BgNVHQ4EFgQUWzOvNaAaGTdCDVfmvL1rYyDClgEwHwYDVR0jBBgwFoAUmtgAMADn +a3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaAAwZQIwMMf+C0NMBVt58Of4YvVO +mVS0OYfzEiB4AOz8QF9pmEyaCAelGeOmq2pOLDEsQbKzAjEA2WTDVMhnnJI3NSnD +itmCtBQnW6NEAohvLUsB4iVehDAJK3mNY8FbYafl4LjFzA4V +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,67 @@ +-----BEGIN CERTIFICATE----- +MIIG2TCCBcGgAwIBAgIQdS+C2M35zv3l1EWcCL2MfTANBgkqhkiG9w0BAQsFADBX +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMTEwLwYDVQQDEyh0 +aGF3dGUgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTSEEyNTYgU1NMIENBMB4XDTE3MDUw +ODAwMDAwMFoXDTE5MDUwODIzNTk1OVowgewxEzARBgsrBgEEAYI3PAIBAxMCVVMx +GTAXBgsrBgEEAYI3PAIBAgwIRGVsYXdhcmUxFTATBgNVBAoMDFRoYXd0ZSwgSW5j +LjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1v +dW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRAwDgYD +VQQFEwczODk4MjYxMRcwFQYDVQQLDA5Sb290IDkgLSBWQUxJRDEfMB0GA1UEAwwW +dmFsaWQtcm9vdDkudGhhd3RlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAMGMwXWgvpsjK9b7JwFIs8Ch6EORhDfWRMk16KGdnO0jeIh1D4NRi1GL +g0WcHiW06dFOF9UaT/Lg66mJLjHguftTHSoi9/cuMHcy0gbbWR+j+6RMxr7RwI6S +eC8VesPWxM+5xW6bI+QBWq678ZK8JYr/cALXX+8ekDhY8vswIdzkUp7qHekkoja6 +4ki2JyJO4Q/uf/gWfohsGc88fEiMAQi3qhyZlHm7QzjeUoB0WgPC+CVB+vxSmZip +6rkfjgPeKPlM1tqIAPjQWnQbdi2AvYCOUT0ZvVPPmsbINp7IMdAZmv9yF5qoW36A +oFtBL3wLNe7w+lm5ZnZ15DHB2b2gDAECAwEAAaOCAwkwggMFMCEGA1UdEQQaMBiC +FnZhbGlkLXJvb3Q5LnRoYXd0ZS5jb20wCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMC +BaAwKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3RmLnN5bWNiLmNvbS90Zi5jcmww +fAYDVR0gBHUwczBoBgtghkgBhvhFAQcwATBZMCYGCCsGAQUFBwIBFhpodHRwczov +L3d3dy50aGF3dGUuY29tL2NwczAvBggrBgEFBQcCAjAjDCFodHRwczovL3d3dy50 +aGF3dGUuY29tL3JlcG9zaXRvcnkwBwYFZ4EMAQEwHQYDVR0lBBYwFAYIKwYBBQUH +AwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFDskyDGgt1rQarjSygd0zB4k1MTcMFcG +CCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3RmLnN5bWNkLmNvbTAm +BggrBgEFBQcwAoYaaHR0cDovL3RmLnN5bWNiLmNvbS90Zi5jcnQwggF/BgorBgEE +AdZ5AgQCBIIBbwSCAWsBaQB2AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM22 +7L7MAAABW+pl8UMAAAQDAEcwRQIhAMdGpN45mO8sPe9cyqC2vxeA7kwbpPL4Ie1Z +qP8A8YSmAiB+O2TOyUyg9TE31kCYyimqMS5tycpG8qTusAi6VClvAAB2AKS5CZC0 +GFgUh7sTosxncAo8NZgE+RvfuON3zQ7IDdwQAAABW+pl8i4AAAQDAEcwRQIhALoI +UwV2CIRu4MVgjNYTnVdKI6ZeklPdb9IQzEYBLI5OAiAgR+WX0RgWiOmn0Khon7ck +QEQ0H+j9VSFAuTqxFNWzXwB3AO5Lvbd1zmC64UJpH6vhnmajD35fsHLYgwDEe4l6 +qP3LAAABW+pl8ZMAAAQDAEgwRgIhAO/SefmFUyrtfsa1WjfN3WRG2pVSRCqaSxc7 +8pbqk7ynAiEA12r243Cr4IWKQdp6IoTqeULQZfZEGGnIUQxVG9yRzdcwDQYJKoZI +hvcNAQELBQADggEBALcczMzw4qLLwR1hbM2qnzs+Ng4ByHPaDcwIZzGlxLCTOjZc +AaVc8TA/MRUQBFxWto2fLmVIoFNS9EceKOx9VWcNK+9gYKkLl0K4amLTWWW+uShT +DooJSdkP2fX2QB1jNsD1jH+44aG6Ll94HEgz88ziVeUH5T0yM3Fou1axDVI1ADKE +Z0UsdhlTIDKcTndv3Wk6HZz2wxtvt3Z3Eenr/6TQuipGCBpfRccVRVhrpIsylVtp +9UkD0UpX0VRgyrQOIXmtbL0WmPodfxB8crczcd6C0Yy2A77torg72fAyUtKmaBBZ +ajj05MMBn8QmmnAZ0pXxvFTnD8MhOZ0nBccJnQM= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE0DCCA7igAwIBAgIQCkieiFN+iqZFTW4sSyrrIDANBgkqhkiG9w0BAQsFADCB +rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV +BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0xMzA0MDkwMDAwMDBa +Fw0yMzA0MDgyMzU5NTlaMFcxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3dGUs +IEluYy4xMTAvBgNVBAMTKHRoYXd0ZSBFeHRlbmRlZCBWYWxpZGF0aW9uIFNIQTI1 +NiBTU0wgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDyxLx06CX2 +AGIo40zouN8Tn4sHN+9iSvFXCfaC6HXwCqknz5M77DaJpW4d1lTzuASXcrRpJczR +Qg5b1Rx/omBusVIa25MvuwsNZFMWyxwJJJUpIrSKGACJ/vcfcsjoXC8aG6IYuO8Y +XMu12zpO2w+u38R54x6qXKOk5axhmzeFj0h1G7nVaJbpJ3lwVyMau2yTkMdF1xfS +Nyp2s82CqU/AA3vhPXp+W7iF8vUV+3CpvfVQZRad47ZrYW6hep7oDRz3Ko5pfkMw +jnjO7mUeO5uHHkkc+DJGXShGeSpOJ10XWKg3/qgTqWkV3zYiiXW6ygFALu2d1wyq +Mc4nrlfV0lH7AgMBAAGjggE+MIIBOjASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1Ud +DwEB/wQEAwIBBjAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9v +Y3NwLnRoYXd0ZS5jb20wOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEW +Gmh0dHBzOi8vd3d3LnRoYXd0ZS5jb20vY3BzMDcGA1UdHwQwMC4wLKAqoCiGJmh0 +dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQQ0EtRzMuY3JsMCoGA1UdEQQjMCGk +HzAdMRswGQYDVQQDExJWZXJpU2lnbk1QS0ktMi0zNzQwHQYDVR0OBBYEFDskyDGg +t1rQarjSygd0zB4k1MTcMB8GA1UdIwQYMBaAFK1sqpRgnO3k//o+CnQrYwP3tlm/ +MA0GCSqGSIb3DQEBCwUAA4IBAQBomCaq1DPJunVw1J9JrdbBVNzuqlYfeKfwoaTu +C/kSr9+muO7DyzUTalkq+MnpTC+8sbwrwgIw4cO+wvCBjJl3iVgAo8x/owJMU7Ju +Nk/+34d2sz/sWmJQtgBFWPKHrHfm0CBQY8XksnAVGJAFe3uvK0a+a04fU/yEJ66D +0o1HU6cOH2O1utsW2GoJJVV9jz1KwYP5s7mnBFrI8xEEkVMw2VKHyzkAnOxTwwIJ +fqc2jnIhLyO7TMZHpaHuZ8QvXDpHOGHiwx43kp7IL2v679LDzSmNmPhSF+21Uzzf +r8kbYq3fAu5dNPZBS8vDVa+xy9qcc9UCqC2nrPzh5QfQUeg1 +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIHIDCCBgigAwIBAgIQS0wGL8U0T0yVa8wAE4DBqjANBgkqhkiG9w0BAQsFADB+ +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVj +IENsYXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MB4XDTE3MDUwMTAwMDAwMFoX +DTIwMDQzMDIzNTk1OVowgaExCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y +bmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQKDBRTeW1hbnRlYyBD +b3Jwb3JhdGlvbjEXMBUGA1UECwwOUm9vdCA0IC0gVkFMSUQxLTArBgNVBAMMJHZh +bGlkLXJvb3Q0LndlYnNlY3VyaXR5LnN5bWFudGVjLmNvbTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALll3Mb7Fu0CAWPMWpSbr6RHdAl10hwmMaDr8ENk +hAv3offJxsUmgS+vqCC+xQNiS5ClDeOLyf5QeltArLuaYNjUaXEy00EEuXFQO5kj +HjTdsWeEkOxzmt2thAJx8eMbskvvtqnHHali2LFIOuMXuyS9mpkk7cG1yk85LvgZ +Ov1xrpBCuB+ppir0MhhXRLmcZ9QMgVUzfjrmQoQWHE0Qu69Mci6mk7fuBboqaPe0 +v0s2KsA1tLSknn39HrXE3d5D1AOoLJP1RiHU+RFQIOJ0oiXPZSH0bdiWhO0xcyuo +vXY+0vaQPO1Uwrj/VdpL7bs65dgdFqXpTdqvMURu5WoDumUCAwEAAaOCA3QwggNw +MC8GA1UdEQQoMCaCJHZhbGlkLXJvb3Q0LndlYnNlY3VyaXR5LnN5bWFudGVjLmNv +bTAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcD +AQYIKwYBBQUHAwIwYQYDVR0gBFowWDBWBgZngQwBAgIwTDAjBggrBgEFBQcCARYX +aHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGQwXaHR0cHM6Ly9k +LnN5bWNiLmNvbS9ycGEwHwYDVR0jBBgwFoAUX2DPYZBV34RDFIpgKrL1evRDGO8w +KwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3NzLnN5bWNiLmNvbS9zcy5jcmwwVwYI +KwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8vc3Muc3ltY2QuY29tMCYG +CCsGAQUFBzAChhpodHRwOi8vc3Muc3ltY2IuY29tL3NzLmNydDCCAfcGCisGAQQB +1nkCBAIEggHnBIIB4wHhAHYA3esdK3oNT6Ygi4GtgWhwfi6OnQHVXIiNPRHEzbbs +vswAAAFbxYEdRwAABAMARzBFAiEAurXvGE124ya7O5ZjYZckdJ7OU64A4fEAszhI +UG3OqMACIGbAqoQLGMr9sMYBqS3cPxtD6EIK8BXzBaYHOe3pGhcXAHYApLkJkLQY +WBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFbxYEdagAABAMARzBFAiBY4mXZ +w8zBWrVURFxwmQGf046/oaidgJQ3Wf9+AlJ+7AIhANWkGBd6nlwE8V/dzQvkjnTz +2edJKGy2NqgyxinZMAbWAHcA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo +/csAAAFbxYEfSwAABAMASDBGAiEAltQbZJ9+Gt1M+YV4YBJVR63aPhk1dFIyKdQL +yjYdBh0CIQDUGxHmR2KVW8N6wHnAGFlUhcwlBJFoiTqaSRP/1Yk0wAB2ALx44d/F +9jxoRkkzTaEPoV8JeWkgCcCBtPP2kX8+2bilAAABW8WBHkcAAAQDAEcwRQIgFqqM +DTAo3RKfwU9gwkD53Zr1HXPJuoI/MhwHQgc8nvkCIQDbwhd3gOdRJhtMyGqxGqr7 +sbD43D/fkyH3BNWOhff04TANBgkqhkiG9w0BAQsFAAOCAQEAQkWtNshWRmFY1t1Y +pH3Ztxd891f4VYLtBzrpapejHIe5ijlZES2d+x4+aCilVUo6sDs0RUgy5Jk9eU5I +6vOh+NkZ1THFqod+w5FKPgDaDuHHryvRaiGdcpn9x5R7zkpgKQ1WqgvcbzAmZkAr +YxpvXfTLhcgbQhPedxbS5YyU1y1QCi8MUrxTwejcFDhAQXGOW3cTMpGsXtRvQVE0 +iI93jCPb3Djpqus9SS7ggzkfJe3bQpl72bv2agn5peBJa0sC1PqRXIT/cWUQe9ez +rKSDoqdPNjTmIcJjql50T+WceNF5nxNPCq+jhMOcmKXJUF3H6yYc8pjLuDDBAFFz +uxAuxw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFFTCCA/2gAwIBAgIQKC4nkXkzkuQo8iGnTsk3rjANBgkqhkiG9w0BAQsFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMTk5OSBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzMwHhcNMTMxMDMxMDAwMDAwWhcNMjMxMDMwMjM1OTU5WjB+MQsw +CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV +BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxLzAtBgNVBAMTJlN5bWFudGVjIENs +YXNzIDMgU2VjdXJlIFNlcnZlciBDQSAtIEc0MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAstgFyhx0LbUXVjnFSlIJluhL2AzxaJ+aQihiw6UwU35VEYJb +A3oNL+F5BMm0lncZgQGUWfm893qZJ4Itt4PdWid/sgN6nFMl6UgfRk/InSn4vnlW +9vf92Tpo2otLgjNBEsPIPMzWlnqEIRoiBAMnF4scaGGTDw5RgDMdtLXO637QYqzu +s3sBdO9pNevK1T2p7peYyo2qRA4lmUoVlqTObQJUHypqJuIGOmNIrLRM0XWTUP8T +L9ba4cYY9Z/JJV3zADreJk20KQnNDz0jbxZKgRb78oMQw7jW2FUyPfG9D72MUpVK +Fpd6UiFjdS8W+cRmvvW1Cdj/JwDNRHxvSz+w9wIDAQABo4IBQDCCATwwHQYDVR0O +BBYEFF9gz2GQVd+EQxSKYCqy9Xr0QxjvMBIGA1UdEwEB/wQIMAYBAf8CAQAwawYD +VR0gBGQwYjBgBgpghkgBhvhFAQc2MFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cu +c3ltYXV0aC5jb20vY3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0 +aC5jb20vcnBhMC8GA1UdHwQoMCYwJKAioCCGHmh0dHA6Ly9zLnN5bWNiLmNvbS9w +Y2EzLWczLmNybDAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwxGjAYBgNV +BAMTEVN5bWFudGVjUEtJLTEtNTM0MC4GCCsGAQUFBwEBBCIwIDAeBggrBgEFBQcw +AYYSaHR0cDovL3Muc3ltY2QuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBbF1K+1lZ7 +9Pc0CUuWysf2IdBpgO/nmhnoJOJ/2S9h3RPrWmXk4WqQy04q6YoW51KN9kMbRwUN +gKOomv4p07wdKNWlStRxPA91xQtzPwBIZXkNq2oeJQzAAt5mrL1LBmuaV4oqgX5n +m7pSYHPEFfe7wVDJCKW6V0o6GxBzHOF7tpQDS65RsIJAOloknO4NWF2uuil6yjOe +soHCL47BJ89A8AShP/U3wsr8rFNtqVNpT+F2ZAwlgak3A/I5czTSwXx4GByoaxbn +5+CdKa/Y5Gk5eZVpuXtcXQGc1PfzSEUTZJXXCm5y2kMiJG8+WnDcwJLgLeVX+OQr +J+71/xuzAYN6 +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,56 @@ +-----BEGIN CERTIFICATE----- +MIIFxDCCBWmgAwIBAgIQZMjAlhAdRd/Im/aYbmgO8DAKBggqhkjOPQQDAjCBizEL +MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD +VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTwwOgYDVQQDEzNTeW1hbnRlYyBD +bGFzcyAzIEVDQyAyNTYgYml0IEV4dGVuZGVkIFZhbGlkYXRpb24gQ0EwHhcNMTcw +NTAxMDAwMDAwWhcNMTkwNTAxMjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMC +VVMxGTAXBgsrBgEEAYI3PAIBAgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUg +T3JnYW5pemF0aW9uMRAwDgYDVQQFEwcyMTU4MTEzMQswCQYDVQQGEwJVUzEOMAwG +A1UEEQwFOTQwNDMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50 +YWluIFZpZXcxGTAXBgNVBAkMEDM1MCBFbGxpcyBTdHJlZXQxHTAbBgNVBAoMFFN5 +bWFudGVjIENvcnBvcmF0aW9uMRcwFQYDVQQLDA5Sb290IDMgLSBWQUxJRDEtMCsG +A1UEAwwkdmFsaWQtcm9vdDMud2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMFkwEwYH +KoZIzj0CAQYIKoZIzj0DAQcDQgAERAIBieoafYh/yFaVSP+vyzoxzZ/zKy4tx7o0 +R1gugD5SArEcRar0oodVQ99eJkT63Xn910gGKx4cP+CM+jZfJqOCAwgwggMEMC8G +A1UdEQQoMCaCJHZhbGlkLXJvb3QzLndlYnNlY3VyaXR5LnN5bWFudGVjLmNvbTAJ +BgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIHgDAdBgNVHSUEFjAUBggrBgEFBQcDAQYI +KwYBBQUHAwIwbwYDVR0gBGgwZjBbBgtghkgBhvhFAQcXBjBMMCMGCCsGAQUFBwIB +FhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcCAjAZDBdodHRwczov +L2Quc3ltY2IuY29tL3JwYTAHBgVngQwBATAfBgNVHSMEGDAWgBRIE2UXlOyeFioq +dFzoUy20+4PrjjArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vc24uc3ltY2IuY29t +L3NuLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9zbi5z +eW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9zbi5zeW1jYi5jb20vc24uY3J0 +MIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgDd6x0reg1PpiCLga2BaHB+Lo6d +AdVciI09EcTNtuy+zAAAAVvFgWTjAAAEAwBHMEUCIF7mhfWFvkMauS0jlQz7t/fO +nDXX+VeHwI7YIHU3Wvg5AiEA97a9fZzAjALA1VTaXOv/WSDyEzA/X9YPesI4Aq+4 +da8AdQCkuQmQtBhYFIe7E6LMZ3AKPDWYBPkb37jjd80OyA3cEAAAAVvFgWUIAAAE +AwBGMEQCIAM5H16X3/vPGds9N8b7Q3+H8cFe7woTT9ddKPfUyLZJAiAF8FivrVBd +wJ5rjxxJOwPSrlkRV2vhbKfSbJH0lDq1XQB2AO5Lvbd1zmC64UJpH6vhnmajD35f +sHLYgwDEe4l6qP3LAAABW8WBZRoAAAQDAEcwRQIgRpro/bdvZbK5eW5FTbTqGUTi +W5RSpjcFW2Gd27Ql6bACIQCgow7825ZtJ31KRYJ2fiTlqvc6jyZ+u67hFT4qs/1Q +oDAKBggqhkjOPQQDAgNJADBGAiEAl565i7SXROFdn7y+hM0AgChi/75FGmaokJaj +h9jhmiMCIQCqIZZ4SuOgBbkt7bMOSI1sOtFqhlsGVXwZKjzSaIFSYA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID4zCCA2qgAwIBAgIQTZVdIK+FxJ9pJfurfGZfiTAKBggqhkjOPQQDAzCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzQwHhcNMTIxMjIwMDAwMDAwWhcNMjIxMjE5MjM1OTU5WjCBizELMAkG +A1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQL +ExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTwwOgYDVQQDEzNTeW1hbnRlYyBDbGFz +cyAzIEVDQyAyNTYgYml0IEV4dGVuZGVkIFZhbGlkYXRpb24gQ0EwWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAATdBD2y8pCTl8bpu7yR21Hwo4bt+8bThZMyBUngBINh +llH/VyGuC9oO5wShf9sqHL3KmDXFcXNAzehqq1SEQybio4IBbTCCAWkwEgYDVR0T +AQH/BAgwBgEB/wIBADA3BgNVHR8EMDAuMCygKqAohiZodHRwOi8vY3JsLndzLnN5 +bWFudGVjLmNvbS9wY2EzLWc0LmNybDAOBgNVHQ8BAf8EBAMCAQYwNwYIKwYBBQUH +AQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC53cy5zeW1hbnRlYy5jb20w +ZQYDVR0gBF4wXDBaBgRVHSAAMFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuc3lt +YXV0aC5jb20vY3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0aC5j +b20vcnBhMCoGA1UdEQQjMCGkHzAdMRswGQYDVQQDExJTWU1DLUVDQy1DQS1wMjU2 +LTMwHQYDVR0OBBYEFEgTZReU7J4WKip0XOhTLbT7g+uOMB8GA1UdIwQYMBaAFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2cAMGQCMFyb7oOjdk2MLQVM +gjS6s77Oj+jDNIH7QHfoNGxbFys7rdWno9LzZsJPsrDIdpiPvwIwT8IvzpLFqb3O +fU7UGztmJOpOzYKvVEqI7+O/OpNjVCF9EjDSMs2ryYGwpxFDe0Vm +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIHOTCCBiGgAwIBAgIQCBmps2cB8a6CGTXUyg9ZzjANBgkqhkiG9w0BAQsFADB3 +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj +IENsYXNzIDMgRVYgU1NMIENBIC0gRzMwHhcNMTcwNDI4MDAwMDAwWhcNMTkwNDI4 +MjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMCVVMxGTAXBgsrBgEEAYI3PAIB +AgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRAwDgYD +VQQFEwcyMTU4MTEzMQswCQYDVQQGEwJVUzEOMAwGA1UEEQwFOTQwNDMxEzARBgNV +BAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxGTAXBgNVBAkM +EDM1MCBFbGxpcyBTdHJlZXQxHTAbBgNVBAoMFFN5bWFudGVjIENvcnBvcmF0aW9u +MRcwFQYDVQQLDA5Sb290IDEgLSBWQUxJRDEtMCsGA1UEAwwkdmFsaWQtcm9vdDEu +d2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEApbJSThUcOfpFWl6PyOeFqED399DWeBcBoAMdXkPfatQ+uJPeRryZ +4UfC1iuQWQM6agDrMhDmnc+IiBiltbF0PVEHkQXxfR6x6TFF1doWDxVfOgl2y9Pz +ilRgdBdGmnQsWbYqaKlCBS3aZ2jCZMUAKmQce8WNLEf8qDjQcHRT1vI2k5AW3+L0 +FccXRSFXx2wZUAh9qxa2gKxEjnUF+qy42WEgh/mXD4smbhtEf+pCUXPYuODlxOaA +ZCy9SeBrKb5Nl3C9UzBhchONPQLUgzlk8d0M17pFLYKLfa8MvBcKRVyTk7/XXdTj +OmW5OO7f4epmXNlN5fHnGZlA5FE/4candwIDAQABo4IDBzCCAwMwLwYDVR0RBCgw +JoIkdmFsaWQtcm9vdDEud2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMAkGA1UdEwQC +MAAwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD +AjBvBgNVHSAEaDBmMFsGC2CGSAGG+EUBBxcGMEwwIwYIKwYBBQUHAgEWF2h0dHBz +Oi8vZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkMF2h0dHBzOi8vZC5zeW1j +Yi5jb20vcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFAFZq+fdOgtZpmRj1s8gB1fV +kedqMCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9zci5zeW1jYi5jb20vc3IuY3Js +MFcGCCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3NyLnN5bWNkLmNv +bTAmBggrBgEFBQcwAoYaaHR0cDovL3NyLnN5bWNiLmNvbS9zci5jcnQwggF8Bgor +BgEEAdZ5AgQCBIIBbASCAWgBZgB2AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0R +xM227L7MAAABW7a3ZxAAAAQDAEcwRQIgeoFObGH+PGc5LRj+f1yzoG3TGHrPQA/z +nRsNG1MXNXACIQCVd5wZWbP1+hp4kaE1sYgUnSiRFN3kfMf5uUQysYvkSwB1AKS5 +CZC0GFgUh7sTosxncAo8NZgE+RvfuON3zQ7IDdwQAAABW7a3Z1AAAAQDAEYwRAIg +MRBDGE2dq1xzPDJ9tKzDTwKP5rC4DrjHZbmtYiZZh3sCIDCMlTV8bpEeeq2evzna +Xq/930hOaclzf4pXEwUHmW/HAHUA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7 +iXqo/csAAAFbtrdpDwAABAMARjBEAiBQpNfvWoFAkIraeupW8zM804c8XvlLIbX4 +6kCYS04HbQIgOmEunrjYREwtG5Rdk1Vd01Fp7lR42AgJ/LQFn7DmXigwDQYJKoZI +hvcNAQELBQADggEBAKlkTQil8u0sfwLdpfFmtUvFexhx4C8gTsZwZeN/40n+S4xR +b6U3rEHIKlFAelipc5EzeYIsJKHGP5qHSs7m7jPKBrf0KsoryvZrSfhMfXDHvrJF +RpF0Rs1VODoK2l/1CosUZ9rTqEjQcv7kUvFvgZpNIoV++k/Y2TsoBsLliRdXKpL8 +SQADr18BlEt1Y8A7E77lJFMmgD4bFN1jJWkEJoAGkrYqsF6i8fAHiESjSLy85Bcs +DGXgP4z8Nifje78wGVygI/4NYgYiFClsk8epBHXOveEV5HRO42XzPG0Zn0BMWCSI +0P08Lq3dwSQSQarkID6iRuhgt4GZvm3zh6MdfrA= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFKzCCBBOgAwIBAgIQfuFKb2/v8tN/P61lTTratDANBgkqhkiG9w0BAQsFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMTMxMDMxMDAwMDAwWhcNMjMxMDMwMjM1OTU5WjB3MQsw +CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV +BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVjIENs +YXNzIDMgRVYgU1NMIENBIC0gRzMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQDYoWV0I+grZOIy1zM3PY71NBZI3U9/hxz4RCMTjvsR2ERaGHGOYBYmkpv9 +FwvhcXBC/r/6HMCqo6e1cej/GIP23xAKE2LIPZyn3i4/DNkd5y77Ks7Imn+Hv9hM +BBUyydHMlXGgTihPhNk1++OGb5RT5nKKY2cuvmn2926OnGAE6yn6xEdC0niY4+wL +pZLct5q9gGQrOHw4CVtm9i2VeoayNC6FnpAOX7ddpFFyRnATv2fytqdNFB5suVPu +IxpOjUhVQ0GxiXVqQCjFfd3SbtICGS97JJRL6/EaqZvjI5rq+jOrCiy39GAI3Z8c +zd0tAWaAr7MvKR0juIrhoXAHDDQPAgMBAAGjggFdMIIBWTAvBggrBgEFBQcBAQQj +MCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9zMi5zeW1jYi5jb20wEgYDVR0TAQH/BAgw +BgEB/wIBADBlBgNVHSAEXjBcMFoGBFUdIAAwUjAmBggrBgEFBQcCARYaaHR0cDov +L3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIwHBoaaHR0cDovL3d3dy5z +eW1hdXRoLmNvbS9ycGEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3MxLnN5bWNi +LmNvbS9wY2EzLWc1LmNybDAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwx +GjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTMzMB0GA1UdDgQWBBQBWavn3ToLWaZk +Y9bPIAdX1ZHnajAfBgNVHSMEGDAWgBR/02Wnwt3su/AwCfNDOfoCrzMxMzANBgkq +hkiG9w0BAQsFAAOCAQEAQgFVe9AWGl1Y6LubqE3X89frE5SG1n8hC0e8V5uSXU8F +nzikEHzPg74GQ0aNCLxq1xCm+quvL2GoY/Jl339MiBKIT7Np2f8nwAqXkY9W+4nE +qLuSLRtzsMarNvSWbCAI7woeZiRFT2cAQMgHVHQzO6atuyOfZu2iRHA0+w7qAf3P +eHTfp61Vt19N9tY/4IbOJMdCqRMURDVLtt/JYKwMf9mTIUvunORJApjTYHtcvNUw +LwfORELEC5n+5p/8sHiGUW3RLJ3GlvuFgrsEL/digO9i2n/2DqyQuFa9eT/ygG6j +2bkPXToHHZGThkspTOHcteHgM52zyzaRS/6htO7w+Q== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,170 @@ +Signer #1: + +Signature: + +Certificate owner: CN="Oracle America, Inc.", OU=Software Engineering, O="Oracle America, Inc.", L=Redwood City, ST=California, C=US + +-----BEGIN CERTIFICATE----- +MIIE4DCCA8igAwIBAgIQMJBKmqOhTgIuAsUw5l33hTANBgkqhkiG9w0BAQsFADB/ +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxMDAuBgNVBAMTJ1N5bWFudGVj +IENsYXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQTAeFw0xNzEyMjEwMDAwMDBa +Fw0yMDAyMDEyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZv +cm5pYTEVMBMGA1UEBwwMUmVkd29vZCBDaXR5MR0wGwYDVQQKDBRPcmFjbGUgQW1l +cmljYSwgSW5jLjEdMBsGA1UECwwUU29mdHdhcmUgRW5naW5lZXJpbmcxHTAbBgNV +BAMMFE9yYWNsZSBBbWVyaWNhLCBJbmMuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxrxa5UAMwofgt7m++glHqMSYP3nlTDxRnWu14FtVtQiaacn20u3w +T5d+5mkoezHXNU3g1sgwkr/Ovf4YVSwz9wtqZWTbK3/r6Ctb9eRxb2th64N4AuDI +R9C/LU2J7ruXsu7FpEhXMIdNLxR4ihfkBA5ndpNqmXmIG9HvFQkd8APsSFRpMQh7 +Com1YlbkySgMyjBwYfAw74bqNrClBmLNAVfq7JSqjJ8EJtlq6lEJWHXEYysZfRIf +StxZ0XtKD3wtADeowBHs1DRnXrkgD/q3kWX5LF75nfHtRWEtHxWKk7/R452pweIv +ZZYXsvSrRA3vC+jbbhtZiRYRk2QCXsUxrQIDAQABo4IBPjCCATowCQYDVR0TBAIw +ADAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwYQYDVR0gBFow +WDBWBgZngQwBBAEwTDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9j +cHMwJQYIKwYBBQUHAgIwGQwXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwHwYDVR0j +BBgwFoAUljtT8Hkzl699g+8uK8zKt4YecmYwKwYDVR0fBCQwIjAgoB6gHIYaaHR0 +cDovL3N2LnN5bWNiLmNvbS9zdi5jcmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUF +BzABhhNodHRwOi8vc3Yuc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8vc3Yu +c3ltY2IuY29tL3N2LmNydDANBgkqhkiG9w0BAQsFAAOCAQEAQcZqmjMAuBgnaQZ5 +JsP3+Rzaa5FrukVVk2brqrJFnqt/79khvfCf95pBafHHCqdndB0T4xuzBL4fk2ZW +Z48ACgq3U6oNP9Ci4pcDuTqU/vZHwh7ICkSWLhGzpErfwby7zZV9ZeIK0AB5vJCK +qgL4DetXgqGOm29gAjTKcXa67jP9lX6tAdh9TcQDbBbGny3NHGAiCderJxTOYhid +9+4v+p+lt2OPxlxmZMPnT/9U2Yp3OzH//OYgQysnwy/UkSVCa2DuMPbL4LTxwV65 +nwEU3jT0Iq7io+oEcjW5FTZDgVC2A7lDVVrNlbAW/f5QoKcmyw8hDLo7TH6tDv8n +hhKFDg== +-----END CERTIFICATE----- + +Certificate owner: CN=Symantec Class 3 SHA256 Code Signing CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US + +-----BEGIN CERTIFICATE----- +MIIFWTCCBEGgAwIBAgIQPXjX+XZJYLJhffTwHsqGKjANBgkqhkiG9w0BAQsFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMTMxMjEwMDAwMDAwWhcNMjMxMjA5MjM1OTU5WjB/MQsw +CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV +BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxMDAuBgNVBAMTJ1N5bWFudGVjIENs +YXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAJeDHgAWryyx0gjE12iTUWAecfbiR7TbWE0jYmq0v1obUfej +DRh3aLvYNqsvIVDanvPnXydOC8KXyAlwk6naXA1OpA2RoLTsFM6RclQuzqPbROlS +Gz9BPMpK5KrA6DmrU8wh0MzPf5vmwsxYaoIV7j02zxzFlwckjvF7vjEtPW7ctZlC +n0thlV8ccO4XfduL5WGJeMdoG68ReBqYrsRVR1PZszLWoQ5GQMWXkorRU6eZW4U1 +V9Pqk2JhIArHMHckEU1ig7a6e2iCMe5lyt/51Y2yNdyMK29qclxghJzyDJRewFZS +AEjM0/ilfd4v1xPkOKiE1Ua4E4bCG53qWjjdm9sCAwEAAaOCAYMwggF/MC8GCCsG +AQUFBwEBBCMwITAfBggrBgEFBQcwAYYTaHR0cDovL3MyLnN5bWNiLmNvbTASBgNV +HRMBAf8ECDAGAQH/AgEAMGwGA1UdIARlMGMwYQYLYIZIAYb4RQEHFwMwUjAmBggr +BgEFBQcCARYaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIw +HBoaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9ycGEwMAYDVR0fBCkwJzAloCOgIYYf +aHR0cDovL3MxLnN5bWNiLmNvbS9wY2EzLWc1LmNybDAdBgNVHSUEFjAUBggrBgEF +BQcDAgYIKwYBBQUHAwMwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRow +GAYDVQQDExFTeW1hbnRlY1BLSS0xLTU2NzAdBgNVHQ4EFgQUljtT8Hkzl699g+8u +K8zKt4YecmYwHwYDVR0jBBgwFoAUf9Nlp8Ld7LvwMAnzQzn6Aq8zMTMwDQYJKoZI +hvcNAQELBQADggEBABOFGh5pqTf3oL2kr34dYVP+nYxeDKZ1HngXI9397BoDVTn7 +cZXHZVqnjjDSRFph23Bv2iEFwi5zuknx0ZP+XcnNXgPgiZ4/dB7X9ziLqdbPuzUv +M1ioklbRyE07guZ5hBb8KLCxR/Mdoj7uh9mmf6RWpT+thC4p3ny8qKqjPQQB6rqT +og5QIikXTIfkOhFf1qQliZsFay+0yQFMJ3sLrBkFIqBgFT/ayftNTI/7cmd3/SeU +x7o1DohJ/o39KK9KEr0Ns5cF3kQMFfo2KwPcwVAB8aERXRTl4r0nS1S+K4ReD6bD +dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE= +-----END CERTIFICATE----- + +Certificate owner: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +Timestamp: + +Certificate owner: CN=Symantec SHA256 TimeStamping Signer - G2, OU=Symantec Trust Network, O=Symantec Corporation, C=US + +-----BEGIN CERTIFICATE----- +MIIFSzCCBDOgAwIBAgIQVFjyqtdB1kS8hKl7oJZS5jANBgkqhkiG9w0BAQsFADB3 +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj +IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMTcwMTAyMDAwMDAwWhcNMjgwNDAx +MjM1OTU5WjCBgDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBv +cmF0aW9uMR8wHQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTEwLwYDVQQD +EyhTeW1hbnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIFNpZ25lciAtIEcyMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmfP82AQJA4b511ymk8BCfOp8Y89d +AOKO88CQ348p9RjqlLeS5dewoHOB6OkKm0p8Af+dj6Q5pw7qRfQiDDpw7TlFi+TF +G1zwRWhGJAVjdpsc/J5sKrFW5Yp/UnGu8jXVRiMGHM9ILR20zbjZdiOOHP8+v7sG +XGkHpmUO+F6ufS7tTa4178nXAEL9KJUOn11yQgm8w9pE0u3MR4Tk/MotrFi+rveu +2UQNCLfCd9YaQ3DRbgPeUpLEEAhx2boiVfIfvO2bnTviXh1Mg/+XD3sL51WDTtIN +677X7K5uR7mf36XWUbwEVe3/J3BMye0qSxPhsblMD8kB7lVlX2kCeGbLPwIDAQAB +o4IBxzCCAcMwDAYDVR0TAQH/BAIwADBmBgNVHSAEXzBdMFsGC2CGSAGG+EUBBxcD +MEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8vZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUF +BwICMBkaF2h0dHBzOi8vZC5zeW1jYi5jb20vcnBhMEAGA1UdHwQ5MDcwNaAzoDGG +L2h0dHA6Ly90cy1jcmwud3Muc3ltYW50ZWMuY29tL3NoYTI1Ni10c3MtY2EuY3Js +MBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMIMA4GA1UdDwEB/wQEAwIHgDB3BggrBgEF +BQcBAQRrMGkwKgYIKwYBBQUHMAGGHmh0dHA6Ly90cy1vY3NwLndzLnN5bWFudGVj +LmNvbTA7BggrBgEFBQcwAoYvaHR0cDovL3RzLWFpYS53cy5zeW1hbnRlYy5jb20v +c2hhMjU2LXRzcy1jYS5jZXIwKAYDVR0RBCEwH6QdMBsxGTAXBgNVBAMTEFRpbWVT +dGFtcC0yMDQ4LTUwHQYDVR0OBBYEFAm1wf6WcpcpQ5rJ4AK6rvj9L7r2MB8GA1Ud +IwQYMBaAFK9j1sqjToVy4Ke8QfMpojh/gHViMA0GCSqGSIb3DQEBCwUAA4IBAQAX +swqI6VxaXiBrOwoVsmzFqYoyh9Ox9BxTroW+P5v/17y3lIW0x1J+lOi97WGy1KeZ +5MPJk8E1PQvoaApdVpi9sSI70UR617/wbVEyitUj3zgBN/biUyt6KxGPt01sejMD +G3xrCZQXu+TbWNQhE2Xn7NElyix1mpx//Mm7KmirxH20z6PJbKfZxACciQp3kfRN +ovsxO4Zu9uYfUAOGm7/LQqvmdptyWhEBisbvpW+V592uuuYiZfAYWRsRyc2At9iX +Rx9CCPiscR+wRlOz1LLVo6tQdUgSF4Ktz+BBTzJ+zZUcv5GKCD2kp2cClt8kTKXQ +QcCCYKOKFzJL07zPpLSM +-----END CERTIFICATE----- + +Certificate owner: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US + +-----BEGIN CERTIFICATE----- +MIIFODCCBCCgAwIBAgIQewWx1EloUUT3yYnSnBmdEjANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0xNjAxMTIwMDAwMDBaFw0zMTAxMTEyMzU5NTlaMHcxCzAJBgNVBAYTAlVTMR0w +GwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMg +VHJ1c3QgTmV0d29yazEoMCYGA1UEAxMfU3ltYW50ZWMgU0hBMjU2IFRpbWVTdGFt +cGluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtZnVlVT52M +cl0agaLrVfOwAa08cawyjwVrhponADKXak3JZBRLKbvC2Sm5Luxjs+HPPwtWkPhi +G37rpgfi3n9ebUA41JEG50F8eRzLy60bv9iVkfPw7mz4rZY5Ln/BJ7h4OcWEpe3t +r4eOzo3HberSmLU6Hx45ncP0mqj0hOHE0XxxxgYptD/kgw0mw3sIPk35CrczSf/K +O9T1sptL4YiZGvXA6TMU1t/HgNuR7v68kldyd/TNqMz+CfWTN76ViGrF3PSxS9TO +6AmRX7WEeTWKeKwZMo8jwTJBG1kOqT6xzPnWK++32OTVHW0ROpL2k8mc40juu1MO +1DaXhnjFoTcCAwEAAaOCAXcwggFzMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8E +CDAGAQH/AgEAMGYGA1UdIARfMF0wWwYLYIZIAYb4RQEHFwMwTDAjBggrBgEFBQcC +ARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoXaHR0cHM6 +Ly9kLnN5bWNiLmNvbS9ycGEwLgYIKwYBBQUHAQEEIjAgMB4GCCsGAQUFBzABhhJo +dHRwOi8vcy5zeW1jZC5jb20wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3Muc3lt +Y2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUEDDAKBggrBgEFBQcDCDAo +BgNVHREEITAfpB0wGzEZMBcGA1UEAxMQVGltZVN0YW1wLTIwNDgtMzAdBgNVHQ4E +FgQUr2PWyqNOhXLgp7xB8ymiOH+AdWIwHwYDVR0jBBgwFoAUtnf6aUhHn1MS1cLq +BzJ2B9GXBxkwDQYJKoZIhvcNAQELBQADggEBAHXqsC3VNBlcMkX+DuHUT6Z4wW/X +6t3cT/OhyIGI96ePFeZAKa3mXfSi2VZkhHEwKt0eYRdmIFYGmBmNXXHy+Je8Cf0c +kUfJ4uiNA/vMkC/WCmxOM+zWtJPITJBjSDlAIcTd1m6JmDy1mJfoqQa3CcmPU1dB +kC/hHk1O3MoQeGxCbvC2xfhhXFL1TvZrjfdKer7zzf0D19n2A6gP41P3CnXsxnUu +qmaFBJm3+AZX4cYO9uiv2uybGB+queM6AL/OipTLAduexzi7D1Kr0eOUA2AKTaD+ +J20UMvw/l0Dhv5mJ2+Q5FL3a5NPD6itas5VYVQR9x5rsIwONhSrS/66pYYE= +-----END CERTIFICATE----- + diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem --- openjdk-17-17.0.13+11/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,73 @@ +-----BEGIN CERTIFICATE----- +MIIHTzCCBjegAwIBAgIQPYH1xfKSpwYMrTEqOxG4OzANBgkqhkiG9w0BAQsFADCB +ijELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8w +HQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTswOQYDVQQDEzJTeW1hbnRl +YyBDbGFzcyAzIEV4dGVuZGVkIFZhbGlkYXRpb24gU0hBMjU2IFNTTCBDQTAeFw0x +NzA1MDEwMDAwMDBaFw0xOTA1MDEyMzU5NTlaMIIBLTETMBEGCysGAQQBgjc8AgED +EwJVUzEZMBcGCysGAQQBgjc8AgECDAhEZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0 +ZSBPcmdhbml6YXRpb24xEDAOBgNVBAUTBzIxNTgxMTMxCzAJBgNVBAYTAlVTMQ4w +DAYDVQQRDAU5NDA0MzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 +bnRhaW4gVmlldzEZMBcGA1UECQwQMzUwIEVsbGlzIFN0cmVldDEdMBsGA1UECgwU +U3ltYW50ZWMgQ29ycG9yYXRpb24xFzAVBgNVBAsMDlJvb3QgMiAtIFZBTElEMS0w +KwYDVQQDDCR2YWxpZC1yb290Mi53ZWJzZWN1cml0eS5zeW1hbnRlYy5jb20wggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDjQDZuIKKgrjmO0+0ty8WIlFZk +HcvIGX/kIAxByd/XA19h0Zk6kjFLgZaRtsUdRotG40DST72Ki8Vmy7nX3w/cqpFg +0x0nl7ZORE/L1EjEOUApqEpaA5GtcMaznu/SVVp2mZgoOWhn4EAvocT6GKQWaKi1 +/tCh6UiieHRz6L29CrN6/JWT6OXv6TGePkGcVKSjJrZoNMiNzoTFyCdvVpYutZiv +YsMzcRJ+KxTepwFM1imssBGc5WM2Wit+Z3kWJhYe0IdOIdqmuR6WxwLGb7nrY44R +dPy+h0n71GJvjbEzI+Qb/ehc8HjOGba0sh/+x/p14t7PplDZyicxzaC/tpTnAgMB +AAGjggMJMIIDBTAvBgNVHREEKDAmgiR2YWxpZC1yb290Mi53ZWJzZWN1cml0eS5z +eW1hbnRlYy5jb20wCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw +FAYIKwYBBQUHAwEGCCsGAQUFBwMCMG8GA1UdIARoMGYwWwYLYIZIAYb4RQEHFwYw +TDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUH +AgIwGQwXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwBwYFZ4EMAQEwHwYDVR0jBBgw +FoAUsm3j5BQPjDxzQqZamRrTFHW2htswKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDov +L3NoLnN5bWNiLmNvbS9zaC5jcmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUFBzAB +hhNodHRwOi8vc2guc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8vc2guc3lt +Y2IuY29tL3NoLmNydDCCAX4GCisGAQQB1nkCBAIEggFuBIIBagFoAHYA3esdK3oN +T6Ygi4GtgWhwfi6OnQHVXIiNPRHEzbbsvswAAAFbxYHx8wAABAMARzBFAiEAoZAV +7qASZQXq7visy9vw4552zDWP/+K/8FmgvPpFHuACICl4k+7Omje9NoIRTwnPs4fm +fqW4rDXzK+HKIGNfEmQ4AHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN +3BAAAAFbxYHyLgAABAMARzBFAiAuvBGEqgabzmMmG2Tzv1KjGR0nTtEz1R1XluNc +w8NrnAIhAOBL9OgiJfN4SRq6Gmfesx8BJGFr7pDfpDKECGOT1uqZAHYA7ku9t3XO +YLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFbxYHz8gAABAMARzBFAiEA2/T1 +kmfJQ/F0SrRDPozVMhaQW/ydrynOQovjsNJM3M0CIEN0T1ac8FsiatIVoxv690J3 +sIfanWlSX7UvPVShVGg2MA0GCSqGSIb3DQEBCwUAA4IBAQB4unTd5lxCGKsEyViE +m1AZpxTwISBdxuixpXoskuHwCw5LApp8WbaO0W4h4ZLfL+P2cAKx7awvfsaLKQ0i +tnmhyCZitwI9cfmRs8wwU3WgVH/CiIWv96R9mqA8AQ0pMRUp240idzd/VkLYc2RL +CFECQOdsgflyp95PqWyFD1aGdMmwCW5nFUYkbA18cJER5VG9nquBNROzM14z73Wa +PelMX56on9fk+KgryPQIMJFQxqwWbiszby6UaWLQ3ZDKiNwdJsmZWvQ/Gw05NTtp +J1gOExSwrDQM0X5gxMaSxTDU7zEWQz2kjYWjdtdtiq8AtRjQ8DlqXseTpHOUB8iW +5vWY +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFSTCCBDGgAwIBAgIQCbdJ/X8LSRbKBVZWz/bZgjANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0xMzA0MDkwMDAwMDBaFw0yMzA0MDgyMzU5NTlaMIGKMQswCQYDVQQGEwJVUzEd +MBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVj +IFRydXN0IE5ldHdvcmsxOzA5BgNVBAMTMlN5bWFudGVjIENsYXNzIDMgRXh0ZW5k +ZWQgVmFsaWRhdGlvbiBTSEEyNTYgU1NMIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAwUo5gP1SVSC5FK9OwhPfSgNKsGXFaGaKJJxyi63peok7gyXs +LFcSKSb3qHD0Y+AGVTyD8cPxY0sypzk9D/exa/G+Xxua5KoXZUbBpue3YXWKmCYZ +HqcPo8eypoUnOQR0G8YHFiqSqOjpm8RaIIoby0YJUeSi5CGDM9UnyXvbqOF2hljp +4b0TV2vgGq9xA7MV8EQB5WFk9fIRmVLs7ej1PRNrISfCxgPA8g/VWH/17yql/yjq +jeWOdt8sZmSbNb9j/Z9KSJ8whT7VsvH+yESoWC6gnWC9Cs7BJQgcTfK0w+tcOLfY +1JslzuMzFs/JL8wocPpjdNXExxEVpZnyKSLABQIDAQABo4IBdDCCAXAwNwYIKwYB +BQUHAQEEKzApMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC53cy5zeW1hbnRlYy5j +b20wEgYDVR0TAQH/BAgwBgEB/wIBADBlBgNVHSAEXjBcMFoGBFUdIAAwUjAmBggr +BgEFBQcCARYaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIw +HBoaaHR0cDovL3d3dy5zeW1hdXRoLmNvbS9ycGEwPgYDVR0fBDcwNTAzoDGgL4Yt +aHR0cDovL2NybC53cy5zeW1hbnRlYy5jb20vdW5pdmVyc2FsLXJvb3QuY3JsMA4G +A1UdDwEB/wQEAwIBBjAqBgNVHREEIzAhpB8wHTEbMBkGA1UEAxMSVmVyaVNpZ25N +UEtJLTItMzcyMB0GA1UdDgQWBBSybePkFA+MPHNCplqZGtMUdbaG2zAfBgNVHSME +GDAWgBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEAdJ3d +mGjc+GgcDYkNvwlH3cWvtjX7EqazxfQGSbmJcnB0fKn1cxQh6wAW9VOsKBq0salx +V6wBS/SYJMULRSKRRtL+1rYIRPMbgwUcFMBo34qHylbm72/zlBO0W4VPrVe68Ow7 +gOeiAV+7ZYUARJc0uNiuIW+Xva9zHMVw3Mb3x2sgh6oEYmnI9sPzpHSPG1VPKrsH +NUZlCdqof2NXVfDrn0kVlVeqf8tER1EAWVaDHUCRLdgd0l9x7ibBbkUNxU0SP7+R +5TYnB2qysmYrhf8nQaKSs8pOAY371fbh5FTWa8ySae7kOY6dNM4Us/CAauNW7mW0 +zB9UpGiJBN2YLL3Pow== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/security/tools/keytool/KeyToolTest.java openjdk-17-17.0.14+7/test/jdk/sun/security/tools/keytool/KeyToolTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/security/tools/keytool/KeyToolTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/security/tools/keytool/KeyToolTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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,6 +23,7 @@ /* * @test + * @library /java/security/testlibrary * @bug 6251120 8231950 8242151 * @summary Testing keytool * @@ -67,6 +68,7 @@ import java.util.*; import java.security.cert.X509Certificate; import jdk.test.lib.util.FileUtils; +import jdk.test.lib.security.SecurityUtils; import sun.security.util.ObjectIdentifier; @@ -102,6 +104,8 @@ "-srcproviderName SunPKCS11-nzz " + "-addprovider SunPKCS11 " + "-providerArg p11-nzz.txt "; + private static final int KEY_LENGTH_DSA = SecurityUtils.getTestKeySize("DSA"); + private static final int KEY_LENGTH_RSA = SecurityUtils.getTestKeySize("RSA"); String p11Arg, srcP11Arg; @@ -191,7 +195,7 @@ // SunPKCS11-NSS does not support SHA256withDSA yet. if (cmd.contains("p11-nss.txt") && cmd.contains("-genkey") && cmd.contains("DSA")) { - cmd += " -sigalg SHA1withDSA -keysize 1024"; + cmd += " -sigalg SHA256withDSA -keysize " + KEY_LENGTH_DSA; } test(input, cmd); } catch(Exception e) { @@ -954,6 +958,9 @@ // sig not compatible testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + "-keypass changeit -selfcert -sigalg MD5withRSA"); + // sig not compatible + testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + + "-keypass changeit -selfcert -sigalg SHA256withRSA"); // bad pass testFail("", "-keystore x.jks -storetype JKS -storepass wrong " + "-keypass changeit -selfcert"); @@ -1061,10 +1068,10 @@ "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 999 " + "-alias n5"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 512 " + + "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 2048 " + "-alias n6"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 1024 " + + "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 3072 " + "-alias n7"); testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala " + @@ -1077,6 +1084,9 @@ "-sigalg MD5withRSA -alias n10"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " + + "-sigalg SHA256withRSA -alias n10-1"); + testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + + "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " + "-sigalg SHA1withRSA -alias n11"); testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit " + "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " + @@ -1151,16 +1161,20 @@ remove("csr1"); // PrivateKeyEntry can do certreq testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 1024"); + "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize " + + KEY_LENGTH_DSA); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + "-certreq -file csr1 -alias mykey"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + "-certreq -file csr1"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-certreq -file csr1 -sigalg SHA1withDSA"); - // unmatched sigalg + "-certreq -file csr1 -sigalg SHA256withDSA"); + // unmatched md5 testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + "-certreq -file csr1 -sigalg MD5withRSA"); + // unmatched sha + testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + + "-certreq -file csr1 -sigalg SHA256withRSA"); // misc test // bad storepass testFail("", "-keystore x.jks -storetype JKS -storepass badstorepass " + @@ -1191,9 +1205,9 @@ "-certreq -file csr1"); // unmatched sigalg testFail("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-certreq -file csr1 -sigalg SHA1withDSA"); + "-certreq -file csr1 -sigalg SHA256withDSA"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + - "-certreq -file csr1 -sigalg MD5withRSA"); + "-certreq -file csr1 -sigalg SHA256withRSA"); // TrustedCertificateEntry cannot do certreq testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + "-exportcert -file x.jks.p1.cert"); @@ -1222,6 +1236,9 @@ "-keypass changeit -genkeypair -dname CN=weak -keyalg rsa " + "-keysize 512 -sigalg MD5withRSA -alias myweakkey"); testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + + "-keypass changeit -genkeypair -dname CN=weak -keyalg rsa -keysize " + + KEY_LENGTH_RSA + " -sigalg SHA256withRSA -alias myweakkey-sha"); + testOK("", "-keystore x.jks -storetype JKS -storepass changeit " + "-export -file myweakkey.cert -alias myweakkey"); testFail("", "-printcert -file badkeystore"); testFail("", "-printcert -file a/b/c/d"); @@ -1672,31 +1689,32 @@ remove("x.jks"); testOK("", "-help"); - // 2. keytool -genkey -keyalg DSA -v -keysize 512 Enter "a" for the keystore + // 2. keytool -genkey -keyalg DSA -v -keysize Enter "a" for the keystore // password. Check error (password too short). Enter "password" for // the keystore password. Hit 'return' for "first and last name", // "organizational unit", "City", "State", and "Country Code". // Type "yes" when they ask you if everything is correct. // Type 'return' for new key password. testOK("a\npassword\npassword\nMe\nHere\nNow\nPlace\nPlace\nUS\nyes\n\n", - "-genkey -keyalg DSA -v -keysize 512 -keystore x.jks -storetype JKS"); + "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA + " -keystore x.jks " + + "-storetype JKS"); // 3. keytool -list -v -storepass password testOK("", "-list -v -storepass password -keystore x.jks -storetype JKS"); // 4. keytool -list -v Type "a" for the keystore password. // Check error (wrong keystore password). testFail("a\n", "-list -v -keystore x.jks -storetype JKS"); assertTrue(ex.indexOf("password was incorrect") != -1); - // 5. keytool - -keyalg DSA -v -keysize 512 Enter "password" as the password. + // 5. keytool - -keyalg DSA -v -keysize Enter "password" as the password. // Check error (alias 'mykey' already exists). - testFail("password\n", "-genkey -keyalg DSA -v -keysize 512" + + testFail("password\n", "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA + " -keystore x.jks -storetype JKS"); assertTrue(ex.indexOf("alias already exists") != -1); - // 6. keytool -genkey -keyalg DSA -v -keysize 512 -alias mykey2 -storepass password + // 6. keytool -genkey -keyalg DSA -v -keysize -alias mykey2 -storepass password // Hit 'return' for "first and last name", "organizational unit", "City", // "State", and "Country Code". Type "yes" when they ask you if // everything is correct. Type 'return' for new key password. - testOK("\n\n\n\n\n\nyes\n\n", "-genkey -keyalg DSA -v -keysize 512 -alias mykey2" + - " -storepass password -keystore x.jks -storetype JKS"); + testOK("\n\n\n\n\n\nyes\n\n", "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA + + " -alias mykey2 -storepass password -keystore x.jks -storetype JKS"); // 7. keytool -list -v Type 'password' for the store password. testOK("password\n", "-list -v -keystore x.jks -storetype JKS"); // 8. keytool -keypasswd -v -alias mykey2 -storepass password @@ -1776,7 +1794,7 @@ // 1. sccs edit cert8.db key3.db //Runtime.getRuntime().exec("/usr/bin/sccs edit cert8.db key3.db"); testOK("", p11Arg + ("-storepass test12 -genkey -alias genkey" + - " -dname cn=genkey -keysize 512 -keyalg rsa")); + " -dname cn=genkey -keysize " + KEY_LENGTH_RSA + " -keyalg rsa")); testOK("", p11Arg + "-storepass test12 -list"); testOK("", p11Arg + "-storepass test12 -list -alias genkey"); testOK("", p11Arg + @@ -1865,172 +1883,4 @@ public TestException(String e) { super(e); } -} - -/** - * HumanInputStream tries to act like a human sitting in front of a computer - * terminal typing on the keyboard while the keytool program is running. - * - * keytool has called InputStream.read() and BufferedReader.readLine() in - * various places. a call to B.readLine() will try to buffer as much input as - * possible. Thus, a trivial InputStream will find it impossible to feed - * anything to I.read() after a B.readLine() call. - * - * This is why i create HumanInputStream, which will only send a single line - * to B.readLine(), no more, no less, and the next I.read() can have a chance - * to read the exact character right after "\n". - * - * I don't know why HumanInputStream works. - */ -class HumanInputStream extends InputStream { - byte[] src; - int pos; - int length; - boolean inLine; - int stopIt; - - public HumanInputStream(String input) { - src = input.getBytes(); - pos = 0; - length = src.length; - stopIt = 0; - inLine = false; - } - - // the trick: when called through read(byte[], int, int), - // return -1 twice after "\n" - - @Override public int read() throws IOException { - int re; - if(pos < length) { - re = src[pos]; - if(inLine) { - if(stopIt > 0) { - stopIt--; - re = -1; - } else { - if(re == '\n') { - stopIt = 2; - } - pos++; - } - } else { - pos++; - } - } else { - re = -1;//throw new IOException("NO MORE TO READ"); - } - //if (re < 32) System.err.printf("[%02d]", re); - //else System.err.printf("[%c]", (char)re); - return re; - } - @Override public int read(byte[] buffer, int offset, int len) { - inLine = true; - try { - int re = super.read(buffer, offset, len); - return re; - } catch(Exception e) { - throw new RuntimeException("HumanInputStream error"); - } finally { - inLine = false; - } - } - @Override public int available() { - if(pos < length) return 1; - return 0; - } - - // test part - static void assertTrue(boolean bool) { - if(!bool) - throw new RuntimeException(); - } - - public static void test() throws Exception { - - class Tester { - HumanInputStream is; - BufferedReader reader; - Tester(String s) { - is = new HumanInputStream(s); - reader = new BufferedReader(new InputStreamReader(is)); - } - - // three kinds of test method - // 1. read byte by byte from InputStream - void testStreamReadOnce(int expection) throws Exception { - assertTrue(is.read() == expection); - } - void testStreamReadMany(String expection) throws Exception { - char[] keys = expection.toCharArray(); - for(int i=0; i { // warm-up predicate return s.contains("Welcome to JShell"); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/tools/jhsdb/JStackStressTest.java openjdk-17-17.0.14+7/test/jdk/sun/tools/jhsdb/JStackStressTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/tools/jhsdb/JStackStressTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/tools/jhsdb/JStackStressTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -93,7 +93,9 @@ System.out.println("Starting Jshell"); long startTime = System.currentTimeMillis(); try { - ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell")); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell"); + launcher.addVMArgs(Utils.getTestJavaOpts()); + ProcessBuilder pb = new ProcessBuilder(launcher.getCommand()); jShellProcess = ProcessTools.startProcess("JShell", pb); } catch (Exception ex) { throw new RuntimeException("Test ERROR " + ex, ex); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/tools/jinfo/JInfoTest.java openjdk-17-17.0.14+7/test/jdk/sun/tools/jinfo/JInfoTest.java --- openjdk-17-17.0.13+11/test/jdk/sun/tools/jinfo/JInfoTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/tools/jinfo/JInfoTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,9 +60,8 @@ LingeredApp app1 = new JInfoTestLingeredApp(); LingeredApp app2 = new JInfoTestLingeredApp(); try { - String[] params = new String[0];; - LingeredApp.startAppExactJvmOpts(app1, params); - LingeredApp.startAppExactJvmOpts(app2, params); + LingeredApp.startApp(app1); + LingeredApp.startApp(app2); OutputAnalyzer output = jinfo("-flag", "MinHeapFreeRatio=1", "JInfoTestLingeredApp"); output.shouldHaveExitValue(0); output = jinfo("-flag", "MinHeapFreeRatio", "JInfoTestLingeredApp"); @@ -89,9 +88,8 @@ LingeredApp app1 = new JInfoTestLingeredApp(); LingeredApp app2 = new JInfoTestLingeredApp(); try { - String[] params = new String[0]; - LingeredApp.startAppExactJvmOpts(app1, params); - LingeredApp.startAppExactJvmOpts(app2, params); + LingeredApp.startApp(app1); + LingeredApp.startApp(app2); OutputAnalyzer output = jinfo("JInfoTestLingeredApp"); output.shouldHaveExitValue(0); // "Runtime Environment" written once per proc diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/tools/jstat/JStatInterval.java openjdk-17-17.0.14+7/test/jdk/sun/tools/jstat/JStatInterval.java --- openjdk-17-17.0.13+11/test/jdk/sun/tools/jstat/JStatInterval.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/tools/jstat/JStatInterval.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,6 +24,7 @@ /** * @test * @bug 8035668 + * @requires vm.flagless * @library /test/lib * @summary Test checks case when target application finishes execution and jstat didn't complete work. jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes @@ -60,9 +61,7 @@ } } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-cp", - System.getProperty("test.class.path"), + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UsePerfData", Application.class.getName() ); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/Month.java openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Month.java --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/Month.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Month.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,11 +21,6 @@ * questions. */ -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * Month enum handles month related manipulation. * @@ -47,15 +42,6 @@ private final String abbr; - private static final Map abbreviations - = new HashMap(12); - - static { - for (Month m : Month.values()) { - abbreviations.put(m.abbr, m); - } - } - private Month(String abbr) { this.abbr = abbr; } @@ -70,11 +56,22 @@ * @return the Month value */ static Month parse(String name) { - Month m = abbreviations.get(name); - if (m != null) { - return m; - } - return null; + int len = name.length(); + + if (name.regionMatches(true, 0, "January", 0, len)) return Month.JANUARY; + if (name.regionMatches(true, 0, "February", 0, len)) return Month.FEBRUARY; + if (name.regionMatches(true, 0, "March", 0, len)) return Month.MARCH; + if (name.regionMatches(true, 0, "April", 0, len)) return Month.APRIL; + if (name.regionMatches(true, 0, "May", 0, len)) return Month.MAY; + if (name.regionMatches(true, 0, "June", 0, len)) return Month.JUNE; + if (name.regionMatches(true, 0, "July", 0, len)) return Month.JULY; + if (name.regionMatches(true, 0, "August", 0, len)) return Month.AUGUST; + if (name.regionMatches(true, 0, "September", 0, len)) return Month.SEPTEMBER; + if (name.regionMatches(true, 0, "October", 0, len)) return Month.OCTOBER; + if (name.regionMatches(true, 0, "November", 0, len)) return Month.NOVEMBER; + if (name.regionMatches(true, 0, "December", 0, len)) return Month.DECEMBER; + + throw new IllegalArgumentException("Unknown month: " + name); } /** diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/RuleDay.java openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleDay.java --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/RuleDay.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleDay.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,11 +21,6 @@ * questions. */ -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * RuleDay class represents the value of the "ON" field. The day of * week values start from 1 following the {@link java.util.Calendar} @@ -34,13 +29,6 @@ * @since 1.4 */ class RuleDay { - private static final Map abbreviations = new HashMap(7); - static { - for (DayOfWeek day : DayOfWeek.values()) { - abbreviations.put(day.getAbbr(), day); - } - } - private String dayName = null; private DayOfWeek dow; private boolean lastOne = false; @@ -166,13 +154,23 @@ return sign + toString(d); } - private static DayOfWeek getDOW(String abbr) { - return abbreviations.get(abbr); + private static DayOfWeek getDOW(String name) { + int len = name.length(); + + if (name.regionMatches(true, 0, "Monday", 0, len)) return DayOfWeek.MONDAY; + if (name.regionMatches(true, 0, "Tuesday", 0, len)) return DayOfWeek.TUESDAY; + if (name.regionMatches(true, 0, "Wednesday", 0, len)) return DayOfWeek.WEDNESDAY; + if (name.regionMatches(true, 0, "Thursday", 0, len)) return DayOfWeek.THURSDAY; + if (name.regionMatches(true, 0, "Friday", 0, len)) return DayOfWeek.FRIDAY; + if (name.regionMatches(true, 0, "Saturday", 0, len)) return DayOfWeek.SATURDAY; + if (name.regionMatches(true, 0, "Sunday", 0, len)) return DayOfWeek.SUNDAY; + + throw new IllegalArgumentException("Unknown day-of-week: " + name); } /** * Converts the specified day of week value to the day-of-week - * name defined in {@link java.util.Calenda}. + * name defined in {@link java.util.Calendar}. * @param dow 1-based day of week value * @return the Calendar day of week name with "Calendar." prefix. * @throws IllegalArgumentException if the specified dow value is out of range. diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/RuleRec.java openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleRec.java --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/RuleRec.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/RuleRec.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -168,12 +168,13 @@ rec.toYear = Integer.parseInt(token); } catch (NumberFormatException e) { // it's not integer - if ("min".equals(token) || "minimum".equals(token)) { + int len = token.length(); + if (token.regionMatches(true, 0, "minimum", 0, len)) { rec.fromYear = Zoneinfo.getMinYear(); - } else if ("max".equals(token) || "maximum".equals(token)) { + } else if (token.regionMatches(true, 0, "maximum", 0, len)) { rec.toYear = Integer.MAX_VALUE; rec.isLastRule = true; - } else if ("only".equals(token)) { + } else if (token.regionMatches(true, 0, "only", 0, len)) { rec.toYear = rec.fromYear; } else { Main.panic("invalid year value: "+token); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java 2025-01-04 20:25:18.000000000 +0000 @@ -50,7 +50,9 @@ "..", "..", "make", "data", "tzdata"); String tzfiles = "africa antarctica asia australasia europe northamerica southamerica backward etcetera gmt"; Path jdk_tzdir = Paths.get(System.getProperty("test.src"), "tzdata_jdk"); - String jdk_tzfiles = "jdk11_backward"; + // tz2024b_overridden_zones file is created to preserve the behaviour of + // "EST", "MST", and "HST" when timezone 2024b changes are applied + String jdk_tzfiles = "jdk11_backward tz2024b_overridden_zones"; String zidir = TESTDIR + File.separator + "zi"; File fZidir = new File(zidir); if (!fZidir.exists()) { diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/Zoneinfo.java openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Zoneinfo.java --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/Zoneinfo.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/Zoneinfo.java 2025-01-04 20:25:18.000000000 +0000 @@ -240,8 +240,9 @@ continue; } String token = tokens.nextToken(); + int len = token.length(); - if (continued || "Zone".equals(token)) { + if (continued || token.regionMatches(true, 0, "Zone", 0, len)){ if (zone == null) { if (!tokens.hasMoreTokens()) { panic("syntax error: zone no more token"); @@ -268,7 +269,7 @@ } zone = null; } - } else if ("Rule".equals(token)) { + } else if (token.regionMatches(true, 0, "Rule", 0, len)) { if (!tokens.hasMoreTokens()) { panic("syntax error: rule no more token"); } @@ -281,7 +282,7 @@ RuleRec rrec = RuleRec.parse(tokens); rrec.setLine(line); rule.add(rrec); - } else if ("Link".equals(token)) { + } else if (token.regionMatches(true, 0, "Link", 0, len)) { // Link try { String name1 = tokens.nextToken(); diff -Nru openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones --- openjdk-17-17.0.13+11/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,36 @@ +# +# Copyright (c) 2024, 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. + +# TZdata2024b changes announced on 5th September 2024 includes changes to +# "EST", "MST", and "HST", i.e., changing those time zones from distinct +# time zones to links to other time zones. Previously +# they were defined as fixed offset zones, +# e.g., "EST" is "-05:00" without any DST transitions. +# With 2024b, "EST" is now a link to "America/Panama." +# This change has Java 8+ specification implications in java.time.ZoneId.SHORT_IDS field +# Solution for jdk24+ to modify the mappings in ZoneId class which requires modification of the spec. +# Update releases will not make the ZoneId changes due to current specification. + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +Zone EST -5:00 - EST +Zone MST -7:00 - MST +Zone HST -10:00 - HST \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jar/ExtractFilesTest.java openjdk-17-17.0.14+7/test/jdk/tools/jar/ExtractFilesTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jar/ExtractFilesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jar/ExtractFilesTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2024, 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 8335912 + * @summary test extract jar files overwrite existing files behavior + * @library /test/lib + * @modules jdk.jartool + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * @run junit/othervm ExtractFilesTest + */ + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestInstance.Lifecycle; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.spi.ToolProvider; +import java.util.stream.Stream; + +import jdk.test.lib.util.FileUtils; + + @TestInstance(Lifecycle.PER_CLASS) + public class ExtractFilesTest { + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() -> + new RuntimeException("jar tool not found") + ); + + private final String nl = System.lineSeparator(); + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + private final PrintStream out = new PrintStream(baos); + + @BeforeAll + public void setupJar() throws IOException { + mkdir("test1 test2"); + echo("testfile1", "test1/testfile1"); + echo("testfile2", "test2/testfile2"); + jar("cf test.jar -C test1 . -C test2 ."); + rm("test1 test2"); + } + + @AfterAll + public void cleanup() { + rm("test.jar"); + } + + /** + * Regular clean extract with expected output. + */ + @Test + public void testExtract() throws IOException { + jar("xvf test.jar"); + println(); + String output = " created: META-INF/" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: testfile1" + nl + + " inflated: testfile2" + nl; + rm("META-INF testfile1 testfile2"); + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Extract should overwrite existing file as default behavior. + */ + @Test + public void testOverwrite() throws IOException { + touch("testfile1"); + jar("xvf test.jar"); + println(); + String output = " created: META-INF/" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: testfile1" + nl + + " inflated: testfile2" + nl; + Assertions.assertEquals("testfile1", cat("testfile1")); + rm("META-INF testfile1 testfile2"); + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Extract with legacy style option `k` should preserve existing files. + */ + @Test + public void testKeptOldFile() throws IOException { + touch("testfile1"); + jar("xkvf test.jar"); + println(); + String output = " created: META-INF/" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " skipped: testfile1 exists" + nl + + " inflated: testfile2" + nl; + Assertions.assertEquals("", cat("testfile1")); + Assertions.assertEquals("testfile2", cat("testfile2")); + rm("META-INF testfile1 testfile2"); + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Extract with gnu style -k should preserve existing files. + */ + @Test + public void testGnuOptionsKeptOldFile() throws IOException { + touch("testfile1 testfile2"); + jar("-x -k -v -f test.jar"); + println(); + String output = " created: META-INF/" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " skipped: testfile1 exists" + nl + + " skipped: testfile2 exists" + nl; + Assertions.assertEquals("", cat("testfile1")); + Assertions.assertEquals("", cat("testfile2")); + rm("META-INF testfile1 testfile2"); + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Extract with gnu style long option --keep-old-files should preserve existing files. + */ + @Test + public void testGnuLongOptionsKeptOldFile() throws IOException { + touch("testfile2"); + jar("-x --keep-old-files -v -f test.jar"); + println(); + String output = " created: META-INF/" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: testfile1" + nl + + " skipped: testfile2 exists" + nl; + Assertions.assertEquals("testfile1", cat("testfile1")); + Assertions.assertEquals("", cat("testfile2")); + rm("META-INF testfile1 testfile2"); + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Test jar will issue warning when use keep option in non-extraction mode. + */ + @Test + public void testWarningOnInvalidKeepOption() throws IOException { + var err = jar("tkf test.jar"); + println(); + + String output = "META-INF/" + nl + + "META-INF/MANIFEST.MF" + nl + + "testfile1" + nl + + "testfile2" + nl; + + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + Assertions.assertEquals("Warning: The --keep-old-files/-k/k option is not valid with current usage, will be ignored." + nl, err); + } + + private Stream mkpath(String... args) { + return Arrays.stream(args).map(d -> Path.of(".", d.split("/"))); + } + + private void mkdir(String cmdline) { + System.out.println("mkdir -p " + cmdline); + mkpath(cmdline.split(" +")).forEach(p -> { + try { + Files.createDirectories(p); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private void touch(String cmdline) { + System.out.println("touch " + cmdline); + mkpath(cmdline.split(" +")).forEach(p -> { + try { + Files.createFile(p); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private void echo(String text, String path) { + System.out.println("echo '" + text + "' > " + path); + try { + var p = Path.of(".", path.split("/")); + Files.writeString(p, text); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + } + + private String cat(String path) { + System.out.println("cat " + path); + try { + return Files.readString(Path.of(path)); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + } + + private void rm(String cmdline) { + System.out.println("rm -rf " + cmdline); + mkpath(cmdline.split(" +")).forEach(p -> { + try { + if (Files.isDirectory(p)) { + FileUtils.deleteFileTreeWithRetry(p); + } else { + FileUtils.deleteFileIfExistsWithRetry(p); + } + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private String jar(String cmdline) throws IOException { + System.out.println("jar " + cmdline); + baos.reset(); + + // the run method catches IOExceptions, we need to expose them + ByteArrayOutputStream baes = new ByteArrayOutputStream(); + PrintStream err = new PrintStream(baes); + PrintStream saveErr = System.err; + System.setErr(err); + try { + int rc = JAR_TOOL.run(out, err, cmdline.split(" +")); + if (rc != 0) { + throw new IOException(baes.toString()); + } + } finally { + System.setErr(saveErr); + } + return baes.toString(); + } + + private void println() throws IOException { + System.out.println(new String(baos.toByteArray())); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jar/MultipleManifestTest.java openjdk-17-17.0.14+7/test/jdk/tools/jar/MultipleManifestTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jar/MultipleManifestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jar/MultipleManifestTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2024, 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 8335912 + * @summary test extract jar with multpile manifest files + * @library /test/lib + * @modules jdk.jartool + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * @run junit/othervm MultipleManifestTest + */ + +import java.io.ByteArrayOutputStream; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestInstance.Lifecycle; + +import java.io.IOException; +import java.io.PrintStream; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import java.util.spi.ToolProvider; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import jdk.test.lib.util.FileUtils; + +@TestInstance(Lifecycle.PER_CLASS) +class MultipleManifestTest { + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() -> + new RuntimeException("jar tool not found") + ); + + private final String nl = System.lineSeparator(); + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + private final PrintStream jarOut = new PrintStream(baos); + + static final Path zip = Path.of("MultipleManifestTest.jar"); + static final String jdkVendor = System.getProperty("java.vendor"); + static final String jdkVersion = System.getProperty("java.version"); + static final String MANIFEST1 = "Manifest-Version: 1.0" + + System.lineSeparator() + + "Created-By: " + jdkVersion + " (" + jdkVendor + ")"; + static final String MANIFEST2 = "Manifest-Version: 2.0" + + System.lineSeparator() + + "Created-By: " + jdkVersion + " (" + jdkVendor + ")"; + static final String MANIFEST3 = "Manifest-Version: 3.0" + + System.lineSeparator() + + "Created-By: " + jdkVersion + " (" + jdkVendor + ")"; + private static final String META_INF = "META-INF/"; + + /** + * Delete the ZIP file produced by this test + * + * @throws IOException if an unexpected IOException occurs + */ + @AfterAll + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Create a JAR with the Manifest as the 1st, 2nd and 4th entry + * + * @throws IOException if an error occurs + */ + @BeforeAll + public void writeManifestAsFirstSecondAndFourthEntry() throws IOException { + int locPosA, locPosB, cenPos; + System.out.printf("%n%n*****Creating Jar with the Manifest as the 1st, 2nd and 4th entry*****%n%n"); + var out = new ByteArrayOutputStream(1024); + try (var zos = new ZipOutputStream(out)) { + zos.putNextEntry(new ZipEntry(JarFile.MANIFEST_NAME)); + zos.write(MANIFEST1.getBytes(StandardCharsets.UTF_8)); + zos.closeEntry(); + locPosA = out.size(); + zos.putNextEntry(new ZipEntry(META_INF + "AANIFEST.MF")); + zos.write(MANIFEST2.getBytes(StandardCharsets.UTF_8)); + zos.putNextEntry(new ZipEntry("entry1.txt")); + zos.write("entry1".getBytes(StandardCharsets.UTF_8)); + zos.closeEntry(); + locPosB = out.size(); + zos.putNextEntry(new ZipEntry(META_INF + "BANIFEST.MF")); + zos.write(MANIFEST3.getBytes(StandardCharsets.UTF_8)); + zos.putNextEntry(new ZipEntry("entry2.txt")); + zos.write("hello entry2".getBytes(StandardCharsets.UTF_8)); + zos.flush(); + cenPos = out.size(); + } + var template = out.toByteArray(); + // ISO_8859_1 to keep the 8-bit value + var s = new String(template, StandardCharsets.ISO_8859_1); + // change META-INF/AANIFEST.MF to META-INF/MANIFEST.MF + var loc = s.indexOf("AANIFEST.MF", locPosA); + var cen = s.indexOf("AANIFEST.MF", cenPos); + template[loc] = template[cen] = (byte) 'M'; + // change META-INF/BANIFEST.MF to META-INF/MANIFEST.MF + loc = s.indexOf("BANIFEST.MF", locPosB); + cen = s.indexOf("BANIFEST.MF", cenPos); + template[loc] = template[cen] = (byte) 'M'; + Files.write(zip, template); + } + + @AfterEach + public void removeExtractedFiles() { + rm("META-INF entry1.txt entry2.txt"); + } + + /** + * Extract by default should have the last manifest. + */ + @Test + public void testOverwrite() throws IOException { + jar("xvf " + zip.toString()); + println(); + Assertions.assertEquals("3.0", getManifestVersion()); + String output = " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: entry1.txt" + nl + + " inflated: META-INF/MANIFEST.MF" + nl + + " inflated: entry2.txt" + nl; + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + /** + * Extract with k option should have first manifest. + */ + @Test + public void testKeptOldFile() throws IOException { + jar("xkvf " + zip.toString()); + println(); + Assertions.assertEquals("1.0", getManifestVersion()); + String output = " inflated: META-INF/MANIFEST.MF" + nl + + " skipped: META-INF/MANIFEST.MF exists" + nl + + " inflated: entry1.txt" + nl + + " skipped: META-INF/MANIFEST.MF exists" + nl + + " inflated: entry2.txt" + nl; + Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes()); + } + + private String getManifestVersion() throws IOException { + try (var is = Files.newInputStream(Path.of(JarFile.MANIFEST_NAME))) { + var manifest = new Manifest(is); + return manifest.getMainAttributes().getValue(Attributes.Name.MANIFEST_VERSION); + } + } + + private void jar(String cmdline) throws IOException { + System.out.println("jar " + cmdline); + baos.reset(); + + // the run method catches IOExceptions, we need to expose them + ByteArrayOutputStream baes = new ByteArrayOutputStream(); + PrintStream err = new PrintStream(baes); + PrintStream saveErr = System.err; + System.setErr(err); + try { + int rc = JAR_TOOL.run(jarOut, err, cmdline.split(" +")); + if (rc != 0) { + throw new IOException(baes.toString()); + } + } finally { + System.setErr(saveErr); + } + } + + private void println() throws IOException { + System.out.println(new String(baos.toByteArray())); + } + + private Stream mkpath(String... args) { + return Arrays.stream(args).map(d -> Path.of(".", d.split("/"))); + } + + private void rm(String cmdline) { + System.out.println("rm -rf " + cmdline); + mkpath(cmdline.split(" +")).forEach(p -> { + try { + if (Files.isDirectory(p)) { + FileUtils.deleteFileTreeWithRetry(p); + } else { + FileUtils.deleteFileIfExistsWithRetry(p); + } + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } +} \ No newline at end of file diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jimage/JImageToolTest.java openjdk-17-17.0.14+7/test/jdk/tools/jimage/JImageToolTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jimage/JImageToolTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jimage/JImageToolTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ args.add("jdk.tools.jimage.Main"); args.addAll(Arrays.asList(jimageArgs)); - ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); + ProcessBuilder builder = ProcessTools.createLimitedTestJavaProcessBuilder(args.toArray(new String[args.size()])); int res = builder.inheritIO().start().waitFor(); if (res != 0) { diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/JLinkReproducibleTest.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/JLinkReproducibleTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/JLinkReproducibleTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/JLinkReproducibleTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -37,6 +37,9 @@ * @run driver JLinkReproducibleTest */ public class JLinkReproducibleTest { + + private static final String TOOL_VM_OPTIONS = System.getProperty("test.tool.vm.opts", ""); + private static void run(List cmd) throws Exception { var pb = new ProcessBuilder(cmd.toArray(new String[0])); var res = ProcessTools.executeProcess(pb); @@ -46,6 +49,9 @@ private static void jlink(Path image, boolean with_default_trace_file) throws Exception { var cmd = new ArrayList(); cmd.add(JDKToolFinder.getJDKTool("jlink")); + if (!TOOL_VM_OPTIONS.isEmpty()) { + cmd.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1))); + } cmd.addAll(List.of( "--module-path", JMODS_DIR.toString() + File.pathSeparator + CLASS_DIR.toString(), "--add-modules", "main", diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2024, 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.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.spi.ToolProvider; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import jdk.test.lib.compiler.CompilerUtils; +import jdk.test.lib.util.FileUtils; + +import static jdk.test.lib.process.ProcessTools.*; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.BeforeAll; +import static org.junit.jupiter.api.Assertions.*; + +/** + * @test + * @bug 8322809 + * @library /test/lib + * @modules jdk.compiler jdk.jlink + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.process.ProcessTools + * jdk.test.lib.util.FileUtils + * ModuleMainClassTest + * @run junit ModuleMainClassTest + */ + +public class ModuleMainClassTest { + private static final String JAVA_HOME = System.getProperty("java.home"); + private static final String TEST_SRC = System.getProperty("test.src"); + + private static final Path SRC_DIR = Path.of(TEST_SRC, "src"); + private static final Path MODS_DIR = Path.of("mods"); + private static final Path JMODS_DIR = Path.of("jmods"); + + private static final Path IMAGE = Path.of("image"); + + // the module names are sorted by the plugin and so these names cover + // the cases that are before and after the elements of `jdk.*` modules + // with main classes + private static String[] modules = new String[] {"com.foo", "net.foo"}; + + private static boolean hasJmods() { + if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) { + System.err.println("Test skipped. NO jmods directory"); + return false; + } + return true; + } + + @BeforeAll + public static void compileAll() throws Throwable { + if (!hasJmods()) return; + + for (String mn : modules) { + Path msrc = SRC_DIR.resolve(mn); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, + "--module-source-path", SRC_DIR.toString(), + "--add-exports", "java.base/jdk.internal.module=" + mn)); + } + + if (Files.exists(IMAGE)) { + FileUtils.deleteFileTreeUnchecked(IMAGE); + } + + // create JMOD files + Files.createDirectories(JMODS_DIR); + Stream.of(modules).forEach(mn -> + assertTrue(jmod("create", + "--class-path", MODS_DIR.resolve(mn).toString(), + "--main-class", mn + ".Main", + JMODS_DIR.resolve(mn + ".jmod").toString()) == 0) + ); + + // the run-time image created will have 4 modules with main classes + createImage(IMAGE, "com.foo"); + } + + @Test + public void testComFoo() throws Exception { + if (!hasJmods()) return; + + Path java = IMAGE.resolve("bin").resolve("java"); + assertTrue(executeProcess(java.toString(), + "-m", "com.foo") + .outputTo(System.out) + .errorTo(System.out) + .getExitValue() == 0); + } + + @Test + public void testNetFoo() throws Exception { + if (!hasJmods()) return; + + Path java = IMAGE.resolve("bin").resolve("java"); + assertTrue(executeProcess(java.toString(), + "-m", "net.foo") + .outputTo(System.out) + .errorTo(System.out) + .getExitValue() == 0); + } + + static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink") + .orElseThrow(() -> new RuntimeException("jlink tool not found")); + + static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod") + .orElseThrow(() -> new RuntimeException("jmod tool not found")); + + private static void createImage(Path outputDir, String... modules) throws Throwable { + assertTrue(JLINK_TOOL.run(System.out, System.out, + "--output", outputDir.toString(), + "--add-modules", Arrays.stream(modules).collect(Collectors.joining(",")), + "--module-path", JMODS_DIR.toString()) == 0); + } + + private static int jmod(String... options) { + System.out.println("jmod " + Arrays.asList(options)); + return JMOD_TOOL.run(System.out, System.out, options); + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/com/foo/Main.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/com/foo/Main.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/com/foo/Main.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/com/foo/Main.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024, 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 com.foo; + +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.util.stream.Stream; + +/** + * Sanity test if SystemModules pre-resolved at link-time for com.foo + * with main class is loaded properly. + */ +public class Main { + public static void main(String... args) throws Exception { + ModuleDescriptor md = Main.class.getModule().getDescriptor(); + System.out.println(md); + + checkMainClass("com.foo", "com.foo.Main"); + checkMainClass("net.foo", "net.foo.Main"); + } + + static void checkMainClass(String mn, String mainClass) { + String cn = ModuleFinder.ofSystem().find(mn).get().descriptor().mainClass().get(); + if (!cn.equals(mainClass)) { + throw new RuntimeException("Mismatched main class of module " + mn + ": " + cn + " expected: " + mainClass); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/module-info.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/module-info.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/module-info.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/com.foo/module-info.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024, 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. + */ + +module com.foo { + requires net.foo; +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/module-info.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/module-info.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/module-info.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/module-info.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024, 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. + */ + +module net.foo { +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/net/foo/Main.java openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/net/foo/Main.java --- openjdk-17-17.0.13+11/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/net/foo/Main.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/src/net.foo/net/foo/Main.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024, 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 net.foo; + +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.util.stream.Stream; + +/** + * Sanity test if SystemModules pre-resolved at link-time for net.foo + * with main class is loaded properly. + */ +public class Main { + public static void main(String... args) throws Exception { + ModuleDescriptor md = Main.class.getModule().getDescriptor(); + System.out.println(md); + + checkMainClass("com.foo", "com.foo.Main"); + checkMainClass("net.foo", "net.foo.Main"); + } + + static void checkMainClass(String mn, String mainClass) { + String cn = ModuleFinder.ofSystem().find(mn).get().descriptor().mainClass().get(); + if (!cn.equals(mainClass)) { + throw new RuntimeException("Mismatched main class of module " + mn + ": " + cn + " expected: " + mainClass); + } + } + +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java openjdk-17-17.0.14+7/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java --- openjdk-17-17.0.13+11/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +public class ChildProcessAppLauncher { + public static void main(String[] args) throws IOException, InterruptedException { + if (args.length == 1 && "noexit".equals(args[0])) { + var lock = new Object(); + synchronized (lock) { + lock.wait(); + } + } else { + var childPath = System.getProperty("jpackage.app-path"); // get the path to the current jpackage app launcher + ProcessBuilder processBuilder = new ProcessBuilder(childPath, "noexit"); //ChildProcessAppLauncher acts as third party app + Process process = processBuilder.start(); + System.out.println("Child id=" + process.pid()); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/jpackage/windows/WinChildProcessTest.java openjdk-17-17.0.14+7/test/jdk/tools/jpackage/windows/WinChildProcessTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/jpackage/windows/WinChildProcessTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/jpackage/windows/WinChildProcessTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024, 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 8325203 + * @summary Test that Jpackage windows executable application kills the launched 3rd party application + * when System.exit(0) is invoked along with terminating java program. + * @library ../helpers + * @library /test/lib + * @requires os.family == "windows" + * @build WinChildProcessTest + * @build jdk.jpackage.test.* + * @build WinChildProcessTest + * @modules jdk.jpackage/jdk.jpackage.internal + * @run main/othervm -Xmx512m jdk.jpackage.test.Main + * --jpt-run=WinChildProcessTest + * + */ + +import java.util.List; +import java.util.Optional; + +import java.nio.file.Path; + +import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.Executor; +import jdk.jpackage.test.TKit; + +public class WinChildProcessTest { + private static final Path TEST_APP_JAVA = TKit.TEST_SRC_ROOT + .resolve("apps/ChildProcessAppLauncher.java"); + + @Test + public static void test() throws Throwable { + long childPid = 0; + try { + JPackageCommand cmd = JPackageCommand + .helloAppImage(TEST_APP_JAVA + "*Hello"); + + // Create the image of the third party application launcher + cmd.executeAndAssertImageCreated(); + + // Start the third party application launcher and dump and save the + // output of the application + List output = new Executor().saveOutput().dumpOutput() + .setExecutable(cmd.appLauncherPath().toAbsolutePath()) + .execute(0).getOutput(); + String pidStr = output.get(0); + + // parse child PID + childPid = Long.parseLong(pidStr.split("=", 2)[1]); + + // Check whether the termination of third party application launcher + // also terminating the launched third party application + // If third party application is not terminated the test is + // successful else failure + Optional processHandle = ProcessHandle.of(childPid); + boolean isAlive = processHandle.isPresent() + && processHandle.get().isAlive(); + TKit.assertTrue(isAlive, "Check is child process is alive"); + } finally { + // Kill only a specific child instance + Runtime.getRuntime().exec("taskkill /F /PID " + childPid); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/launcher/TestXcheckJNIWarnings.java openjdk-17-17.0.14+7/test/jdk/tools/launcher/TestXcheckJNIWarnings.java --- openjdk-17-17.0.13+11/test/jdk/tools/launcher/TestXcheckJNIWarnings.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/launcher/TestXcheckJNIWarnings.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, 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,14 +25,22 @@ import java.io.IOException; /** - * @test + * @test id=noagent * @bug 8187442 * @summary Launching app shouldn't produce any jni warnings. * @modules jdk.compiler * jdk.zipfs - * @compile TestXcheckJNIWarnings.java * @run main TestXcheckJNIWarnings */ + +/** + * @test id=jdwp-agent + * @bug 8187442 + * @summary Launching app with jdwp agent shouldn't produce any jni warnings. + * @modules jdk.compiler + * jdk.zipfs + * @run main TestXcheckJNIWarnings -agentlib:jdwp=transport=dt_socket,server=y,suspend=n + */ public final class TestXcheckJNIWarnings extends TestHelper { static void createJarFile(File testJar) throws IOException { @@ -46,8 +54,14 @@ public static void main(String... args) throws IOException { File testJarFile = new File("test.jar"); createJarFile(testJarFile); - TestResult tr = doExec(javaCmd, "-jar", "-Xcheck:jni", - testJarFile.getName()); + + TestResult tr; + if (args.length > 0) { + tr = doExec(javaCmd, "-jar", "-Xcheck:jni", args[0], testJarFile.getName()); + } else { + tr = doExec(javaCmd, "-jar", "-Xcheck:jni", testJarFile.getName()); + } + if (!tr.isOK()) { System.out.println(tr); throw new RuntimeException("test returned non-positive value"); diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/launcher/modules/basic/BasicTest.java openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/basic/BasicTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/launcher/modules/basic/BasicTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/basic/BasicTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -270,7 +270,7 @@ * while setting the _JAVA_LAUNCHER_DEBUG environment variable. */ private ProcessBuilder createProcessWithLauncherDebugging(String... cmds) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(Utils.addTestJavaOpts(cmds)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(Utils.addTestJavaOpts(cmds)); pb.environment().put("_JAVA_LAUNCHER_DEBUG", "true"); return pb; diff -Nru openjdk-17-17.0.13+11/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java --- openjdk-17-17.0.13+11/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -200,7 +200,7 @@ } private OutputAnalyzer execute(List options) throws Throwable { - // can't use ProcessTools.createJavaProcessBuilder as it always adds -cp + // can't use ProcessTools.createLimitedTestJavaProcessBuilder as it always adds -cp ProcessBuilder pb = new ProcessBuilder( Stream.concat(Stream.of(JDKToolFinder.getTestJDKTool("java")), options.stream() diff -Nru openjdk-17-17.0.13+11/test/langtools/jdk/jshell/ExceptionMessageTest.java openjdk-17-17.0.14+7/test/langtools/jdk/jshell/ExceptionMessageTest.java --- openjdk-17-17.0.13+11/test/langtools/jdk/jshell/ExceptionMessageTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/jdk/jshell/ExceptionMessageTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8185108 * @summary Test exception().getMessage() in events returned by eval() * @run testng ExceptionMessageTest + * @key intermittent */ import java.util.HashMap; diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Class-Path.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Class-Path.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2003, 2011, 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 4212732 -# @summary Test handling of the Class-Path attribute in jar file manifests -# @author Martin Buchholz -# -# @run shell Class-Path.sh - -# To run this test manually, simply do ./Class-Path.sh - -. ${TESTSRC-.}/Util.sh - -set -u - -Cleanup() { - Sys rm -rf pkg Main.java Main.class Main.jar jars - Sys rm -rf MANIFEST.MF A.jar B.zip -} - -Cleanup -Sys mkdir pkg - -#---------------------------------------------------------------- -# Create mutually referential jar files -#---------------------------------------------------------------- -cat >pkg/A.java <pkg/B.java <Main.java <> MANIFEST.MF -Sys "$jar" cmf MANIFEST.MF Main.jar Main.class - -Success "$java" ${TESTVMOPTS} -jar Main.jar - -MkManifestWithClassPath "." -Sys "$jar" cmf MANIFEST.MF A.jar pkg/A.class - -Success "$javac" ${TESTTOOLVMOPTS} -cp "A.jar" Main.java -Success "$java" ${TESTVMOPTS} -jar Main.jar - -MkManifestWithClassPath "" -Sys "$jar" cmf MANIFEST.MF A.jar pkg/A.class - -Failure "$javac" ${TESTTOOLVMOPTS} -cp "A.jar" Main.java -Failure "$java" ${TESTVMOPTS} -jar Main.jar - -#---------------------------------------------------------------- -# Test new flag -e (application entry point) -#---------------------------------------------------------------- - -cat > Hello.java < Bye.java <> MANIFEST.MF - -# test for error: " 'e' flag and manifest with the 'Main-Class' -# attribute cannot be specified together, during creation -Failure "$jar" cmfe MANIFEST.MF "Bye.jar" "Bye" Bye.class - -# test for overriding the manifest when updating the jar -# -Success "$jar" cfe "greetings.jar" "Hello" Hello.class -Success "$jar" ufe "greetings.jar" "Bye" Bye.class -Success "$java" ${TESTVMOPTS} -jar greetings.jar - -# test for error: " 'e' flag and manifest with the 'Main-Class' -# attribute cannot be specified together, during update -Failure "$jar" umfe MANIFEST.MF "greetings.jar" "Hello" - -# test jar updation when there are no inputfiles -# -Success "$jar" ufe "Hello.jar" "Bye" -Failure "$java" ${TESTVMOPTS} -jar Hello.jar -Success "$jar" umf MANIFEST.MF "Hello.jar" - -# test creating jar when the to-be-archived files -# do not contain the specified main class, there is no check done -# for the presence of the main class, so the test will pass -# -Success "$jar" cfe "Hello.jar" "Hello" Bye.class - -# Jar creation and update when there is no manifest and inputfiles -# specified -Failure "$jar" cvf "A.jar" -Failure "$jar" uvf "A.jar" - -# error: no such file or directory -Failure "$jar" cvf "A.jar" non-existing.file -Failure "$jar" uvf "A.jar" non-existing.file - -Cleanup - -Bottom Line diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Class-Path2.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path2.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Class-Path2.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Class-Path2.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2011, 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 4212732 6485027 -# @summary Test handling of the Class-Path attribute in jar file manifests -# @author Martin Buchholz -# -# @run shell Class-Path2.sh - -# To run this test manually, simply do ./Class-Path2.sh - -. ${TESTSRC-.}/Util.sh - -set -u - -Cleanup() { - Sys rm -rf pkg Main.java Main.class Main.jar jars - Sys rm -rf MANIFEST.MF A.jar B.zip -} - -Cleanup -Sys mkdir pkg - -#---------------------------------------------------------------- -# Create mutually referential jar files -#---------------------------------------------------------------- -cat >pkg/A.java <pkg/B.java <Main.java <&1`; rc="$?" - output2=`echo "$output" | grep -v "bootstrap class path not set in conjunction with -source"` - test -n "$output2" && echo "$output" - test $rc -eq 0 || Fail "Command \"$*\" failed with exitValue $rc"; - case "$output2" in *warning:*) gotwarning="yes";; *) gotwarning="no";; esac - - if test "$gotwarning" = "yes" -a "$NO" = "no"; then - Fail "Command \"$*\" printed an unexpected warning" - elif test "$gotwarning" = "no" -a "$NO" != "no"; then - Fail "Command \"$*\" did not generate the expected warning" - fi -} - -Error() { - HorizontalRule - echo "$@" - output=`"$@" 2>&1`; rc="$?" - test -n "$output" && echo "$output" - case "$output" in *error:*) goterror="yes";; *) goterror="no";; esac - - if test "$NO" = "no"; then - test "$rc" -ne 0 && \ - Fail "Command \"$*\" failed with return code $rc" - test "$goterror" = "yes" && \ - Fail "Command \"$*\" did not generate any error message" - else - test "$rc" -eq 0 && \ - Fail "Command \"$*\" was supposed to Die with fatal error"; - test "$goterror" = "no" && \ - Fail "Command \"$*\" printed an unexpected error message" - fi -} - -Cleanup() { - Sys rm -rf Main.java Main.class - Sys rm -rf classes classes.foo classes.jar classes.war classes.zip - Sys rm -rf MANIFEST.MF classesRef.jar classesRefRef.jar jars -} - -Cleanup -echo "public class Main{public static void main(String[]a){}}" > Main.java - -# We need to set -source 8 -target 8 for those cases where the option is -# not legal in 9 and later. However, that triggers an additional warning -# about not setting bootclasspath, which is filtered out in Warning. -# The alternative would be to extract a minimal rt.jar from JDK and -# specify that with -bootclasspath. -SRCTRG8="-source 8 -target 8" - -#---------------------------------------------------------------- -# No warnings unless -Xlint:path is used -#---------------------------------------------------------------- -No Warning "$javac" ${TESTTOOLVMOPTS} Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} -cp ".${PS}classes" Main.java - -#---------------------------------------------------------------- -# Warn for missing elts in user-specified paths -#---------------------------------------------------------------- -Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes" Main.java -Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-Xbootclasspath/p:classes" Main.java -Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint "-Xbootclasspath/a:classes" Main.java - -Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-endorseddirs" "classes" Main.java -Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint "-extdirs" "classes" Main.java -#Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-Xbootclasspath:classes${PS}${BCP}" Main.java - -#---------------------------------------------------------------- -# No warning for missing elts in "system" paths -#---------------------------------------------------------------- -# No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path "-J-Djava.endorsed.dirs=classes" Main.java -# No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path "-J-Djava.ext.dirs=classes" Main.java -# No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path "-J-Xbootclasspath/p:classes" Main.java -# No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path "-J-Xbootclasspath/a:classes" Main.java -# No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path "-J-Xbootclasspath:classes${PS}${BCP}" Main.java - -#---------------------------------------------------------------- -# No warning if class path element exists -#---------------------------------------------------------------- -Sys mkdir classes -No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes" Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-endorseddirs" "classes" Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-extdirs" "classes" Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-Xbootclasspath/p:classes" Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-Xbootclasspath/a:classes" Main.java -#No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint:path "-Xbootclasspath:classes${PS}${BCP}" Main.java - -Sys "$jar" cf classes.jar Main.class -Sys cp classes.jar classes.war -Sys cp classes.war classes.zip -No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes.jar" Main.java - Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes.war" Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes.zip" Main.java - -#---------------------------------------------------------------- -# Warn if -Xlint is used and if class path element refers to -# regular file which doesn't look like a zip file, but is -#---------------------------------------------------------------- -Sys cp classes.war classes.foo - Warning "$javac" ${TESTTOOLVMOPTS} -Xlint:path -cp ".${PS}classes.foo" Main.java - - -#---------------------------------------------------------------- -# No error if class path element refers to regular file which is -# not a zip file -#---------------------------------------------------------------- -No Error "$javac" ${TESTTOOLVMOPTS} -cp Main.java Main.java # Main.java is NOT a jar file -No Error "$javac" ${TESTTOOLVMOPTS} Main.java - -#---------------------------------------------------------------- -# Warn if -Xlint is used and if class path element refers to -# regular file which is not a zip file -#---------------------------------------------------------------- -Warning "$javac" ${TESTTOOLVMOPTS} -Xlint -cp Main.java Main.java # Main.java is NOT a jar file - -#---------------------------------------------------------------- -# Test jar file class path reference recursion -#---------------------------------------------------------------- -MkManifestWithClassPath classesRef.jar -Sys "$jar" cmf MANIFEST.MF classesRefRef.jar Main.class - -#---------------------------------------------------------------- -# Non-existent recursive Class-Path reference gives warning -#---------------------------------------------------------------- -No Warning "$javac" ${TESTTOOLVMOPTS} -classpath classesRefRef.jar Main.java - Warning "$javac" ${TESTTOOLVMOPTS} -Xlint -classpath classesRefRef.jar Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -Xbootclasspath/p:classesRefRef.jar Main.java - -BadJarFile classesRef.jar - -#---------------------------------------------------------------- -# Non-jar file recursive Class-Path reference gives error -#---------------------------------------------------------------- - Error "$javac" ${TESTTOOLVMOPTS} -classpath classesRefRef.jar Main.java -No Error "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xbootclasspath/a:classesRefRef.jar Main.java - -MkManifestWithClassPath classes -Sys "$jar" cmf MANIFEST.MF classesRef.jar Main.class - -#---------------------------------------------------------------- -# Jar file recursive Class-Path reference is OK -#---------------------------------------------------------------- -No Warning "$javac" ${TESTTOOLVMOPTS} -Xlint -classpath classesRefRef.jar Main.java -No Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -Xbootclasspath/p:classesRefRef.jar Main.java - -#---------------------------------------------------------------- -# Class-Path attribute followed in extdirs or endorseddirs -#---------------------------------------------------------------- -Sys mkdir jars -Sys cp classesRefRef.jar jars/. - Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -extdirs jars Main.java - Warning "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -endorseddirs jars Main.java - -#---------------------------------------------------------------- -# Bad Jar file in extdirs and endorseddirs should not be ignored -#---------------------------------------------------------------- -BadJarFile jars/classesRef.jar - Error "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -extdirs jars Main.java - Error "$javac" ${TESTTOOLVMOPTS} ${SRCTRG8} -Xlint -endorseddirs jars Main.java - -Cleanup - -Bottom Line diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Help.java openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Help.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2003, 2022, 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 4940642 8293877 + * @summary Check for -help and -X flags + */ + +/* + * Converted from Help.sh, originally written by Martin Buchholz + * + * For the last version of the original, Help.sh, see + * https://git.openjdk.org/jdk/blob/jdk-19%2B36/test/langtools/tools/javac/Paths/Help.sh + * + * This class provides rudimentary tests of the javac command-line help. + */ + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.spi.ToolProvider; + +public class Help { + public static void main(String... args) throws Exception { + new Help().run(args); + } + + void run(String... args) throws Exception { + String helpText = javac("-help"); + check(helpText, + "-X ", "-J", "-classpath ", "-cp ", "-bootclasspath ", "-sourcepath "); + + String xText = javac("-X"); + check(xText, "-Xbootclasspath/p:"); + } + + void check(String text, String... options) throws Exception { + for (String opt : options) { + System.err.println("Checking '" + opt + "'"); + if (!text.contains(opt)) { + text.lines().forEach(System.err::println); + throw new Exception("Bad help output"); + } + } + } + + String javac(String... args) throws Exception { + var javac = ToolProvider.findFirst("javac") + .orElseThrow(() -> new Exception("cannot find javac")); + try (StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw)) { + int rc = javac.run(pw, pw, args); + if (rc != 0) { + throw new Error("unexpected exit from javac: " + rc); + } + pw.flush(); + return sw.toString(); + } + } +} + diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Help.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Help.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Help.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2003, 2011, 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 4940642 -# @summary Check for -help and -X flags -# @author Martin Buchholz -# -# @run shell Help.sh - -# To run this test manually, simply do ./MineField.sh - - -. ${TESTSRC-.}/Util.sh - -set -u - -DiagnosticsInEnglishPlease - -HELP="`\"$javac\" ${TESTTOOLVMOPTS} -help 2>&1`" -XHELP="`\"$javac\" ${TESTTOOLVMOPTS} -X 2>&1`" - -#---------------------------------------------------------------- -# Standard options -#---------------------------------------------------------------- -for opt in \ - "-X " \ - "-J" \ - "-classpath " \ - "-cp " \ - "-bootclasspath " \ - "-sourcepath "; -do - case "$HELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac -done - -#---------------------------------------------------------------- -# Non-standard options -#---------------------------------------------------------------- -for opt in \ - "-Xbootclasspath/p:"; -do - case "$XHELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac -done - -Bottom Line diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/MineField.java openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/MineField.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2003, 2022, 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 4758537 4809833 8149599 8293877 + * @summary Test that javac and java find files in similar ways + * @library /tools/lib + * @build toolbox.ToolBox Util MineField + * @run main MineField + */ + +/* + * Converted from MineField.sh, originally written by Martin Buchholz. + * + * For the last version of the original, MineField.sh, see + * https://git.openjdk.org/jdk/blob/jdk-19%2B36/test/langtools/tools/javac/Paths/MineField.sh + * + * This class primarily tests that javac and the java launcher provide + * equivalent handling of all path-related options, like {@code -classpath}. + */ + +/* +#---------------------------------------------------------------- +# The search order for classes used by both java and javac is: +# +# -Xbootclasspath/p: +# -endorseddirs or -Djava.endorsed.dirs= (search for jar/zip only) +# -bootclasspath or -Xbootclasspath: +# -Xbootclasspath/a: +# -extdirs or -Djava.ext.dirs= (search for jar/zip only) +# -classpath , -cp , env CLASSPATH= +# +# Peculiarities of the class file search: +# - Empty elements of the (user) classpath default to ".", +# while empty elements of other paths are ignored. +# - Only for the user classpath is an empty string value equivalent to "." +# - Specifying a bootclasspath on the command line obliterates any +# previous -Xbootclasspath/p: or -Xbootclasspath/a: command line flags. +# +# JDK 9 update: +# java: The java launcher does not support any of the following: +# * -Xbootclasspath/p: -Xbootclasspath: +# * -endorseddirs -Djava.endorsed.dirs +# * -extdirs -Djava.ext.dirs +# All test cases exercising these features have been removed. +# javac: The following features are only supported when compiling +# for older releases: +# * -Xbootclasspath/p: -Xbootclasspath: -bootclasspath -Xbootclasspath/a: +# * -endorseddirs -Djava.endorsed.dirs +# * -extdirs -Djava.ext.dirs +# All test cases exercising these features have been modified to +# use -source 8 -target 8. In addition, javac test cases involving +# use of the runtime properties java.endorsed.dirs and java.extdirs +# (by means of -J-Dname=value) have been removed. +# Although the primary purpose of the test cases in this file is to +# compare javac and java behavior, some tests remain for javac for +# which there is no java equivalent. However, the cases remain as useful +# test cases for javac handling of the paths involved. + */ + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +public class MineField extends Util { + public static void main(String... args) throws Exception { + new MineField().run(args); + } + + void run(String... args) throws Exception{ + setup(); + tests(); + cleanup(); + bottomLine(); + } + + void cleanup() throws IOException { + deleteFiles("GooSrc", "GooJar", "GooZip", "GooClass"); + deleteFiles("BadSrc", "BadJar", "BadZip", "BadClass"); + deleteFiles("OneDir", "Main.java", "MANIFEST.MF"); + deleteFiles(listFiles(Path.of("."), "*.class")); + deleteFiles("java-lang.jar"); + } + + /** + * "Prepare the minefield". + */ + void setup() throws Exception { + cleanup(); + + tb.createDirectories("GooSrc", "GooJar", "GooZip", "GooClass"); + tb.createDirectories("BadSrc", "BadJar", "BadZip", "BadClass"); + + Files.writeString(Path.of("Lib.java"), + "public class Lib {public static void f(){}}"); + javac("Lib.java"); + jar("cf", "GooJar/Lib.jar", "Lib.class"); + jar("cf", "GooZip/Lib.zip", "Lib.class"); + tb.moveFile("Lib.class", "GooClass/."); + tb.moveFile("Lib.java", "GooSrc/."); + checkFiles("GooZip/Lib.zip", "GooJar/Lib.jar", "GooSrc/Lib.java"); + + Files.writeString(Path.of("Lib.java"), + "public class Lib {/* Bad */}"); + javac("Lib.java"); + jar("cf", "BadJar/Lib.jar", "Lib.class"); + jar("cf", "BadZip/Lib.zip", "Lib.class"); + tb.moveFile("Lib.class", "BadClass/."); + tb.moveFile("Lib.java", "BadSrc/."); + checkFiles("BadZip/Lib.zip", "BadJar/Lib.jar", "BadSrc/Lib.java"); + + Files.writeString(Path.of("Main.java"), + "public class Main {public static void main(String[] a) {Lib.f();}}"); + Path libModules = javaHome.resolve("lib").resolve("modules"); + if (Files.isReadable(libModules)) { + jimage("extract", "--dir", "modules", libModules.toString()); + jar("cf", "java-lang.jar", "-C", "modules/java.base", "java/lang"); + deleteFiles("modules"); + } else { + Path modules = javaHome.resolve("modules"); + if (Files.isDirectory(modules)) { + jar("cf", "java-lang.jar", "-C", modules.resolve("java.base").toString(), "java/lang"); + } else { + throw new Exception("Cannot create java-lang.jar"); + } + } + } + + void tests() throws Exception { + + //---------------------------------------------------------------- + // Verify that javac class search order is the same as java's + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:GooClass + -bootclasspath java-lang.jar${PS}BadZip/Lib.zip + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:BadClass${PS}GooClass + -bootclasspath java-lang.jar${PS}GooZip/Lib.zip${PS}BadClass + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:BadJar/Lib.jar + -Xbootclasspath:java-lang.jar${PS}GooClass + Main.java"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -bootclasspath java-lang.jar${PS}GooZip/Lib.zip + -Xbootclasspath/p:BadClass + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -bootclasspath java-lang.jar${PS}BadZip/Lib.zip + -Xbootclasspath/p:GooClass${PS}BadJar/Lib.jar + Main.java"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:BadClass + -Xbootclasspath/a:GooClass + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:GooClass${PS}BadClass + -Xbootclasspath/a:BadClass + Main.java"""); + + expectPass(JAVA, """ + -Xbootclasspath/a:GooClass + Main"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:GooClass + -Xbootclasspath:BadClass${PS}java-lang.jar + -Xbootclasspath/a:GooClass + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/p:BadClass + -Xbootclasspath:GooClass${PS}BadClass${PS}java-lang.jar + -Xbootclasspath/a:BadClass + Main.java"""); + + //---------------------------------------------------------------- + + expectPass(JAVAC, """ + -source 8 -target 8 + -endorseddirs BadClass${PS}GooZip${PS}BadJar + -Xbootclasspath:"BadClass${PS}java-lang.jar + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Djava.endorsed.dirs=BadClass${PS}GooZip${PS}BadJar + -Xbootclasspath:BadClass${PS}java-lang.jar + Main.java"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/a:BadClass + -extdirs GooZip + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Xbootclasspath/a:GooClass${PS}BadClass + -extdirs BadZip + Main.java"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, """ + -source 8 -target 8 + -extdirs GooClass${PS}BadZip + -cp GooZip/Lib.zip + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -extdirs BadClass${PS}GooZip${PS}BadJar + -cp BadZip/Lib.zip + Main.java"""); + + expectPass(JAVAC, """ + -source 8 -target 8 + -Djava.ext.dirs=GooZip${PS}BadJar + -classpath BadZip/Lib.zip + Main.java"""); + + //---------------------------------------------------------------- + + expectFail(JAVAC, "-classpath BadClass${PS}GooClass Main.java"); + expectPass(JAVAC, "-classpath GooClass${PS}BadClass Main.java"); + expectFail(JAVA, "-classpath BadClass${PS}GooClass${PS}. Main"); + expectPass(JAVA, "-classpath GooClass${PS}BadClass${PS}. Main"); + + expectFail(JAVAC, "-cp BadJar/Lib.jar${PS}GooZip/Lib.zip Main.java"); + expectPass(JAVAC, "-cp GooJar/Lib.jar${PS}BadZip/Lib.zip Main.java"); + expectFail(JAVA, "-cp BadJar/Lib.jar${PS}${PS}GooZip/Lib.zip Main"); + expectPass(JAVA, "-cp GooJar/Lib.jar${PS}${PS}BadZip/Lib.zip Main"); + + //---------------------------------------------------------------- + + expectFail(classpath("BadZip/Lib.zip${PS}GooJar/Lib.jar"), JAVAC,"Main.java"); + expectPass(classpath("GooZip/Lib.zip${PS}BadJar/Lib.jar"), JAVAC, "Main.java"); + expectFail(classpath("${PS}BadZip/Lib.zip${PS}GooJar/Lib.jar"), JAVA, "Main"); + expectPass(classpath("${PS}GooZip/Lib.zip${PS}BadJar/Lib.jar"), JAVA, "Main"); + + //---------------------------------------------------------------- + // Check behavior of empty paths and empty path elements + //---------------------------------------------------------------- + + Path GooClass = Path.of("GooClass"); + Path GooJar = Path.of("GooJar"); + + expectFail(GooClass, JAVAC, "-cp .. ../Main.java"); + expectFail(GooClass, JAVA, "-cp .. Main"); + + // Unspecified classpath defaults to "." + Path OneDir = Path.of("OneDir"); + tb.createDirectories(OneDir); + tb.copyFile(Path.of("Main.java"), OneDir); + tb.copyFile(GooClass.resolve("Lib.class"), OneDir); + expectPass(OneDir, JAVAC, "Main.java"); + expectPass(OneDir, JAVA, "Main"); + + // Empty classpath elements mean "." + expectPass(GooClass, JAVAC, "-cp ${PS}.. ../Main.java"); + expectPass(GooClass, JAVA, "-cp ${PS}.. Main"); + + expectPass(GooClass, JAVAC, "-cp ..${PS} ../Main.java"); + expectPass(GooClass, JAVA, "-cp ..${PS} Main"); + + expectPass(GooClass, JAVAC, "-cp ..${PS}${PS}/xyzzy ../Main.java"); + expectPass(GooClass, JAVA, "-cp ..${PS}${PS}/xyzzy Main"); + + // All other empty path elements are ignored. + + // note presence of empty arg in this invocation + expectFail(GooJar, null, JAVAC, "-source", "8", "-target", "8", "-extdirs", "", "-cp", "..", "../Main.java"); + + expectFail(GooJar, JAVAC, "-source 8 -target 8 -extdirs ${PS} -cp .. ../Main.java"); + expectFail(GooJar, JAVAC, "-source 8 -target 8 -Djava.ext.dirs=${PS} -cp .. ../Main.java"); + + expectPass(GooJar, JAVAC, "-source 8 -target 8 -extdirs . -cp .. ../Main.java"); + expectPass(GooJar, JAVAC, "-source 8 -target 8 -Djava.ext.dirs=. -cp .. ../Main.java"); + + expectFail(GooJar, JAVAC, "-source 8 -target 8 -Djava.endorsed.dirs= -cp .. ../Main.java"); + + expectFail(GooJar, JAVAC, "-source 8 -target 8 -endorseddirs ${PS} -cp .. ../Main.java"); + + expectPass(GooJar, JAVAC, "-source 8 -target 8 -Djava.endorsed.dirs=. -cp .. ../Main.java"); + + expectFail(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath/p: -cp .. ../Main.java"); + + expectPass(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath/p:. -cp .. ../Main.java"); + + expectFail(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath:../java-lang.jar -cp .. ../Main.java"); + + expectPass(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath:../java-lang.jar${PS}. -cp .. ../Main.java"); + + expectFail(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath/a: -cp .. ../Main.java"); + expectFail(GooClass, JAVA, "-Xbootclasspath/a: -cp .. Main"); + + expectPass(GooClass, JAVAC, "-source 8 -target 8 -Xbootclasspath/a:. -cp .. ../Main.java"); + expectPass(GooClass, JAVA, "-Xbootclasspath/a:. -cp .. Main"); + + } + + +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/MineField.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/MineField.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/MineField.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# @test -# @bug 4758537 4809833 8149599 -# @summary Test that javac and java find files in similar ways -# @author Martin Buchholz -# -# @run shell/timeout=600 MineField.sh - -# To run this test manually, simply do ./MineField.sh - -#---------------------------------------------------------------- -# The search order for classes used by both java and javac is: -# -# -Xbootclasspath/p: -# -endorseddirs or -Djava.endorsed.dirs= (search for jar/zip only) -# -bootclasspath or -Xbootclasspath: -# -Xbootclasspath/a: -# -extdirs or -Djava.ext.dirs= (search for jar/zip only) -# -classpath , -cp , env CLASSPATH= -# -# Peculiarities of the class file search: -# - Empty elements of the (user) classpath default to ".", -# while empty elements of other paths are ignored. -# - Only for the user classpath is an empty string value equivalent to "." -# - Specifying a bootclasspath on the command line obliterates any -# previous -Xbootclasspath/p: or -Xbootclasspath/a: command line flags. -# -# JDK 9 update: -# java: The java launcher does not support any of the following: -# * -Xbootclasspath/p: -Xbootclasspath: -# * -endorseddirs -Djava.endorsed.dirs -# * -extdirs -Djava.ext.dirs -# All test cases exercising these features have been removed. -# javac: The following features are only supported when compiling -# for older releases: -# * -Xbootclasspath/p: -Xbootclasspath: -bootclasspath -Xbootclasspath/a: -# * -endorseddirs -Djava.endorsed.dirs -# * -extdirs -Djava.ext.dirs -# All test cases exercising these features have been modified to -# use -source 8 -target 8. In addition, javac test cases involving -# use of the runtime properties java.endorsed.dirs and java.extdirs -# (by means of -J-Dname=value) have been removed. -# Although the primary purpose of the test cases in this file is to -# compare javac and java behavior, some tests remain for javac for -# which there is no java equivalent. However, the cases remain as useful -# test cases for javac handling of the paths involved. - -#---------------------------------------------------------------- - -. ${TESTSRC-.}/Util.sh - -set -u - -#---------------------------------------------------------------- -# Prepare the "Minefield" -#---------------------------------------------------------------- -Cleanup() { - Sys rm -rf GooSrc GooJar GooZip GooClass - Sys rm -rf BadSrc BadJar BadZip BadClass - Sys rm -rf OneDir *.class Main.java MANIFEST.MF - Sys rm -f java-lang.jar -} - -Cleanup -Sys mkdir GooSrc GooJar GooZip GooClass -Sys mkdir BadSrc BadJar BadZip BadClass - -echo 'public class Lib {public static void f(){}}' > Lib.java -Sys "$javac" ${TESTTOOLVMOPTS} Lib.java -Sys "$jar" cf GooJar/Lib.jar Lib.class -Sys "$jar" cf GooZip/Lib.zip Lib.class -Sys mv Lib.class GooClass/. -Sys mv Lib.java GooSrc/. -CheckFiles GooZip/Lib.zip GooJar/Lib.jar GooSrc/Lib.java - -echo 'public class Lib {/* Bad */}' > Lib.java -Sys "$javac" ${TESTTOOLVMOPTS} Lib.java -Sys "$jar" cf BadJar/Lib.jar Lib.class -Sys "$jar" cf BadZip/Lib.zip Lib.class -Sys mv Lib.class BadClass/. -Sys mv Lib.java BadSrc/. -CheckFiles BadZip/Lib.zip BadJar/Lib.jar BadSrc/Lib.java - -echo 'public class Main {public static void main(String[] a) {Lib.f();}}' > Main.java - -# Create a jar file that is good enough to put on the javac boot class path (i.e. contains java.lang.**) -if [ -r ${TESTJAVA}/lib/modules ]; then - Sys "$jimage" extract --dir modules ${TESTJAVA}/lib/modules - Sys "$jar" cf java-lang.jar -C modules/java.base java/lang - Sys rm -rf modules -elif [ -d ${TESTJAVA}/modules ]; then - Sys "$jar" cf java-lang.jar -C ${TESTJAVA}/modules/java.base java/lang -else - echo 'cannot create java-lang.jar' ; exit 1 -fi - -#---------------------------------------------------------------- -# Verify that javac class search order is the same as java's -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"GooClass" \ - -bootclasspath "java-lang.jar${PS}BadZip/Lib.zip" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"BadClass${PS}GooClass" \ - -bootclasspath "java-lang.jar${PS}GooZip/Lib.zip${PS}BadClass" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"BadJar/Lib.jar" \ - -Xbootclasspath:"java-lang.jar${PS}GooClass" \ - Main.java - -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -bootclasspath "java-lang.jar${PS}GooZip/Lib.zip" \ - -Xbootclasspath/p:"BadClass" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -bootclasspath "java-lang.jar${PS}BadZip/Lib.zip" \ - -Xbootclasspath/p:"GooClass${PS}BadJar/Lib.jar" \ - Main.java - -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"BadClass" \ - -Xbootclasspath/a:"GooClass" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"GooClass${PS}BadClass" \ - -Xbootclasspath/a:"BadClass" \ - Main.java -Success "$java" ${TESTVMOPTS} \ - -Xbootclasspath/a:"GooClass" \ - Main - -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"GooClass" \ - -Xbootclasspath:"BadClass${PS}java-lang.jar" \ - -Xbootclasspath/a:"GooClass" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/p:"BadClass" \ - -Xbootclasspath:"GooClass${PS}BadClass${PS}java-lang.jar" \ - -Xbootclasspath/a:"BadClass" \ - Main.java - -#---------------------------------------------------------------- -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -endorseddirs "BadClass${PS}GooZip${PS}BadJar" \ - -Xbootclasspath:"BadClass${PS}java-lang.jar" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Djava.endorsed.dirs="BadClass${PS}GooZip${PS}BadJar" \ - -Xbootclasspath:"BadClass${PS}java-lang.jar" \ - Main.java - -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/a:"BadClass" \ - -extdirs "GooZip" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Xbootclasspath/a:"GooClass${PS}BadClass" \ - -extdirs "BadZip" \ - Main.java - -#---------------------------------------------------------------- -Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -extdirs "GooClass${PS}BadZip" \ - -cp "GooZip/Lib.zip" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -extdirs "BadClass${PS}GooZip${PS}BadJar" \ - -cp "BadZip/Lib.zip" \ - Main.java -Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} \ - -Djava.ext.dirs="GooZip${PS}BadJar" \ - -classpath "BadZip/Lib.zip" \ - Main.java - -#---------------------------------------------------------------- -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "BadClass${PS}GooClass" Main.java -Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooClass${PS}BadClass" Main.java -Failure "$java" ${TESTVMOPTS} -classpath "BadClass${PS}GooClass${PS}." Main -Success "$java" ${TESTVMOPTS} -classpath "GooClass${PS}BadClass${PS}." Main - -Failure "$javac" ${TESTTOOLVMOPTS} -cp "BadJar/Lib.jar${PS}GooZip/Lib.zip" Main.java -Success "$javac" ${TESTTOOLVMOPTS} -cp "GooJar/Lib.jar${PS}BadZip/Lib.zip" Main.java -Failure "$java" ${TESTVMOPTS} -cp "BadJar/Lib.jar${PS}${PS}GooZip/Lib.zip" Main -Success "$java" ${TESTVMOPTS} -cp "GooJar/Lib.jar${PS}${PS}BadZip/Lib.zip" Main - -Failure env CLASSPATH="BadZip/Lib.zip${PS}GooJar/Lib.jar" "$javac" ${TESTTOOLVMOPTS} Main.java -Success env CLASSPATH="GooZip/Lib.zip${PS}BadJar/Lib.jar" "$javac" ${TESTTOOLVMOPTS} Main.java -Failure env CLASSPATH="${PS}BadZip/Lib.zip${PS}GooJar/Lib.jar" "$java" ${TESTVMOPTS} Main -Success env CLASSPATH="${PS}GooZip/Lib.zip${PS}BadJar/Lib.jar" "$java" ${TESTVMOPTS} Main - -#---------------------------------------------------------------- -# Check behavior of empty paths and empty path elements -#---------------------------------------------------------------- -In() { cd "$1"; shift; "$@"; cd ..; } - -In GooClass Failure "$javac" ${TESTTOOLVMOPTS} -cp ".." ../Main.java -In GooClass Failure "$java" ${TESTVMOPTS} -cp ".." Main - -# Unspecified classpath defaults to "." -Sys mkdir OneDir; Sys cp Main.java GooClass/Lib.class OneDir/. -In OneDir Success "$javac" ${TESTTOOLVMOPTS} Main.java -In OneDir Success "$java" ${TESTVMOPTS} Main - -# Empty classpath elements mean "." -In GooClass Success "$javac" ${TESTTOOLVMOPTS} -cp "${PS}.." ../Main.java -In GooClass Success "$java" ${TESTVMOPTS} -cp "${PS}.." Main - -In GooClass Success "$javac" ${TESTTOOLVMOPTS} -cp "..${PS}" ../Main.java -In GooClass Success "$java" ${TESTVMOPTS} -cp "..${PS}" Main - -In GooClass Success "$javac" ${TESTTOOLVMOPTS} -cp "..${PS}${PS}/xyzzy" ../Main.java -In GooClass Success "$java" ${TESTVMOPTS} -cp "..${PS}${PS}/xyzzy" Main - -# All other empty path elements are ignored. -In GooJar Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -extdirs "" -cp ".." ../Main.java - -In GooJar Failure "$javac" -source 8 -targt 8 ${TESTTOOLVMOPTS} -extdirs "${PS}" -cp ".." ../Main.java -In GooJar Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Djava.ext.dirs="${PS}" -cp ".." ../Main.java - -In GooJar Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -extdirs "." -cp ".." ../Main.java -In GooJar Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Djava.ext.dirs="." -cp ".." ../Main.java - -In GooJar Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Djava.endorsed.dirs="" -cp ".." ../Main.java - -In GooJar Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -endorseddirs "${PS}" -cp ".." ../Main.java - -In GooJar Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Djava.endorsed.dirs="." -cp ".." ../Main.java - -In GooClass Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath/p: -cp ".." ../Main.java - -In GooClass Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath/p:. -cp ".." ../Main.java - -In GooClass Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath:"../java-lang.jar" -cp ".." ../Main.java - -In GooClass Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath:"../java-lang.jar${PS}." -cp ".." ../Main.java - -In GooClass Failure "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath/a: -cp ".." ../Main.java -In GooClass Failure "$java" ${TESTVMOPTS} -Xbootclasspath/a: -cp ".." Main - -In GooClass Success "$javac" -source 8 -target 8 ${TESTTOOLVMOPTS} -Xbootclasspath/a:. -cp ".." ../Main.java -In GooClass Success "$java" ${TESTVMOPTS} -Xbootclasspath/a:. -cp ".." Main - -Cleanup - -Bottom Line diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Util.java openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Util.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.spi.ToolProvider; + +import toolbox.ToolBox; + +/** + * Utility methods for use by tests in the `Paths` directory. + */ +class Util { + + ToolBox tb = new ToolBox(); + PrintStream out = tb.out; + + Path javaHome = Path.of(System.getProperty("java.home")); + String PS = File.pathSeparator; + Path curDir = Path.of("."); + + static final String JAR = "jar"; + static final String JAVA = "java"; + static final String JAVAC = "javac"; + static final String JIMAGE = "jimage"; + + /** The number of test-case failures. */ + int failCount = 0; + /** The number of test-case passes. */ + int passCount = 0; + /** A map recording how often each tool is executed in a separate process. */ + Map execCounts = new TreeMap<>(); + /** A map recording how often each tool is invoked via its ToolProvider API. */ + Map toolCounts = new TreeMap<>(); + + /** + * Reports a summary of the overall test statistics, and throws an exception + * if any test cases failed. + * + * @throws Exception if any test cases failed + */ + void bottomLine() throws Exception { + out.println(); + out.println("-- Summary --"); + out.println("Passed: " + passCount); + out.println("Failed: " + failCount); + out.println("exec: " + execCounts); + out.println("tool: " + toolCounts); + + if (failCount > 0) { + throw new Exception(failCount + " tests failed"); + } + } + + /** + * The result of executing a tool, either in a separate process, or via its ToolProvider API. + * + * @param exitCode the exit code from the tool: 0 for success + * @param out the output from the tool + */ + record Result(int exitCode, String out) { } + + /** + * Executes a tool with given arguments and verifies that it passes. + * + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectPass(String command, String args) throws Exception { + expectPass(null, null, command, splitArgs(args)); + } + + /** + * Executes a tool in a specific directory with given arguments and verifies that it passes. + * In order to set the directory, the tool will be executed in a separate process. + * + * @param dir the directory + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectPass(Path dir, String command, String args) throws Exception { + expectPass(dir, null, command, splitArgs(args)); + } + + /** + * Executes a tool with additional env variables with given arguments and verifies that it passes. + * In order to set the env variables, the tool will be executed in a separate process. + * Note that any value of {@code CLASSPATH} inherited from this process will always be removed. + * + * @param env the additional env variables + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectPass(Map env, String command, String args) throws Exception { + expectPass(null, env, command, splitArgs(args)); + } + + /** + * Executes a tool in a given directory with additional env variables with given arguments + * and verifies that it passes. + * In order to set any directory and env variables, the tool will be executed in a separate process. + * Note that any value of {@code CLASSPATH} inherited from this process will always be removed. + * + * @param dir the directory, or {@code null} + * @param env the additional env variables, or {@code null} + * @param command the name of a JDK tool: java, javac or jar + * @param args the arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + */ + void expectPass(Path dir, Map env, String command, String... args) throws Exception { + Result result = switch (command) { + case JAR -> jar(args); + case JAVAC -> javac(dir, env, args); + case JAVA -> java(dir, env, args); + default -> throw new Exception("unknown command: " + command); + }; + + if (result.exitCode == 0) { + out.println("PASS: test passed as expected"); + passCount++; + } else { + out.println("FAIL: test failed unexpectedly"); + failCount++; + } + } + + /** + * Executes a tool with given arguments and verifies that it fails. + * + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectFail(String command, String args) throws Exception { + expectFail(null, null, command, splitArgs(args)); + } + + /** + * Executes a tool in a specific directory with given arguments and verifies that it fails. + * In order to set the directory, the tool will be executed in a separate process. + * + * @param dir the directory + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectFail(Path dir, String command, String args) throws Exception { + expectFail(dir, null, command, splitArgs(args)); + } + + /** + * Executes a tool with additional env variables with given arguments and verifies that it passes. + * In order to set the env variables, the tool will be executed in a separate process. + * Note that any value of {@code CLASSPATH} inherited from this process will always be removed. + * + * @param env the additional env variables + * @param command the name of a JDK tool: java, javac or jar + * @param args a string containing whitespace separated arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + * @see #splitArgs(String) + */ + void expectFail(Map env, String command, String args) throws Exception { + expectFail(null, env, command, splitArgs(args)); + } + + /** + * Executes a tool in a given directory with additional env variables with given arguments + * and verifies that it passes. + * In order to set any directory and env variables, the tool will be executed in a separate process. + * Note that any value of {@code CLASSPATH} inherited from this process will always be removed. + * + * @param dir the directory, or {@code null} + * @param env the additional env variables, or {@code null} + * @param command the name of a JDK tool: java, javac or jar + * @param args the arguments + * @throws Exception if there was an issue trying to execute the tool + * @see #passCount + * @see #failCount + */ + void expectFail(Path dir, Map env, String command, String... args) throws Exception { + Result result = switch (command) { + case JAR -> jar(args); + case JAVAC -> javac(dir, env, args); + case JAVA -> java(dir, env, args); + default -> throw new Exception("unknown command: " + command); + }; + + if (result.exitCode == 0) { + out.println("FAIL: test passed unexpectedly"); + failCount++; + } else { + out.println("PASS: failed as expected"); + passCount++; + } + } + + /** + * Splits a string into a list of strings that were separated by whitespace. + * Leading and trailing whitespace is removed. + * The character sequence {@code ${PS}} is replaced by the platform path separator. + * Note, quotes are not supported, and so there is no support for embedded whitespace + * or empty strings in the output. + * + * @param args a string of tokens separated by whitespace + * @return an array of the tokens that were separated by whitespace + */ + String[] splitArgs(String args) { + return args.trim() + .replace("${PS}", PS) + .split("\\s+"); + } + + /** + * Executes {@code javac} using its ToolProvider API. + * + * @param args the arguments + * @return an object containing the output and exit code from the tool + * @throws Exception if there is an issue executing the tool + */ + Result javac(String... args) throws Exception { + return runTool(JAVAC, args); + } + + /** + * Executes {@code javac} in either a separate process or using its ToolProvider API. + * The ToolProvider API is used if the directory and env parameters are {@code null}, + * and if the arguments definitely do not use "classpath wildcards", which are + * only supported when the tool is invoked by the launcher. + * + * @param dir the directory, or {@code null} + * @param env any additional environment variables, or {@code null} + * @param args the arguments + * @return an object containing the output and exit code from the tool + * @throws Exception if there is an issue executing the tool + */ + Result javac(Path dir, Map env, String... args) throws Exception { + return (env != null || dir != null || hasWildcardClassPath(args)) + ? execTool(dir, env, JAVAC, args) + : runTool(JAVAC, args); + } + + /** + * {@return true if the arguments may contain a classpath option using a "classpath wildcard"} + * + * The result is {@code true} if there is any form of a classpath option whose value contains {@code *}. + * Note: this may include "false positives", where the {@code *} is not at the end of + * any element in the path, such as when the character is part of the filename. + * However, in context, the approximation is safe, and just means that we may sometimes + * execute javac in a separate process when it would be sufficient to use its ToolProvider API. + * + * A more refined implementation could split apart the path elements and looking for + * an element that is {@code *} or which ends in {@code *}. + * + * @param args the arguments to be checked + */ + private boolean hasWildcardClassPath(String... args) { + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + switch (arg) { + case "-classpath", "--class-path", "-cp" -> { + if (i + 1 < args.length && args[i + 1].contains("*")) { + return true; + } + } + default -> { + if (arg.startsWith("--class-path=") && arg.contains("*")) { + return true; + } + } + } + } + return false; + } + + /** + * Executes {@code jar} using its ToolProvider API. + * + * @param args the arguments + * @return an object containing the output and exit code from the tool + * @throws Exception if there is an issue executing the tool + */ + Result jar(String... args) throws Exception { + return runTool(JAR, args); + } + + /** + * Executes {@code jimage} using its ToolProvider API. + * + * @param args the arguments + * @return an object containing the output and exit code from the tool + * @throws Exception if there is an issue executing the tool + */ + Result jimage(String... args) throws Exception { + return execTool(null, null, JIMAGE, args); + } + + /** + * Executes {@code java} in a separate process. + * + * @param dir the directory, or {@code null} + * @param env any additional environment variables, or {@code null} + * @param args the arguments + * @return an object containing the output and exit code from the launcher + * @throws Exception if there is an issue executing the tool + */ + Result java(Path dir, Map env, String... args) throws Exception { + return execTool(dir, env, JAVA, args); + } + + /** + * Runs a tool using its ToolProvider API. + * + * @param args the arguments + * @return an object containing the output and exit code from the launcher + * @throws Exception if there is an issue executing the tool + */ + Result runTool(String name, String... args) throws Exception { + out.println(name + ": " + String.join(" ", args)); + var tool = ToolProvider.findFirst(name) + .orElseThrow(() -> new Exception("cannot find " + name)); + try (StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw)) { + int rc = tool.run(pw, pw, args); + pw.flush(); + String output = sw.toString(); + output.lines() + .forEach(l -> out.println(name + ": " + l)); + if (rc != 0) { + out.println(name + ": exit code " + rc); + } + toolCounts.put(name, toolCounts.computeIfAbsent(name, n -> 0) + 1); + return new Result(rc, output); + } + } + + /** + * Executes a tool in a separate process. + * + * Note that any value of {@code CLASSPATH} inherited from this process will always be removed. + * + * @param dir the directory, or {@code null} + * @param env any additional environment variables, or {@code null} + * @param args the arguments + * @return an object containing the output and exit code from the launcher + * @throws Exception if there is an issue executing the tool + */ + Result execTool(Path dir, Map env, String name, String... args) throws Exception { + out.print(name + ":"); + if (env != null) { + out.print(" " + env); + } + if (dir != null) { + out.print(" (" + dir + ")"); + } + out.println(" " + String.join(" ", args)); + + Path tool = javaHome.resolve("bin").resolve(name + (ToolBox.isWindows() ? ".exe" : "")); + if (!Files.exists(tool)) { + throw new Exception("cannot find " + name); + } + var cmd = new ArrayList(); + cmd.add(tool.toString()); + cmd.addAll(List.of(args)); + ProcessBuilder pb = new ProcessBuilder(cmd) + .redirectErrorStream(true); + pb.environment().remove("CLASSPATH"); // always remove default value set by jtreg + if (env != null) { + pb.environment().putAll(env); + } + if (dir != null) { + pb.directory(dir.toFile()); + } + Process p = pb.start(); + StringBuilder sb = new StringBuilder(); + try (var in = p.inputReader()) { + in.lines().forEach(l -> { + sb.append(l).append("\n"); + out.println(name + ": " + l); + }); + } + p.waitFor(); + int rc = p.exitValue(); + if (rc != 0) { + out.println(name + ": exit code " + rc); + } + execCounts.put(name, execCounts.computeIfAbsent(name, n -> 0) + 1); + return new Result(rc, sb.toString()); + } + + /** + * Checks that a series of files exist and are readable. + * + * @param paths the files + * @throws Exception if any of the files are not found or are not readable + */ + void checkFiles(String... paths) throws Exception { + for (String p : paths) { + Path path = Path.of(p); + if (!Files.isReadable(path) ) { + throw new Exception("file not found: " + path); + } + } + } + + /** + * List the files in a directory that match a "glob" pattern. + * + * @param dir the directory + * @param glob the pattern + * @return the list of files + * @throws IOException if there is a problem listing the contents of the directory + */ + List listFiles(Path dir, String glob) throws IOException { + var files = new ArrayList(); + try (DirectoryStream ds = Files.newDirectoryStream(dir, glob)) { + for (Path p : ds) { + files.add(p); + } + } + return files; + } + + /** + * Deletes a series of files. + * The files are deleted using {@link ToolBox#cleanDirectory(Path)} and + * {@code ToolBox#deleteFiles}, which together try hard to delete the files, + * even on Windows. + * + * @param paths the paths + * @throws IOException if there is a problem deleting any of the files + * @see #deleteFiles(List) + */ + void deleteFiles(String... paths) throws IOException { + deleteFiles(Arrays.stream(paths) + .map(Path::of) + .toList()); + } + + /** + * Deletes a series of files. + * The files are deleted using {@link ToolBox#cleanDirectory(Path)} and + * {@code ToolBox#deleteFiles}, which together try hard to delete the files, + * even on Windows. + * + * @param paths the paths + * @throws IOException if there is a problem deleting any of the files + */ + void deleteFiles(List paths) throws IOException { + for (Path path : paths) { + if (Files.exists(path)) { + if (Files.isDirectory(path)) { + tb.cleanDirectory(path); + } + tb.deleteFiles(path); + } + } + } + + /** + * Moves a series of files into a given directory. + * + * @param files the files + * @param dir the target directory + * @throws IOException if there is a problem moving any of the files + */ + void moveFiles(List files, Path dir) throws IOException { + for (Path p : files) { + tb.moveFile(p, dir); + } + } + + /** + * Moves a series of files into a given directory. + * + * @param files the files + * @param dir the target directory + * @throws IOException if there is a problem moving any of the files + */ + void moveFiles(List files, String dir) throws IOException { + for (String p : files) { + tb.moveFile(p, dir); + } + } + + /** + * {@return a map containing a setting for the {@code CLASSPATH} env variable} + * + * @param classpath the value for the env variable + */ + Map classpath(String classpath) { + return Map.of("CLASSPATH", classpath.replace("${PS}", PS)); + } + + /** + * Writes a file called {@code MANIFEST.MF} containing a given value for + * the {@code Class-Path} entry. + * + * @param path the value for the {@code Class-Path} entry + * @throws IOException if there is a problem writing the file + */ + void makeManifestWithClassPath(String path) throws IOException { + Files.writeString(Path.of("MANIFEST.MF"), + "Manifest-Version: 1.0\n" + + "Class-Path: " + path + "\n"); + } + +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Util.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/Util.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/Util.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -# -# Copyright (c) 2003, 2022, 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. -# - -# Utilities for shell tests - -: ${TESTSRC=.} ${TESTCLASSES=.} - java="${TESTJAVA+${TESTJAVA}/bin/}java${EXE_SUFFIX}" - javac="${TESTJAVA+${TESTJAVA}/bin/}javac${EXE_SUFFIX}" - jar="${TESTJAVA+${TESTJAVA}/bin/}jar${EXE_SUFFIX}" -jimage="${TESTJAVA+${TESTJAVA}/bin/}jimage${EXE_SUFFIX}" - -case `uname -s` in - Windows*|CYGWIN*|MSYS*|MINGW*) - WindowsOnly() { "$@"; } - UnixOnly() { :; } - PS=";" ;; - *) - UnixOnly() { "$@"; } - WindowsOnly() { :; } - PS=":";; -esac - -failed="" -Fail() { echo "FAIL: $1"; failed="${failed}."; } - -Die() { printf "%s\n" "$*"; exit 1; } - -Sys() { - printf "%s\n" "$*"; "$@"; rc="$?"; - test "$rc" -eq 0 || Die "Command \"$*\" failed with exitValue $rc"; -} - -CheckFiles() { - for f in "$@"; do test -r "$f" || Die "File $f not found"; done -} - -Report() { - test "$#" != 2 && Die "Usage: Report success|failure rc" - - if test "$1" = "success" -a "$2" = 0; then - echo "PASS: succeeded as expected" - elif test "$1" = "failure" -a "$2" != 0; then - echo "PASS: failed as expected" - elif test "$1" = "success" -a "$2" != 0; then - Fail "test failed unexpectedly" - elif test "$1" = "failure" -a "$2" = 0; then - Fail "test succeeded unexpectedly" - else - Die "Usage: Report success|failure rc" - fi -} - -MkManifestWithClassPath() { - (echo "Manifest-Version: 1.0"; echo "Class-Path: $*") > MANIFEST.MF -} - -HorizontalRule() { - echo "-----------------------------------------------------------------" -} - -Test() { - HorizontalRule - expectedResult="$1"; shift - printf "%s\n" "$*" - "$@" - Report "$expectedResult" "$?" -} - -Failure() { Test failure "$@"; } -Success() { Test success "$@"; } - -Bottom() { - test "$#" = 1 -a "$1" = "Line" || Die "Usage: Bottom Line" - - if test -n "$failed"; then - count=`printf "%s" "$failed" | wc -c | tr -d ' '` - echo "FAIL: $count tests failed" - exit 1 - else - echo "PASS: all tests gave expected results" - exit 0 - fi -} - -BadJarFile() { - for jarfilename in "$@"; do pwd > "$jarfilename"; done -} - - -#---------------------------------------------------------------- -# Foil message localization -#---------------------------------------------------------------- -DiagnosticsInEnglishPlease() { - LANG="C" LC_ALL="C" LC_MESSAGES="C"; export LANG LC_ALL LC_MESSAGES -} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/WildcardMineField.java openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/WildcardMineField.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/WildcardMineField.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/WildcardMineField.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2005, 2022, 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 6268383 8172309 8293877 + * @summary Test classpath wildcards for javac and java -classpath option. + * @library /tools/lib + * @build toolbox.ToolBox Util WildcardMineField + * @run main WildcardMineField + */ + +/* + * Converted from wcMineField.sh, originally written by Martin Buchholz. + * + * For the last version of the original, wcMineField.sh, see + * https://git.openjdk.org/jdk/blob/jdk-19%2B36/test/langtools/tools/javac/Paths/wcMineField.sh + * + * This class primarily tests support for "classpath wildcards", which is a feature + * by which elements of a classpath option ending in {@code *} are expanded into + * the set of jar files found in the directory preceding the {@code *}. + * + * Note that this feature is only implemented in the launcher, even for javac, + * and so is only available when running javac via its launcher, in a separate process. + * + * Note that this feature does not affect the use of {@code *} elsewhere in any path, + * classpath or otherwise, and so this class also tests the use of {@code *} and other special + * characters (like {@code ,} and {@code ;}) in filenames. Some of these tests, + * labelled in the original code as "UnixOnly", do not apply to Windows. + * + * For information on the launcher support for the {@code -classpath} option, + * see the java man page. As of September 2022, there is no equivalent documentation + * for javac, except to say that the support is only in the native launcher for javac, + * and not in the main javac source code. + */ + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import toolbox.ToolBox; + +public class WildcardMineField extends Util { + public static void main(String... args) throws Exception { + new WildcardMineField().run(args); + } + + void run(String... args) throws Exception { + setup(); + tests(); + cleanup(); + bottomLine(); + } + + void setup() throws Exception { + cleanup(); + tb.createDirectories("GooSrc", "GooJar", "GooZip", "GooClass", "GooJar/SubDir"); + tb.createDirectories("BadSrc", "BadJar", "BadZip", "BadClass"); + tb.createDirectories("SpeSrc", "SpeJar", "SpeZip", "SpeClass"); + tb.createDirectories("JarNClass", "StarJar", "MixJar"); + Files.writeString(Path.of("Lib.java"), "public class Lib {public static void f(){}}"); + Files.writeString(Path.of("Lib2.java"), "public class Lib2 {public static void g(){}}"); + Files.writeString(Path.of("Lib3.java"), "public class Lib3 {public static void h(){}}"); + javac("Lib.java", "Lib2.java", "Lib3.java"); + tb.copyFile("Lib.class", "JarNClass/."); + jar("cf", "GooJar/Lib.jar", "Lib.class"); + jar("cf", "GooJar/SubDir/Lib2.jar", "Lib2.class"); + jar("cf", "JarNClass/Lib.jar", "Lib.class"); + + jar("cf", "GooZip/Lib.zip", "Lib.class"); + tb.moveFile("Lib.class", "GooClass/."); + tb.moveFile("Lib2.class", "GooClass/."); + tb.moveFile("Lib3.class", "GooClass/."); + tb.moveFile("Lib.java", "GooSrc/."); + tb.moveFile("Lib2.java", "GooSrc/."); + tb.moveFile("Lib3.java", "GooSrc/."); + + checkFiles("GooZip/Lib.zip", "GooJar/Lib.jar", "GooSrc/Lib.java"); + checkFiles("GooSrc/Lib2.java", "GooSrc/Lib3.java", "GooJar/SubDir/Lib2.jar"); + + Files.writeString(Path.of("Spe1.java"), "public class Spe1 {public static void f(){}}"); + Files.writeString(Path.of("Spe2.java"), "public class Spe2 {public static void f(){}}"); + Files.writeString(Path.of("Spe3.java"), "public class Spe3 {public static void f(){}}"); + Files.writeString(Path.of("Spe4.java"), "public class Spe4 {public static void f(){}}"); + javac("Spe1.java", "Spe2.java", "Spe3.java", "Spe4.java"); + + if (!ToolBox.isWindows()) { + jar("cf", "SpeJar/Spe:Colon.jar", "Spe1.class"); + jar("cf", "SpeJar/Spe*wc.jar", "Spe4.class"); + checkFiles("SpeJar/Spe*wc.jar"); + + jar("cf", "StarJar/*jar.jar", "Spe2.class"); + jar("cf", "StarJar/jar*.jar", "Spe3.class"); + jar("cf", "StarJar/*jar*.jar", "Spe4.class"); + checkFiles("StarJar/*jar.jar", "StarJar/jar*.jar", "StarJar/*jar*.jar"); + } + + jar("cf", "SpeJar/Spe,Comma.jar", "Spe2.class"); + jar("cf", "SpeJar/Spe;Semi.jar", "Spe3.class"); + + jar("cf", "MixJar/mix.jAr", "Spe1.class"); + jar("cf", "MixJar/mix2.JAR", "Spe2.class"); + jar("cf", "MixJar/mix3.zip", "Spe3.class"); + jar("cf", "MixJar/.hiddenjar.jar", "Spe4.class"); + + moveFiles(listFiles(curDir, "Spe*.class"), Path.of("SpeClass/.")); + moveFiles(listFiles(curDir, "Spe*.java"), Path.of("SpeSrc/.")); + checkFiles("SpeJar/Spe,Comma.jar", "SpeJar/Spe;Semi.jar", "SpeSrc/Spe2.java", "SpeSrc/Spe3." + + "java", "SpeSrc/Spe4.java"); + checkFiles("MixJar/mix.jAr", "MixJar/mix2.JAR", "MixJar/mix3.zip", "MixJar/.hiddenjar.jar"); + + Files.writeString(Path.of("Main.java"), "public class Main {public static void main(String[] a) {Lib.f();}}"); + Files.writeString(Path.of("Main1.java"), "public class Main1 {public static void main(String[] a) {Lib2.g();}}"); + Files.writeString(Path.of("Main1b.java"), "public class Main1b {public static void main(String[] a) {Spe1.f();}}"); + Files.writeString(Path.of("Main2.java"), "public class Main2 {public static void main(String[] a) {Spe2.f();}}"); + Files.writeString(Path.of("Main3.java"), "public class Main3 {public static void main(String[] a) {Spe3.f();}}"); + Files.writeString(Path.of("Main4.java"), "public class Main4 {public static void main(String[] a) {Spe4.f();}}"); + Files.writeString(Path.of("Main5.java"), "public class Main5 {public static void main(String[] a) {Spe2.f(); Lib.f();}}"); + Files.writeString(Path.of("Main6.java"), "public class Main6 {public static void main(String[] a) {Lib3.h();}}"); + } + + void cleanup() throws IOException { + deleteFiles("GooSrc", "GooJar", "GooZip", "GooClass"); + deleteFiles("SpeSrc", "SpeJar", "SpeZip", "SpeClass"); + deleteFiles("BadSrc", "BadJar", "BadZip", "BadClass"); + deleteFiles("JarNClass", "StarJar", "MixJar", "StarDir"); + deleteFiles("OneDir", "MANIFEST.MF"); + deleteFiles(listFiles(curDir, "*.class")); + deleteFiles(listFiles(curDir, "Main*.java")); + } + + void tests() throws Exception { + if (!ToolBox.isWindows()) { + starDirTests(); + } + + /*---------------------------------------------------------------- + * Verify the basic jar file works + *----------------------------------------------------------------*/ + + // baseline test to verify it works. + expectPass(JAVAC, "-cp GooJar/Lib.jar Main.java"); + expectPass(JAVAC, "-classpath GooJar/Lib.jar Main.java"); + expectPass(JAVA, "-classpath GooJar/Lib.jar${PS}. Main"); + expectPass(JAVA, "-cp GooJar/Lib.jar${PS}. Main"); + + // basic test of one jar to be loaded + if (!ToolBox.isWindows()) { + expectPass(JAVAC, "-classpath GooJar/* Main.java"); + } + expectPass(JAVAC, "-classpath GooJar/*${PS}. Main.java"); + expectPass(JAVA, "-classpath GooJar/*${PS}. Main"); + + // in a subdir. First * should not load jars in subdirectories unless specified + expectFail(JAVAC, "-classpath GooJar/* Main1.java"); + expectFail(JAVAC, " -classpath GooJar/*${PS}. Main1.java"); + expectPass(JAVAC, "-cp GooJar/SubDir/* Main1.java"); + expectPass(JAVAC, "-classpath GooJar/SubDir/* Main1.java"); + expectPass(JAVAC, "--class-path GooJar/SubDir/* Main1.java"); + expectPass(JAVAC, "--class-path=GooJar/SubDir/* Main1.java"); + + // Same with launcher. Should not load jar in subdirectories unless specified + expectFail(JAVA, "-classpath GooJar/*${PS}. Main1"); + expectPass(JAVA, "-classpath GooJar/SubDir/*${PS}. Main1"); + expectPass(JAVA, "-cp GooJar/SubDir/*${PS}. Main1"); + + expectPass(classpath("GooJar/SubDir/*"), JAVAC, "Main1.java"); + expectPass(classpath("GooJar/SubDir/*${PS}."), JAVA, "Main1"); + + /*---------------------------------------------------------------- + * Verify the jar files in 2 directories + *----------------------------------------------------------------*/ + + expectPass(JAVAC, "-classpath GooJar/Lib.jar${PS}SpeJar/Spe,Comma.jar Main5.java"); + expectPass(JAVA, "-classpath GooJar/Lib.jar${PS}SpeJar/Spe,Comma.jar${PS}. Main5"); + + expectPass(JAVAC, "-classpath GooJar/*${PS}SpeJar/* Main5.java"); + expectPass(JAVA, "-classpath GooJar/*${PS}SpeJar/*${PS}. Main5"); + + /*---------------------------------------------------------------- + * Verify jar file and class file in same directory. + *----------------------------------------------------------------*/ + + expectPass(JAVAC, "-classpath JarNClass/*${PS} Main.java"); + expectPass(JAVA, "-classpath JarNClass/*${PS}. Main"); + + /*---------------------------------------------------------------- + * Verify these odd jar files work explicitly on classpath, kind of + * a baseline. Last one is also a test with * in a jar name. + *----------------------------------------------------------------*/ + + expectFail(JAVAC, "-classpath SpeJar/Spe:Colon.jar Main1.java"); + + expectPass(JAVAC, "-classpath SpeJar/Spe,Comma.jar Main2.java"); + expectPass(JAVA, "-classpath SpeJar/Spe,Comma.jar${PS}. Main2"); + + if (!ToolBox.isWindows()) { + expectPass(JAVAC, "-classpath SpeJar/Spe;Semi.jar Main3.java"); + expectPass(JAVA, "-classpath SpeJar/Spe;Semi.jar${PS}. Main3"); + + expectPass(JAVAC, "-classpath SpeJar/Spe*wc.jar Main4.java"); + expectPass(JAVA, "-classpath SpeJar/Spe*wc.jar${PS}. Main4"); + } + + if (!ToolBox.isWindows()) { + speJar(); + } + + if (!ToolBox.isWindows()) { + starJar(); + } + + /*---------------------------------------------------------------- + * Verify these jar files with varying extensions + *----------------------------------------------------------------*/ + + // Mixed case extensions should not be loaded. + expectFail(JAVAC, "-classpath MixJar/* Main1b.java"); + expectPass(JAVAC, "-classpath MixJar/mix.jAr Main1b.java"); + expectFail(JAVAC, "-classpath MixJar/* Main1b"); + + // upper case, .JAR, extension should be loaded + if (!ToolBox.isWindows()) { + expectPass(JAVAC, "-classpath MixJar/* Main2.java"); + } + expectPass(JAVAC, "-classpath .${PS}MixJar/* Main2.java"); + + expectPass(JAVA, "-classpath MixJar/*${PS}. Main2"); + + // zip extensions should not be loaded + expectFail(JAVAC, "-classpath MixJar/* Main3.java"); + expectPass(JAVAC, "-classpath MixJar/mix3.zip Main3.java"); + expectFail(JAVA, "-classpath MixJar/*${PS}. Main3"); + + // unix "hidden" file + if (!ToolBox.isWindows()) { + expectPass(JAVAC, "-classpath MixJar/* Main4.java"); + expectPass(JAVA, "-classpath MixJar/*${PS}. Main4"); + } + } + + void starDirTests() throws Exception { + out.println("Running tests with directory named \"*\""); + deleteFiles("./StarDir"); + tb.createDirectories("StarDir/*"); + tb.copyFile("GooClass/Lib2.class", "StarDir/*/Lib2.class"); + jar("cf", "StarDir/Lib3.jar", "-C", "GooClass", "Lib3.class"); + jar("cf", "StarDir/*/Lib.jar", "-C", "GooClass", "Lib.class"); + checkFiles("StarDir/*/Lib.jar", "StarDir/*/Lib2.class", "StarDir/Lib3.jar"); + tb.copyFile("Main6.java", "./StarDir/."); + tb.copyFile("Main.java", "./StarDir/*/."); + tb.copyFile("Main1.java", "./StarDir/*/."); + Path StarDir = Path.of("StarDir"); + expectFail(StarDir, JAVAC, "-classpath * Main6.java"); + expectFail(StarDir, JAVAC, "-classpath ./* Main6.java"); + deleteFiles(listFiles(StarDir, "Main6.*")); + Path StarDir_star = StarDir.resolve("*"); + expectPass(StarDir_star, JAVAC, "-classpath * Main.java"); + expectPass(StarDir_star, JAVA, "-classpath .${PS}* Main"); + expectPass(StarDir_star, JAVAC, "Main1.java"); + expectPass(StarDir_star, JAVA, "-classpath . Main1"); + + expectFail(JAVAC, "-classpath StarDir/* Main6.java"); + + expectPass(JAVAC, "-classpath StarDir/* Main1.java"); + expectPass(JAVA, "-classpath StarDir/*:. Main1"); + + expectPass(JAVAC, "-classpath StarDir/* Main1.java"); + expectPass(JAVA, "-classpath .${PS}StarDir/* Main1"); + + expectFail(JAVAC, "-classpath StarDir/\\*/* Main.java"); + expectPass(JAVAC, "-classpath StarDir/*/* Main.java"); + + expectPass(JAVA, "-classpath .${PS}StarDir/*/* Main"); + expectFail(JAVA, "-classpath .${PS}StarDir/\\*/* Main"); + + expectPass(JAVAC, "-classpath StarDir/Lib3.jar Main6.java"); + expectPass(JAVA, "-classpath .${PS}StarDir/Lib3.jar Main6"); + + expectPass(JAVAC, "-classpath StarDir/*/Lib.jar Main.java"); + expectPass(JAVA, "-classpath .${PS}StarDir/*/Lib.jar Main"); + } + + void speJar() throws Exception { + out.println("Running tests with jar file names containing special characters"); + + expectPass(JAVAC, "-classpath SpeJar/* Main2.java"); + expectPass(JAVA, "-classpath SpeJar/*${PS}. Main2"); + + expectPass(JAVAC, "-classpath SpeJar/* Main3.java"); + expectPass(JAVA, "-classpath SpeJar/*${PS}. Main3"); + + expectPass(JAVAC, "-classpath SpeJar/* Main4.java"); + expectPass(JAVA, "-classpath SpeJar/*${PS}. Main4"); + } + + /*---------------------------------------------------------------- + * Verify these jar files with asterisk in jar file name + *----------------------------------------------------------------*/ + void starJar() throws Exception { + out.println("Running tests with jar file names containing \"*\""); + expectPass(JAVAC, "-classpath StarJar/*jar.jar Main2.java"); + expectPass(JAVA, "-classpath StarJar/*jar.jar${PS}. Main2"); + + expectPass(JAVAC, "-classpath StarJar/jar*.jar Main3.java"); + expectPass(JAVA, "-classpath StarJar/jar*.jar${PS}. Main3"); + + expectPass(JAVAC, "-classpath StarJar/*jar*.jar Main4.java"); + expectPass(JAVA, "-classpath StarJar/*jar*.jar${PS}. Main4"); + + expectPass(JAVAC, "-classpath StarJar/* Main2.java"); + expectPass(JAVA, "-classpath StarJar/*${PS}. Main2"); + + expectPass(JAVAC, "-classpath StarJar/* Main3.java"); + expectPass(JAVA, "-classpath StarJar/*${PS}. Main3"); + + expectPass(JAVAC, "-classpath StarJar/* Main4.java"); + expectPass(JAVA, "-classpath StarJar/*${PS}. Main4"); + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/wcMineField.sh openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/wcMineField.sh --- openjdk-17-17.0.13+11/test/langtools/tools/javac/Paths/wcMineField.sh 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/Paths/wcMineField.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,296 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# @test -# @summary Test classpath wildcards for javac and java -classpath option. -# @bug 6268383 8172309 -# @run shell/timeout=600 wcMineField.sh - -# To run this test manually, simply do ./wcMineField.sh -#---------------------------------------------------------------- - -. ${TESTSRC-.}/Util.sh - -set -u - -#---------------------------------------------------------------- -# Note that, on Windows only, the launcher also includes another -# kind of command-line wildcard expansion, via setargv.obj -# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/progs_11.asp -# Therefore, on Windows, -classpath "foo/*" is treated differently -# from -classpath ".${PS}foo/*" -#---------------------------------------------------------------- - -#---------------------------------------------------------------- -# Prepare the "Minefield" -#---------------------------------------------------------------- -Cleanup() { - Sys rm -rf GooSrc GooJar GooZip GooClass - Sys rm -rf SpeSrc SpeJar SpeZip SpeClass - Sys rm -rf BadSrc BadJar BadZip BadClass - Sys rm -rf JarNClass StarJar MixJar StarDir - Sys rm -rf OneDir *.class Main*.java MANIFEST.MF -} - -Cleanup -Sys mkdir GooSrc GooJar GooZip GooClass GooJar/SubDir -Sys mkdir BadSrc BadJar BadZip BadClass -Sys mkdir SpeSrc SpeJar SpeZip SpeClass -Sys mkdir JarNClass StarJar MixJar -echo 'public class Lib {public static void f(){}}' > Lib.java -echo 'public class Lib2 {public static void g(){}}' > Lib2.java -echo 'public class Lib3 {public static void h(){}}' > Lib3.java -Sys "$javac" ${TESTTOOLVMOPTS} Lib.java Lib2.java Lib3.java -Sys cp Lib.class JarNClass/. -Sys "$jar" cf GooJar/Lib.jar Lib.class -Sys "$jar" cf GooJar/SubDir/Lib2.jar Lib2.class -Sys "$jar" cf JarNClass/Lib.jar Lib.class - -Sys "$jar" cf GooZip/Lib.zip Lib.class -Sys mv Lib.class GooClass/. -Sys mv Lib2.class GooClass/. -Sys mv Lib3.class GooClass/. -Sys mv Lib.java GooSrc/. -Sys mv Lib2.java GooSrc/. -Sys mv Lib3.java GooSrc -CheckFiles GooZip/Lib.zip GooJar/Lib.jar GooSrc/Lib.java -CheckFiles GooSrc/Lib2.java GooSrc/Lib3.java GooJar/SubDir/Lib2.jar - -echo 'public class Spe1 {public static void f(){}}' > Spe1.java -echo 'public class Spe2 {public static void f(){}}' > Spe2.java -echo 'public class Spe3 {public static void f(){}}' > Spe3.java -echo 'public class Spe4 {public static void f(){}}' > Spe4.java -Sys "$javac" ${TESTTOOLVMOPTS} Spe1.java -Sys "$javac" ${TESTTOOLVMOPTS} Spe2.java -Sys "$javac" ${TESTTOOLVMOPTS} Spe3.java -Sys "$javac" ${TESTTOOLVMOPTS} Spe4.java - -UnixOnly Sys "$jar" cf "SpeJar/Spe:Colon.jar" Spe1.class -UnixOnly Sys "$jar" cf "SpeJar/Spe*wc.jar" Spe4.class -UnixOnly CheckFiles "SpeJar/Spe*wc.jar" - -UnixOnly Sys "$jar" cf "StarJar/*jar.jar" Spe2.class -UnixOnly Sys "$jar" cf "StarJar/jar*.jar" Spe3.class -UnixOnly Sys "$jar" cf "StarJar/*jar*.jar" Spe4.class -UnixOnly CheckFiles "StarJar/*jar.jar" "StarJar/jar*.jar" "StarJar/*jar*.jar" - -Sys "$jar" cf "SpeJar/Spe,Comma.jar" Spe2.class -Sys "$jar" cf "SpeJar/Spe;Semi.jar" Spe3.class - -Sys "$jar" cf "MixJar/mix.jAr" Spe1.class -Sys "$jar" cf "MixJar/mix2.JAR" Spe2.class -Sys "$jar" cf "MixJar/mix3.zip" Spe3.class -Sys "$jar" cf "MixJar/.hiddenjar.jar" Spe4.class - -Sys mv Spe*.class SpeClass/. -Sys mv Spe*.java SpeSrc/. -CheckFiles "SpeJar/Spe,Comma.jar" "SpeJar/Spe;Semi.jar" "SpeSrc/Spe2.java" "SpeSrc/Spe3.java" "SpeSrc/Spe4.java" -CheckFiles "MixJar/mix.jAr" "MixJar/mix2.JAR" "MixJar/mix3.zip" "MixJar/.hiddenjar.jar" - -echo 'public class Main {public static void main(String[] a) {Lib.f();}}' > Main.java -echo 'public class Main1 {public static void main(String[] a) {Lib2.g();}}' > Main1.java -echo 'public class Main1b {public static void main(String[] a) {Spe1.f();}}' > Main1b.java -echo 'public class Main2 {public static void main(String[] a) {Spe2.f();}}' > Main2.java -echo 'public class Main3 {public static void main(String[] a) {Spe3.f();}}' > Main3.java -echo 'public class Main4 {public static void main(String[] a) {Spe4.f();}}' > Main4.java -echo 'public class Main5 {public static void main(String[] a) {Spe2.f(); Lib.f();}}' > Main5.java -echo 'public class Main6 {public static void main(String[] a) {Lib3.h();}}' > Main6.java - - -#---------------------------------------------------------------- -# Verify expected behaviour with directory named "*" -#---------------------------------------------------------------- -starDir() { - printf "Running tests with directory named \"*\"\n" - Sys rm -rf ./StarDir - Sys mkdir -p StarDir/"*" - Sys cp "GooClass/Lib2.class" "StarDir/*/Lib2.class" - Sys "$jar" cf "StarDir/Lib3.jar" -C GooClass "Lib3.class" - Sys "$jar" cf "StarDir/*/Lib.jar" -C GooClass "Lib.class" - CheckFiles "StarDir/*/Lib.jar" "StarDir/*/Lib2.class" "StarDir/Lib3.jar" - Sys cp Main6.java ./StarDir/. - Sys cp Main.java ./StarDir/"*"/. - Sys cp Main1.java ./StarDir/"*"/. - CPWC_DIR=`pwd` - Sys cd StarDir - Failure "$javac" ${TESTTOOLVMOPTS} -classpath "*" Main6.java - Failure "$javac" ${TESTTOOLVMOPTS} -classpath "./*" Main6.java - Sys rm -f Main6.* - Sys cd "*" - Success "$javac" ${TESTTOOLVMOPTS} -classpath "*" Main.java - Success "$java" ${TESTVMOPTS} -classpath .${PS}"*" Main - Success "$javac" ${TESTTOOLVMOPTS} Main1.java - Success "$java" ${TESTVMOPTS} -classpath "." Main1 - Sys cd $CPWC_DIR - - Failure "$javac" ${TESTTOOLVMOPTS} -classpath "StarDir/*" Main6.java - - Success "$javac" ${TESTTOOLVMOPTS} -classpath StarDir/\* Main1.java - Success "$java" ${TESTVMOPTS} -classpath StarDir/\*:. Main1 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarDir/*" Main1.java - Success "$java" ${TESTVMOPTS} -classpath ".${PS}StarDir/*" Main1 - - Failure "$javac" ${TESTTOOLVMOPTS} -classpath StarDir/"\*/*" Main.java - Success "$javac" ${TESTTOOLVMOPTS} -classpath StarDir/"*/*" Main.java - - Success "$java" ${TESTVMOPTS} -classpath .${PS}StarDir/"*/*" Main - Failure "$java" ${TESTVMOPTS} -classpath .${PS}StarDir/"\*/*" Main - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarDir/Lib3.jar" Main6.java - Success "$java" ${TESTVMOPTS} -classpath ".${PS}StarDir/Lib3.jar" Main6 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath StarDir/"*"/Lib.jar Main.java - Success "$java" ${TESTVMOPTS} -classpath .${PS}StarDir/"*"/Lib.jar Main -} -UnixOnly starDir - -#---------------------------------------------------------------- -# Verify the basic jar file works -#---------------------------------------------------------------- -#baseline test to verify it works. -Success "$javac" ${TESTTOOLVMOPTS} -cp "GooJar/Lib.jar" Main.java -Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/Lib.jar" Main.java -Success "$java" ${TESTVMOPTS} -classpath "GooJar/Lib.jar${PS}." Main -Success "$java" ${TESTVMOPTS} -cp "GooJar/Lib.jar${PS}." Main - -#basic test of one jar to be loaded -UnixOnly Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/*" Main.java - Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/*${PS}." Main.java -Success "$java" ${TESTVMOPTS} -classpath "GooJar/*${PS}." Main -#in a subdir. First * should not load jars in subdirectories unless specified -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/*" Main1.java -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/*${PS}." Main1.java -Success "$javac" ${TESTTOOLVMOPTS} -cp "GooJar/SubDir/*" Main1.java -Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/SubDir/*" Main1.java -Success "$javac" ${TESTTOOLVMOPTS} --class-path "GooJar/SubDir/*" Main1.java -Success "$javac" ${TESTTOOLVMOPTS} --class-path="GooJar/SubDir/*" Main1.java -#Same with launcher. Should not load jar in subdirectories unless specified -Failure "$java" ${TESTVMOPTS} -classpath "GooJar/*${PS}." Main1 -Success "$java" ${TESTVMOPTS} -classpath "GooJar/SubDir/*${PS}." Main1 -Success "$java" ${TESTVMOPTS} -cp "GooJar/SubDir/*${PS}." Main1 - -Success env CLASSPATH="GooJar/SubDir/*" "$javac" ${TESTTOOLVMOPTS} Main1.java -Success env CLASSPATH="GooJar/SubDir/*${PS}." "$java" ${TESTVMOPTS} Main1 -#---------------------------------------------------------------- -# Verify the jar files in 2 directories -#---------------------------------------------------------------- -Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/Lib.jar${PS}SpeJar/Spe,Comma.jar" Main5.java -Success "$java" ${TESTVMOPTS} -classpath "GooJar/Lib.jar${PS}SpeJar/Spe,Comma.jar${PS}." Main5 - -Success "$javac" ${TESTTOOLVMOPTS} -classpath "GooJar/*${PS}SpeJar/*" Main5.java -Success "$java" ${TESTVMOPTS} -classpath "GooJar/*${PS}SpeJar/*${PS}." Main5 - -#---------------------------------------------------------------- -# Verify jar file and class file in same directory. -#---------------------------------------------------------------- -Success "$javac" ${TESTTOOLVMOPTS} -classpath "JarNClass/*${PS}" Main.java -Success "$java" ${TESTVMOPTS} -classpath "JarNClass/*${PS}." Main - -#---------------------------------------------------------------- -# Verify these odd jar files work explicitly on classpath, kind of -# a baseline. Last one is also a test with * in a jar name. -#---------------------------------------------------------------- -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/Spe:Colon.jar" Main1.java - -Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/Spe,Comma.jar" Main2.java -Success "$java" ${TESTVMOPTS} -classpath "SpeJar/Spe,Comma.jar${PS}." Main2 - -UnixOnly Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/Spe;Semi.jar" Main3.java -UnixOnly Success "$java" ${TESTVMOPTS} -classpath "SpeJar/Spe;Semi.jar${PS}." Main3 - -UnixOnly Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/Spe*wc.jar" Main4.java -UnixOnly Success "$java" ${TESTVMOPTS} -classpath "SpeJar/Spe*wc.jar${PS}." Main4 -#---------------------------------------------------------------- -# Verify these odd jar files work with classpath wildcard. -#---------------------------------------------------------------- - -speJar() { - printf "Running tests with jar file names containing special characters\n" -# Failure "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/*" Main1.java -# Success "$java" ${TESTVMOPTS} -classpath "SpeJar/*" Main1 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/*" Main2.java - Success "$java" ${TESTVMOPTS} -classpath "SpeJar/*${PS}." Main2 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/*" Main3.java - Success "$java" ${TESTVMOPTS} -classpath "SpeJar/*${PS}." Main3 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "SpeJar/*" Main4.java - Success "$java" ${TESTVMOPTS} -classpath "SpeJar/*${PS}." Main4 -} -UnixOnly speJar - -#---------------------------------------------------------------- -# Verify these jar files with asterisk in jar file name -#---------------------------------------------------------------- -starJar() { - printf "Running tests with jar file names containing \"*\"\n" - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/*jar.jar" Main2.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/*jar.jar${PS}." Main2 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/jar*.jar" Main3.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/jar*.jar${PS}." Main3 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/*jar*.jar" Main4.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/*jar*.jar${PS}." Main4 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/*" Main2.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/*${PS}." Main2 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/*" Main3.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/*${PS}." Main3 - - Success "$javac" ${TESTTOOLVMOPTS} -classpath "StarJar/*" Main4.java - Success "$java" ${TESTVMOPTS} -classpath "StarJar/*${PS}." Main4 -} -UnixOnly starJar - -#---------------------------------------------------------------- -# Verify these jar files with varying extensions -#---------------------------------------------------------------- -# Mixed case extensions should not be loaded. -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/*" Main1b.java -Success "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/mix.jAr" Main1b.java -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/*" Main1b - -#upper case, .JAR, extension should be loaded -UnixOnly Success "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/*" Main2.java - Success "$javac" ${TESTTOOLVMOPTS} -classpath ".${PS}MixJar/*" Main2.java - -Success "$java" ${TESTVMOPTS} -classpath "MixJar/*${PS}." Main2 -# zip extensions should not be loaded -Failure "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/*" Main3.java -Success "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/mix3.zip" Main3.java -Failure "$java" ${TESTVMOPTS} -classpath "MixJar/*${PS}." Main3 -# unix "hidden" file -UnixOnly Success "$javac" ${TESTTOOLVMOPTS} -classpath "MixJar/*" Main4.java -UnixOnly Success "$java" ${TESTVMOPTS} -classpath "MixJar/*${PS}." Main4 - -Cleanup - -Bottom Line -#---------------------------------------------------------------- diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/StringAppendEvaluatesInOrder.java openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/StringAppendEvaluatesInOrder.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/StringAppendEvaluatesInOrder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/StringAppendEvaluatesInOrder.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021, Google LLC. 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 8273914 + * @summary Indy string concat changes order of operations + * + * @clean * + * @compile -XDstringConcat=indy StringAppendEvaluatesInOrder.java + * @run main StringAppendEvaluatesInOrder + * + * @clean * + * @compile -XDstringConcat=indyWithConstants StringAppendEvaluatesInOrder.java + * @run main StringAppendEvaluatesInOrder + * + * @clean * + * @compile -XDstringConcat=inline StringAppendEvaluatesInOrder.java + * @run main StringAppendEvaluatesInOrder + */ + +public class StringAppendEvaluatesInOrder { + static String test() { + StringBuilder builder = new StringBuilder("foo"); + int i = 15; + return "Test: " + i + " " + (++i) + builder + builder.append("bar"); + } + + static String compoundAssignment() { + StringBuilder builder2 = new StringBuilder("foo"); + Object oo = builder2; + oo += "" + builder2.append("bar"); + return oo.toString(); + } + + public static void main(String[] args) throws Exception { + assertEquals(test(), "Test: 15 16foofoobar"); + assertEquals(compoundAssignment(), "foofoobar"); + } + + private static void assertEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new AssertionError("expected: " + expected + ", actual: " + actual); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/WellKnownTypeSignatures.java openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypeSignatures.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/WellKnownTypeSignatures.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypeSignatures.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021, Google LLC. 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.classfile.*; +import com.sun.tools.classfile.ConstantPool.*; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/* + * @test + * @bug 8273914 + * @summary Indy string concat changes order of operations + * @modules jdk.jdeps/com.sun.tools.classfile + * + * @clean * + * @compile -XDstringConcat=indy WellKnownTypeSignatures.java + * @run main WellKnownTypeSignatures + * + * @clean * + * @compile -XDstringConcat=indyWithConstants WellKnownTypeSignatures.java + * @run main WellKnownTypeSignatures + */ + +public class WellKnownTypeSignatures { + static List actualTypes; + + static int idx = 0; + + static boolean z = true; + static char c = (char) 42; + static short s = (short) 42; + static byte b = (byte) 42; + static int i = 42; + static long l = 42L; + static float f = 42.0f; + static double d = 42.0; + + public static void main(String[] argv) throws Exception { + readIndyTypes(); + + test("" + WellKnownTypeSignatures.class, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); + test("" + Boolean.valueOf(z), idx++, "(Ljava/lang/Boolean;)Ljava/lang/String;"); + test("" + Character.valueOf(c), idx++, "(Ljava/lang/Character;)Ljava/lang/String;"); + test("" + Byte.valueOf(b), idx++, "(Ljava/lang/Byte;)Ljava/lang/String;"); + test("" + Short.valueOf(s), idx++, "(Ljava/lang/Short;)Ljava/lang/String;"); + test("" + Integer.valueOf(i), idx++, "(Ljava/lang/Integer;)Ljava/lang/String;"); + test("" + Long.valueOf(l), idx++, "(Ljava/lang/Long;)Ljava/lang/String;"); + test("" + Double.valueOf(d), idx++, "(Ljava/lang/Double;)Ljava/lang/String;"); + test("" + Float.valueOf(f), idx++, "(Ljava/lang/Float;)Ljava/lang/String;"); + test("" + z, idx++, "(Z)Ljava/lang/String;"); + test("" + c, idx++, "(C)Ljava/lang/String;"); + test("" + b, idx++, "(B)Ljava/lang/String;"); + test("" + s, idx++, "(S)Ljava/lang/String;"); + test("" + i, idx++, "(I)Ljava/lang/String;"); + test("" + l, idx++, "(J)Ljava/lang/String;"); + test("" + d, idx++, "(D)Ljava/lang/String;"); + test("" + f, idx++, "(F)Ljava/lang/String;"); + } + + public static void test(String actual, int index, String expectedType) { + String actualType = actualTypes.get(index); + if (!actualType.equals(expectedType)) { + throw new IllegalStateException( + index + + " Unexpected type: expected = " + + expectedType + + ", actual = " + + actualType); + } + } + + public static void readIndyTypes() throws Exception { + actualTypes = new ArrayList(); + + ClassFile classFile = + ClassFile.read( + new File( + System.getProperty("test.classes", "."), + WellKnownTypeSignatures.class.getName() + ".class")); + ConstantPool constantPool = classFile.constant_pool; + + for (Method method : classFile.methods) { + if (method.getName(constantPool).equals("main")) { + Code_attribute code = (Code_attribute) method.attributes.get(Attribute.Code); + for (Instruction i : code.getInstructions()) { + if (i.getOpcode() == Opcode.INVOKEDYNAMIC) { + CONSTANT_InvokeDynamic_info indyInfo = + (CONSTANT_InvokeDynamic_info) + constantPool.get(i.getUnsignedShort(1)); + CONSTANT_NameAndType_info natInfo = indyInfo.getNameAndTypeInfo(); + actualTypes.add(natInfo.getType()); + } + } + } + } + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/WellKnownTypes.java openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypes.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/WellKnownTypes.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/WellKnownTypes.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021, Google LLC. 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.classfile.*; +import com.sun.tools.classfile.ConstantPool.*; + +/* + * @test + * @bug 8273914 + * @summary Indy string concat changes order of operations + * @modules jdk.jdeps/com.sun.tools.classfile + * + * @compile -XDstringConcat=indy WellKnownTypes.java + * @run main WellKnownTypes + * + * @compile -XDstringConcat=indyWithConstants WellKnownTypes.java + * @run main WellKnownTypes + * + * @compile -XDstringConcat=inline WellKnownTypes.java + * @run main WellKnownTypes + */ + +public class WellKnownTypes { + static int idx = 0; + + static boolean z = true; + static char c = (char) 42; + static byte b = (byte) 43; + static short s = (short) 44; + static int i = 45; + static long l = 46L; + static float f = 47.0f; + static double d = 48.0; + + public static void main(String[] argv) throws Exception { + test("" + WellKnownTypes.class, idx++, "class WellKnownTypes"); + test("" + Boolean.valueOf(z), idx++, "true"); + test("" + Character.valueOf(c), idx++, "*"); + test("" + Byte.valueOf(b), idx++, "43"); + test("" + Short.valueOf(s), idx++, "44"); + test("" + Integer.valueOf(i), idx++, "45"); + test("" + Long.valueOf(l), idx++, "46"); + test("" + Float.valueOf(f), idx++, "47.0"); + test("" + Double.valueOf(d), idx++, "48.0"); + test("" + z, idx++, "true"); + test("" + c, idx++, "*"); + test("" + b, idx++, "43"); + test("" + s, idx++, "44"); + test("" + i, idx++, "45"); + test("" + l, idx++, "46"); + test("" + f, idx++, "47.0"); + test("" + d, idx++, "48.0"); + } + + public static void test(String actual, int index, String expected) { + if (!actual.equals(expected)) { + throw new IllegalStateException( + index + " Unexpected: expected = " + expected + ", actual = " + actual); + } + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/access/Test.java openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/access/Test.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/StringConcat/access/Test.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/StringConcat/access/Test.java 2025-01-04 20:25:18.000000000 +0000 @@ -56,109 +56,109 @@ // ---------------------------------------------------------------------------- // public Private_PublicClass c1 = new Private_PublicClass(); - test("" + holder.c1, idx++, "(Lp1/PublicClass;)Ljava/lang/String;"); + test("" + holder.c1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PublicInterface c2 = new Private_PublicInterface(); - test("" + holder.c2, idx++, "(Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.c2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface1 c3 = new Private_PrivateInterface1(); - test("" + holder.c3, idx++, "(Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.c3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface2 c4 = new Private_PrivateInterface2(); - test("" + holder.c4, idx++, "(Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.c4, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicClass c5 = new Public_PublicClass(); - test("" + holder.c5, idx++, "(Lp1/Public_PublicClass;)Ljava/lang/String;"); + test("" + holder.c5, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicInterface c6 = new Public_PublicInterface(); - test("" + holder.c6, idx++, "(Lp1/Public_PublicInterface;)Ljava/lang/String;"); + test("" + holder.c6, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface1 c7 = new Public_PrivateInterface1(); - test("" + holder.c7, idx++, "(Lp1/Public_PrivateInterface1;)Ljava/lang/String;"); + test("" + holder.c7, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface2 c8 = new Public_PrivateInterface2(); - test("" + holder.c8, idx++, "(Lp1/Public_PrivateInterface2;)Ljava/lang/String;"); + test("" + holder.c8, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // ---------------------------------------------------------------------------- // public Private_PublicClass[] ac1 = new Private_PublicClass[0]; - test("" + holder.ac1, idx++, "([Lp1/PublicClass;)Ljava/lang/String;"); + test("" + holder.ac1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PublicInterface[] ac2 = new Private_PublicInterface[0]; - test("" + holder.ac2, idx++, "([Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.ac2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface1[] ac3 = new Private_PrivateInterface1[0]; - test("" + holder.ac3, idx++, "([Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.ac3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface2[] ac4 = new Private_PrivateInterface2[0]; - test("" + holder.ac4, idx++, "([Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.ac4, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicClass[] ac5 = new Public_PublicClass[0]; - test("" + holder.ac5, idx++, "([Lp1/Public_PublicClass;)Ljava/lang/String;"); + test("" + holder.ac5, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicInterface[] ac6 = new Public_PublicInterface[0]; - test("" + holder.ac6, idx++, "([Lp1/Public_PublicInterface;)Ljava/lang/String;"); + test("" + holder.ac6, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface1[] ac7 = new Public_PrivateInterface1[0]; - test("" + holder.ac7, idx++, "([Lp1/Public_PrivateInterface1;)Ljava/lang/String;"); + test("" + holder.ac7, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface2[] ac8 = new Public_PrivateInterface2[0]; - test("" + holder.ac8, idx++, "([Lp1/Public_PrivateInterface2;)Ljava/lang/String;"); + test("" + holder.ac8, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // ---------------------------------------------------------------------------- // public Private_PublicClass[][] aac1 = new Private_PublicClass[0][]; - test("" + holder.aac1, idx++, "([[Lp1/PublicClass;)Ljava/lang/String;"); + test("" + holder.aac1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PublicInterface[][] aac2 = new Private_PublicInterface[0][]; - test("" + holder.aac2, idx++, "([[Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.aac2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface1[][] aac3 = new Private_PrivateInterface1[0][]; - test("" + holder.aac3, idx++, "([[Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.aac3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Private_PrivateInterface2[][] aac4 = new Private_PrivateInterface2[0][]; - test("" + holder.aac4, idx++, "([[Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.aac4, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicClass[][] aac5 = new Public_PublicClass[0][]; - test("" + holder.aac5, idx++, "([[Lp1/Public_PublicClass;)Ljava/lang/String;"); + test("" + holder.aac5, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PublicInterface[][] aac6 = new Public_PublicInterface[0][]; - test("" + holder.aac6, idx++, "([[Lp1/Public_PublicInterface;)Ljava/lang/String;"); + test("" + holder.aac6, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface1[][] aac7 = new Public_PrivateInterface1[0][]; - test("" + holder.aac7, idx++, "([[Lp1/Public_PrivateInterface1;)Ljava/lang/String;"); + test("" + holder.aac7, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public Public_PrivateInterface2[][] aac8 = new Public_PrivateInterface2[0][]; - test("" + holder.aac8, idx++, "([[Lp1/Public_PrivateInterface2;)Ljava/lang/String;"); + test("" + holder.aac8, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // ---------------------------------------------------------------------------- // public PublicInterface i1 = new Private_PublicInterface(); - test("" + holder.i1, idx++, "(Lp1/PublicInterface;)Ljava/lang/String;"); + test("" + holder.i1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface1 i2 = new Private_PrivateInterface1(); - test("" + holder.i2, idx++, "(Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.i2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface2 i3 = new Private_PrivateInterface2(); - test("" + holder.i3, idx++, "(Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.i3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PublicInterface[] ai1 = new Private_PublicInterface[0]; - test("" + holder.ai1, idx++, "([Lp1/PublicInterface;)Ljava/lang/String;"); + test("" + holder.ai1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface1[] ai2 = new Private_PrivateInterface1[0]; - test("" + holder.ai2, idx++, "([Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.ai2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface2[] ai3 = new Private_PrivateInterface2[0]; - test("" + holder.ai3, idx++, "([Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.ai3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PublicInterface[][] aai1 = new Private_PublicInterface[0][]; - test("" + holder.aai1, idx++, "([[Lp1/PublicInterface;)Ljava/lang/String;"); + test("" + holder.aai1, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface1[][] aai2 = new Private_PrivateInterface1[0][]; - test("" + holder.aai2, idx++, "([[Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.aai2, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); // public PrivateInterface2[][] aai3 = new Private_PrivateInterface2[0][]; - test("" + holder.aai3, idx++, "([[Ljava/lang/Object;)Ljava/lang/String;"); + test("" + holder.aai3, idx++, "(Ljava/lang/String;)Ljava/lang/String;"); } diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/generics/ParametricException.java openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/ParametricException.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/generics/ParametricException.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/ParametricException.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2002, 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 4509267 - * @summary generics: parametric exception type versus overriding - * @author gafter - * - * @compile ParametricException.java - */ - -import java.io.*; - -abstract class AChurchBoolean { - public abstract - Return accept(IVisitor visitor, Parameter parameter) throws Throws; - - public interface IVisitor { - public Return caseTrue(Parameter parameter) throws Throws; - public Return caseFalse(Parameter parameter) throws Throws; - } -} - -class TrueChurchBoolean extends AChurchBoolean { - private static TrueChurchBoolean instance = new TrueChurchBoolean(); - private TrueChurchBoolean() {} - public static TrueChurchBoolean singleton() { - return instance; - } - public - Return accept(IVisitor visitor, Parameter parameter) throws Throws { - return visitor.caseTrue(parameter); - } -} - -class FalseChurchBoolean extends AChurchBoolean { - private static FalseChurchBoolean instance = new FalseChurchBoolean(); - private FalseChurchBoolean() {} - public static FalseChurchBoolean singleton() { - return instance; - } - public - Return accept(IVisitor visitor, Parameter parameter) throws Throws { - return visitor.caseFalse(parameter); - } -} - -class Pair { - private T first; - private U second; - Pair(T first, U second) { - this.first = first; - this.second = second; - } - T getFirst() { - return first; - } - U getSecond() { - return second; - } -} - -// Perhaps a bit of a toy example, but relevant nonetheless. -class ChurchBooleanTest { - private AChurchBoolean bool; - public ChurchBooleanTest(AChurchBoolean bool) { - this.bool = bool; - } - public AChurchBoolean readIf(File file, byte[] output) throws IOException { - return bool.accept(new AChurchBoolean.IVisitor, IOException>() { - public AChurchBoolean caseTrue(Pair parameter) throws IOException { - FileInputStream input = new FileInputStream(parameter.getFirst()); // throws - input.read(parameter.getSecond()); // throws - input.close(); // throws - return TrueChurchBoolean.singleton(); - } - public AChurchBoolean caseFalse(Pair parameter) throws IOException { - return FalseChurchBoolean.singleton(); - } - }, new Pair(file, output)); - } -} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/generics/parametricException/ParametricException.java openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/parametricException/ParametricException.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/generics/parametricException/ParametricException.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/generics/parametricException/ParametricException.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2002, 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 4509267 + * @summary generics: parametric exception type versus overriding + * @author gafter + * + * @compile ParametricException.java + */ + +import java.io.*; + +abstract class AChurchBoolean { + public abstract + Return accept(IVisitor visitor, Parameter parameter) throws Throws; + + public interface IVisitor { + public Return caseTrue(Parameter parameter) throws Throws; + public Return caseFalse(Parameter parameter) throws Throws; + } +} + +class TrueChurchBoolean extends AChurchBoolean { + private static TrueChurchBoolean instance = new TrueChurchBoolean(); + private TrueChurchBoolean() {} + public static TrueChurchBoolean singleton() { + return instance; + } + public + Return accept(IVisitor visitor, Parameter parameter) throws Throws { + return visitor.caseTrue(parameter); + } +} + +class FalseChurchBoolean extends AChurchBoolean { + private static FalseChurchBoolean instance = new FalseChurchBoolean(); + private FalseChurchBoolean() {} + public static FalseChurchBoolean singleton() { + return instance; + } + public + Return accept(IVisitor visitor, Parameter parameter) throws Throws { + return visitor.caseFalse(parameter); + } +} + +class Pair { + private T first; + private U second; + Pair(T first, U second) { + this.first = first; + this.second = second; + } + T getFirst() { + return first; + } + U getSecond() { + return second; + } +} + +// Perhaps a bit of a toy example, but relevant nonetheless. +class ChurchBooleanTest { + private AChurchBoolean bool; + public ChurchBooleanTest(AChurchBoolean bool) { + this.bool = bool; + } + public AChurchBoolean readIf(File file, byte[] output) throws IOException { + return bool.accept(new AChurchBoolean.IVisitor, IOException>() { + public AChurchBoolean caseTrue(Pair parameter) throws IOException { + FileInputStream input = new FileInputStream(parameter.getFirst()); // throws + input.read(parameter.getSecond()); // throws + input.close(); // throws + return TrueChurchBoolean.singleton(); + } + public AChurchBoolean caseFalse(Pair parameter) throws IOException { + return FalseChurchBoolean.singleton(); + } + }, new Pair(file, output)); + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial/Serial.java openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial/Serial.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * @test /nodynamiccopyright/ + * @bug 4986256 + * @compile/ref=Serial.out -XDrawDiagnostics -Xlint:all Serial.java + */ + +import java.io.Serializable; + +// control: this class should generate warnings +class Serial implements Serializable +{ + static class Inner implements Serializable + { + } + + @SuppressWarnings("serial") + void m() { + class Inner implements Serializable + { + } + } +} + +// tests: the warnings that would otherwise be generated should all be suppressed +@SuppressWarnings("serial") +class Serial1 implements Serializable +{ + static class Inner implements Serializable + { + } +} + +class Serial2 +{ + @SuppressWarnings("serial") + static class Inner implements Serializable + { + } + + @SuppressWarnings("serial") + void m() { + class Inner implements Serializable + { + } + } +} + +// this class should produce warnings because @SuppressWarnings should not be inherited +class Serial3 extends Serial1 +{ + static class Inner implements Serializable + { + } +} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial/Serial.out openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.out --- openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial/Serial.out 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial/Serial.out 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,5 @@ +Serial.java:12:12: compiler.warn.missing.SVUID: Serial.Inner +Serial.java:10:1: compiler.warn.missing.SVUID: Serial +Serial.java:51:12: compiler.warn.missing.SVUID: Serial3.Inner +Serial.java:49:1: compiler.warn.missing.SVUID: Serial3 +4 warnings diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial.java openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.java --- openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 4986256 - * @compile/ref=Serial.out -XDrawDiagnostics -Xlint:all Serial.java - */ - -import java.io.Serializable; - -// control: this class should generate warnings -class Serial implements Serializable -{ - static class Inner implements Serializable - { - } - - @SuppressWarnings("serial") - void m() { - class Inner implements Serializable - { - } - } -} - -// tests: the warnings that would otherwise be generated should all be suppressed -@SuppressWarnings("serial") -class Serial1 implements Serializable -{ - static class Inner implements Serializable - { - } -} - -class Serial2 -{ - @SuppressWarnings("serial") - static class Inner implements Serializable - { - } - - @SuppressWarnings("serial") - void m() { - class Inner implements Serializable - { - } - } -} - -// this class should produce warnings because @SuppressWarnings should not be inherited -class Serial3 extends Serial1 -{ - static class Inner implements Serializable - { - } -} diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial.out openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.out --- openjdk-17-17.0.13+11/test/langtools/tools/javac/warnings/Serial.out 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/javac/warnings/Serial.out 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -Serial.java:12:12: compiler.warn.missing.SVUID: Serial.Inner -Serial.java:10:1: compiler.warn.missing.SVUID: Serial -Serial.java:51:12: compiler.warn.missing.SVUID: Serial3.Inner -Serial.java:49:1: compiler.warn.missing.SVUID: Serial3 -4 warnings diff -Nru openjdk-17-17.0.13+11/test/langtools/tools/lib/toolbox/ToolBox.java openjdk-17-17.0.14+7/test/langtools/tools/lib/toolbox/ToolBox.java --- openjdk-17-17.0.13+11/test/langtools/tools/lib/toolbox/ToolBox.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/langtools/tools/lib/toolbox/ToolBox.java 2025-01-04 20:25:18.000000000 +0000 @@ -245,7 +245,7 @@ public void copyFile(Path from, Path to) throws IOException { if (Files.isDirectory(to)) { to = to.resolve(from.getFileName()); - } else { + } else if (to.getParent() != null) { Files.createDirectories(to.getParent()); } Files.copy(from, to, StandardCopyOption.REPLACE_EXISTING); diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/StringArrayUtils.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/StringArrayUtils.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/StringArrayUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/StringArrayUtils.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023, 2024, 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; + +import java.util.ArrayList; + +public class StringArrayUtils { + /** + * The various concat() functions in this class can be used for building + * a command-line argument array for ProcessTools.createTestJavaProcessBuilder(), + * etc. When some of the arguments are conditional, this is more convenient + * than alternatives like ArrayList. + * + * Example: + * + *

    +     *     String args[] = StringArrayUtils.concat("-Xint", "-Xmx32m");
    +     *     if (verbose) {
    +     *         args = StringArrayUtils.concat(args, "-verbose");
    +     *     }
    +     *     args = StringArrayUtils.concat(args, "HelloWorld");
    +     *     ProcessTools.createTestJavaProcessBuilder(args);
    +     * 
    + */ + public static String[] concat(String... args) { + return args; + } + + public static String[] concat(String[] prefix, String... extra) { + String[] ret = new String[prefix.length + extra.length]; + System.arraycopy(prefix, 0, ret, 0, prefix.length); + System.arraycopy(extra, 0, ret, prefix.length, extra.length); + return ret; + } + + public static String[] concat(String prefix, String[] extra) { + String[] ret = new String[1 + extra.length]; + ret[0] = prefix; + System.arraycopy(extra, 0, ret, 1, extra.length); + return ret; + } +} diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/Utils.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/Utils.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/Utils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/Utils.java 2025-01-04 20:25:18.000000000 +0000 @@ -23,7 +23,11 @@ package jdk.test.lib; +import java.io.BufferedReader; import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.FilenameFilter; import java.io.IOException; import java.net.Inet6Address; import java.net.InetAddress; @@ -35,11 +39,16 @@ import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.nio.file.CopyOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.attribute.AclEntry; +import java.nio.file.attribute.AclEntryType; +import java.nio.file.attribute.AclFileAttributeView; import java.nio.file.attribute.FileAttribute; import java.nio.channels.SocketChannel; +import java.nio.file.attribute.PosixFilePermissions; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; @@ -53,12 +62,14 @@ import java.util.LinkedList; import java.util.List; import java.util.Random; +import java.util.Set; import java.util.function.BooleanSupplier; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import static jdk.test.lib.Asserts.assertTrue; import jdk.test.lib.process.ProcessTools; @@ -821,4 +832,220 @@ Path dir = Paths.get(System.getProperty("user.dir", ".")); return Files.createTempDirectory(dir, prefix, attrs); } + + /** + * Converts slashes in a pathname to backslashes + * if slashes is not the file separator. + */ + public static String convertPath(String path) { + // No need to do the conversion if file separator is '/' + if (FILE_SEPARATOR.length() == 1 && FILE_SEPARATOR.charAt(0) == '/') { + return path; + } + + char[] cs = path.toCharArray(); + for (int i = 0; i < cs.length; i++) { + if (cs[i] == '/') { + cs[i] = '\\'; + } + } + String newPath = new String(cs); + return newPath; + } + + /** + * Return file directories that satisfy the specified filter. + * + * @param searchDirectory the base directory to search + * @param filter a filename filter + * @return file directories + */ + public static List findFiles(Path searchDirectory, + FilenameFilter filter) { + return Arrays.stream(searchDirectory.toFile().listFiles(filter)) + .map(f -> f.toPath()) + .collect(Collectors.toList()); + } + + /** + * Copy files to the target path. + * + * @param source the paths to the files to copy + * @param target the path to the target files + * @param filenameMapper mapper function applied to filenames + * @param options options specifying how the copy should be done + * @return the paths to the target files + * @throws IOException if error occurs + */ + public static List copyFiles(List source, Path target, + Function filenameMapper, + CopyOption... options) throws IOException { + List result = new ArrayList<>(); + + if (!target.toFile().exists()) { + Files.createDirectory(target); + } + + for (Path file : source) { + if (!file.toFile().exists()) { + continue; + } + + String baseName = file.getFileName().toString(); + + Path targetFile = target.resolve(filenameMapper.apply(baseName)); + Files.copy(file, targetFile, options); + result.add(targetFile); + } + return result; + } + + /** + * Copy files to the target path. + * + * @param source the paths to the files to copy + * @param target the path to the target files + * @param options options specifying how the copy should be done + * @return the paths to the target files + * @throws IOException if error occurs + */ + public static List copyFiles(List source, Path target, + CopyOption... options) throws IOException { + return copyFiles(source, target, (s) -> s, options); + } + + /** + * Replace file string by applying the given mapper function. + * + * @param source the file to read + * @param contentMapper the mapper function applied to file's content + * @throws IOException if an I/O error occurs + */ + public static void replaceFileString(Path source, + Function contentMapper) throws IOException { + StringBuilder sb = new StringBuilder(); + String lineSep = System.getProperty("line.separator"); + + try (BufferedReader reader = + new BufferedReader(new FileReader(source.toFile()))) { + + String line; + + // read all and replace all at once?? + while ((line = reader.readLine()) != null) { + sb.append(contentMapper.apply(line)) + .append(lineSep); + } + } + + try (FileWriter writer = new FileWriter(source.toFile())) { + writer.write(sb.toString()); + } + } + + /** + * Replace files' string by applying the given mapper function. + * + * @param source the file to read + * @param contentMapper the mapper function applied to files' content + * @throws IOException if an I/O error occurs + */ + public static void replaceFilesString(List source, + Function contentMapper) throws IOException { + for (Path file : source) { + replaceFileString(file, contentMapper); + } + } + + /** + * Grant file user access or full access to everyone. + * + * @param file file to grant access + * @param userOnly true for user access, otherwise full access to everyone + * @throws IOException if error occurs + */ + public static void grantFileAccess(Path file, boolean userOnly) + throws IOException { + Set attr = file.getFileSystem().supportedFileAttributeViews(); + if (attr.contains("posix")) { + String perms = userOnly ? "rwx------" : "rwxrwxrwx"; + Files.setPosixFilePermissions(file, PosixFilePermissions.fromString(perms)); + } else if (attr.contains("acl")) { + AclFileAttributeView view = + Files.getFileAttributeView(file, AclFileAttributeView.class); + List acl = new ArrayList<>(); + for (AclEntry thisEntry : view.getAcl()) { + if (userOnly) { + if (thisEntry.principal().getName() + .equals(view.getOwner().getName())) { + acl.add(allowAccess(thisEntry)); + } else if (thisEntry.type() == AclEntryType.ALLOW) { + acl.add(revokeAccess(thisEntry)); + } else { + acl.add(thisEntry); + } + } else { + if (thisEntry.type() != AclEntryType.ALLOW) { + acl.add(allowAccess(thisEntry)); + } else { + acl.add(thisEntry); + } + } + } + view.setAcl(acl); + } else { + throw new RuntimeException("Unsupported file attributes: " + attr); + } + } + + /** + * Return an ACL entry that revokes owner access. + * + * @param acl original ACL entry to build from + * @return an ACL entry that revokes all access + */ + public static AclEntry revokeAccess(AclEntry acl) { + return buildAclEntry(acl, AclEntryType.DENY); + } + + /** + * Return an ACL entry that allow owner access. + * @param acl original ACL entry to build from + * @return an ACL entry that allows all access + */ + public static AclEntry allowAccess(AclEntry acl) { + return buildAclEntry(acl, AclEntryType.ALLOW); + } + + /** + * Build an ACL entry with a given ACL entry type. + * + * @param acl original ACL entry to build from + * @return an ACL entry with a given ACL entry type + */ + public static AclEntry buildAclEntry(AclEntry acl, AclEntryType type) { + return AclEntry.newBuilder(acl) + .setType(type) + .build(); + } + + /** + * Grant file user access. + * + * @param file file to grant access + * @throws IOException if error occurs + */ + public static void userAccess(Path file) throws IOException { + grantFileAccess(file, true); + } + + /** + * Grant file full access to everyone. + * + * @param file file to grant access + * @throws IOException if error occurs + */ + public static void fullAccess(Path file) throws IOException { + grantFileAccess(file, false); + } } diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSAppTester.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSAppTester.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSAppTester.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSAppTester.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2023, 2024, 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.cds; + +import java.io.File; +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.StringArrayUtils; + +/* + * This is a base class used for testing CDS functionalities with complex applications. + * You can define the application by overridding the vmArgs(), classpath() and appCommandLine() + * methods. Application-specific validation checks can be implemented with checkExecution(). +*/ +abstract public class CDSAppTester { + private final String name; + private final String classListFile; + private final String classListFileLog; + private final String staticArchiveFile; + private final String staticArchiveFileLog; + private final String dynamicArchiveFile; + private final String dynamicArchiveFileLog; + private final String productionRunLog; + + public CDSAppTester(String name) { + // Old workflow + this.name = name; + classListFile = name() + ".classlist"; + classListFileLog = classListFile + ".log"; + staticArchiveFile = name() + ".static.jsa"; + staticArchiveFileLog = staticArchiveFile + ".log"; + dynamicArchiveFile = name() + ".dynamic.jsa"; + dynamicArchiveFileLog = dynamicArchiveFile + ".log"; + productionRunLog = name() + ".production.log"; + } + + private enum Workflow { + STATIC, // classic -Xshare:dump workflow + DYNAMIC, // classic -XX:ArchiveClassesAtExit + } + + public enum RunMode { + CLASSLIST, + DUMP_STATIC, + DUMP_DYNAMIC, + PRODUCTION; + + public boolean isStaticDump() { + return this == DUMP_STATIC; + } + public boolean isProductionRun() { + return this == PRODUCTION; + } + } + + public final String name() { + return this.name; + } + + // optional + public String[] vmArgs(RunMode runMode) { + return new String[0]; + } + + // optional + public String classpath(RunMode runMode) { + return null; + } + + // must override + // main class, followed by arguments to the main class + abstract public String[] appCommandLine(RunMode runMode); + + // optional + public void checkExecution(OutputAnalyzer out, RunMode runMode) throws Exception {} + + private Workflow workflow; + + public final boolean isStaticWorkflow() { + return workflow == Workflow.STATIC; + } + + public final boolean isDynamicWorkflow() { + return workflow == Workflow.DYNAMIC; + } + + private String logToFile(String logFile, String... logTags) { + StringBuilder sb = new StringBuilder("-Xlog:"); + String prefix = ""; + for (String tag : logTags) { + sb.append(prefix); + sb.append(tag); + prefix = ","; + } + sb.append(":file=" + logFile + "::filesize=0"); + return sb.toString(); + } + + private void listOutputFile(String file) { + File f = new File(file); + if (f.exists()) { + System.out.println("[output file: " + file + " " + f.length() + " bytes]"); + } else { + System.out.println("[output file: " + file + " does not exist]"); + } + } + + private OutputAnalyzer executeAndCheck(String[] cmdLine, RunMode runMode, String... logFiles) throws Exception { + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); + Process process = pb.start(); + OutputAnalyzer output = CDSTestUtils.executeAndLog(process, runMode.toString()); + for (String logFile : logFiles) { + listOutputFile(logFile); + } + output.shouldHaveExitValue(0); + CDSTestUtils.checkCommonExecExceptions(output); + checkExecution(output, runMode); + return output; + } + + private OutputAnalyzer createClassList() throws Exception { + RunMode runMode = RunMode.CLASSLIST; + String[] cmdLine = StringArrayUtils.concat(vmArgs(runMode), + "-Xshare:off", + "-XX:DumpLoadedClassList=" + classListFile, + "-cp", classpath(runMode), + logToFile(classListFileLog, + "class+load=debug")); + cmdLine = StringArrayUtils.concat(cmdLine, appCommandLine(runMode)); + return executeAndCheck(cmdLine, runMode, classListFile, classListFileLog); + } + + private OutputAnalyzer dumpStaticArchive() throws Exception { + RunMode runMode = RunMode.DUMP_STATIC; + String[] cmdLine = StringArrayUtils.concat(vmArgs(runMode), + "-Xlog:cds", + "-Xlog:cds+heap=error", + "-Xshare:dump", + "-XX:SharedArchiveFile=" + staticArchiveFile, + "-XX:SharedClassListFile=" + classListFile, + "-cp", classpath(runMode), + logToFile(staticArchiveFileLog, + "cds=debug", + "cds+class=debug", + "cds+heap=warning", + "cds+resolve=debug")); + return executeAndCheck(cmdLine, runMode, staticArchiveFile, staticArchiveFileLog); + } + + private OutputAnalyzer dumpDynamicArchive() throws Exception { + RunMode runMode = RunMode.DUMP_DYNAMIC; + String[] cmdLine = new String[0]; + if (isDynamicWorkflow()) { + // "classic" dynamic archive + cmdLine = StringArrayUtils.concat(vmArgs(runMode), + "-Xlog:cds", + "-XX:ArchiveClassesAtExit=" + dynamicArchiveFile, + "-cp", classpath(runMode), + logToFile(dynamicArchiveFileLog, + "cds=debug", + "cds+class=debug", + "cds+resolve=debug", + "class+load=debug")); + } + cmdLine = StringArrayUtils.concat(cmdLine, appCommandLine(runMode)); + return executeAndCheck(cmdLine, runMode, dynamicArchiveFile, dynamicArchiveFileLog); + } + + private OutputAnalyzer productionRun() throws Exception { + RunMode runMode = RunMode.PRODUCTION; + String[] cmdLine = StringArrayUtils.concat(vmArgs(runMode), + "-cp", classpath(runMode), + logToFile(productionRunLog, "cds")); + + if (isStaticWorkflow()) { + cmdLine = StringArrayUtils.concat(cmdLine, "-XX:SharedArchiveFile=" + staticArchiveFile); + } else if (isDynamicWorkflow()) { + cmdLine = StringArrayUtils.concat(cmdLine, "-XX:SharedArchiveFile=" + dynamicArchiveFile); + } + + cmdLine = StringArrayUtils.concat(cmdLine, appCommandLine(runMode)); + return executeAndCheck(cmdLine, runMode, productionRunLog); + } + + public void run(String args[]) throws Exception { + String err = "Must have exactly one command line argument of the following: "; + String prefix = ""; + for (Workflow wf : Workflow.values()) { + err += prefix; + err += wf; + prefix = ", "; + } + if (args.length != 1) { + throw new RuntimeException(err); + } else { + if (args[0].equals("STATIC")) { + runStaticWorkflow(); + } else if (args[0].equals("DYNAMIC")) { + runDynamicWorkflow(); + } else { + throw new RuntimeException(err); + } + } + } + + private void runStaticWorkflow() throws Exception { + this.workflow = Workflow.STATIC; + createClassList(); + dumpStaticArchive(); + productionRun(); + } + + private void runDynamicWorkflow() throws Exception { + this.workflow = Workflow.DYNAMIC; + dumpDynamicArchive(); + productionRun(); + } +} diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSOptions.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSOptions.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSOptions.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSOptions.java 2025-01-04 20:25:18.000000000 +0000 @@ -32,6 +32,8 @@ public ArrayList prefix = new ArrayList(); public ArrayList suffix = new ArrayList(); public boolean useSystemArchive = false; + public String appJar; + public String appJarDir; // classes to be archived public String[] classList; @@ -100,4 +102,15 @@ return this; } + // AppCDS methods + public CDSOptions setAppJar(String appJar) { + this.appJar = appJar; + return this; + } + + public CDSOptions setAppJarDir(String appJarDir) { + this.appJarDir = appJarDir; + return this; + } + } diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSTestUtils.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2025-01-04 20:25:18.000000000 +0000 @@ -257,7 +257,7 @@ for (String s : opts.suffix) cmd.add(s); String[] cmdLine = cmd.toArray(new String[cmd.size()]); - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); return executeAndLog(pb, "dump"); } @@ -430,7 +430,7 @@ for (String s : opts.suffix) cmd.add(s); String[] cmdLine = cmd.toArray(new String[cmd.size()]); - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); return executeAndLog(pb, "exec"); } diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/classloader/ClassUnloadCommon.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/classloader/ClassUnloadCommon.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/classloader/ClassUnloadCommon.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/classloader/ClassUnloadCommon.java 2025-01-04 20:25:18.000000000 +0000 @@ -23,12 +23,13 @@ /* - * To use ClassUnloadCommon from a sub-process, see hotspot/test/runtime/logging/ClassLoadUnloadTest.java + * To use ClassUnloadCommon from a sub-process, see test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java * for an example. */ package jdk.test.lib.classloader; +import jdk.test.whitebox.WhiteBox; import java.io.File; import java.net.MalformedURLException; @@ -62,8 +63,8 @@ } public static void triggerUnloading() { - allocateMemory(16 * 1024); // force young collection - System.gc(); + WhiteBox wb = WhiteBox.getWhiteBox(); + wb.fullGC(); // will do class unloading } /** diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -113,7 +113,7 @@ finalOptions.add("-version"); ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder(finalOptions.toArray( + = ProcessTools.createLimitedTestJavaProcessBuilder(finalOptions.toArray( new String[finalOptions.size()])); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); @@ -263,7 +263,7 @@ Collections.addAll(vmOpts, additionalVMOpts); Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( vmOpts.toArray(new String[vmOpts.size()])); OutputAnalyzer outputAnalyzer @@ -333,7 +333,7 @@ Collections.addAll(vmOpts, additionalVMOpts); Collections.addAll(vmOpts, "-version"); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( vmOpts.toArray(new String[vmOpts.size()])); return new OutputAnalyzer(processBuilder.start()); diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -74,7 +74,7 @@ Collections.addAll(arguments, classArguments); } - ProcessBuilder pb = ProcessTools.createTestJvm(arguments); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(arguments); return ProcessTools.executeProcess(pb); } } diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/OutputBuffer.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/OutputBuffer.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/OutputBuffer.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/OutputBuffer.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -120,6 +120,7 @@ private final StreamTask outTask; private final StreamTask errTask; private final Process p; + private volatile Integer exitValue; // null implies we don't yet know private final void logProgress(String state) { System.out.println("[" + Instant.now().toString() + "] " + state @@ -146,14 +147,17 @@ @Override public int getExitValue() { + if (exitValue != null) { + return exitValue; + } try { logProgress("Waiting for completion"); boolean aborted = true; try { - int result = p.waitFor(); + exitValue = p.waitFor(); logProgress("Waiting for completion finished"); aborted = false; - return result; + return exitValue; } finally { if (aborted) { logProgress("Waiting for completion FAILED"); diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/ProcessTools.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/ProcessTools.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/ProcessTools.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/ProcessTools.java 2025-01-04 20:25:18.000000000 +0000 @@ -370,17 +370,7 @@ * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createJavaProcessBuilder(List command) { - return createJavaProcessBuilder(command.toArray(String[]::new)); - } - - /** - * Create ProcessBuilder using the java launcher from the jdk to be tested. - * - * @param command Arguments to pass to the java command. - * @return The ProcessBuilder instance representing the java command. - */ - public static ProcessBuilder createJavaProcessBuilder(String... command) { + private static ProcessBuilder createJavaProcessBuilder(String... command) { String javapath = JDKToolFinder.getJDKTool("java"); ArrayList args = new ArrayList<>(); @@ -421,8 +411,8 @@ * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createTestJvm(List command) { - return createTestJvm(command.toArray(String[]::new)); + public static ProcessBuilder createTestJavaProcessBuilder(List command) { + return createTestJavaProcessBuilder(command.toArray(String[]::new)); } /** @@ -436,11 +426,55 @@ * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createTestJvm(String... command) { + public static ProcessBuilder createTestJavaProcessBuilder(String... command) { return createJavaProcessBuilder(Utils.prependTestJavaOpts(command)); } /** + * Create ProcessBuilder using the java launcher from the jdk to + * be tested. + * + *

    Please observe that you likely should use + * createTestJavaProcessBuilder() instead of this method because + * createTestJavaProcessBuilder() will add JVM options from + * "test.vm.opts" and "test.java.opts" and this method will + * not do that. + * + *

    If you still chose to use + * createLimitedTestJavaProcessBuilder() you should probably use + * it in combination with @requires vm.flagless JTREG + * anotation as to not waste energy and test resources. + * + * @param command Arguments to pass to the java command. + * @return The ProcessBuilder instance representing the java command. + */ + public static ProcessBuilder createLimitedTestJavaProcessBuilder(List command) { + return createLimitedTestJavaProcessBuilder(command.toArray(String[]::new)); + } + + /** + * Create ProcessBuilder using the java launcher from the jdk to + * be tested. + * + *

    Please observe that you likely should use + * createTestJavaProcessBuilder() instead of this method because + * createTestJavaProcessBuilder() will add JVM options from + * "test.vm.opts" and "test.java.opts" and this method will + * not do that. + * + *

    If you still chose to use + * createLimitedTestJavaProcessBuilder() you should probably use + * it in combination with @requires vm.flagless JTREG + * anotation as to not waste energy and test resources. + * + * @param command Arguments to pass to the java command. + * @return The ProcessBuilder instance representing the java command. + */ + public static ProcessBuilder createLimitedTestJavaProcessBuilder(String... command) { + return createJavaProcessBuilder(command); + } + + /** * Executes a test jvm process, waits for it to finish and returns the process output. * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added. * The java from the test.jdk is used to execute the command. @@ -471,7 +505,7 @@ * @return The output from the process. */ public static OutputAnalyzer executeTestJvm(String... cmds) throws Exception { - ProcessBuilder pb = createTestJvm(cmds); + ProcessBuilder pb = createTestJavaProcessBuilder(cmds); return executeProcess(pb); } diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/StreamPumper.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/StreamPumper.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/process/StreamPumper.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/process/StreamPumper.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -95,13 +95,15 @@ /** * Implements Thread.run(). Continuously read from {@code in} and write to - * {@code out} until {@code in} has reached end of stream. Abort on - * interruption. Abort on IOExceptions. + * {@code out} until {@code in} has reached end of stream. + * Additionally this method also splits the data read from the buffer into lines, + * and processes each line using linePumps. + * Abort on interruption. Abort on IOExceptions. */ @Override public void run() { - try (BufferedInputStream is = new BufferedInputStream(in)) { - ByteArrayOutputStream lineBos = new ByteArrayOutputStream(); + try (BufferedInputStream is = new BufferedInputStream(in); + ByteArrayOutputStream lineBos = new ByteArrayOutputStream()) { byte[] buf = new byte[BUF_SIZE]; int len = 0; int linelen = 0; @@ -133,6 +135,10 @@ i++; } + // If no crlf was found, or there was additional data after the last crlf was found, then write the leftover data + // in lineBos. If there is more data to read it will be concatenated with the current data on the next iteration. + // If there is no more data, or no more crlf found, all the remaining data will be processed after the loop, as the + // final line. if (lastcrlf == -1) { lineBos.write(buf, 0, len); linelen += len; @@ -143,6 +149,12 @@ } } + // If there was no terminating crlf the remaining data has been written to lineBos, + // but this final line of data now needs to be processed by the linePumper. + final String line = lineBos.toString(); + if (!line.isEmpty()) { + linePumps.forEach((lp) -> lp.processLine(line)); + } } catch (IOException e) { if (!e.getMessage().equalsIgnoreCase("stream closed")) { e.printStackTrace(); diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024, 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.security; + +import java.math.BigInteger; + +/** + * An enumeration of DH groups for tests. + */ +public enum DiffieHellmanGroup { + + /** + * RFC 7919 - ffdhe2048. + */ + ffdhe2048(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B423861285C97FFFFFFFFFFFFFFFF", 16), 2), + /** + * RFC 7919 - ffdhe3072. + */ + ffdhe3072(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B66C62E37FFFFFFFFFFFFFFFF", 16), 2), + /** + * RFC 7919 - ffdhe4096. + */ + ffdhe4096(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E655F6A" + + "FFFFFFFFFFFFFFFF", 16), 2); + + + public BigInteger getPrime() { + return prime; + } + + private final BigInteger prime; + + public BigInteger getBase() { + return base; + } + + private final BigInteger base; + + DiffieHellmanGroup(BigInteger prime, int base) { + this.prime = prime; + this.base = BigInteger.valueOf(base); + } +} diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/SecurityUtils.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/SecurityUtils.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/SecurityUtils.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/SecurityUtils.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,12 +30,34 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; +import jdk.test.lib.security.DiffieHellmanGroup; /** * Common library for various security test helper functions. */ public final class SecurityUtils { + /* + * Key Sizes for various algorithms. + */ + private enum KeySize{ + RSA(2048), + DSA(2048), + DH(2048); + + private final int keySize; + KeySize(int keySize) { + this.keySize = keySize; + } + + @Override + public String toString() { + return String.valueOf(keySize); + } + } + + private final static int DEFAULT_SALTSIZE = 16; + private static String getCacerts() { String sep = File.separator; return System.getProperty("java.home") + sep @@ -107,6 +129,44 @@ removeFromDSigPolicy("disallowAlg", List.of(algs)); } + /** + * Returns a salt size for tests + */ + public static int getTestSaltSize() { + return DEFAULT_SALTSIZE; + } + + /** + * Returns a key size in bits for tests, depending on the specified algorithm + */ + public static int getTestKeySize(String algo) { + return switch (algo) { + case "RSA" -> KeySize.RSA.keySize; + case "DSA" -> KeySize.DSA.keySize; + case "DH", "DiffieHellman" -> KeySize.DH.keySize; + default -> throw new RuntimeException("Test key size not defined for " + algo); + }; + } + + /** + * Returns a DH predefined group for tests + */ + public static DiffieHellmanGroup getTestDHGroup() { + return getTestDHGroup(2048); + } + + /** + * Returns a DH predefined group for tests, depending on the specified prime size + */ + public static DiffieHellmanGroup getTestDHGroup(int primeSize) { + return switch(primeSize) { + case 2048 -> DiffieHellmanGroup.ffdhe2048; + case 3072 -> DiffieHellmanGroup.ffdhe3072; + case 4096 -> DiffieHellmanGroup.ffdhe4096; + default -> throw new RuntimeException("Test DH group not defined for " + primeSize); + }; + } + private static void removeFromDSigPolicy(String rule, List algs) { String value = Security.getProperty("jdk.xml.dsig.secureValidationPolicy"); value = Arrays.stream(value.split(",")) diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/TestCertificate.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestCertificate.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/TestCertificate.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestCertificate.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ // Subject: CN=SSLCertificate, O=SomeCompany // Issuer: CN=Intermediate CA Cert, O=SomeCompany // Validity: Tue Aug 30 14:37:19 PDT 2016 to Wed Aug 30 14:37:19 PDT 2017 - ONE("1000", + ONE("10:00", "CN=SSLCertificate, O=SomeCompany", "CN=Intermediate CA Cert, O=SomeCompany", -1063259762, diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/TestTLSHandshake.java openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestTLSHandshake.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/lib/security/TestTLSHandshake.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/lib/security/TestTLSHandshake.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,8 @@ "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"; public static final long HASHCODE = -1057291798L; public static final long ANCHOR_HASHCODE = 1688661792L; - public static final String CERT_SERIAL = "edbec8f705af2514"; - public static final String ANCHOR_CERT_SERIAL = "8e191778b2f331be"; + public static final String CERT_SERIAL = "00:ed:be:c8:f7:05:af:25:14"; + public static final String ANCHOR_CERT_SERIAL = "8e:19:17:78:b2:f3:31:be"; public String protocolVersion; public String peerHost; diff -Nru openjdk-17-17.0.13+11/test/lib/jdk/test/whitebox/WhiteBox.java openjdk-17-17.0.14+7/test/lib/jdk/test/whitebox/WhiteBox.java --- openjdk-17-17.0.13+11/test/lib/jdk/test/whitebox/WhiteBox.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib/jdk/test/whitebox/WhiteBox.java 2025-01-04 20:25:18.000000000 +0000 @@ -138,6 +138,12 @@ return getConstantPoolCacheLength0(aClass); } + private native Object[] getResolvedReferences0(Class aClass); + public Object[] getResolvedReferences(Class aClass) { + Objects.requireNonNull(aClass); + return getResolvedReferences0(aClass); + } + private native int remapInstructionOperandFromCPCache0(Class aClass, int index); public int remapInstructionOperandFromCPCache(Class aClass, int index) { Objects.requireNonNull(aClass); @@ -603,7 +609,6 @@ public native boolean isJFRIncluded(); public native boolean isDTraceIncluded(); public native boolean canWriteJavaHeapArchive(); - public native Object getResolvedReferences(Class c); public native void linkClass(Class c); public native boolean areOpenArchiveHeapObjectsMapped(); diff -Nru openjdk-17-17.0.13+11/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java openjdk-17-17.0.14+7/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java --- openjdk-17-17.0.13+11/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023, 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 8303697 + * @summary Test verifies that ProcessTools.startProcess() print all lines even the last line doesn't end with '\n' + * @library /test/lib + * @run main ProcessToolsLastLineTest + */ + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Asserts; + +public class ProcessToolsLastLineTest { + + static void test(String output) throws Exception { + final StringBuffer sb = new StringBuffer(); + Process p = ProcessTools.startProcess("process", + ProcessTools.createLimitedTestJavaProcessBuilder(ProcessToolsLastLineTest.class.getName(), output), + line -> { sb.append(line);}); + p.waitFor(); + String expectedOutput = output.replace("\n", ""); + Asserts.assertEQ(sb.toString(), expectedOutput); + } + + public static void main(String[] args) throws Exception { + + // The line which exceeds internal StreamPumper buffer (256 bytes) + String VERY_LONG_LINE = "X".repeat(257); + if (args.length > 0) { + System.out.print(args[0]); + } else { + test("\n"); + test("\nARG1"); + test("\nARG1\n"); + test("ARG1\n"); + test("ARG1"); + test("ARG1\nARG2"); + test("ARG1\nARG2\n"); + test("\nARG1\nARG2\n"); + test("\nARG1\n" + VERY_LONG_LINE + "\nARG2\n"); + test("\nARG1\n" + VERY_LONG_LINE); + test("\nARG1\n" + VERY_LONG_LINE + VERY_LONG_LINE + VERY_LONG_LINE + "\nARG2\n"); + test("\nARG1\n" + VERY_LONG_LINE + VERY_LONG_LINE + VERY_LONG_LINE); + + } + + } +} diff -Nru openjdk-17-17.0.13+11/test/lib-test/jdk/test/whitebox/vm_flags/BooleanTest.java openjdk-17-17.0.14+7/test/lib-test/jdk/test/whitebox/vm_flags/BooleanTest.java --- openjdk-17-17.0.13+11/test/lib-test/jdk/test/whitebox/vm_flags/BooleanTest.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/lib-test/jdk/test/whitebox/vm_flags/BooleanTest.java 2025-01-04 20:25:18.000000000 +0000 @@ -69,7 +69,7 @@ } private static void testFunctional(boolean value) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff -Nru openjdk-17-17.0.13+11/test/micro/org/openjdk/bench/java/security/SSLHandshake.java openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/SSLHandshake.java --- openjdk-17-17.0.13+11/test/micro/org/openjdk/bench/java/security/SSLHandshake.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/SSLHandshake.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -80,11 +80,12 @@ KeyStore ks = TestCertificates.getKeyStore(); KeyStore ts = TestCertificates.getTrustStore(); - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + KeyManagerFactory kmf = KeyManagerFactory.getInstance( + KeyManagerFactory.getDefaultAlgorithm()); kmf.init(ks, new char[0]); - TrustManagerFactory tmf = - TrustManagerFactory.getInstance("SunX509"); + TrustManagerFactory tmf = TrustManagerFactory.getInstance( + TrustManagerFactory.getDefaultAlgorithm()); tmf.init(ts); SSLContext sslCtx = SSLContext.getInstance(tlsVersion); diff -Nru openjdk-17-17.0.13+11/test/micro/org/openjdk/bench/java/security/TestCertificates.java openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/TestCertificates.java --- openjdk-17-17.0.13+11/test/micro/org/openjdk/bench/java/security/TestCertificates.java 2024-10-10 14:01:59.000000000 +0000 +++ openjdk-17-17.0.14+7/test/micro/org/openjdk/bench/java/security/TestCertificates.java 2025-01-04 20:25:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -115,12 +115,12 @@ private TestCertificates() {} public static KeyStore getKeyStore() throws GeneralSecurityException, IOException { - KeyStore result = KeyStore.getInstance("JKS"); + KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType()); result.load(null, null); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate serverCert = cf.generateCertificate( new ByteArrayInputStream( - TestCertificates.SERVER_CERT.getBytes(StandardCharsets.ISO_8859_1))); + SERVER_CERT.getBytes(StandardCharsets.ISO_8859_1))); Certificate caCert = cf.generateCertificate( new ByteArrayInputStream( CA_CERT.getBytes(StandardCharsets.ISO_8859_1))); @@ -135,7 +135,7 @@ } public static KeyStore getTrustStore() throws GeneralSecurityException, IOException { - KeyStore result = KeyStore.getInstance("JKS"); + KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType()); result.load(null, null); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate rootcaCert = cf.generateCertificate(