From c86ba43b8e880e0415f6732b19306568f3a10bdc Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 30 Aug 2023 08:11:06 +0000 Subject: [PATCH 001/177] 8312972: Bump update version for OpenJDK: jdk-11.0.22 Reviewed-by: serb --- .jcheck/conf | 2 +- make/autoconf/version-numbers | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.jcheck/conf b/.jcheck/conf index 5b8b093c86f..57ef1f63d39 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1,7 +1,7 @@ [general] project=jdk-updates jbs=JDK -version=11.0.21 +version=11.0.22 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index a9b6c2ea496..1657ac50291 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -28,12 +28,12 @@ DEFAULT_VERSION_FEATURE=11 DEFAULT_VERSION_INTERIM=0 -DEFAULT_VERSION_UPDATE=21 +DEFAULT_VERSION_UPDATE=22 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2023-10-17 +DEFAULT_VERSION_DATE=2024-01-16 DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11" From b984b0a2937ad612697586d4f90e18dbc22d2571 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 30 Aug 2023 08:47:03 +0000 Subject: [PATCH 002/177] 8293107: GHA: Bump to Ubuntu 22.04 8293098: GHA: Harmonize GCC version handling for host and cross builds 8293361: GHA: dump config.log in case of configure failure 8295213: Run GHA manually with user-specified make and configure arguments 8295885: GHA: Bump gcc versions 8313428: GHA: Bump GCC versions for July 2023 updates Reviewed-by: clanger Backport-of: d7536588b38e368eaa6395bcbcc6724a39303fc5 --- .github/workflows/build-cross-compile.yml | 24 ++++++++--- .github/workflows/build-linux.yml | 25 ++++++++--- .github/workflows/build-macos.yml | 13 +++++- .github/workflows/build-windows.yml | 13 +++++- .github/workflows/main.yml | 51 ++++++++++++++++++----- 5 files changed, 100 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 742f27a4ff8..f0411585199 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -29,14 +29,22 @@ on: workflow_call: inputs: gcc-major-version: + required: true + type: string + extra-conf-options: + required: false + type: string + configure-arguments: + required: false + type: string + make-arguments: required: false type: string - default: '10' jobs: build-cross-compile: name: build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -110,7 +118,7 @@ jobs: --verbose --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev --resolve-deps - buster + bullseye sysroot https://httpredir.debian.org/debian/ if: steps.get-cached-sysroot.outputs.cache-hit != 'true' @@ -135,12 +143,16 @@ jobs: --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} --with-sysroot=sysroot --with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }} - CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10 - CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10 + CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }} + CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }} + ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) - name: 'Build' id: build uses: ./.github/actions/do-build with: - make-target: 'hotspot' + make-target: 'hotspot ${{ inputs.make-arguments }}' platform: linux-${{ matrix.target-cpu }} diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 7f981118e23..8ebf9744955 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -42,20 +42,30 @@ on: required: false type: string default: '[ "debug", "release" ]' - apt-gcc-version: + gcc-major-version: required: true type: string + gcc-package-suffix: + required: false + type: string + default: '' apt-architecture: required: false type: string apt-extra-packages: required: false type: string + configure-arguments: + required: false + type: string + make-arguments: + required: false + type: string jobs: build-linux: name: build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -97,8 +107,8 @@ jobs: fi sudo apt-get update sudo apt-get install --only-upgrade apt - sudo apt-get install gcc-${{ inputs.apt-gcc-version }} g++-${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 + sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }} - name: 'Configure' run: > @@ -110,13 +120,16 @@ jobs: --with-jtreg=${{ steps.jtreg.outputs.path }} --enable-jtreg-failure-handler --with-zlib=system - ${{ inputs.extra-conf-options }} + ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) - name: 'Build' id: build uses: ./.github/actions/do-build with: - make-target: '${{ inputs.make-target }}' + make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index b00f7e091dd..b8fc0abcd8a 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -45,6 +45,12 @@ on: xcode-toolset-version: required: true type: string + configure-arguments: + required: false + type: string + make-arguments: + required: false + type: string jobs: build-macos: @@ -92,13 +98,16 @@ jobs: --with-jtreg=${{ steps.jtreg.outputs.path }} --enable-jtreg-failure-handler --with-zlib=system - ${{ inputs.extra-conf-options }} + ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) - name: 'Build' id: build uses: ./.github/actions/do-build with: - make-target: '${{ inputs.make-target }}' + make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 090c1451a8e..d383b90b0fb 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -48,6 +48,12 @@ on: msvc-toolset-architecture: required: true type: string + configure-arguments: + required: false + type: string + make-arguments: + required: false + type: string env: # These are needed to make the MSYS2 bash work properly @@ -119,7 +125,10 @@ jobs: --with-jtreg=${{ steps.jtreg.outputs.path }} --enable-jtreg-failure-handler --with-msvc-toolset-version=${{ inputs.msvc-toolset-version }} - ${{ inputs.extra-conf-options }} + ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) env: # We need a minimal PATH on Windows # Set PATH to "", so just GITHUB_PATH is included @@ -129,7 +138,7 @@ jobs: id: build uses: ./.github/actions/do-build with: - make-target: '${{ inputs.make-target }}' + make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b59bc48b805..1c365db99b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,12 @@ on: description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' required: true default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64' + configure-arguments: + description: 'Additional configure arguments' + required: false + make-arguments: + description: 'Additional make arguments' + required: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -49,7 +55,7 @@ jobs: select: name: 'Select platforms' - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: linux-x64: ${{ steps.include.outputs.linux-x64 }} linux-x86: ${{ steps.include.outputs.linux-x86 }} @@ -121,7 +127,9 @@ jobs: uses: ./.github/workflows/build-linux.yml with: platform: linux-x64 - apt-gcc-version: '10' + gcc-major-version: '10' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} # The linux-x64 jdk bundle is used as buildjdk for the cross-compile job if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true' @@ -131,12 +139,15 @@ jobs: uses: ./.github/workflows/build-linux.yml with: platform: linux-x86 - apt-gcc-version: '10-multilib' + gcc-major-version: '10' + gcc-package-suffix: '-multilib' apt-architecture: 'i386' # Some multilib libraries do not have proper inter-dependencies, so we have to # install their dependencies manually. apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386' extra-conf-options: '--with-target-bits=32' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-x86 == 'true' build-linux-x64-hs-nopch: @@ -147,8 +158,10 @@ jobs: platform: linux-x64 make-target: 'hotspot' debug-levels: '[ "debug" ]' - apt-gcc-version: '10' + gcc-major-version: '10' extra-conf-options: '--disable-precompiled-headers' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-x64-variants == 'true' build-linux-x64-hs-zero: @@ -159,8 +172,10 @@ jobs: platform: linux-x64 make-target: 'hotspot' debug-levels: '[ "debug" ]' - apt-gcc-version: '10' + gcc-major-version: '10' extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-x64-variants == 'true' build-linux-x64-hs-minimal: @@ -171,8 +186,10 @@ jobs: platform: linux-x64 make-target: 'hotspot' debug-levels: '[ "debug" ]' - apt-gcc-version: '10' + gcc-major-version: '10' extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-x64-variants == 'true' build-linux-x64-hs-optimized: @@ -184,8 +201,10 @@ jobs: make-target: 'hotspot' # Technically this is not the "debug" level, but we can't inject a new matrix state for just this job debug-levels: '[ "debug" ]' - apt-gcc-version: '10' + gcc-major-version: '10' extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-x64-variants == 'true' build-linux-cross-compile: @@ -194,6 +213,10 @@ jobs: - select - build-linux-x64 uses: ./.github/workflows/build-cross-compile.yml + with: + gcc-major-version: '10' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-cross-compile == 'true' build-macos-x64: @@ -203,6 +226,8 @@ jobs: with: platform: macos-x64 xcode-toolset-version: '11.7' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.macos-x64 == 'true' build-macos-aarch64: @@ -213,6 +238,8 @@ jobs: platform: macos-aarch64 xcode-toolset-version: '12.4' extra-conf-options: '--openjdk-target=aarch64-apple-darwin' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.macos-aarch64 == 'true' build-windows-x64: @@ -223,6 +250,8 @@ jobs: platform: windows-x64 msvc-toolset-version: '14.29' msvc-toolset-architecture: 'x86.x64' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.windows-x64 == 'true' build-windows-aarch64: @@ -235,6 +264,8 @@ jobs: msvc-toolset-architecture: 'arm64' make-target: 'hotspot' extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.windows-aarch64 == 'true' ### @@ -249,7 +280,7 @@ jobs: with: platform: linux-x64 bootjdk-platform: linux-x64 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 test-linux-x86: name: linux-x86 @@ -259,7 +290,7 @@ jobs: with: platform: linux-x86 bootjdk-platform: linux-x64 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 test-macos-x64: name: macos-x64 @@ -284,7 +315,7 @@ jobs: # Remove bundles so they are not misconstrued as binary distributions from the JDK project remove-bundles: name: 'Remove bundle artifacts' - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: always() needs: - build-linux-x64 From b77c161e7509aa3b09ebf3e6b2b1490c0667bbdc Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Wed, 30 Aug 2023 15:16:47 +0000 Subject: [PATCH 003/177] 8315135: Memory leak in the native implementation of Pack200.Unpacker.unpack() Co-authored-by: Yakov Shafranovich Reviewed-by: clanger, stuefe --- .../sun/java/util/jar/pack/NativeUnpack.java | 2 +- .../sun/java/util/jar/pack/UnpackerImpl.java | 5 ++ src/jdk.pack/share/native/libunpack/jni.cpp | 5 +- test/jdk/tools/pack200/UnpackMalformed.java | 55 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 test/jdk/tools/pack200/UnpackMalformed.java diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java index 86392160c9e..212a612c1f7 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java @@ -61,7 +61,7 @@ class NativeUnpack { // Resets the engine and frees all resources. // Returns total number of bytes consumed by the engine. - private synchronized native long finish(); + synchronized native long finish(); // Setting state in the unpacker. protected synchronized native boolean setOption(String opt, String value); diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java index e5942075fbf..9ff1369295c 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java @@ -116,6 +116,11 @@ public synchronized void unpack(InputStream in, JarOutputStream out) throws IOEx } catch (UnsatisfiedLinkError | NoClassDefFoundError ex) { // failover to java implementation (new DoUnpack()).run(in0, out); + } finally { + if (_nunp != null) { + // Free up native memory and JNI handles to prevent leaks + ((NativeUnpack) _nunp).finish(); + } } in0.close(); Utils.markJarFile(out); diff --git a/src/jdk.pack/share/native/libunpack/jni.cpp b/src/jdk.pack/share/native/libunpack/jni.cpp index 069df3f3a35..b0ff3eacfb7 100644 --- a/src/jdk.pack/share/native/libunpack/jni.cpp +++ b/src/jdk.pack/share/native/libunpack/jni.cpp @@ -314,9 +314,12 @@ Java_com_sun_java_util_jar_pack_NativeUnpack_getUnusedInput(JNIEnv *env, jobject JNIEXPORT jlong JNICALL Java_com_sun_java_util_jar_pack_NativeUnpack_finish(JNIEnv *env, jobject pObj) { - unpacker* uPtr = get_unpacker(env, pObj, false); + // There's no need to create a new unpacker here if we don't already have one + // just to immediatly free it afterwards. + unpacker* uPtr = get_unpacker(env, pObj, /* noCreate= */ true); CHECK_EXCEPTION_RETURN_VALUE(uPtr, 0); size_t consumed = uPtr->input_consumed(); + // free_unpacker() will set the unpacker field on 'pObj' to null free_unpacker(env, pObj, uPtr); return consumed; } diff --git a/test/jdk/tools/pack200/UnpackMalformed.java b/test/jdk/tools/pack200/UnpackMalformed.java new file mode 100644 index 00000000000..70a84acdf2e --- /dev/null +++ b/test/jdk/tools/pack200/UnpackMalformed.java @@ -0,0 +1,55 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * 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 8315135 + * @run main/othervm/timeout=300 -Dcom.sun.java.util.jar.pack.disable.native=false -Xmx8m UnpackMalformed + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; + +@SuppressWarnings("removal") +public class UnpackMalformed { + public static void main(String[] args) { + try { + ByteArrayInputStream in = new ByteArrayInputStream("foobar".getBytes()); + for (int i=0; i < 1_000; i++) { + try { + JarOutputStream out = new JarOutputStream(new ByteArrayOutputStream()); + Pack200.Unpacker unpacker = Pack200.newUnpacker(); + unpacker.unpack(in, out); + } catch (IOException e) { + } + } + } catch (OutOfMemoryError e) { + System.out.println(e); + throw e; + } + } +} From d76e6ea25e7b77cd28584a1e804e702f77176e8e Mon Sep 17 00:00:00 2001 From: Andrei Pangin Date: Wed, 30 Aug 2023 15:20:51 +0000 Subject: [PATCH 004/177] 8237858: PlainSocketImpl.socketAccept() handles EINTR incorrectly PlainSocketImpl.socketAccept() handles EINTR incorrectly Reviewed-by: phh Backport-of: 955aee3bfa8cad8b60fd38fb472b431075eea9d0 --- make/common/TestFilesCompilation.gmk | 6 +- src/java.base/aix/native/libnet/aix_close.c | 16 +- .../linux/native/libnet/linux_close.c | 16 +- .../macosx/native/libnet/bsd_close.c | 25 +-- test/jdk/java/net/Socket/NativeThread.java | 37 ++++ .../net/Socket/SocketAcceptInterruptTest.java | 153 +++++++++++++++ .../net/Socket/SocketReadInterruptTest.java | 181 ++++++++++++++++++ test/jdk/java/net/Socket/libNativeThread.c | 70 +++++++ 8 files changed, 480 insertions(+), 24 deletions(-) create mode 100644 test/jdk/java/net/Socket/NativeThread.java create mode 100644 test/jdk/java/net/Socket/SocketAcceptInterruptTest.java create mode 100644 test/jdk/java/net/Socket/SocketReadInterruptTest.java create mode 100644 test/jdk/java/net/Socket/libNativeThread.c diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index 74d20585b71..41124e1846c 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -62,7 +62,11 @@ define SetupTestFilesCompilationBody $1_OUTPUT_SUBDIR := lib $1_BASE_CFLAGS := $(CFLAGS_JDKLIB) $1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB) - $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) + ifeq ($(call isTargetOs, windows), false) + $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) -pthread + else + $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) + endif $1_COMPILATION_TYPE := LIBRARY else ifeq ($$($1_TYPE), PROGRAM) $1_PREFIX = exe diff --git a/src/java.base/aix/native/libnet/aix_close.c b/src/java.base/aix/native/libnet/aix_close.c index 1abe7710547..687d649b3cb 100644 --- a/src/java.base/aix/native/libnet/aix_close.c +++ b/src/java.base/aix/native/libnet/aix_close.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2019, SAP SE and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -531,12 +531,16 @@ int NET_Timeout(JNIEnv *env, int s, long timeout, jlong nanoTimeStamp) { * has expired return 0 (indicating timeout expired). */ if (rv < 0 && errno == EINTR) { - jlong newNanoTime = JVM_NanoTime(env, 0); - nanoTimeout -= newNanoTime - prevNanoTime; - if (nanoTimeout < NET_NSEC_PER_MSEC) { - return 0; + if (timeout > 0) { + jlong newNanoTime = JVM_NanoTime(env, 0); + nanoTimeout -= newNanoTime - prevNanoTime; + if (nanoTimeout < NET_NSEC_PER_MSEC) { + return 0; + } + prevNanoTime = newNanoTime; + } else { + continue; // timeout is -1, so loop again. } - prevNanoTime = newNanoTime; } else { return rv; } diff --git a/src/java.base/linux/native/libnet/linux_close.c b/src/java.base/linux/native/libnet/linux_close.c index fdfe7bf5c21..0d4e81e0731 100644 --- a/src/java.base/linux/native/libnet/linux_close.c +++ b/src/java.base/linux/native/libnet/linux_close.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -437,12 +437,16 @@ int NET_Timeout(JNIEnv *env, int s, long timeout, jlong nanoTimeStamp) { * has expired return 0 (indicating timeout expired). */ if (rv < 0 && errno == EINTR) { - jlong newNanoTime = JVM_NanoTime(env, 0); - nanoTimeout -= newNanoTime - prevNanoTime; - if (nanoTimeout < NET_NSEC_PER_MSEC) { - return 0; + if (timeout > 0) { + jlong newNanoTime = JVM_NanoTime(env, 0); + nanoTimeout -= newNanoTime - prevNanoTime; + if (nanoTimeout < NET_NSEC_PER_MSEC) { + return 0; + } + prevNanoTime = newNanoTime; + } else { + continue; // timeout is -1, so loop again. } - prevNanoTime = newNanoTime; } else { return rv; } diff --git a/src/java.base/macosx/native/libnet/bsd_close.c b/src/java.base/macosx/native/libnet/bsd_close.c index 4869fa58ca2..4a348b212f8 100644 --- a/src/java.base/macosx/native/libnet/bsd_close.c +++ b/src/java.base/macosx/native/libnet/bsd_close.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -472,17 +472,20 @@ int NET_Timeout(JNIEnv *env, int s, long timeout, jlong nanoTimeStamp) { * has expired return 0 (indicating timeout expired). */ if (rv < 0 && errno == EINTR) { - jlong newNanoTime = JVM_NanoTime(env, 0); - nanoTimeout -= newNanoTime - prevNanoTime; - if (nanoTimeout < NET_NSEC_PER_MSEC) { - if (allocated != 0) - free(fdsp); - return 0; + if (timeout > 0) { + jlong newNanoTime = JVM_NanoTime(env, 0); + nanoTimeout -= newNanoTime - prevNanoTime; + if (nanoTimeout < NET_NSEC_PER_MSEC) { + if (allocated != 0) + free(fdsp); + return 0; + } + prevNanoTime = newNanoTime; + t.tv_sec = nanoTimeout / NET_NSEC_PER_SEC; + t.tv_usec = (nanoTimeout % NET_NSEC_PER_SEC) / NET_NSEC_PER_USEC; + } else { + continue; // timeout is -1, so loop again. } - prevNanoTime = newNanoTime; - t.tv_sec = nanoTimeout / NET_NSEC_PER_SEC; - t.tv_usec = (nanoTimeout % NET_NSEC_PER_SEC) / NET_NSEC_PER_USEC; - } else { if (allocated != 0) free(fdsp); diff --git a/test/jdk/java/net/Socket/NativeThread.java b/test/jdk/java/net/Socket/NativeThread.java new file mode 100644 index 00000000000..5ab00ef855e --- /dev/null +++ b/test/jdk/java/net/Socket/NativeThread.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + +public class NativeThread { + + public static final int SIGPIPE; + + static { + SIGPIPE = getSIGPIPE(); + } + + public static native long getID(); + + public static native int signal(long threadId, int sig); + + private static native int getSIGPIPE(); +} diff --git a/test/jdk/java/net/Socket/SocketAcceptInterruptTest.java b/test/jdk/java/net/Socket/SocketAcceptInterruptTest.java new file mode 100644 index 00000000000..c759609091b --- /dev/null +++ b/test/jdk/java/net/Socket/SocketAcceptInterruptTest.java @@ -0,0 +1,153 @@ +/* + * 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 8237858 + * @summary PlainSocketImpl.socketAccept() handles EINTR incorrectly + * @requires (os.family != "windows") + * @compile NativeThread.java + * @run main/othervm/native -Djdk.net.usePlainSocketImpl=true SocketAcceptInterruptTest 0 + * @run main/othervm/native -Djdk.net.usePlainSocketImpl=true SocketAcceptInterruptTest 5000 + * @run main/othervm/native SocketAcceptInterruptTest 0 + * @run main/othervm/native SocketAcceptInterruptTest 5000 + */ +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +public class SocketAcceptInterruptTest { + + public static void main(String[] args) throws Exception { + System.loadLibrary("NativeThread"); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ExecutorService executor = Executors.newFixedThreadPool(1); + + try ( ServerSocket ss = new ServerSocket(0, 50, loopback);) { + Server server = new Server(ss, Integer.parseInt(args[0])); + Future future = executor.submit(server); + long threadId = server.getID(); + + sendSignal(threadId, ss); + sleep(100); + // In failing case server socket will be closed, so we do need to check first + if (!ss.isClosed()) { + // After sending SIGPIPE, create client socket and connect to server + try ( Socket s = new Socket(loopback, ss.getLocalPort()); InputStream in = s.getInputStream();) { + in.read(); // reading one byte is enought for test. + } + } + Result result = future.get(); + if (result.status == Result.FAIL) { + throw result.exception; + } + } finally { + executor.shutdown(); + } + System.out.println("OK!"); + } + + private static void sendSignal(long threadId, ServerSocket ss) { + System.out.println("Sending SIGPIPE to ServerSocket thread."); + int count = 0; + while (!ss.isClosed() && count++ < 20) { + sleep(10); + if (NativeThread.signal(threadId, NativeThread.SIGPIPE) != 0) { + throw new RuntimeException("Failed to interrupt the server thread."); + } + } + } + + private static void sleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + // ignore the exception. + } + } + + static class Server implements Callable { + + private volatile long threadId; + private final ServerSocket serverSocket; + private final int timeout; + + public Server(ServerSocket ss, int timeout) { + serverSocket = ss; + this.timeout = timeout; + } + + @Override + public Result call() { + try { + threadId = NativeThread.getID(); + serverSocket.setSoTimeout(timeout); + try ( Socket socket = serverSocket.accept(); + OutputStream outputStream = socket.getOutputStream();) { + outputStream.write("Hello!".getBytes()); + return new Result(Result.SUCCESS, null); + } + } catch (IOException e) { + close(); + return new Result(Result.FAIL, e); + } + } + + long getID() { + while (threadId == 0) { + sleep(5); + } + return threadId; + } + + private void close() { + if (!serverSocket.isClosed()) { + try { + serverSocket.close(); + } catch (IOException ex) { + // ignore the exception + } + } + } + } + + static class Result { + + static final int SUCCESS = 0; + static final int FAIL = 1; + final int status; + final Exception exception; + + public Result(int status, Exception ex) { + this.status = status; + exception = ex; + } + } +} diff --git a/test/jdk/java/net/Socket/SocketReadInterruptTest.java b/test/jdk/java/net/Socket/SocketReadInterruptTest.java new file mode 100644 index 00000000000..340f8bf2f16 --- /dev/null +++ b/test/jdk/java/net/Socket/SocketReadInterruptTest.java @@ -0,0 +1,181 @@ +/* + * 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 8237858 + * @summary PlainSocketImpl.socketAccept() handles EINTR incorrectly + * @requires (os.family != "windows") + * @compile NativeThread.java + * @run main/othervm/native -Djdk.net.usePlainSocketImpl=true SocketReadInterruptTest 2000 3000 + * @run main/othervm/native SocketReadInterruptTest 2000 3000 + * @run main/othervm/native -Djdk.net.usePlainSocketImpl=true SocketReadInterruptTest 2000 0 + * @run main/othervm/native SocketReadInterruptTest 2000 0 + */ +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.ServerSocket; + +import java.net.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +public class SocketReadInterruptTest { + + public static void main(String[] args) throws Exception { + System.loadLibrary("NativeThread"); + ExecutorService executor = Executors.newFixedThreadPool(2); + InetAddress loopback = InetAddress.getLoopbackAddress(); + + try ( ServerSocket ss = new ServerSocket(0, 50, loopback); + Socket s1 = new Socket(loopback, ss.getLocalPort());) { + Server server = new Server(ss, Integer.parseInt(args[0])); + Future f1 = executor.submit(server); + + Client client = new Client(s1, Integer.parseInt(args[1])); + Future f2 = executor.submit(client); + long threadId = client.getID(); + + sleep(200); + System.out.println("Sending SIGPIPE to client thread."); + if (NativeThread.signal(threadId, NativeThread.SIGPIPE) != 0) { + throw new RuntimeException("Failed to interrupt the thread."); + } + + Result r1 = f1.get(); + if (r1.status == Result.FAIL) { + throw r1.exception; + } + + Result r2 = f2.get(); + if (r2.status == Result.FAIL) { + throw r2.exception; + } + System.out.println("OK!"); + } finally { + executor.shutdown(); + } + } + + private static void sleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } + + static class Client implements Callable { + + private volatile long threadId; + private final Socket client; + private final int timeout; + + public Client(Socket s, int timeout) { + client = s; + this.timeout = timeout; + } + + @Override + public Result call() { + threadId = NativeThread.getID(); + byte[] arr = new byte[64]; + try ( InputStream in = client.getInputStream();) { + client.setSoTimeout(timeout); + in.read(arr); + return new Result(Result.SUCCESS, null); + } catch (IOException ex) { + close(); + return new Result(Result.FAIL, ex); + } + } + + long getID() { + while (threadId == 0) { + sleep(5); + } + return threadId; + } + + void close() { + if (!client.isClosed()) { + try { + client.close(); + } catch (IOException ex) { + // ignore the exception. + } + } + } + } + + static class Server implements Callable { + + private final ServerSocket serverSocket; + private final int timeout; + + public Server(ServerSocket ss, int timeout) { + serverSocket = ss; + this.timeout = timeout; + } + + @Override + public Result call() { + try { + try ( Socket client = serverSocket.accept(); OutputStream outputStream = client.getOutputStream();) { + sleep(timeout); + outputStream.write("This is just a test string.".getBytes()); + return new Result(Result.SUCCESS, null); + } + } catch (IOException e) { + close(); + return new Result(Result.FAIL, e); + } + } + + public void close() { + if (!serverSocket.isClosed()) { + try { + serverSocket.close(); + } catch (IOException ex) { + } + } + } + } + + static class Result { + + static final int SUCCESS = 0; + static final int FAIL = 1; + final int status; + final Exception exception; + + public Result(int status, Exception ex) { + this.status = status; + exception = ex; + } + } +} diff --git a/test/jdk/java/net/Socket/libNativeThread.c b/test/jdk/java/net/Socket/libNativeThread.c new file mode 100644 index 00000000000..8d2204cea7f --- /dev/null +++ b/test/jdk/java/net/Socket/libNativeThread.c @@ -0,0 +1,70 @@ +/* + * 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. + */ +#include +#include +#include +#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) +#include +#endif + +/* + * Class: NativeThread + * Method: getID + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_NativeThread_getID(JNIEnv *env, jclass class) +{ + #if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) + return (jlong)pthread_self(); + #else + return 0; + #endif +} + +/* + * Class: NativeThread + * Method: signal + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_NativeThread_signal(JNIEnv *env, jclass class, jlong thread, jint sig) +{ + #if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) + return pthread_kill((pthread_t)thread, sig); + #else + return 0; + #endif +} + +/* + * Class: NativeThread + * Method: getSIGPIPE + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_NativeThread_getSIGPIPE(JNIEnv *env, jclass class) +{ + #if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) + return SIGPIPE; + #else + return 0; + #endif +} From 121c997e02031a2ce208129feea143fac1e79c4c Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 31 Aug 2023 04:21:35 +0000 Subject: [PATCH 005/177] 8312535: MidiSystem.getSoundbank() throws unexpected SecurityException Backport-of: 87298d2ade41c689d3140981a123b0e9130fc651 --- .../sun/media/sound/JARSoundbankReader.java | 19 ++++--- .../GetSoundBankSecurityException.java | 50 +++++++++++++++++++ .../security.policy | 4 ++ 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java create mode 100644 test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy diff --git a/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java b/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java index 16749e99b89..f64c9a2327c 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, 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 @@ -32,6 +32,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLClassLoader; +import java.security.AccessController; import java.util.ArrayList; import java.util.Objects; @@ -40,6 +41,7 @@ import javax.sound.midi.spi.SoundbankReader; import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetBooleanAction; /** * JarSoundbankReader is used to read soundbank object from jar files. @@ -48,12 +50,15 @@ */ public final class JARSoundbankReader extends SoundbankReader { - /* - * Name of the system property that enables the Jar soundbank loading - * true if jar sound bank is allowed to be loaded - * default is false + /** + * Value of the system property that enables the Jar soundbank loading + * {@code true} if jar sound bank is allowed to be loaded default is + * {@code false}. */ - private final static String JAR_SOUNDBANK_ENABLED = "jdk.sound.jarsoundbank"; + @SuppressWarnings("removal") + private static final boolean JAR_SOUNDBANK_ENABLED = + AccessController.doPrivileged( + new GetBooleanAction("jdk.sound.jarsoundbank")); private static boolean isZIP(URL url) { boolean ok = false; @@ -81,7 +86,7 @@ private static boolean isZIP(URL url) { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { Objects.requireNonNull(url); - if (!Boolean.getBoolean(JAR_SOUNDBANK_ENABLED) || !isZIP(url)) + if (!JAR_SOUNDBANK_ENABLED || !isZIP(url)) return null; ArrayList soundbanks = new ArrayList<>(); diff --git a/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java new file mode 100644 index 00000000000..53f0450f482 --- /dev/null +++ b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java @@ -0,0 +1,50 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * 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.nio.file.Files; +import java.nio.file.Paths; + +import javax.sound.midi.InvalidMidiDataException; +import javax.sound.midi.MidiSystem; + +/** + * @test + * @bug 8312535 + * @summary MidiSystem.getSoundbank() throws unexpected SecurityException + * @run main/othervm/policy=security.policy GetSoundBankSecurityException + */ +public final class GetSoundBankSecurityException { + + public static void main(String[] args) throws Exception { + File tempFile = new File("sound.bank"); + tempFile.createNewFile(); + try { + MidiSystem.getSoundbank(tempFile); + throw new RuntimeException("InvalidMidiDataException is expected"); + } catch (InvalidMidiDataException ignore) { + } finally { + Files.delete(Paths.get(tempFile.getAbsolutePath())); + } + } +} diff --git a/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy new file mode 100644 index 00000000000..6c9c2a26aaf --- /dev/null +++ b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy @@ -0,0 +1,4 @@ +grant { + permission java.io.FilePermission "*", "read,write,delete"; + permission java.util.PropertyPermission "user.dir", "read"; +}; From f5eb11f381d4812c489dc2b206e88b34201300f8 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 31 Aug 2023 15:02:55 +0000 Subject: [PATCH 006/177] 8294941: GHA: Cut down cross-compilation sysroots Backport-of: a1747ef81a10e84177f474565193204ceaa0ede8 --- .github/workflows/build-cross-compile.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index f0411585199..0009c90c7c0 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -128,7 +128,9 @@ jobs: # Prepare sysroot and remove unused files to minimize cache sudo chroot sysroot symlinks -cr . sudo chown ${USER} -R sysroot - rm -rf sysroot/{dev,proc,run,sys} + rm -rf sysroot/{dev,proc,run,sys,var} + rm -rf sysroot/usr/{sbin,bin,share} + rm -rf sysroot/usr/lib/{apt,udev,systemd} if: steps.get-cached-sysroot.outputs.cache-hit != 'true' - name: 'Configure' From 373be4349c03f841e62a76120aeafd9631b2e765 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 31 Aug 2023 15:03:36 +0000 Subject: [PATCH 007/177] 8294956: GHA: qemu-debootstrap is deprecated, use the regular one Backport-of: c5f462e83b85ec53ec395622063a5b131aaf0827 --- .github/workflows/build-cross-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 0009c90c7c0..a3811da3f04 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -113,7 +113,7 @@ jobs: - name: 'Create sysroot' run: > - sudo qemu-debootstrap + sudo debootstrap --arch=${{ matrix.debian-arch }} --verbose --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev From 4cd3ad9c7177231bc4d981d28e155621e42f72ff Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 31 Aug 2023 15:04:12 +0000 Subject: [PATCH 008/177] 8299330: Minor improvements in MSYS2 Workflow handling Backport-of: cf00d09c8c37ee301e1c6657df45777647a834e9 --- .github/actions/get-msys2/action.yml | 4 ++-- .github/workflows/build-windows.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/get-msys2/action.yml b/.github/actions/get-msys2/action.yml index 3e6c3417a31..f6de676a327 100644 --- a/.github/actions/get-msys2/action.yml +++ b/.github/actions/get-msys2/action.yml @@ -34,11 +34,11 @@ runs: with: install: 'autoconf tar unzip zip make' path-type: minimal - location: msys2 + location: ${{ runner.tool_cache }}/msys2 # We can't run bash until this is completed, so stick with pwsh - name: 'Set MSYS2 path' run: | # Prepend msys2/msys64/usr/bin to the PATH - echo "$env:GITHUB_WORKSPACE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH + echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH shell: pwsh diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d383b90b0fb..ee8da06e740 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -133,6 +133,7 @@ jobs: # We need a minimal PATH on Windows # Set PATH to "", so just GITHUB_PATH is included PATH: '' + shell: env /usr/bin/bash --login -eo pipefail {0} - name: 'Build' id: build From caa05aca911798eb9a0e71f18bbb2e56cc2f0fd1 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 31 Aug 2023 16:32:06 +0000 Subject: [PATCH 009/177] 8294281: Allow warnings to be disabled on a per-file basis Backport-of: e45f3d5176e4affaa08480b560ca983fdbcb2846 --- make/common/NativeCompilation.gmk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 6189810888e..0710bf5bf97 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -359,10 +359,15 @@ define SetupCompileNativeFileBody endif endif + ifneq ($(DISABLE_WARNING_PREFIX), ) + $1_WARNINGS_FLAGS := $$(addprefix $(DISABLE_WARNING_PREFIX), \ + $$($$($1_BASE)_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$$($1_FILENAME))) + endif + $1_BASE_CFLAGS := $$($$($1_BASE)_CFLAGS) $$($$($1_BASE)_EXTRA_CFLAGS) \ - $$($$($1_BASE)_SYSROOT_CFLAGS) + $$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_WARNINGS_FLAGS) $1_BASE_CXXFLAGS := $$($$($1_BASE)_CXXFLAGS) $$($$($1_BASE)_EXTRA_CXXFLAGS) \ - $$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS) + $$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS) $$($1_WARNINGS_FLAGS) $1_BASE_ASFLAGS := $$($$($1_BASE)_ASFLAGS) $$($$($1_BASE)_EXTRA_ASFLAGS) ifneq ($$(filter %.c, $$($1_FILENAME)), ) From 7ce927107a735daf1f0a4ab4aae650f06a2fcd84 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 1 Sep 2023 13:03:13 +0000 Subject: [PATCH 010/177] 8314262: GHA: Cut down cross-compilation sysroots deeper Backport-of: 38687f1a3eb7d1c2e8aa43b85509ab7999fe0e40 --- .github/workflows/build-cross-compile.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index a3811da3f04..8f56cc5e5dc 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -130,7 +130,8 @@ jobs: sudo chown ${USER} -R sysroot rm -rf sysroot/{dev,proc,run,sys,var} rm -rf sysroot/usr/{sbin,bin,share} - rm -rf sysroot/usr/lib/{apt,udev,systemd} + rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd} + rm -rf sysroot/usr/libexec/gcc if: steps.get-cached-sysroot.outputs.cache-hit != 'true' - name: 'Configure' From 1bbbad1d2f7d95160be77455e43c21d3891c17e4 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 1 Sep 2023 13:03:49 +0000 Subject: [PATCH 011/177] 8315480: [11u] Harmonize GHA cross-compilation block with mainline Reviewed-by: fyang --- .github/workflows/build-cross-compile.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 8f56cc5e5dc..07fe9fe1040 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -56,18 +56,26 @@ jobs: - ppc64le include: - target-cpu: aarch64 - debian-arch: arm64 gnu-arch: aarch64 + debian-arch: arm64 + debian-repository: https://httpredir.debian.org/debian/ + debian-version: bullseye - target-cpu: arm - debian-arch: armhf gnu-arch: arm + debian-arch: armhf + debian-repository: https://httpredir.debian.org/debian/ + debian-version: bullseye gnu-abi: eabihf - target-cpu: s390x - debian-arch: s390x gnu-arch: s390x + debian-arch: s390x + debian-repository: https://httpredir.debian.org/debian/ + debian-version: bullseye - target-cpu: ppc64le - debian-arch: ppc64el gnu-arch: powerpc64le + debian-arch: ppc64el + debian-repository: https://httpredir.debian.org/debian/ + debian-version: bullseye steps: - name: 'Checkout the JDK source' @@ -118,9 +126,9 @@ jobs: --verbose --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev --resolve-deps - bullseye + ${{ matrix.debian-version }} sysroot - https://httpredir.debian.org/debian/ + ${{ matrix.debian-repository }} if: steps.get-cached-sysroot.outputs.cache-hit != 'true' - name: 'Prepare sysroot' From dc47d1fd380cd9ce4d6759edf4271c49abdd46e7 Mon Sep 17 00:00:00 2001 From: Fei Yang Date: Fri, 1 Sep 2023 13:22:13 +0000 Subject: [PATCH 012/177] 8292407: Improve Weak CAS VarHandle/Unsafe tests resilience under spurious failures Reviewed-by: shade Backport-of: 6e6202c14d0f6dd26369f21883ff317057aa469f --- ...dkInternalMiscUnsafeAccessTestBoolean.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestByte.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestChar.java | 23 +++++++- ...JdkInternalMiscUnsafeAccessTestDouble.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestFloat.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestInt.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestLong.java | 23 +++++++- ...JdkInternalMiscUnsafeAccessTestObject.java | 23 +++++++- .../JdkInternalMiscUnsafeAccessTestShort.java | 23 +++++++- .../SunMiscUnsafeAccessTestBoolean.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestByte.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestChar.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestDouble.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestFloat.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestInt.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestLong.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestObject.java | 19 ++++++- .../unsafe/SunMiscUnsafeAccessTestShort.java | 19 ++++++- .../unsafe/X-UnsafeAccessTest.java.template | 23 +++++++- .../invoke/VarHandles/VarHandleBaseTest.java | 21 +++++++- .../VarHandleTestAccessBoolean.java | 12 +++++ .../VarHandles/VarHandleTestAccessByte.java | 12 +++++ .../VarHandles/VarHandleTestAccessChar.java | 12 +++++ .../VarHandles/VarHandleTestAccessDouble.java | 12 +++++ .../VarHandles/VarHandleTestAccessFloat.java | 12 +++++ .../VarHandles/VarHandleTestAccessInt.java | 12 +++++ .../VarHandles/VarHandleTestAccessLong.java | 12 +++++ .../VarHandles/VarHandleTestAccessShort.java | 12 +++++ .../VarHandles/VarHandleTestAccessString.java | 12 +++++ .../VarHandleTestByteArrayAsDouble.java | 8 +++ .../VarHandleTestByteArrayAsFloat.java | 8 +++ .../VarHandleTestByteArrayAsInt.java | 8 +++ .../VarHandleTestByteArrayAsLong.java | 8 +++ ...arHandleTestMethodHandleAccessBoolean.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessByte.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessChar.java | 52 ++++++++++++++----- ...VarHandleTestMethodHandleAccessDouble.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessFloat.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessInt.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessLong.java | 52 ++++++++++++++----- .../VarHandleTestMethodHandleAccessShort.java | 52 ++++++++++++++----- ...VarHandleTestMethodHandleAccessString.java | 52 ++++++++++++++----- .../X-VarHandleTestAccess.java.template | 12 +++++ ...X-VarHandleTestByteArrayView.java.template | 8 +++ ...HandleTestMethodHandleAccess.java.template | 52 ++++++++++++++----- 45 files changed, 951 insertions(+), 151 deletions(-) diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java index b3fa7c49a8d..98f638abe2d 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestBoolean { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestBoolean { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static boolean static_v; boolean v; @@ -211,6 +228,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetBooleanPlain(base, offset, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = UNSAFE.getBoolean(base, offset); @@ -228,6 +246,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetBooleanAcquire(base, offset, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = UNSAFE.getBoolean(base, offset); @@ -245,6 +264,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetBooleanRelease(base, offset, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = UNSAFE.getBoolean(base, offset); @@ -262,6 +282,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetBoolean(base, offset, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = UNSAFE.getBoolean(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java index 0ce54ce877e..e149f6bd07b 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestByte { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestByte { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static byte static_v; byte v; @@ -240,6 +257,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetBytePlain(base, offset, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = UNSAFE.getByte(base, offset); @@ -257,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetByteAcquire(base, offset, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = UNSAFE.getByte(base, offset); @@ -274,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetByteRelease(base, offset, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = UNSAFE.getByte(base, offset); @@ -291,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetByte(base, offset, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = UNSAFE.getByte(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java index bcc8a481800..62d926b66a1 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestChar { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestChar { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static char static_v; char v; @@ -258,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetCharPlain(base, offset, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = UNSAFE.getChar(base, offset); @@ -275,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetCharAcquire(base, offset, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = UNSAFE.getChar(base, offset); @@ -292,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetCharRelease(base, offset, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = UNSAFE.getChar(base, offset); @@ -309,6 +329,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetChar(base, offset, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = UNSAFE.getChar(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java index ec68b3a52b9..2f90f0d7c7b 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestDouble { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestDouble { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static double static_v; double v; @@ -240,6 +257,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetDoublePlain(base, offset, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = UNSAFE.getDouble(base, offset); @@ -257,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetDoubleAcquire(base, offset, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = UNSAFE.getDouble(base, offset); @@ -274,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetDoubleRelease(base, offset, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = UNSAFE.getDouble(base, offset); @@ -291,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetDouble(base, offset, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = UNSAFE.getDouble(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java index 73da36c8355..f0256e7815d 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestFloat { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestFloat { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static float static_v; float v; @@ -240,6 +257,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetFloatPlain(base, offset, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = UNSAFE.getFloat(base, offset); @@ -257,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetFloatAcquire(base, offset, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = UNSAFE.getFloat(base, offset); @@ -274,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetFloatRelease(base, offset, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = UNSAFE.getFloat(base, offset); @@ -291,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetFloat(base, offset, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = UNSAFE.getFloat(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java index a62fede83d7..038cd2151b1 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestInt { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestInt { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static int static_v; int v; @@ -258,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetIntPlain(base, offset, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = UNSAFE.getInt(base, offset); @@ -275,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetIntAcquire(base, offset, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = UNSAFE.getInt(base, offset); @@ -292,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetIntRelease(base, offset, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = UNSAFE.getInt(base, offset); @@ -309,6 +329,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetInt(base, offset, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = UNSAFE.getInt(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java index f7ab52cb04e..cffec14ad72 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestLong { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestLong { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static long static_v; long v; @@ -258,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetLongPlain(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = UNSAFE.getLong(base, offset); @@ -275,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetLongAcquire(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = UNSAFE.getLong(base, offset); @@ -292,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetLongRelease(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = UNSAFE.getLong(base, offset); @@ -309,6 +329,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetLong(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = UNSAFE.getLong(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java index 04797707ff8..5daa5467aed 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestObject { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestObject { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static Object static_v; Object v; @@ -211,6 +228,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetObjectPlain(base, offset, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain Object"); Object x = UNSAFE.getObject(base, offset); @@ -228,6 +246,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetObjectAcquire(base, offset, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire Object"); Object x = UNSAFE.getObject(base, offset); @@ -245,6 +264,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetObjectRelease(base, offset, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease Object"); Object x = UNSAFE.getObject(base, offset); @@ -262,6 +282,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetObject(base, offset, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet Object"); Object x = UNSAFE.getObject(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java index 5b3b006308b..770677a98d3 100644 --- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java +++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java @@ -43,7 +43,14 @@ public class JdkInternalMiscUnsafeAccessTestShort { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final jdk.internal.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestShort { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static short static_v; short v; @@ -258,6 +275,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetShortPlain(base, offset, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = UNSAFE.getShort(base, offset); @@ -275,6 +293,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetShortAcquire(base, offset, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = UNSAFE.getShort(base, offset); @@ -292,6 +311,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetShortRelease(base, offset, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = UNSAFE.getShort(base, offset); @@ -309,6 +329,7 @@ static void testAccess(Object base, long offset) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSetShort(base, offset, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = UNSAFE.getShort(base, offset); diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java index 6de29f5b39c..c176277d2ba 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestBoolean { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestBoolean { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static boolean static_v; boolean v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestByte.java index 87aa8c66a57..b205b1d3376 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestByte.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestByte.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestByte { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestByte { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static byte static_v; byte v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestChar.java index 8e10d4334e4..114ed7e9b5a 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestChar.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestChar.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestChar { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestChar { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static char static_v; char v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java index 878336db8a1..d813ea73e70 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestDouble { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestDouble { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static double static_v; double v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java index 616919f09f4..f0482c82637 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestFloat { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestFloat { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static float static_v; float v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestInt.java index 05e9a467a89..9326539f4ef 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestInt.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestInt.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestInt { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestInt { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static int static_v; int v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestLong.java index 38b0a83296a..30bc9551dd5 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestLong.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestLong.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestLong { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestLong { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static long static_v; long v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestObject.java index 8782995957b..add15ff77fd 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestObject.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestObject.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestObject { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestObject { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static Object static_v; Object v; diff --git a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestShort.java index c16761daaac..4ea81f026e7 100644 --- a/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestShort.java +++ b/test/hotspot/jtreg/compiler/unsafe/SunMiscUnsafeAccessTestShort.java @@ -43,7 +43,14 @@ public class SunMiscUnsafeAccessTestShort { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final sun.misc.Unsafe UNSAFE; @@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestShort { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static short static_v; short v; diff --git a/test/hotspot/jtreg/compiler/unsafe/X-UnsafeAccessTest.java.template b/test/hotspot/jtreg/compiler/unsafe/X-UnsafeAccessTest.java.template index 8e1da7f63c8..3e74019635a 100644 --- a/test/hotspot/jtreg/compiler/unsafe/X-UnsafeAccessTest.java.template +++ b/test/hotspot/jtreg/compiler/unsafe/X-UnsafeAccessTest.java.template @@ -47,7 +47,14 @@ import static org.testng.Assert.*; public class $Qualifier$UnsafeAccessTest$Type$ { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); static final $package$.Unsafe UNSAFE; @@ -90,6 +97,16 @@ public class $Qualifier$UnsafeAccessTest$Type$ { ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); } + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } + static $type$ static_v; $type$ v; @@ -302,6 +319,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSet$Type$Plain(base, offset, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = UNSAFE.get$Type$(base, offset); @@ -319,6 +337,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSet$Type$Acquire(base, offset, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = UNSAFE.get$Type$(base, offset); @@ -336,6 +355,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSet$Type$Release(base, offset, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = UNSAFE.get$Type$(base, offset); @@ -353,6 +373,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = UNSAFE.weakCompareAndSet$Type$(base, offset, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = UNSAFE.get$Type$(base, offset); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java index 7792df89155..bf41574342d 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleBaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, 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 @@ -40,7 +40,14 @@ abstract class VarHandleBaseTest { static final int ITERS = Integer.getInteger("iters", 1); - static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10); + + // More resilience for Weak* tests. These operations may spuriously + // fail, and so we do several attempts with delay on failure. + // Be mindful of worst-case total time on test, which would be at + // roughly (delay*attempts) milliseconds. + // + static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100); + static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1)); interface ThrowingRunnable { void run() throws Throwable; @@ -490,4 +497,14 @@ static void testTypes(VarHandle vh) { assertEquals(mt.parameterType(mt.parameterCount() - 1), vh.varType()); } } + + static void weakDelay() { + try { + if (WEAK_DELAY_MS > 0) { + Thread.sleep(WEAK_DELAY_MS); + } + } catch (InterruptedException ie) { + // Do nothing. + } + } } diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java index 47977761d47..e897d87a9f8 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java @@ -442,6 +442,7 @@ static void testInstanceField(VarHandleTestAccessBoolean recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) vh.get(recv); @@ -459,6 +460,7 @@ static void testInstanceField(VarHandleTestAccessBoolean recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) vh.get(recv); @@ -476,6 +478,7 @@ static void testInstanceField(VarHandleTestAccessBoolean recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) vh.get(recv); @@ -493,6 +496,7 @@ static void testInstanceField(VarHandleTestAccessBoolean recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) vh.get(recv); @@ -730,6 +734,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) vh.get(); @@ -747,6 +752,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) vh.get(); @@ -764,6 +770,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) vh.get(); @@ -781,6 +788,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) vh.get(); @@ -1021,6 +1029,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) vh.get(array, i); @@ -1038,6 +1047,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) vh.get(array, i); @@ -1055,6 +1065,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) vh.get(array, i); @@ -1072,6 +1083,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java index 302b72997e7..10c9ff270c1 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java @@ -420,6 +420,7 @@ static void testInstanceField(VarHandleTestAccessByte recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) vh.get(recv); @@ -437,6 +438,7 @@ static void testInstanceField(VarHandleTestAccessByte recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) vh.get(recv); @@ -454,6 +456,7 @@ static void testInstanceField(VarHandleTestAccessByte recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) vh.get(recv); @@ -471,6 +474,7 @@ static void testInstanceField(VarHandleTestAccessByte recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) vh.get(recv); @@ -724,6 +728,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain((byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) vh.get(); @@ -741,6 +746,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire((byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) vh.get(); @@ -758,6 +764,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease((byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) vh.get(); @@ -775,6 +782,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet((byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) vh.get(); @@ -1031,6 +1039,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) vh.get(array, i); @@ -1048,6 +1057,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) vh.get(array, i); @@ -1065,6 +1075,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) vh.get(array, i); @@ -1082,6 +1093,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java index 534ebf83b8a..4b1394336ba 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java @@ -420,6 +420,7 @@ static void testInstanceField(VarHandleTestAccessChar recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) vh.get(recv); @@ -437,6 +438,7 @@ static void testInstanceField(VarHandleTestAccessChar recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) vh.get(recv); @@ -454,6 +456,7 @@ static void testInstanceField(VarHandleTestAccessChar recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) vh.get(recv); @@ -471,6 +474,7 @@ static void testInstanceField(VarHandleTestAccessChar recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) vh.get(recv); @@ -724,6 +728,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain('\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) vh.get(); @@ -741,6 +746,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire('\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) vh.get(); @@ -758,6 +764,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease('\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) vh.get(); @@ -775,6 +782,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet('\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) vh.get(); @@ -1031,6 +1039,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) vh.get(array, i); @@ -1048,6 +1057,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) vh.get(array, i); @@ -1065,6 +1075,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) vh.get(array, i); @@ -1082,6 +1093,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java index 8f5bfca9cf7..3c1ff7fcc53 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java @@ -490,6 +490,7 @@ static void testInstanceField(VarHandleTestAccessDouble recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) vh.get(recv); @@ -507,6 +508,7 @@ static void testInstanceField(VarHandleTestAccessDouble recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) vh.get(recv); @@ -524,6 +526,7 @@ static void testInstanceField(VarHandleTestAccessDouble recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) vh.get(recv); @@ -541,6 +544,7 @@ static void testInstanceField(VarHandleTestAccessDouble recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) vh.get(recv); @@ -746,6 +750,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) vh.get(); @@ -763,6 +768,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) vh.get(); @@ -780,6 +786,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) vh.get(); @@ -797,6 +804,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) vh.get(); @@ -1005,6 +1013,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) vh.get(array, i); @@ -1022,6 +1031,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) vh.get(array, i); @@ -1039,6 +1049,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) vh.get(array, i); @@ -1056,6 +1067,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java index 13bc8a12b02..d1ec3c5565c 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java @@ -490,6 +490,7 @@ static void testInstanceField(VarHandleTestAccessFloat recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) vh.get(recv); @@ -507,6 +508,7 @@ static void testInstanceField(VarHandleTestAccessFloat recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) vh.get(recv); @@ -524,6 +526,7 @@ static void testInstanceField(VarHandleTestAccessFloat recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) vh.get(recv); @@ -541,6 +544,7 @@ static void testInstanceField(VarHandleTestAccessFloat recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) vh.get(recv); @@ -746,6 +750,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) vh.get(); @@ -763,6 +768,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) vh.get(); @@ -780,6 +786,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) vh.get(); @@ -797,6 +804,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) vh.get(); @@ -1005,6 +1013,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) vh.get(array, i); @@ -1022,6 +1031,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) vh.get(array, i); @@ -1039,6 +1049,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) vh.get(array, i); @@ -1056,6 +1067,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java index d459e8eebe5..ba7bb95aee7 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java @@ -420,6 +420,7 @@ static void testInstanceField(VarHandleTestAccessInt recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) vh.get(recv); @@ -437,6 +438,7 @@ static void testInstanceField(VarHandleTestAccessInt recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) vh.get(recv); @@ -454,6 +456,7 @@ static void testInstanceField(VarHandleTestAccessInt recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) vh.get(recv); @@ -471,6 +474,7 @@ static void testInstanceField(VarHandleTestAccessInt recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) vh.get(recv); @@ -724,6 +728,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) vh.get(); @@ -741,6 +746,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) vh.get(); @@ -758,6 +764,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) vh.get(); @@ -775,6 +782,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) vh.get(); @@ -1031,6 +1039,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) vh.get(array, i); @@ -1048,6 +1057,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) vh.get(array, i); @@ -1065,6 +1075,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) vh.get(array, i); @@ -1082,6 +1093,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java index ce6fc2b1137..412adf1d7ce 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java @@ -420,6 +420,7 @@ static void testInstanceField(VarHandleTestAccessLong recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) vh.get(recv); @@ -437,6 +438,7 @@ static void testInstanceField(VarHandleTestAccessLong recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) vh.get(recv); @@ -454,6 +456,7 @@ static void testInstanceField(VarHandleTestAccessLong recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) vh.get(recv); @@ -471,6 +474,7 @@ static void testInstanceField(VarHandleTestAccessLong recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) vh.get(recv); @@ -724,6 +728,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) vh.get(); @@ -741,6 +746,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) vh.get(); @@ -758,6 +764,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) vh.get(); @@ -775,6 +782,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) vh.get(); @@ -1031,6 +1039,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) vh.get(array, i); @@ -1048,6 +1057,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) vh.get(array, i); @@ -1065,6 +1075,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) vh.get(array, i); @@ -1082,6 +1093,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java index 5e8f61b3cdb..c4be5b71190 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java @@ -420,6 +420,7 @@ static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) vh.get(recv); @@ -437,6 +438,7 @@ static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) vh.get(recv); @@ -454,6 +456,7 @@ static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) vh.get(recv); @@ -471,6 +474,7 @@ static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) vh.get(recv); @@ -724,6 +728,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain((short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) vh.get(); @@ -741,6 +746,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire((short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) vh.get(); @@ -758,6 +764,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease((short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) vh.get(); @@ -775,6 +782,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet((short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) vh.get(); @@ -1031,6 +1039,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) vh.get(array, i); @@ -1048,6 +1057,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) vh.get(array, i); @@ -1065,6 +1075,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) vh.get(array, i); @@ -1082,6 +1093,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java index f3705210594..0be9939ddce 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java @@ -519,6 +519,7 @@ static void testInstanceField(VarHandleTestAccessString recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) vh.get(recv); @@ -536,6 +537,7 @@ static void testInstanceField(VarHandleTestAccessString recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) vh.get(recv); @@ -553,6 +555,7 @@ static void testInstanceField(VarHandleTestAccessString recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) vh.get(recv); @@ -570,6 +573,7 @@ static void testInstanceField(VarHandleTestAccessString recv, VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) vh.get(recv); @@ -759,6 +763,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain("foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) vh.get(); @@ -776,6 +781,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire("bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) vh.get(); @@ -793,6 +799,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease("foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) vh.get(); @@ -810,6 +817,7 @@ static void testStaticField(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet("bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) vh.get(); @@ -1002,6 +1010,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) vh.get(array, i); @@ -1019,6 +1028,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) vh.get(array, i); @@ -1036,6 +1046,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) vh.get(array, i); @@ -1053,6 +1064,7 @@ static void testArray(VarHandle vh) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java index 4b67fa9a250..2b9a24699cd 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java @@ -1050,6 +1050,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) vh.get(array, i); @@ -1067,6 +1068,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) vh.get(array, i); @@ -1084,6 +1086,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) vh.get(array, i); @@ -1101,6 +1104,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) vh.get(array, i); @@ -1251,6 +1255,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) vh.get(array, i); @@ -1268,6 +1273,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) vh.get(array, i); @@ -1285,6 +1291,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) vh.get(array, i); @@ -1302,6 +1309,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java index a5afcf76ca5..bdd592e4af4 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java @@ -1050,6 +1050,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) vh.get(array, i); @@ -1067,6 +1068,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) vh.get(array, i); @@ -1084,6 +1086,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) vh.get(array, i); @@ -1101,6 +1104,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) vh.get(array, i); @@ -1251,6 +1255,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) vh.get(array, i); @@ -1268,6 +1273,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) vh.get(array, i); @@ -1285,6 +1291,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) vh.get(array, i); @@ -1302,6 +1309,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java index e40a84ddc19..16b91cff35a 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java @@ -1234,6 +1234,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) vh.get(array, i); @@ -1251,6 +1252,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) vh.get(array, i); @@ -1268,6 +1270,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) vh.get(array, i); @@ -1285,6 +1288,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) vh.get(array, i); @@ -1545,6 +1549,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) vh.get(array, i); @@ -1562,6 +1567,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) vh.get(array, i); @@ -1579,6 +1585,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) vh.get(array, i); @@ -1596,6 +1603,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java index 18e6902082b..b03d79dd6f0 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java @@ -1234,6 +1234,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) vh.get(array, i); @@ -1251,6 +1252,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) vh.get(array, i); @@ -1268,6 +1270,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) vh.get(array, i); @@ -1285,6 +1288,7 @@ static void testArrayReadWrite(ByteArraySource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) vh.get(array, i); @@ -1545,6 +1549,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) vh.get(array, i); @@ -1562,6 +1567,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) vh.get(array, i); @@ -1579,6 +1585,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) vh.get(array, i); @@ -1596,6 +1603,7 @@ static void testArrayReadWrite(ByteBufferSource bs, VarHandleSource vhs) { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java index 3be56ac3c4a..9255bfeb577 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessBoolean recv, Handl } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, true, false); + success = (boolean) mh.invokeExact(recv, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessBoolean recv, Handl } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, false, true); + success = (boolean) mh.invokeExact(recv, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessBoolean recv, Handl } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, true, false); + success = (boolean) mh.invokeExact(recv, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessBoolean recv, Handl { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, false, true); + success = (boolean) mh.invokeExact(recv, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -470,9 +479,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(true, false); + success = (boolean) mh.invokeExact(true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(); @@ -487,9 +498,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(false, true); + success = (boolean) mh.invokeExact(false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(); @@ -497,16 +510,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(false, false); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact(false, false); assertEquals(success, false, "failing weakCompareAndSetAcquire boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, true, "failing weakCompareAndSetAcquire boolean value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(true, false); + success = (boolean) mh.invokeExact(true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(); @@ -521,9 +537,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(false, true); + success = (boolean) mh.invokeExact(false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(); @@ -757,9 +775,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, true, false); + success = (boolean) mh.invokeExact(array, i, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -774,9 +794,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, false, true); + success = (boolean) mh.invokeExact(array, i, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -791,9 +813,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, true, false); + success = (boolean) mh.invokeExact(array, i, true, false); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -808,9 +832,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, false, true); + success = (boolean) mh.invokeExact(array, i, false, true); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet boolean"); boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java index b60ab7bd8e6..a31081d994f 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessByte recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact(recv, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessByte recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact(recv, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessByte recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact(recv, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessByte recv, Handles { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact(recv, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -492,9 +501,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact((byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(); @@ -509,9 +520,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact((byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(); @@ -519,16 +532,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((byte)0x23, (byte)0x45); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact((byte)0x23, (byte)0x45); assertEquals(success, false, "failing weakCompareAndSetAcquire byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, (byte)0x01, "failing weakCompareAndSetAcquire byte value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact((byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(); @@ -543,9 +559,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact((byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(); @@ -801,9 +819,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact(array, i, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -818,9 +838,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact(array, i, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -835,9 +857,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (byte)0x01, (byte)0x23); + success = (boolean) mh.invokeExact(array, i, (byte)0x01, (byte)0x23); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -852,9 +876,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (byte)0x23, (byte)0x01); + success = (boolean) mh.invokeExact(array, i, (byte)0x23, (byte)0x01); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet byte"); byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java index 79bbb8622e4..fc76b6705e0 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessChar recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, '\u0123', '\u4567'); + success = (boolean) mh.invokeExact(recv, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessChar recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, '\u4567', '\u0123'); + success = (boolean) mh.invokeExact(recv, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessChar recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, '\u0123', '\u4567'); + success = (boolean) mh.invokeExact(recv, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessChar recv, Handles { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, '\u4567', '\u0123'); + success = (boolean) mh.invokeExact(recv, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -492,9 +501,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact('\u0123', '\u4567'); + success = (boolean) mh.invokeExact('\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(); @@ -509,9 +520,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact('\u4567', '\u0123'); + success = (boolean) mh.invokeExact('\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(); @@ -519,16 +532,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact('\u4567', '\u89AB'); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact('\u4567', '\u89AB'); assertEquals(success, false, "failing weakCompareAndSetAcquire char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, '\u0123', "failing weakCompareAndSetAcquire char value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact('\u0123', '\u4567'); + success = (boolean) mh.invokeExact('\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(); @@ -543,9 +559,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact('\u4567', '\u0123'); + success = (boolean) mh.invokeExact('\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(); @@ -801,9 +819,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, '\u0123', '\u4567'); + success = (boolean) mh.invokeExact(array, i, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -818,9 +838,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, '\u4567', '\u0123'); + success = (boolean) mh.invokeExact(array, i, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -835,9 +857,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, '\u0123', '\u4567'); + success = (boolean) mh.invokeExact(array, i, '\u0123', '\u4567'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -852,9 +876,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, '\u4567', '\u0123'); + success = (boolean) mh.invokeExact(array, i, '\u4567', '\u0123'); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet char"); char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java index ae31f8dc9b2..158333622e2 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessDouble recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0d, 2.0d); + success = (boolean) mh.invokeExact(recv, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessDouble recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0d, 1.0d); + success = (boolean) mh.invokeExact(recv, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessDouble recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0d, 2.0d); + success = (boolean) mh.invokeExact(recv, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessDouble recv, Handle { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0d, 1.0d); + success = (boolean) mh.invokeExact(recv, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -414,9 +423,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0d, 2.0d); + success = (boolean) mh.invokeExact(1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(); @@ -431,9 +442,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0d, 1.0d); + success = (boolean) mh.invokeExact(2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(); @@ -441,16 +454,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0d, 3.0d); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact(2.0d, 3.0d); assertEquals(success, false, "failing weakCompareAndSetAcquire double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, 1.0d, "failing weakCompareAndSetAcquire double value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0d, 2.0d); + success = (boolean) mh.invokeExact(1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(); @@ -465,9 +481,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0d, 1.0d); + success = (boolean) mh.invokeExact(2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(); @@ -645,9 +663,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0d, 2.0d); + success = (boolean) mh.invokeExact(array, i, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -662,9 +682,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0d, 1.0d); + success = (boolean) mh.invokeExact(array, i, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -679,9 +701,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0d, 2.0d); + success = (boolean) mh.invokeExact(array, i, 1.0d, 2.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -696,9 +720,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0d, 1.0d); + success = (boolean) mh.invokeExact(array, i, 2.0d, 1.0d); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet double"); double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java index 4fdc63dff0c..0350406d1b2 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessFloat recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0f, 2.0f); + success = (boolean) mh.invokeExact(recv, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessFloat recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0f, 1.0f); + success = (boolean) mh.invokeExact(recv, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessFloat recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0f, 2.0f); + success = (boolean) mh.invokeExact(recv, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessFloat recv, Handles { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0f, 1.0f); + success = (boolean) mh.invokeExact(recv, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -414,9 +423,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0f, 2.0f); + success = (boolean) mh.invokeExact(1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(); @@ -431,9 +442,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0f, 1.0f); + success = (boolean) mh.invokeExact(2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(); @@ -441,16 +454,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0f, 3.0f); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact(2.0f, 3.0f); assertEquals(success, false, "failing weakCompareAndSetAcquire float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, 1.0f, "failing weakCompareAndSetAcquire float value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0f, 2.0f); + success = (boolean) mh.invokeExact(1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(); @@ -465,9 +481,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0f, 1.0f); + success = (boolean) mh.invokeExact(2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(); @@ -645,9 +663,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0f, 2.0f); + success = (boolean) mh.invokeExact(array, i, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -662,9 +682,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0f, 1.0f); + success = (boolean) mh.invokeExact(array, i, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -679,9 +701,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0f, 2.0f); + success = (boolean) mh.invokeExact(array, i, 1.0f, 2.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -696,9 +720,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0f, 1.0f); + success = (boolean) mh.invokeExact(array, i, 2.0f, 1.0f); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet float"); float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java index aebeece1254..239b7548f9d 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessInt recv, Handles h } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(recv, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessInt recv, Handles h } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(recv, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessInt recv, Handles h } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(recv, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessInt recv, Handles h { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(recv, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -492,9 +501,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(); @@ -509,9 +520,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(); @@ -519,16 +532,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF, 0xCAFEBABE); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact(0x89ABCDEF, 0xCAFEBABE); assertEquals(success, false, "failing weakCompareAndSetAcquire int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, 0x01234567, "failing weakCompareAndSetAcquire int value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(); @@ -543,9 +559,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(); @@ -801,9 +819,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(array, i, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -818,9 +838,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(array, i, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -835,9 +857,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x01234567, 0x89ABCDEF); + success = (boolean) mh.invokeExact(array, i, 0x01234567, 0x89ABCDEF); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -852,9 +876,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x89ABCDEF, 0x01234567); + success = (boolean) mh.invokeExact(array, i, 0x89ABCDEF, 0x01234567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet int"); int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java index c30b1395ee3..41afce3d468 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessLong recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessLong recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessLong recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessLong recv, Handles { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -492,9 +501,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(); @@ -509,9 +520,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(); @@ -519,16 +532,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL); assertEquals(success, false, "failing weakCompareAndSetAcquire long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, 0x0123456789ABCDEFL, "failing weakCompareAndSetAcquire long value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(); @@ -543,9 +559,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(); @@ -801,9 +819,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -818,9 +838,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -835,9 +857,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = (boolean) mh.invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -852,9 +876,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = (boolean) mh.invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet long"); long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java index 49e9f744b9b..cfe3105782b 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessShort recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact(recv, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessShort recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact(recv, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessShort recv, Handles } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact(recv, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessShort recv, Handles { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact(recv, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -492,9 +501,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact((short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(); @@ -509,9 +520,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact((short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(); @@ -519,16 +532,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((short)0x4567, (short)0x89AB); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact((short)0x4567, (short)0x89AB); assertEquals(success, false, "failing weakCompareAndSetAcquire short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, (short)0x0123, "failing weakCompareAndSetAcquire short value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact((short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(); @@ -543,9 +559,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact((short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(); @@ -801,9 +819,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact(array, i, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -818,9 +838,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact(array, i, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -835,9 +857,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (short)0x0123, (short)0x4567); + success = (boolean) mh.invokeExact(array, i, (short)0x0123, (short)0x4567); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -852,9 +876,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (short)0x4567, (short)0x0123); + success = (boolean) mh.invokeExact(array, i, (short)0x4567, (short)0x0123); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet short"); short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java index cd70d2d7928..7b80c12467b 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java @@ -30,6 +30,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -208,9 +209,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessString recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, "foo", "bar"); + success = (boolean) mh.invokeExact(recv, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -225,9 +228,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessString recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, "bar", "foo"); + success = (boolean) mh.invokeExact(recv, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -242,9 +247,11 @@ static void testInstanceField(VarHandleTestMethodHandleAccessString recv, Handle } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, "foo", "bar"); + success = (boolean) mh.invokeExact(recv, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -260,8 +267,10 @@ static void testInstanceField(VarHandleTestMethodHandleAccessString recv, Handle { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, "bar", "foo"); + success = (boolean) mh.invokeExact(recv, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -392,9 +401,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact("foo", "bar"); + success = (boolean) mh.invokeExact("foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(); @@ -409,9 +420,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact("bar", "foo"); + success = (boolean) mh.invokeExact("bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(); @@ -419,16 +432,19 @@ static void testStaticField(Handles hs) throws Throwable { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact("bar", "baz"); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact("bar", "baz"); assertEquals(success, false, "failing weakCompareAndSetAcquire String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, "foo", "failing weakCompareAndSetAcquire String value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact("foo", "bar"); + success = (boolean) mh.invokeExact("foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(); @@ -443,9 +459,11 @@ static void testStaticField(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact("bar", "foo"); + success = (boolean) mh.invokeExact("bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(); @@ -601,9 +619,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, "foo", "bar"); + success = (boolean) mh.invokeExact(array, i, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -618,9 +638,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, "bar", "foo"); + success = (boolean) mh.invokeExact(array, i, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -635,9 +657,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, "foo", "bar"); + success = (boolean) mh.invokeExact(array, i, "foo", "bar"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -652,9 +676,11 @@ static void testArray(Handles hs) throws Throwable { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, "bar", "foo"); + success = (boolean) mh.invokeExact(array, i, "bar", "foo"); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet String"); String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template index 9f409dfaf0b..31bdcd22543 100644 --- a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template +++ b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template @@ -658,6 +658,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(recv, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) vh.get(recv); @@ -675,6 +676,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(recv, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) vh.get(recv); @@ -692,6 +694,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(recv, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) vh.get(recv); @@ -709,6 +712,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(recv, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) vh.get(recv); @@ -1063,6 +1067,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain($value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) vh.get(); @@ -1080,6 +1085,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire($value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) vh.get(); @@ -1097,6 +1103,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease($value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) vh.get(); @@ -1114,6 +1121,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet($value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) vh.get(); @@ -1471,6 +1479,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1488,6 +1497,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1505,6 +1515,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1522,6 +1533,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template index bea9fec4e2b..c25ac554472 100644 --- a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template +++ b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template @@ -1591,6 +1591,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1608,6 +1609,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1625,6 +1627,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1642,6 +1645,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1908,6 +1912,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1925,6 +1930,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1942,6 +1948,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) vh.get(array, i); @@ -1959,6 +1966,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) vh.get(array, i); diff --git a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template index 79875db904b..a26dc769024 100644 --- a/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template +++ b/test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template @@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -209,9 +210,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, $value1$, $value2$); + success = (boolean) mh.invokeExact(recv, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -226,9 +229,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, $value2$, $value1$); + success = (boolean) mh.invokeExact(recv, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -243,9 +248,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, $value1$, $value2$); + success = (boolean) mh.invokeExact(recv, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -261,8 +268,10 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { { boolean success = false; + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, $value2$, $value1$); + success = (boolean) mh.invokeExact(recv, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv); @@ -532,9 +541,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact($value1$, $value2$); + success = (boolean) mh.invokeExact($value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(); @@ -549,9 +560,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact($value2$, $value1$); + success = (boolean) mh.invokeExact($value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(); @@ -559,16 +572,19 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { - boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact($value2$, $value3$); + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); + boolean success = (boolean) mh.invokeExact($value2$, $value3$); assertEquals(success, false, "failing weakCompareAndSetAcquire $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(); assertEquals(x, $value1$, "failing weakCompareAndSetAcquire $type$ value"); } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact($value1$, $value2$); + success = (boolean) mh.invokeExact($value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(); @@ -583,9 +599,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact($value2$, $value1$); + success = (boolean) mh.invokeExact($value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(); @@ -880,9 +898,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, $value1$, $value2$); + success = (boolean) mh.invokeExact(array, i, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetPlain $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -897,9 +917,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, $value2$, $value1$); + success = (boolean) mh.invokeExact(array, i, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetAcquire $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -914,9 +936,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, $value1$, $value2$); + success = (boolean) mh.invokeExact(array, i, $value1$, $value2$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSetRelease $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i); @@ -931,9 +955,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest { } { + MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET); boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, $value2$, $value1$); + success = (boolean) mh.invokeExact(array, i, $value2$, $value1$); + if (!success) weakDelay(); } assertEquals(success, true, "success weakCompareAndSet $type$"); $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i); From 72018a19ccbdbccb3bf22bd50f5e2e4b43d783fd Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 1 Sep 2023 16:34:16 +0000 Subject: [PATCH 013/177] 8313576: GCC 7 reports compiler warning in bundled freetype 2.13.0 Backport-of: 8248e351d0bed263fb68d8468004a4286e6391af --- make/lib/Awt2dLibraries.gmk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk index fecbb248a7c..3db2dd9b150 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -516,6 +516,7 @@ else LIBFREETYPE_LIBS := -lfreetype endif + # gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds. $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \ NAME := freetype, \ OPTIMIZATION := HIGHEST, \ @@ -528,6 +529,7 @@ else DISABLED_WARNINGS_microsoft := 4018 4267 4244 4312 4819, \ DISABLED_WARNINGS_gcc := implicit-fallthrough cast-function-type bad-function-cast, \ DISABLED_WARNINGS_clang := missing-declarations, \ + DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ )) From 5327f67b9e40ad756c6616779f3a2a44cdd257f7 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 4 Sep 2023 06:40:50 +0000 Subject: [PATCH 014/177] 8313707: GHA: Bootstrap sysroots with --variant=minbase Backport-of: 29f1d8ef50e3b4b235177fd9642a1fcf26fe3bab --- .github/workflows/build-cross-compile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 07fe9fe1040..f16d22d5de6 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -126,6 +126,7 @@ jobs: --verbose --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev --resolve-deps + --variant=minbase ${{ matrix.debian-version }} sysroot ${{ matrix.debian-repository }} From 3eb7a82fef6a6e6554aa4e640bbf4226e716e582 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 5 Sep 2023 09:48:20 +0000 Subject: [PATCH 015/177] 8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev Reviewed-by: fyang Backport-of: 69d900d2ce97e5479020cff9a63c471d07e39989 --- .github/workflows/build-cross-compile.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index f16d22d5de6..bbd9a81add7 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -124,7 +124,7 @@ jobs: sudo debootstrap --arch=${{ matrix.debian-arch }} --verbose - --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev + --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev --resolve-deps --variant=minbase ${{ matrix.debian-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c365db99b6..8d011e4d39d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -144,7 +144,7 @@ jobs: apt-architecture: 'i386' # Some multilib libraries do not have proper inter-dependencies, so we have to # install their dependencies manually. - apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386' + apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386' extra-conf-options: '--with-target-bits=32' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} From 765f6af9153913a272a628941cee4426cc5159cd Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 5 Sep 2023 09:50:14 +0000 Subject: [PATCH 016/177] 8313626: C2 crash due to unexpected exception control flow Backport-of: f8203cb272e6136b784e5c43a500f6a0bfb19c8b --- src/hotspot/share/opto/doCall.cpp | 4 + .../parsing/MissingSafepointOnTryCatch.jasm | 111 ++++++++++++++++++ .../TestMissingSafepointOnTryCatch.java | 65 ++++++++++ 3 files changed, 180 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm create mode 100644 test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index dfcc8c4021a..4b1ffc52ffb 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -916,6 +916,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { if (PrintOpto && WizardMode) { tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); // jump to handler return; // No more handling to be done here! } @@ -947,6 +949,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { klass->print_name(); tty->cr(); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); } set_control(not_subtype_ctrl); diff --git a/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm new file mode 100644 index 00000000000..5d5fced0cb3 --- /dev/null +++ b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm @@ -0,0 +1,111 @@ +/* + * 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 MissingSafepointOnTryCatch version 52:0 { + + static Method m:"()V" { + return; + } + + static Method test1:"()V" stack 1 { + try t; + invokestatic m:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + + static Method test2:"()V" stack 1 { + try t0; + try t1; + invokestatic m:"()V"; + endtry t1; + return; + + catch t1 java/lang/Exception; + stack_map class java/lang/Exception; + return; + + catch t0 java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t0; + } + + public static Method th:"()V" + throws java/lang/Exception + stack 2 locals 0 + { + new class java/lang/Exception; + dup; + invokespecial Method java/lang/Exception."":"()V"; + athrow; + } + + static Method test3:"()V" stack 1 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method test4:"()V" stack 2 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + iconst_1; + istore_0; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method testInfinite:"()V" stack 1 { + try t; + invokestatic th:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + +} // end Class MissingSafepointOnTryCatch diff --git a/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java new file mode 100644 index 00000000000..9a8a3135794 --- /dev/null +++ b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java @@ -0,0 +1,65 @@ +/* + * 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 8313626 + * @summary assert(false) failed: malformed control flow to missing safepoint on backedge of a try-catch + * @library /test/lib + * @compile MissingSafepointOnTryCatch.jasm + * @run main/othervm -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,MissingSafepointOnTryCatch::test* + * -XX:CompileCommand=dontinline,MissingSafepointOnTryCatch::m + * -XX:CompileCommand=inline,MissingSafepointOnTryCatch::th + * -XX:-TieredCompilation -Xcomp TestMissingSafepointOnTryCatch + */ + +import jdk.test.lib.Utils; + +public class TestMissingSafepointOnTryCatch { + + public static void infiniteLoop() { + try { + Thread thread = new Thread() { + public void run() { + MissingSafepointOnTryCatch.testInfinite(); + } + }; + thread.setDaemon(true); + thread.start(); + Thread.sleep(Utils.adjustTimeout(500)); + } catch (Exception e) {} + } + + public static void main(String[] args) { + try { + // to make sure java/lang/Exception class is resolved + MissingSafepointOnTryCatch.th(); + } catch (Exception e) {} + MissingSafepointOnTryCatch.test1(); + MissingSafepointOnTryCatch.test2(); + MissingSafepointOnTryCatch.test3(); + MissingSafepointOnTryCatch.test4(); + infiniteLoop(); + } +} From 50074a04e62f91faa080b831d9ce343396ead252 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Tue, 5 Sep 2023 20:48:42 +0000 Subject: [PATCH 017/177] 8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar Backport-of: e47a84f23dd2608c6f5748093eefe301fb5bf750 --- .../share/classes/java/util/jar/JarFile.java | 4 +++- .../sun/security/util/SignatureFileVerifier.java | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/java/util/jar/JarFile.java b/src/java.base/share/classes/java/util/jar/JarFile.java index cb7e308e0d7..cce897c0d31 100644 --- a/src/java.base/share/classes/java/util/jar/JarFile.java +++ b/src/java.base/share/classes/java/util/jar/JarFile.java @@ -809,7 +809,9 @@ private byte[] getBytes(ZipEntry ze) throws IOException { throw new IOException("Unsupported size: " + uncompressedSize + " for JarEntry " + ze.getName() + ". Allowed max size: " + - SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes"); + SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " + + "You can use the jdk.jar.maxSignatureFileSize " + + "system property to increase the default value."); } int len = (int)uncompressedSize; int bytesRead; diff --git a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java index cb477fc1340..a766b8249fb 100644 --- a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java @@ -852,16 +852,16 @@ private static int initializeMaxSigFileSize() { * the maximum allowed number of bytes for the signature-related files * in a JAR file. */ - Integer tmp = GetIntegerAction.privilegedGetProperty( - "jdk.jar.maxSignatureFileSize", 8000000); + int tmp = GetIntegerAction.privilegedGetProperty( + "jdk.jar.maxSignatureFileSize", 16000000); if (tmp < 0 || tmp > MAX_ARRAY_SIZE) { if (debug != null) { - debug.println("Default signature file size 8000000 bytes " + - "is used as the specified size for the " + - "jdk.jar.maxSignatureFileSize system property " + + debug.println("The default signature file size of 16000000 bytes " + + "will be used for the jdk.jar.maxSignatureFileSize " + + "system property since the specified value " + "is out of range: " + tmp); } - tmp = 8000000; + tmp = 16000000; } return tmp; } From bcce7afba4503e3bc9f1d7dc2aa7de7eca86c764 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 7 Sep 2023 08:04:48 +0000 Subject: [PATCH 018/177] 8306372: Open source AWT CardLayout and Checkbox tests Backport-of: 781d6d793ad4cecb774bcbcb362c726779408ffd --- .../java/awt/CardLayout/CardsOrderTest.java | 69 +++++++++++++++++++ .../java/awt/CardLayout/ObedienceTest.java | 59 ++++++++++++++++ .../java/awt/Checkbox/CheckboxCrashTest.java | 56 +++++++++++++++ .../MultiCheckedCheckboxGroupTest.java | 59 ++++++++++++++++ .../awt/Checkbox/NullCheckboxGroupTest.java | 55 +++++++++++++++ .../awt/Checkbox/SetCheckboxGroupNull.java | 66 ++++++++++++++++++ 6 files changed, 364 insertions(+) create mode 100644 test/jdk/java/awt/CardLayout/CardsOrderTest.java create mode 100644 test/jdk/java/awt/CardLayout/ObedienceTest.java create mode 100644 test/jdk/java/awt/Checkbox/CheckboxCrashTest.java create mode 100644 test/jdk/java/awt/Checkbox/MultiCheckedCheckboxGroupTest.java create mode 100644 test/jdk/java/awt/Checkbox/NullCheckboxGroupTest.java create mode 100644 test/jdk/java/awt/Checkbox/SetCheckboxGroupNull.java diff --git a/test/jdk/java/awt/CardLayout/CardsOrderTest.java b/test/jdk/java/awt/CardLayout/CardsOrderTest.java new file mode 100644 index 00000000000..5ca2cff1ae1 --- /dev/null +++ b/test/jdk/java/awt/CardLayout/CardsOrderTest.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +/* + @test + @bug 4689398 + @summary Inserting items in a Container with CardLayout does not work since Merlin +*/ + +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Container; + +public class CardsOrderTest { + + public static void main(String[] args) throws Exception { + + CardLayout layout = new CardLayout(); + Container cont = new Container(); + Component comp1 = new Component() {}; + Component comp2 = new Component() {}; + Component comp3 = new Component() {}; + cont.setLayout(layout); + cont.add(comp1, "1", 0); + cont.add(comp2, "2", 0); + cont.add(comp3, "3", 0); + + // Testing visibility "state" - not actually if its visible on screen + // since this test does not require a UI. + System.out.println("comp1.isVisible() = " + comp1.isVisible()); + System.out.println("comp2.isVisible() = " + comp2.isVisible()); + System.out.println("comp3.isVisible() = " + comp3.isVisible()); + + if (!comp1.isVisible() || comp2.isVisible() || comp3.isVisible()) { + throw new RuntimeException("first added component must be visible"); + } + + System.out.println("CardLayout.next()"); + layout.next(cont); + + System.out.println("comp1.isVisible() = " + comp1.isVisible()); + System.out.println("comp2.isVisible() = " + comp2.isVisible()); + System.out.println("comp3.isVisible() = " + comp3.isVisible()); + + if (!comp3.isVisible() ||comp1.isVisible() || comp2.isVisible()) { + throw new RuntimeException("the wrong component is visible after CardLayout.next() (must be comp3)"); + } + } +} diff --git a/test/jdk/java/awt/CardLayout/ObedienceTest.java b/test/jdk/java/awt/CardLayout/ObedienceTest.java new file mode 100644 index 00000000000..0a3590dd425 --- /dev/null +++ b/test/jdk/java/awt/CardLayout/ObedienceTest.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +/* + @test + @bug 4690266 + @summary REGRESSION: Wizard Page does not move to the next page +*/ + +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Container; + +public class ObedienceTest { + + public static void main(String[] args) { + Container cont = new Container(); + Component comp1 = new Component() {}; + Component comp2 = new Component() {}; + CardLayout layout = new CardLayout(); + cont.setLayout(layout); + cont.add(comp1, "first"); + cont.add(comp2, "second"); + + if (!comp1.isVisible()) { + throw new RuntimeException("first component must be visible"); + } + + comp1.setVisible(false); + comp2.setVisible(true); + layout.layoutContainer(cont); + + if (!comp2.isVisible() || comp1.isVisible()) { + System.out.println("comp1.isVisible() = " + comp1.isVisible()); + System.out.println("comp2.isVisible() = " + comp2.isVisible()); + throw new RuntimeException("manually shown component must be visible after layoutContainer()"); + } + } +} diff --git a/test/jdk/java/awt/Checkbox/CheckboxCrashTest.java b/test/jdk/java/awt/Checkbox/CheckboxCrashTest.java new file mode 100644 index 00000000000..3584233723a --- /dev/null +++ b/test/jdk/java/awt/Checkbox/CheckboxCrashTest.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +/* + @test + @bug 4378378 + @summary Tests that checkbox.setLabel(null) doesn't crash the VM. + @key headful +*/ + +import java.awt.Checkbox; +import java.awt.EventQueue; +import java.awt.Frame; + +public class CheckboxCrashTest { + + static Frame f; + + public static void main(String[] args) throws Exception { + try { + EventQueue.invokeAndWait(() -> runTest()); + Thread.sleep(1000); + } finally { + f.dispose(); + } + } + + static void runTest() { + f = new Frame("CheckboxCrashTest"); + Checkbox cb = new Checkbox(); + f.add(cb); + f.pack(); + cb.setLabel(null); + f.setVisible(true); + } +} diff --git a/test/jdk/java/awt/Checkbox/MultiCheckedCheckboxGroupTest.java b/test/jdk/java/awt/Checkbox/MultiCheckedCheckboxGroupTest.java new file mode 100644 index 00000000000..4e52b8cd269 --- /dev/null +++ b/test/jdk/java/awt/Checkbox/MultiCheckedCheckboxGroupTest.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +/* + @test + @bug 4136496 + @key headful + @summary Checkbox.setCheckboxGroup(CheckboxGroup) works wrong on some Checkbox states +*/ + +import java.awt.Checkbox; +import java.awt.CheckboxGroup; + +public class MultiCheckedCheckboxGroupTest { + + public static void main(String[] args) throws Exception { + + CheckboxGroup gr = new CheckboxGroup(); + Checkbox chb1 = new Checkbox("Box 1", true, gr); + Checkbox chb2 = new Checkbox("Box 2", true, null); + + chb2.setCheckboxGroup(gr); + + System.out.println("chb1="+chb1); + System.out.println("chb2="+chb2); + System.out.println("gr.getSelectedCheckbox="+gr.getSelectedCheckbox()); + + if(chb1.getState() + && !chb2.getState() + && chb1.getCheckboxGroup() == gr + && chb2.getCheckboxGroup() == gr + && gr.getSelectedCheckbox() == chb1) { + System.out.println("PASSED"); + } else { + System.out.println("FAILED"); + throw new RuntimeException("Test FAILED"); + } + } +} diff --git a/test/jdk/java/awt/Checkbox/NullCheckboxGroupTest.java b/test/jdk/java/awt/Checkbox/NullCheckboxGroupTest.java new file mode 100644 index 00000000000..be2d139d944 --- /dev/null +++ b/test/jdk/java/awt/Checkbox/NullCheckboxGroupTest.java @@ -0,0 +1,55 @@ +/* + * 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. + */ + +/* + @test + @bug 4114268 + @key headful + @summary Checkbox.setCheckboxGroup(null) alters selection for CB's previous CBGroup +*/ + +import java.awt.Checkbox; +import java.awt.CheckboxGroup; + +public class NullCheckboxGroupTest { + + + public static void main(String[] args) { + CheckboxGroup cbg = new CheckboxGroup(); + Checkbox chbox1 = new Checkbox("First", cbg, true); + Checkbox chbox2 = new Checkbox("Second", cbg, false); + + chbox2.setCheckboxGroup(null); + + System.out.println("chbox1="+chbox1); + System.out.println("chbox2="+chbox2); + System.out.println("cbg="+cbg); + + if (cbg.getSelectedCheckbox() != chbox1) { + System.out.println("FAILED"); + throw new RuntimeException("Test FAILED"); + } else { + System.out.println("PASSED"); + } + } + } diff --git a/test/jdk/java/awt/Checkbox/SetCheckboxGroupNull.java b/test/jdk/java/awt/Checkbox/SetCheckboxGroupNull.java new file mode 100644 index 00000000000..1ba339ecde7 --- /dev/null +++ b/test/jdk/java/awt/Checkbox/SetCheckboxGroupNull.java @@ -0,0 +1,66 @@ +/* + * 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. + */ + +/* + @test + @bug 4726853 + @key headful + @summary Checkbox is changing it's state after removing from CheckboxGroup +*/ + +import java.awt.Checkbox; +import java.awt.CheckboxGroup; + +public class SetCheckboxGroupNull { + + public static void main(String[] args) { + boolean passed = true; + + // 1 step + { + CheckboxGroup g = new CheckboxGroup(); + Checkbox cb1 = new Checkbox("Label", true, g); + System.out.println("1. (should be true) "+cb1.getState()); + passed = passed && (cb1.getState() == true); + cb1.setCheckboxGroup(null); + System.out.println("2. (should be true) "+cb1.getState()); + passed = passed && (cb1.getState() == true); + } + + // 2 step + { + CheckboxGroup g = new CheckboxGroup(); + Checkbox cb1 = new Checkbox("CB1", true, g); + System.out.println("3. (should be true) " + cb1.getState()); + passed = passed && (cb1.getState() == true); + g.setSelectedCheckbox(null); + System.out.println("4. (should be false) " + cb1.getState()); + passed = passed && (cb1.getState() == false); + } + + if (!passed) { + throw new RuntimeException("SetCheckboxGroupNull FAILED"); + } + System.out.println("SetCheckboxGroupNull PASSED"); + } +} From 0fd1ce3eea2bc425f1d3f2440743b8bb9aae8188 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Mon, 11 Sep 2023 13:22:08 +0000 Subject: [PATCH 019/177] 8233847: (sctp) Flx link-local IPv6 scope handling and test cleanup. Backport-of: 76e5a32c52c670173ded80eb10f5afd715f472cd --- src/java.base/share/classes/module-info.java | 3 +- .../com/sun/nio/sctp/HandlerResult.java | 2 +- .../sun/nio/ch/sctp/SctpChannelImpl.java | 4 ++ .../sun/nio/ch/sctp/SctpMultiChannelImpl.java | 4 ++ .../unix/classes/sun/nio/ch/sctp/SctpNet.java | 7 +++- .../com/sun/nio/sctp/SctpChannel/Bind.java | 13 +++--- .../com/sun/nio/sctp/SctpChannel/CommUp.java | 5 ++- .../com/sun/nio/sctp/SctpChannel/Connect.java | 7 +--- .../sctp/SctpChannel/SocketOptionTests.java | 42 ++++++++----------- .../sun/nio/sctp/SctpMultiChannel/Branch.java | 3 +- .../sun/nio/sctp/SctpMultiChannel/Send.java | 6 ++- .../nio/sctp/SctpMultiChannel/SendFailed.java | 23 ++++++---- .../SctpMultiChannel/SocketOptionTests.java | 38 +++++++---------- 13 files changed, 85 insertions(+), 72 deletions(-) diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index 7351627db36..f64b6c9b741 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -240,8 +240,9 @@ jdk.naming.dns; exports sun.net.util to java.desktop, + java.net.http, jdk.jconsole, - java.net.http; + jdk.sctp; exports sun.net.www to java.desktop, java.net.http, diff --git a/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java b/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java index c4ca0a3de0d..a037264d056 100644 --- a/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java +++ b/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java @@ -29,7 +29,7 @@ * *

The {@code HandlerResult} is used to determine the behavior of the * channel after it handles a notification from the SCTP stack. Essentially its - * value determines if the channel should try to receive another notificaiton or + * value determines if the channel should try to receive another notification or * a message before returning. * * @since 1.7 diff --git a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java index f33d105dc69..c214ee06789 100644 --- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java +++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -53,6 +53,7 @@ import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.net.util.IPAddressUtil; import sun.nio.ch.DirectBuffer; import sun.nio.ch.IOStatus; import sun.nio.ch.IOUtil; @@ -1033,6 +1034,9 @@ private int sendFromNativeBuffer(int fd, if (target != null) { InetSocketAddress isa = Net.checkAddress(target); addr = isa.getAddress(); + if (addr.isLinkLocalAddress()) { + addr = IPAddressUtil.toScopedAddress(addr); + } port = isa.getPort(); } diff --git a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index 084e5e36859..d62469bfd49 100644 --- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java +++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -53,6 +53,7 @@ import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpMultiChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.net.util.IPAddressUtil; import sun.nio.ch.DirectBuffer; import sun.nio.ch.NativeThread; import sun.nio.ch.IOStatus; @@ -892,6 +893,9 @@ private int sendFromNativeBuffer(int fd, if (target != null) { InetSocketAddress isa = Net.checkAddress(target); addr = isa.getAddress(); + if (addr.isLinkLocalAddress()) { + addr = IPAddressUtil.toScopedAddress(addr); + } port = isa.getPort(); } int pos = bb.position(); diff --git a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java index 367ab1f1e4d..7539a37f280 100644 --- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java +++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java @@ -34,6 +34,7 @@ import java.util.HashSet; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.net.util.IPAddressUtil; import sun.nio.ch.IOUtil; import sun.nio.ch.Net; import com.sun.nio.sctp.SctpSocketOption; @@ -169,9 +170,13 @@ static void setSocketOption(int fd, InetSocketAddress netAddr = (InetSocketAddress)addr; if (name.equals(SCTP_PRIMARY_ADDR)) { + InetAddress inetAddress = netAddr.getAddress(); + if (inetAddress.isLinkLocalAddress()) { + inetAddress = IPAddressUtil.toScopedAddress(inetAddress); + } setPrimAddrOption0(fd, assocId, - netAddr.getAddress(), + inetAddress, netAddr.getPort()); } else { setPeerPrimAddrOption0(fd, diff --git a/test/jdk/com/sun/nio/sctp/SctpChannel/Bind.java b/test/jdk/com/sun/nio/sctp/SctpChannel/Bind.java index 90f29e1456f..027f31695ae 100644 --- a/test/jdk/com/sun/nio/sctp/SctpChannel/Bind.java +++ b/test/jdk/com/sun/nio/sctp/SctpChannel/Bind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,9 +110,10 @@ void testBind() { try { channel.close(); /* open a new unbound channel for test */ channel = SctpChannel.open(); - connectChannel(channel); - channel.bind(null); - fail("AlreadyConnectedException expected"); + try (var peer = connectChannel(channel)) { + channel.bind(null); + fail("AlreadyConnectedException expected"); + } } catch (AlreadyConnectedException unused) { pass(); } catch (IOException ioe) { unexpected(ioe); } @@ -264,7 +265,9 @@ void testBindUnbind(boolean connected) { } finally { try { if (channel != null) channel.close(); } catch (IOException ioe) { unexpected(ioe); } - } + try { if (peerChannel != null) peerChannel.close(); } + catch (IOException ioe) { unexpected(ioe); } + } } boolean boundAddress(SctpChannel channel, InetAddress addr) diff --git a/test/jdk/com/sun/nio/sctp/SctpChannel/CommUp.java b/test/jdk/com/sun/nio/sctp/SctpChannel/CommUp.java index 68380a47c11..8cbe034b00d 100644 --- a/test/jdk/com/sun/nio/sctp/SctpChannel/CommUp.java +++ b/test/jdk/com/sun/nio/sctp/SctpChannel/CommUp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -191,6 +191,9 @@ else if (sk.isReadable()) { } } //for + try { sc.close(); } + catch (IOException ioe) { unexpected(ioe); } + } catch (IOException ioe) { unexpected(ioe); } catch (InterruptedException ie) { diff --git a/test/jdk/com/sun/nio/sctp/SctpChannel/Connect.java b/test/jdk/com/sun/nio/sctp/SctpChannel/Connect.java index 1e992a7c05f..fccc12a9f06 100644 --- a/test/jdk/com/sun/nio/sctp/SctpChannel/Connect.java +++ b/test/jdk/com/sun/nio/sctp/SctpChannel/Connect.java @@ -61,11 +61,10 @@ void test(String[] args) { void doTest() { SctpChannel channel = null; - SctpServerChannel ssc = null; - try { + try (SctpServerChannel ssc = SctpServerChannel.open()) { /* Create a server channel to connect to */ - ssc = SctpServerChannel.open().bind(null); + ssc.bind(null); Set addrs = ssc.getAllLocalAddresses(); if (addrs.isEmpty()) debug("addrs should not be empty"); @@ -209,8 +208,6 @@ public Void call() throws IOException { } finally { try { if (channel != null) channel.close(); } catch (IOException unused) {} - try { if (ssc != null) ssc.close(); } - catch (IOException unused) {} } } diff --git a/test/jdk/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java b/test/jdk/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java index af0aed0435d..1da835b9cbb 100644 --- a/test/jdk/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java +++ b/test/jdk/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java @@ -72,8 +72,7 @@ void test(String[] args) { return; } - try { - SctpChannel sc = SctpChannel.open(); + try (SctpChannel sc = SctpChannel.open()) { /* check supported options */ Set> options = sc.supportedOptions(); @@ -143,8 +142,6 @@ void test(String[] args) { /* SCTP_PRIMARY_ADDR */ void sctpPrimaryAddr() throws IOException { - SocketAddress addrToSet = null;; - System.out.println("TESTING SCTP_PRIMARY_ADDR"); SctpChannel sc = SctpChannel.open(); SctpServerChannel ssc = SctpServerChannel.open().bind(null); @@ -158,12 +155,11 @@ void sctpPrimaryAddr() throws IOException { sc.connect(serverAddr); SctpChannel peerChannel = ssc.accept(); ssc.close(); - Set peerAddrs = peerChannel.getAllLocalAddresses(); - debug("Peer local Addresses: "); - for (Iterator it = peerAddrs.iterator(); it.hasNext(); ) { + Set remoteAddresses = sc.getRemoteAddresses(); + debug("Remote Addresses: "); + for (Iterator it = remoteAddresses.iterator(); it.hasNext(); ) { InetSocketAddress addr = (InetSocketAddress)it.next(); debug("\t" + addr); - addrToSet = addr; // any of the peer addresses will do! } /* retrieval of SCTP_PRIMARY_ADDR is not supported on Solaris */ @@ -176,25 +172,21 @@ void sctpPrimaryAddr() throws IOException { } else { /* Linux */ SocketAddress primaryAddr = sc.getOption(SCTP_PRIMARY_ADDR); System.out.println("SCTP_PRIMARY_ADDR returned: " + primaryAddr); - /* Verify that this is one of the peer addresses */ - boolean found = false; - addrToSet = primaryAddr; // may not have more than one addr - for (Iterator it = peerAddrs.iterator(); it.hasNext(); ) { - InetSocketAddress addr = (InetSocketAddress)it.next(); - if (addr.equals(primaryAddr)) { - found = true; - } - addrToSet = addr; + /* Verify that this is one of the remote addresses */ + check(remoteAddresses.contains(primaryAddr), "SCTP_PRIMARY_ADDR returned bogus address!"); + + for (Iterator it = remoteAddresses.iterator(); it.hasNext(); ) { + InetSocketAddress addrToSet = (InetSocketAddress) it.next(); + System.out.println("SCTP_PRIMARY_ADDR try set to: " + addrToSet); + sc.setOption(SCTP_PRIMARY_ADDR, addrToSet); + System.out.println("SCTP_PRIMARY_ADDR set to : " + addrToSet); + primaryAddr = sc.getOption(SCTP_PRIMARY_ADDR); + System.out.println("SCTP_PRIMARY_ADDR returned : " + primaryAddr); + check(addrToSet.equals(primaryAddr), "SCTP_PRIMARY_ADDR not set correctly"); } - check(found, "SCTP_PRIMARY_ADDR returned bogus address!"); - - System.out.println("SCTP_PRIMARY_ADDR try set to: " + addrToSet); - sc.setOption(SCTP_PRIMARY_ADDR, addrToSet); - System.out.println("SCTP_PRIMARY_ADDR set to: " + addrToSet); - primaryAddr = sc.getOption(SCTP_PRIMARY_ADDR); - System.out.println("SCTP_PRIMARY_ADDR returned: " + primaryAddr); - check(addrToSet.equals(primaryAddr),"SCTP_PRIMARY_ADDR not set correctly"); } + sc.close(); + peerChannel.close(); } //--------------------- Infrastructure --------------------------- boolean debug = true; diff --git a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java index f7638b50d0a..ffd8eb361c3 100644 --- a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java +++ b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java @@ -210,7 +210,8 @@ public void run() { /* echo the message */ debug("Server: echoing first message"); buffer.flip(); - int bytes = serverChannel.send(buffer, info); + MessageInfo sendInfo = MessageInfo.createOutgoing(info.association(), null, 0); + int bytes = serverChannel.send(buffer, sendInfo); debug("Server: sent " + bytes + "bytes"); clientFinishedLatch.await(10L, TimeUnit.SECONDS); diff --git a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Send.java b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Send.java index 1f314686bac..feb914a410e 100644 --- a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Send.java +++ b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/Send.java @@ -276,7 +276,8 @@ public void run() { /* echo the message */ debug("Server: echoing first message"); buffer.flip(); - int bytes = serverChannel.send(buffer, info); + MessageInfo sendInfo = MessageInfo.createOutgoing(assoc, null, info.streamNumber()); + int bytes = serverChannel.send(buffer, sendInfo); debug("Server: sent " + bytes + "bytes"); /* receive a large message */ @@ -302,7 +303,8 @@ public void run() { /* echo the message */ debug("Server: echoing second message"); buffer.flip(); - bytes = serverChannel.send(buffer, info); + sendInfo = MessageInfo.createOutgoing(assoc, null, info.streamNumber()); + bytes = serverChannel.send(buffer, sendInfo); debug("Server: sent " + bytes + "bytes"); /* TEST 6 */ diff --git a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java index be50b4efb2f..50741af3565 100644 --- a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java +++ b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java @@ -97,14 +97,19 @@ void doTest(int sendBufferSize, int recvBufferSize, boolean direct, int offset) new SendFailedNotificationHandler(); ByteBuffer recvBuffer = direct ? allocateDirect(recvBufferSize) : allocate((recvBufferSize)); - channel.receive(recvBuffer, null, handler); - - // verify sent buffer received by send failed notification - ByteBuffer buffer = handler.getSendFailedByteBuffer(); - check(buffer.remaining() == sent); - check(buffer.position() == 0); - check(buffer.limit() == sent); - assertSameContent(sendBuffer, handler.getSendFailedByteBuffer()); + MessageInfo info = channel.receive(recvBuffer, null, handler); + debug("receive returned info:" + info); + + if (handler.receivedSendFailed) { + // verify sent buffer received by send failed notification + ByteBuffer buffer = handler.getSendFailedByteBuffer(); + check(buffer.remaining() == sent); + check(buffer.position() == 0); + check(buffer.limit() == sent); + assertSameContent(sendBuffer, handler.getSendFailedByteBuffer()); + } else { + debug("Unexpected event or received data. Check output."); + } } } @@ -112,6 +117,7 @@ class SendFailedNotificationHandler extends AbstractNotificationHandler { /** Reference to the buffer captured in send failed notification */ private ByteBuffer sentBuffer; + boolean receivedSendFailed; @Override public HandlerResult handleNotification( @@ -134,6 +140,7 @@ public HandlerResult handleNotification( public HandlerResult handleNotification( SendFailedNotification notification, Object attachment) { debug("%nSendFailedNotification: %s. ", notification); + receivedSendFailed = true; sentBuffer = notification.buffer(); return HandlerResult.RETURN; } diff --git a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java index 250bf4c4d0a..20267aa6f16 100644 --- a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java +++ b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java @@ -154,7 +154,6 @@ void test(String[] args) { /* SCTP_PRIMARY_ADDR */ void sctpPrimaryAddr() throws IOException { - SocketAddress addrToSet = null; ByteBuffer buffer = ByteBuffer.allocate(Util.SMALL_BUFFER); System.out.println("TESTING SCTP_PRIMARY_ADDR"); @@ -189,12 +188,11 @@ void sctpPrimaryAddr() throws IOException { SctpChannel peerChannel = ssc.accept(); ssc.close(); - Set peerAddrs = peerChannel.getAllLocalAddresses(); - debug("Peer local Addresses: "); - for (Iterator it = peerAddrs.iterator(); it.hasNext(); ) { + Set remoteAddresses = smc.getRemoteAddresses(assoc); + debug("Remote Addresses: "); + for (Iterator it = remoteAddresses.iterator(); it.hasNext(); ) { InetSocketAddress addr = (InetSocketAddress)it.next(); debug("\t" + addr); - addrToSet = addr; // any of the peer addresses will do! } /* retrieval of SCTP_PRIMARY_ADDR is not supported on Solaris */ @@ -207,25 +205,21 @@ void sctpPrimaryAddr() throws IOException { } else { /* Linux */ SocketAddress primaryAddr = smc.getOption(SCTP_PRIMARY_ADDR, assoc); System.out.println("SCTP_PRIMARY_ADDR returned: " + primaryAddr); - /* Verify that this is one of the peer addresses */ - boolean found = false; - addrToSet = primaryAddr; // may not have more than one addr - for (Iterator it = peerAddrs.iterator(); it.hasNext(); ) { - InetSocketAddress addr = (InetSocketAddress)it.next(); - if (addr.equals(primaryAddr)) { - found = true; - } - addrToSet = addr; + /* Verify that this is one of the remote addresses */ + check(remoteAddresses.contains(primaryAddr), "SCTP_PRIMARY_ADDR returned bogus address!"); + + for (Iterator it = remoteAddresses.iterator(); it.hasNext(); ) { + InetSocketAddress addrToSet = (InetSocketAddress) it.next(); + System.out.println("SCTP_PRIMARY_ADDR try set to: " + addrToSet); + smc.setOption(SCTP_PRIMARY_ADDR, addrToSet, assoc); + System.out.println("SCTP_PRIMARY_ADDR set to : " + addrToSet); + primaryAddr = smc.getOption(SCTP_PRIMARY_ADDR, assoc); + System.out.println("SCTP_PRIMARY_ADDR returned : " + primaryAddr); + check(addrToSet.equals(primaryAddr), "SCTP_PRIMARY_ADDR not set correctly"); } - check(found, "SCTP_PRIMARY_ADDR returned bogus address!"); - - System.out.println("Try SCTP_PRIMARY_ADDR set to: " + addrToSet); - smc.setOption(SCTP_PRIMARY_ADDR, addrToSet, assoc); - System.out.println("SCTP_PRIMARY_ADDR set to: " + addrToSet); - primaryAddr = smc.getOption(SCTP_PRIMARY_ADDR, assoc); - System.out.println("SCTP_PRIMARY_ADDR returned: " + primaryAddr); - check(addrToSet.equals(primaryAddr),"SCTP_PRIMARY_ADDR not set correctly"); } + smc.close(); + peerChannel.close(); } class SOTNotificationHandler extends AbstractNotificationHandler From 0713dbb1ce95ba0d3b9c7331890cff1f73ddb1e0 Mon Sep 17 00:00:00 2001 From: Fei Yang Date: Tue, 12 Sep 2023 01:06:42 +0000 Subject: [PATCH 020/177] 8292713: Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses Reviewed-by: phh Backport-of: c0623972cffdbcd7f80e84a1ec344fd382a4a5cc --- src/hotspot/share/classfile/vmSymbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/classfile/vmSymbols.cpp b/src/hotspot/share/classfile/vmSymbols.cpp index 19fe196bc76..c1ba95578dc 100644 --- a/src/hotspot/share/classfile/vmSymbols.cpp +++ b/src/hotspot/share/classfile/vmSymbols.cpp @@ -716,6 +716,7 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) { case vmIntrinsics::_compareAndExchangeObject: case vmIntrinsics::_compareAndExchangeObjectAcquire: case vmIntrinsics::_compareAndExchangeObjectRelease: + case vmIntrinsics::_allocateInstance: if (!InlineUnsafeOps) return true; break; case vmIntrinsics::_getShortUnaligned: @@ -726,7 +727,6 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) { case vmIntrinsics::_putCharUnaligned: case vmIntrinsics::_putIntUnaligned: case vmIntrinsics::_putLongUnaligned: - case vmIntrinsics::_allocateInstance: if (!InlineUnsafeOps || !UseUnalignedAccesses) return true; break; case vmIntrinsics::_hashCode: From 0d9a364d00054c7565bd0c09b56803541fd56253 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 13 Sep 2023 20:54:29 +0000 Subject: [PATCH 021/177] 8306135: Clean up and open source some AWT tests Reviewed-by: mdoerr Backport-of: 4ad3ac6317f6fc95fdf0340885d4099e785132ad --- .../awt/Cursor/SingleColorCursorTest.java | 78 ++++++++ .../java/awt/Dialog/ComponentShownEvent.java | 93 +++++++++ .../Dialog/DialogAsParentOfFileDialog.java | 189 ++++++++++++++++++ 3 files changed, 360 insertions(+) create mode 100644 test/jdk/java/awt/Cursor/SingleColorCursorTest.java create mode 100644 test/jdk/java/awt/Dialog/ComponentShownEvent.java create mode 100644 test/jdk/java/awt/Dialog/DialogAsParentOfFileDialog.java diff --git a/test/jdk/java/awt/Cursor/SingleColorCursorTest.java b/test/jdk/java/awt/Cursor/SingleColorCursorTest.java new file mode 100644 index 00000000000..a35b13606dd --- /dev/null +++ b/test/jdk/java/awt/Cursor/SingleColorCursorTest.java @@ -0,0 +1,78 @@ +/* + * 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. + */ + +/* + @test + @bug 4653170 + @summary Make sure setCursor does not produce Arithmetic Exception. + @key headful + @run main SingleColorCursorTest +*/ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Cursor; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.lang.reflect.InvocationTargetException; + +public class SingleColorCursorTest extends Panel { + public void init() { + setLayout (new BorderLayout()); + setSize (200,200); + add(new Button("JButton")); + } + + public void start () { + Cursor singleColorCursor = Toolkit.getDefaultToolkit() + .createCustomCursor(new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_BINARY), + new Point(0,0), "Single Color Cursor"); + try { + setCursor(singleColorCursor); + } catch (ArithmeticException ae) { + throw new RuntimeException("Setting a 1x1 custom cursor causes arithmetic exception"); + } + } + + public static void main(String[] args) throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(() -> { + Frame frame = new Frame("Test window"); + try { + SingleColorCursorTest test = new SingleColorCursorTest(); + test.init(); + frame.add(test); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + test.start(); + frame.setVisible(false); + } finally { + frame.dispose(); + } + }); + } +} diff --git a/test/jdk/java/awt/Dialog/ComponentShownEvent.java b/test/jdk/java/awt/Dialog/ComponentShownEvent.java new file mode 100644 index 00000000000..ab1763f719d --- /dev/null +++ b/test/jdk/java/awt/Dialog/ComponentShownEvent.java @@ -0,0 +1,93 @@ +/* + * 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 + * 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 4274360 + @summary Ensures that Dialogs receive COMPONENT_SHOWN events + @key headful + @run main ComponentShownEvent +*/ + +import java.awt.AWTException; +import java.awt.Dialog; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.lang.reflect.InvocationTargetException; + +public class ComponentShownEvent { + + volatile boolean componentShown = false; + Frame f; + Dialog d; + + public void start() throws InterruptedException, + InvocationTargetException, AWTException { + Robot robot = new Robot(); + try { + EventQueue.invokeAndWait(() -> { + f = new Frame(); + d = new Dialog(f); + + d.addComponentListener(new ComponentAdapter() { + public void componentShown(ComponentEvent e) { + componentShown = true; + } + }); + + f.setSize(100, 100); + f.setLocationRelativeTo(null); + f.setVisible(true); + d.setVisible(true); + }); + + robot.waitForIdle(); + robot.delay(1000); + + if (!componentShown) { + throw new RuntimeException("test failed"); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (d != null) { + d.setVisible(false); + d.dispose(); + } + if (f != null) { + f.setVisible(false); + f.dispose(); + } + }); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, AWTException { + ComponentShownEvent test = new ComponentShownEvent(); + test.start(); + System.out.println("test passed"); + } +} diff --git a/test/jdk/java/awt/Dialog/DialogAsParentOfFileDialog.java b/test/jdk/java/awt/Dialog/DialogAsParentOfFileDialog.java new file mode 100644 index 00000000000..4cc8c83b517 --- /dev/null +++ b/test/jdk/java/awt/Dialog/DialogAsParentOfFileDialog.java @@ -0,0 +1,189 @@ +/* + * 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. + */ + +/* + @test + @bug 4221123 + @summary Why Dialog can't be an owner of FileDialog? + @key headful + @run main DialogAsParentOfFileDialog +*/ + +import java.awt.Dialog; +import java.awt.EventQueue; +import java.awt.FileDialog; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class DialogAsParentOfFileDialog { + FileDialog fdialog; + + public void start () { + StringBuilder errors = new StringBuilder(); + String nl = System.lineSeparator(); + Dialog dlg; + String title; + int mode; + boolean passed; + + System.out.println("DialogAsParentOfFileDialog"); + + /* + * public FileDialog(Dialog parent), + * checks owner and default settings. + */ + System.out.print("\ttest 01: "); + dlg = new Dialog(new Frame()); + fdialog = new FileDialog(dlg); + passed = + fdialog.getOwner() == dlg + && fdialog.isModal() + && fdialog.getTitle().equals("") + && fdialog.getMode() == FileDialog.LOAD + && fdialog.getFile() == null + && fdialog.getDirectory() == null + && fdialog.getFilenameFilter() == null; + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + /* + * public FileDialog(Dialog parent, String title), + * checks owner, title and default settings. + */ + System.out.print("\ttest 02: "); + dlg = new Dialog(new Frame()); + title = "Title"; + fdialog = new FileDialog(dlg, title); + passed = + fdialog.getOwner() == dlg + && fdialog.isModal() + && fdialog.getTitle().equals(title) + && fdialog.getMode() == FileDialog.LOAD + && fdialog.getFile() == null + && fdialog.getDirectory() == null + && fdialog.getFilenameFilter() == null; + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + /* + * public FileDialog(Dialog parent, String title), + * title: null. + * expected results: FileDialog object with a null title + */ + System.out.print("\ttest 03: "); + dlg = new Dialog(new Frame()); + title = null; + fdialog = new FileDialog(dlg, title); + passed = + fdialog.getOwner() == dlg + && (fdialog.getTitle() == null + || fdialog.getTitle().equals("")); + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + /* + * public FileDialog(Dialog parent, String title, int mode), + * checks owner, title and mode. + */ + dlg = new Dialog(new Frame()); + title = "Title"; + + System.out.print("\ttest 04: "); + mode = FileDialog.SAVE; + fdialog = new FileDialog(dlg, title, mode); + passed = + fdialog.getOwner() == dlg + && fdialog.isModal() + && fdialog.getTitle().equals(title) + && fdialog.getMode() == mode + && fdialog.getFile() == null + && fdialog.getDirectory() == null + && fdialog.getFilenameFilter() == null; + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + System.out.print("\ttest 05: "); + mode = FileDialog.LOAD; + fdialog = new FileDialog(dlg, title, mode); + passed = + fdialog.getOwner() == dlg + && fdialog.isModal() + && fdialog.getTitle().equals(title) + && fdialog.getMode() == mode + && fdialog.getFile() == null + && fdialog.getDirectory() == null + && fdialog.getFilenameFilter() == null; + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + /* + * public FileDialog(Dialog parent, String title, int mode), + * mode: Integer.MIN_VALUE, Integer.MIN_VALUE+1, + * Integer.MAX_VALUE-1, Integer.MAX_VALUE + * expected results: IllegalArgumentException should be thrown + */ + System.out.print("\ttest 06: "); + dlg = new Dialog(new Frame()); + title = "Title"; + int[] modes = {Integer.MIN_VALUE, Integer.MIN_VALUE+1, + Integer.MAX_VALUE-1, Integer.MAX_VALUE}; + passed = true; + for (int i = 0; i < modes.length; i++) { + try { + fdialog = new FileDialog(dlg, title, modes[i]); + passed = false; + } catch (IllegalArgumentException e) {} + } + System.out.println(passed ? "passed" : "FAILED"); + if (!passed) { + errors.append(nl); + errors.append("DialogAsParentOfFileDialog FAILED"); + } + + if (errors.length() > 0) { + throw new RuntimeException("Following tests failed:" + errors); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(() -> { + new DialogAsParentOfFileDialog().start(); + }); + } +} From 470789a62a9b269f4e33e759c24425e4d66a686a Mon Sep 17 00:00:00 2001 From: Chad Rakoczy Date: Wed, 13 Sep 2023 20:55:20 +0000 Subject: [PATCH 022/177] 8311813: C1: Uninitialized PhiResolver::_loop field Reviewed-by: shade Backport-of: 489a32fe40e2a2c539296d51d4ffc0abc036d33c --- src/hotspot/share/c1/c1_LIRGenerator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index f4b156d59b7..88f6d30697d 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -81,6 +81,7 @@ void PhiResolverState::reset(int max_vregs) { PhiResolver::PhiResolver(LIRGenerator* gen, int max_vregs) : _gen(gen) , _state(gen->resolver_state()) + , _loop(NULL) , _temp(LIR_OprFact::illegalOpr) { // reinitialize the shared state arrays From 3dd87610f95e309f6074e95bb6368ac46b0fa635 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 13 Sep 2023 20:57:09 +0000 Subject: [PATCH 023/177] 8306575: Clean up and open source four Dialog related tests Reviewed-by: mdoerr Backport-of: 8d696aea9e1cefca97a760c017a5fde545facaa9 --- .../java/awt/Dialog/DialogDeadlockTest.java | 129 +++++++++++++ .../java/awt/Dialog/DialogLocationTest.java | 176 ++++++++++++++++++ .../java/awt/Dialog/ModalDialogOnNonEdt.java | 136 ++++++++++++++ .../java/awt/Dialog/NewMessagePumpTest.java | 140 ++++++++++++++ 4 files changed, 581 insertions(+) create mode 100644 test/jdk/java/awt/Dialog/DialogDeadlockTest.java create mode 100644 test/jdk/java/awt/Dialog/DialogLocationTest.java create mode 100644 test/jdk/java/awt/Dialog/ModalDialogOnNonEdt.java create mode 100644 test/jdk/java/awt/Dialog/NewMessagePumpTest.java diff --git a/test/jdk/java/awt/Dialog/DialogDeadlockTest.java b/test/jdk/java/awt/Dialog/DialogDeadlockTest.java new file mode 100644 index 00000000000..87a929053c7 --- /dev/null +++ b/test/jdk/java/awt/Dialog/DialogDeadlockTest.java @@ -0,0 +1,129 @@ +/* + * 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 + * 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 5006427 + @summary Shows many modal dialog and checks if there is a deadlock or thread race. + @key headful + @run main DialogDeadlockTest +*/ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dialog; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Window; +import java.lang.reflect.InvocationTargetException; +import java.util.LinkedList; +import java.util.List; + +public class DialogDeadlockTest { + public static final int MAX_COUNT = 200; + private static Dialog lastDialog; + private static Runnable r; + private static volatile int count; + private static volatile int cumul; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + DialogDeadlockTest ddt = new DialogDeadlockTest(); + ddt.start(); + } + + public void start() { + final Frame frame = new Frame("abc"); + final List toDispose = new LinkedList<>(); + + try { + frame.setLocation(300, 0); + frame.add(new Button("def")); + frame.pack(); + frame.setVisible(true); + cumul = 0; + + r = new Runnable() { + public void run() { + count++; + if (count < 10) { + Dialog xlastDialog = lastDialog; + cumul += count; + Dialog d = new Dialog(frame, "Dialog " + + cumul, true); + d.setLayout(new BorderLayout()); + d.add(new Button("button " + count), BorderLayout.CENTER); + d.pack(); + toDispose.add(d); + lastDialog = d; + EventQueue.invokeLater(r); + d.setVisible(true); + if (xlastDialog != null) { + xlastDialog.setVisible(false); + } else { + if (cumul < MAX_COUNT) { + count = 0; + lastDialog = null; + EventQueue.invokeLater(r); + } + } + } else { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + lastDialog.setVisible(false); + lastDialog = null; + } + } + }; + try { + EventQueue.invokeAndWait(r); + } catch (InterruptedException ignore) { + } catch (Exception e) { + throw new RuntimeException("Unexpected exception: " + + e.getLocalizedMessage()); + } + while (cumul < MAX_COUNT - 1) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) {} + } + System.out.println("Test PASSED"); + } finally { + try { + EventQueue.invokeAndWait(() -> { + frame.setVisible(false); + frame.dispose(); + for (Window w: toDispose) { + w.dispose(); + } + }); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/test/jdk/java/awt/Dialog/DialogLocationTest.java b/test/jdk/java/awt/Dialog/DialogLocationTest.java new file mode 100644 index 00000000000..624db8ea7dd --- /dev/null +++ b/test/jdk/java/awt/Dialog/DialogLocationTest.java @@ -0,0 +1,176 @@ +/* + * 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 + * 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 4101437 + @summary Dialog.setLocation(int,int) works unstable when the dialog is visible + @key headful + @run main DialogLocationTest +*/ + +import java.awt.AWTException; +import java.awt.Container; +import java.awt.Dialog; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GraphicsEnvironment; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.lang.reflect.InvocationTargetException; +import java.util.Random; + +public class DialogLocationTest extends Panel { + private volatile int count = 0; + private Dialog my_dialog; + private volatile boolean waitingForEvent = false; + private volatile int newX, newY; + Random random = new Random(); + + public void init() { + Container f = getParent(); + + while (!(f instanceof Frame)) { + f = f.getParent(); + } + + my_dialog = new Dialog((Frame) f, "TestDialog"); + my_dialog.setSize(150, 100); + + setSize(200, 200); + } + + public void start() throws InterruptedException, + InvocationTargetException { + Robot robot; + try { + robot = new Robot(); + EventQueue.invokeAndWait(() -> { + my_dialog.setLocationRelativeTo(null); + my_dialog.setVisible(true); + }); + robot.waitForIdle(); + robot.delay(1000); + my_dialog.addComponentListener(new CL()); + setDialogLocation(my_dialog); + } catch (AWTException e) { + throw new RuntimeException(e); + } finally { + EventQueue.invokeAndWait(() -> { + my_dialog.setVisible(false); + my_dialog.dispose(); + }); + } + } + + public void setDialogLocation(Dialog dialog) { + int height, width, insetX, insetY; + Point curLoc; + int i; + + Rectangle screen = GraphicsEnvironment + .getLocalGraphicsEnvironment() + .getMaximumWindowBounds(); + height = screen.height; + width = screen.width; + insetX = screen.x; + insetY = screen.y; + + for (i = 0; i < 100; i++) { + newX = random.nextInt(width - 300 - insetX) + insetX; + newY = random.nextInt(height - 400 - insetY) + insetY; + + if (newX == 0 && newY == 0) { + i--; + continue; + } + + waitingForEvent = true; + + EventQueue.invokeLater(() -> { + dialog.setLocation(newX, newY); + }); + + while (waitingForEvent) { + Thread.yield(); + } + + curLoc = dialog.getLocation(); + if (curLoc.x != newX || curLoc.y != newY) { + count++; + System.out.println("Failed on iteration " + i + " expect:[" + newX + "," + newY + "] reported:[" + curLoc.x + "," + + curLoc.y + "] diff:[" + (curLoc.x - newX) + "," + (curLoc.y - newY) + "]"); + System.out.flush(); + } + } + + if (count > 0) { + throw new RuntimeException("Dialog Location was set incorrectly"); + } + } + + public class CL extends ComponentAdapter { + int lastX, lastY; + + public void componentMoved(ComponentEvent e) { + if (e.getComponent() == my_dialog) { + Point eventLoc = e.getComponent().getLocation(); + if (lastX != eventLoc.x || lastY != eventLoc.y) { + lastX = eventLoc.x; + lastY = eventLoc.y; + if (newX != 0 && newY != 0 && (eventLoc.x != newX || eventLoc.y != newY)) { + count++; + System.out.println("Failed in componentMoved() expect:[" + newX +"," + newY + "] reported: [" + + eventLoc.x + "," + eventLoc.y + "] diff [" + (eventLoc.x - newX) + "," + (eventLoc.y - newY) + "]"); + System.out.flush(); + } + waitingForEvent = false; + } + } + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + Frame frame = new Frame("DialogLocationTest"); + try { + DialogLocationTest test = new DialogLocationTest(); + EventQueue.invokeAndWait(() -> { + frame.add(test); + test.init(); + frame.setVisible(true); + }); + test.start(); + } finally { + EventQueue.invokeLater(() -> { + frame.setVisible(false); + frame.dispose(); + }); + } + } +} + diff --git a/test/jdk/java/awt/Dialog/ModalDialogOnNonEdt.java b/test/jdk/java/awt/Dialog/ModalDialogOnNonEdt.java new file mode 100644 index 00000000000..a7a9565d054 --- /dev/null +++ b/test/jdk/java/awt/Dialog/ModalDialogOnNonEdt.java @@ -0,0 +1,136 @@ +/* + * 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. + */ + +/* + @test + @bug 4636311 4645035 + @summary Modal dialog shown on EDT after modal dialog on EDT doesn't receive mouse events + @key headful + @run main ModalDialogOnNonEdt +*/ + +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.EventQueue; +import java.awt.Robot; +import java.awt.Point; +import java.awt.Dimension; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.AWTException; +import java.awt.event.MouseEvent; +import java.awt.event.MouseAdapter; +import java.util.ArrayList; +import java.util.List; + +public class ModalDialogOnNonEdt { + + public void start () { + ShowModalDialog showModalDialog = new ShowModalDialog(); + + try { + EventQueue.invokeLater(showModalDialog); + Robot robot = new Robot(); + robot.delay(2000); + + Point origin = ShowModalDialog.lastShownDialog.getLocationOnScreen(); + Dimension dim = ShowModalDialog.lastShownDialog.getSize(); + robot.mouseMove((int)origin.getX() + (int)dim.getWidth()/2, + (int)origin.getY() + (int)dim.getHeight()/2); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + robot.delay(2000); + if (ShowModalDialog.count < 2) { + throw new RuntimeException("TEST FAILED: second modal dialog was not shown"); + } + + /* click on second modal dialog to verify if it receives mouse events */ + synchronized (ShowModalDialog.monitor) { + origin = ShowModalDialog.lastShownDialog.getLocationOnScreen(); + dim = ShowModalDialog.lastShownDialog.getSize(); + robot.mouseMove((int)origin.getX() + (int)dim.getWidth()/2, + (int)origin.getY() + (int)dim.getHeight()/2); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + ShowModalDialog.monitor.wait(2000); + } + + if (ShowModalDialog.count < 3) { + throw new RuntimeException("TEST FAILED: second modal dialog didn't receive mouse events"); + } + + } catch (AWTException e) { + e.printStackTrace(); + throw new RuntimeException("Some AWTException occurred"); + } catch (InterruptedException e) { + e.printStackTrace(); + throw new RuntimeException("Test was interrupted"); + } finally { + for (Window w : ShowModalDialog.toDispose) { + w.setVisible(false); + w.dispose(); + } + } + + System.out.println("TEST PASSED"); + } + + public static void main(String[] args) { + new ModalDialogOnNonEdt().start(); + } +} + +class ShowModalDialog implements Runnable { + static volatile int count = 0; + static Object monitor = new Object(); + static Dialog lastShownDialog; + static List toDispose = new ArrayList<>(); + + public void run() { + count++; + Frame frame = new Frame("Frame #" + count); + toDispose.add(frame); + Dialog dialog = new Dialog(frame, "Modal Dialog #" + count, true); + dialog.setSize(100, 100); + dialog.setLocation(100, 100*count); + dialog.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent me) { + System.out.println(me.toString()); + if (ShowModalDialog.count < 2) { + Runnable runner = new ShowModalDialog(); + new Thread(runner).start(); + } else { + synchronized (monitor) { + ShowModalDialog.count++; + monitor.notifyAll(); + } + } + } + }); + lastShownDialog = dialog; + toDispose.add(dialog); + dialog.setVisible(true); + } +} diff --git a/test/jdk/java/awt/Dialog/NewMessagePumpTest.java b/test/jdk/java/awt/Dialog/NewMessagePumpTest.java new file mode 100644 index 00000000000..084d0f2e43c --- /dev/null +++ b/test/jdk/java/awt/Dialog/NewMessagePumpTest.java @@ -0,0 +1,140 @@ +/* + * 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 + * 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 4119383 + @summary Tests total rewrite of modality blocking model + @key headful + @run main/timeout=30 NewMessagePumpTest +*/ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; + +public class NewMessagePumpTest { + public void start() { + Frame1 frame = new Frame1(); + frame.validate(); + frame.setVisible(true); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + NewMessagePumpTest test = new NewMessagePumpTest(); + EventQueue.invokeAndWait(test::start); + } +} + +class Frame1 extends Frame { + Frame1() { + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void jbInit() throws Exception { + MyPanel panel1 = new MyPanel(this); + this.setLayout(new BorderLayout()); + this.setSize(new Dimension(400, 300)); + this.setLocationRelativeTo(null); + this.setTitle("Frame Title"); + panel1.setLayout(new BorderLayout()); + this.add(panel1, BorderLayout.CENTER); + } +} + +class Dialog1 extends Dialog { + BorderLayout borderLayout1 = new BorderLayout(); + Button button1 = new Button(); + + Dialog1(Frame f) { + super(f, true); + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + void jbInit() throws Exception { + button1.setLabel("close"); + button1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + button1_actionPerformed(e); + } + }); + this.setLayout(borderLayout1); + this.add(button1, BorderLayout.NORTH); + } + + void button1_actionPerformed(ActionEvent e) { + dispose(); + } +} + +class MyPanel extends Panel { + Frame frame; + + MyPanel(Frame f) { + frame = f; + } + + public void addNotify() { + super.addNotify(); + System.out.println("AddNotify bringing up modal dialog..."); + final Dialog1 dlg = new Dialog1(frame); + dlg.pack(); + new Thread(() -> { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + try { + EventQueue.invokeAndWait(() -> { + dlg.setVisible(false); + dlg.dispose(); + }); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + }).start(); + dlg.setVisible(true); + frame.setVisible(false); + frame.dispose(); + System.out.println("Test passed"); + } +} From 5c7ec0dea6751a256db2a7373420863040a21804 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Thu, 14 Sep 2023 15:31:56 +0000 Subject: [PATCH 024/177] 8315862: [11u] Backport 8227337: javax/management/remote/mandatory/connection/ReconnectTest.java NoSuchObjectException no such object in table Reviewed-by: mdoerr --- .../mandatory/connection/MultiThreadDeadLockTest.java | 7 +++++-- .../remote/mandatory/connection/ReconnectTest.java | 11 ++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java b/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java index 4f82efc7d54..a3d2d7f74eb 100644 --- a/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java +++ b/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,11 +40,14 @@ import javax.management.remote.JMXServiceURL; import javax.management.remote.rmi.RMIConnectorServer; +import jdk.test.lib.Utils; + /* * @test * @bug 6697180 * @summary test on a client notification deadlock. * @author Shanliang JIANG + * @library /test/lib * * @run clean MultiThreadDeadLockTest * @run build MultiThreadDeadLockTest @@ -53,7 +56,7 @@ public class MultiThreadDeadLockTest { - private static long serverTimeout = 500L; + private static long serverTimeout = Utils.adjustTimeout(500); public static void main(String[] args) throws Exception { print("Create the MBean server"); diff --git a/test/jdk/javax/management/remote/mandatory/connection/ReconnectTest.java b/test/jdk/javax/management/remote/mandatory/connection/ReconnectTest.java index 6c3ca9a1c67..3ace0ba5018 100644 --- a/test/jdk/javax/management/remote/mandatory/connection/ReconnectTest.java +++ b/test/jdk/javax/management/remote/mandatory/connection/ReconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,15 +26,16 @@ * @bug 4927217 * @summary test to reconnect * @author Shanliang JIANG - * + * @library /test/lib * @run clean ReconnectTest * @run build ReconnectTest * @run main ReconnectTest */ +import jdk.test.lib.Utils; + import java.util.*; import java.net.MalformedURLException; -import java.io.IOException; import javax.management.*; import javax.management.remote.*; @@ -46,7 +47,7 @@ public class ReconnectTest { private static HashMap env = new HashMap(2); static { - String timeout = "1000"; + String timeout = Long.toString(Utils.adjustTimeout(1000)); env.put("jmx.remote.x.server.connection.timeout", timeout); env.put("jmx.remote.x.client.connection.check.period", timeout); } @@ -104,7 +105,7 @@ private static boolean test(String proto) for (int i=0; i<3; i++) { System.out.println("************** Sleeping ...... "+i); - Thread.sleep(2000); + Thread.sleep(Utils.adjustTimeout(2000)); System.out.println("Sleep done."); System.out.println("The default domain is " From 22dd2d3801f2603b18b5da7b81afc2e4ee086f6e Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Thu, 14 Sep 2023 15:34:14 +0000 Subject: [PATCH 025/177] 8207166: jdk/jshell/JdiHangingLaunchExecutionControlTest.java - launch timeout Backport-of: c4612c12e63a2d8c79beacec528ea29bc8c1c058 --- test/langtools/jdk/jshell/HangingRemoteAgent.java | 11 +++++++---- .../jshell/JdiHangingLaunchExecutionControlTest.java | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/langtools/jdk/jshell/HangingRemoteAgent.java b/test/langtools/jdk/jshell/HangingRemoteAgent.java index e64f1c25ea3..515f98731a3 100644 --- a/test/langtools/jdk/jshell/HangingRemoteAgent.java +++ b/test/langtools/jdk/jshell/HangingRemoteAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -30,12 +30,15 @@ import jdk.jshell.spi.ExecutionControlProvider; /** - * Hang for three minutes (long enough to cause a timeout). + * HangingRemoteAgent main() runs in its loop for 2X the timeout + * we give the launcher to fail to attach. */ class HangingRemoteAgent extends RemoteExecutionControl { - private static final long DELAY = 4000L; - private static final int TIMEOUT = 2000; + private static float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0")); + + private static final int TIMEOUT = (int)(2000 * timeoutFactor); + private static final long DELAY = TIMEOUT * 2L; private static final boolean INFRA_VERIFY = false; public static void main(String[] args) throws Exception { diff --git a/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java b/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java index 44354c57433..577228d4820 100644 --- a/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java +++ b/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 8169519 + * @bug 8169519 8207166 * @summary Tests for JDI connector timeout failure * @modules jdk.jshell/jdk.jshell jdk.jshell/jdk.jshell.spi jdk.jshell/jdk.jshell.execution * @build HangingRemoteAgent From 94c048f909c7d9180266db526dc309cb4e2e8cef Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Thu, 14 Sep 2023 15:34:53 +0000 Subject: [PATCH 026/177] 8314094: java/lang/ProcessHandle/InfoTest.java fails on Windows when run as user with Administrator privileges Backport-of: 69c9ec92d04a399946b2157690a1dc3fec517329 --- .../jdk/java/lang/ProcessHandle/InfoTest.java | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/test/jdk/java/lang/ProcessHandle/InfoTest.java b/test/jdk/java/lang/ProcessHandle/InfoTest.java index e61b374e0cf..9901ee81592 100644 --- a/test/jdk/java/lang/ProcessHandle/InfoTest.java +++ b/test/jdk/java/lang/ProcessHandle/InfoTest.java @@ -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 @@ -39,12 +39,13 @@ import java.util.Random; import java.util.concurrent.TimeUnit; -import jdk.test.lib.Platform; -import jdk.test.lib.Utils; import org.testng.Assert; import org.testng.TestNG; import org.testng.annotations.Test; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + /* * @test * @bug 8077350 8081566 8081567 8098852 8136597 @@ -81,7 +82,6 @@ public class InfoTest { } // Main can be used to run the tests from the command line with only testng.jar. - @SuppressWarnings("raw_types") public static void main(String[] args) { Class[] testclass = {InfoTest.class}; TestNG testng = new TestNG(); @@ -160,11 +160,7 @@ public static void test2() { ProcessHandle.Info info = p1.info(); System.out.printf(" info: %s%n", info); - if (info.user().isPresent()) { - String user = info.user().get(); - Assert.assertNotNull(user, "User name"); - Assert.assertEquals(user, whoami, "User name"); - } + assertUser(info); Optional command = info.command(); if (command.isPresent()) { @@ -291,11 +287,8 @@ public static void test3() { ProcessHandle.Info info = p.info(); System.out.printf(" info: %s%n", info); - if (info.user().isPresent()) { - String user = info.user().get(); - Assert.assertNotNull(user); - Assert.assertEquals(user, whoami); - } + assertUser(info); + if (info.command().isPresent()) { String command = info.command().get(); String expected = "sleep"; @@ -397,7 +390,7 @@ public static void test5() { Instant end = Instant.now().plusMillis(500L); while (end.isBefore(Instant.now())) { // burn the cpu time checking the time - long x = r.nextLong(); + r.nextLong(); } if (self.info().totalCpuDuration().isPresent()) { Duration totalCpu = self.info().totalCpuDuration().get(); @@ -410,6 +403,7 @@ public static void test5() { } } } + /** * Check two Durations, the second should be greater than the first or * within the supplied Epsilon. @@ -443,4 +437,31 @@ static Process spawn(String command, String... args) throws IOException { pb.command(list); return pb.start(); } + + /** + * Asserts the expected process user. + * + * The Expected user is determined by creating a file and reading its owner, see static block above. + * + * On Windows, when run privileged as member of the Administrators group, this does not always + * work because new files can be owned by BUILTIN\Administrators instead, depending on system + * settings. In that case we resort to comparing System property user.name, which does not contain + * the domain name, though. + * + * @param info ProcessHanlde info object + */ + static void assertUser(ProcessHandle.Info info) { + if (!info.user().isPresent()) { + return; + } + String user = info.user().get(); + Assert.assertNotNull(user, "User name"); + if (Platform.isWindows() && "BUILTIN\\Administrators".equals(whoami)) { + int bsi = user.lastIndexOf("\\"); + Assert.assertEquals(bsi == -1 ? user : user.substring(bsi + 1), + System.getProperty("user.name"), "User name"); + } else { + Assert.assertEquals(user, whoami, "User name"); + } + } } From de3589ca473c141237449e378121f18c7aacaad9 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Thu, 14 Sep 2023 15:37:00 +0000 Subject: [PATCH 027/177] 8205467: javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java possible deadlock Backport-of: f243b281ea40c04ffbb60849844e1e4c3aa6f5cc --- .../remote/mandatory/connection/MultiThreadDeadLockTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java b/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java index a3d2d7f74eb..fe308327553 100644 --- a/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java +++ b/test/jdk/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java @@ -125,7 +125,7 @@ public static void main(String[] args) throws Exception { StateMachine.setState(CREATE_SOCKET); print("Check whether the user thread gets free to call the mbean."); - if (!ut.waitDone(5000)) { + if (!ut.waitDone(Utils.adjustTimeout(5000))) { throw new RuntimeException("Possible deadlock!"); } From 6fe81727d87b33acd33b96e9b87a167713f8d608 Mon Sep 17 00:00:00 2001 From: Ao Qi Date: Fri, 15 Sep 2023 07:45:21 +0000 Subject: [PATCH 028/177] 8315020: The macro definition for LoongArch64 zero build is not accurate. Reviewed-by: fyang Backport-of: 725ec0ce1b463b21cd4c5287cf4ccbee53ec7349 --- make/autoconf/platform.m4 | 2 ++ src/hotspot/os/linux/os_linux.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4 index 26a58eb2ee8..5d1d9efa399 100644 --- a/make/autoconf/platform.m4 +++ b/make/autoconf/platform.m4 @@ -566,6 +566,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], HOTSPOT_$1_CPU_DEFINE=S390 elif test "x$OPENJDK_$1_CPU" = xriscv64; then HOTSPOT_$1_CPU_DEFINE=RISCV + elif test "x$OPENJDK_$1_CPU" = xloongarch64; then + HOTSPOT_$1_CPU_DEFINE=LOONGARCH64 elif test "x$OPENJDK_$1_CPU" != x; then HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z) fi diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 3799adf5dd9..7e6580e8eed 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2051,11 +2051,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { static Elf32_Half running_arch_code=EM_SH; #elif (defined RISCV) static Elf32_Half running_arch_code=EM_RISCV; -#elif (defined LOONGARCH) +#elif (defined LOONGARCH64) static Elf32_Half running_arch_code=EM_LOONGARCH; #else #error Method os::dll_load requires that one of following is defined:\ - AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc + AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc #endif // Identify compatability class for VM's architecture and library's architecture From 723c0c0163a2b4f59960b241abaabfc03017ad05 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 18 Sep 2023 15:04:26 +0000 Subject: [PATCH 029/177] 8195589: T6587786.java failed after JDK-8189997 Backport-of: 21b62fef335aa981a239415532fa8b804fb5676d --- test/langtools/ProblemList.txt | 1 - test/langtools/tools/javap/T6587786.java | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/langtools/ProblemList.txt b/test/langtools/ProblemList.txt index 847d4f69391..9ad2b728dcd 100644 --- a/test/langtools/ProblemList.txt +++ b/test/langtools/ProblemList.txt @@ -60,7 +60,6 @@ tools/javac/importscope/T8193717.java # javap tools/javap/output/RepeatingTypeAnnotations.java 8057687 generic-all emit correct byte code an attributes for type annotations -tools/javap/T6587786.java 8195589 generic-all T6587786.java failed after JDK-8189997 ########################################################################### # diff --git a/test/langtools/tools/javap/T6587786.java b/test/langtools/tools/javap/T6587786.java index 950ff20a463..4cb1acf5b1f 100644 --- a/test/langtools/tools/javap/T6587786.java +++ b/test/langtools/tools/javap/T6587786.java @@ -36,18 +36,21 @@ public static void main(String[] args) throws Exception { } public void run() throws IOException { - javap("com.sun.javadoc.Doc", "com.sun.crypto.provider.ai"); - javap("com.sun.crypto.provider.ai", "com.sun.javadoc.ClassDoc"); + javap("jdk.javadoc.doclet.Doclet", "java.util.List"); + javap("java.util.List", "jdk.javadoc.doclet.StandardDoclet"); } void javap(String... args) { StringWriter sw = new StringWriter(); PrintWriter out = new PrintWriter(sw); //sun.tools.javap.Main.entry(args); - int rc = com.sun.tools.javap.Main.run(args, out); - if (rc != 0) - throw new Error("javap failed. rc=" + rc); - out.close(); - System.out.println(sw.toString()); + try { + int rc = com.sun.tools.javap.Main.run(args, out); + if (rc != 0) + throw new Error("javap failed. rc=" + rc); + } finally { + out.close(); + System.out.println(sw.toString()); + } } } From d52e9ed182b0d1801da72d194a9b4108bf12c322 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Wed, 20 Sep 2023 10:37:04 +0000 Subject: [PATCH 030/177] 8316380: [11u] Backport 8170089: nsk/jdi/EventSet/resume/resume008: ERROR: suspendCounts don't match for : Common-Cleaner Reviewed-by: mbaesken --- .../nsk/jdi/EventSet/resume/resume001.java | 31 ++- .../nsk/jdi/EventSet/resume/resume001a.java | 17 +- .../nsk/jdi/EventSet/resume/resume002.java | 28 ++- .../nsk/jdi/EventSet/resume/resume002a.java | 22 +- .../nsk/jdi/EventSet/resume/resume003.java | 29 ++- .../nsk/jdi/EventSet/resume/resume003a.java | 21 +- .../nsk/jdi/EventSet/resume/resume004.java | 28 ++- .../nsk/jdi/EventSet/resume/resume004a.java | 19 +- .../nsk/jdi/EventSet/resume/resume005.java | 28 ++- .../nsk/jdi/EventSet/resume/resume005a.java | 20 +- .../nsk/jdi/EventSet/resume/resume006.java | 28 ++- .../nsk/jdi/EventSet/resume/resume006a.java | 22 +- .../nsk/jdi/EventSet/resume/resume007.java | 28 ++- .../nsk/jdi/EventSet/resume/resume007a.java | 20 +- .../nsk/jdi/EventSet/resume/resume008.java | 190 +++++++++++------- .../nsk/jdi/EventSet/resume/resume008a.java | 90 ++++----- .../nsk/jdi/EventSet/resume/resume009.java | 31 ++- .../nsk/jdi/EventSet/resume/resume009a.java | 16 +- .../nsk/jdi/EventSet/resume/resume010.java | 28 ++- .../nsk/jdi/EventSet/resume/resume010a.java | 22 +- 20 files changed, 526 insertions(+), 192 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001.java index 45cad0aaef4..1a6697271c6 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001.java @@ -50,9 +50,9 @@ * To check up on the method, a debugger, * upon getting new set for ClassPrepareEvent, * suspends VM with the method VirtualMachine.suspend(), - * gets the List of geduggee's threads calling VM.allThreads(), + * gets the List of debuggee's threads calling VM.allThreads(), * invokes the method EventSet.resume(), and - * gets another List of geduggee's threads. + * gets another List of debuggee's threads. * The debugger then compares values of * each thread's suspendCount from first and second Lists. * @@ -63,6 +63,13 @@ * making special clases loaded and prepared to create the Events * - Upon getting the Events, * the debugger performs the check required. + * - The debugger informs the debuggee when it completes + * each test case, so it will wait before hitting + * communication breakpoints. + * This prevents the breakpoint SUSPEND_ALL policy + * disrupting the first test case check for + * SUSPEND_NONE, if the debuggee gets ahead of + * the debugger processing. */ public class resume001 extends TestDebuggerType1 { @@ -233,6 +240,7 @@ protected void testRun() { default: throw new Failure("** default case 1 **"); } + informDebuggeeTestCase(i); } display("......--> vm.resume()"); @@ -261,5 +269,22 @@ private ClassPrepareRequest settingClassPrepareRequest ( String testedClass, throw new Failure("** FAILURE to set up ClassPrepareRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001a.java index da96c913ec3..f0b118a4034 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume001a.java @@ -33,7 +33,7 @@ public class resume001a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -57,6 +57,7 @@ private static void logErr(String message) { static int exitCode = PASSED; + static int testCase = -1; static int instruction = 1; static int end = 0; // static int quit = 0; @@ -100,6 +101,10 @@ public static void main (String argv[]) { case 0: TestClass2 obj2 = new TestClass2(); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); + break; case 1: @@ -119,6 +124,16 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class TestClass2 { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java index fe456247eca..808c6a0c8c8 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume002 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume002 ", sHeader2 = "--> debugger: ", @@ -503,6 +503,7 @@ private void testRun() log2("......--> vm.resume()"); vm.resume(); + informDebuggeeTestCase(i); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } log1(" TESTING ENDS"); @@ -642,5 +643,22 @@ private AccessWatchpointRequest settingAccessWatchpointRequest ( throw new JDITestRuntimeException("** FAILURE to set up AccessWatchpointRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002a.java index fe219b453a7..b2d06cc2f3c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002a.java @@ -33,7 +33,7 @@ public class resume002a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -41,6 +41,7 @@ public class resume002a { static ArgumentHandler argHandler; static Log log; + static int testCase = -1; //-------------------------------------------------- log procedures @@ -98,8 +99,12 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume002aTestClass.method(); - break; + case 0: + resume002aTestClass.method(); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); + break; case 1: resume002aTestClass.method(); break; @@ -118,6 +123,17 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } + } class resume002aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java index 0b985421c6f..45e470f5359 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume003 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume003 ", sHeader2 = "--> debugger: ", @@ -503,6 +503,8 @@ private void testRun() log2("......--> vm.resume()"); vm.resume(); + informDebuggeeTestCase(i); + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } log1(" TESTING ENDS"); @@ -642,5 +644,22 @@ private ModificationWatchpointRequest settingModificationWatchpointRequest ( throw new JDITestRuntimeException("** FAILURE to set up ModificationWatchpointRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003a.java index 2bb0df34fc1..11b0f07dd41 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003a.java @@ -33,7 +33,8 @@ public class resume003a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section + static int testCase = -1; static final int PASSED = 0; static final int FAILED = 2; @@ -98,8 +99,12 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume003aTestClass.method(); - break; + case 0: + resume003aTestClass.method(); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); + break; case 1: resume003aTestClass.method(); break; @@ -118,6 +123,16 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume003aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java index 3f185107ea7..4ebfb3ff30f 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume004 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume004 ", sHeader2 = "--> debugger: ", @@ -493,6 +493,7 @@ private void testRun() default: throw new JDITestRuntimeException("** default case 1 **"); } + informDebuggeeTestCase(i); } log2("......--> vm.resume()"); @@ -638,5 +639,22 @@ private BreakpointRequest settingBreakpointRequest ( ThreadReference thread, throw new JDITestRuntimeException("** FAILURE to set up BreakpointRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004a.java index 56712b489b7..bb32b5bf6ed 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004a.java @@ -33,7 +33,8 @@ public class resume004a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section + static int testCase = -1; static final int PASSED = 0; static final int FAILED = 2; @@ -98,8 +99,10 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume004aTestClass.method(); - break; + case 0: + resume004aTestClass.method(); + waitForTestCase(0); + break; case 1: resume004aTestClass.method(); break; @@ -118,6 +121,16 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume004aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java index 0705c3929ae..11b0ab2561b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume005 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume005 ", sHeader2 = "--> debugger: ", @@ -493,6 +493,7 @@ private void testRun() default: throw new JDITestRuntimeException("** default case 1 **"); } + informDebuggeeTestCase(i); } log2("......--> vm.resume()"); @@ -634,5 +635,22 @@ private ExceptionRequest settingExceptionRequest ( ThreadReference thread, throw new JDITestRuntimeException("** FAILURE to set up ExceptionRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005a.java index bdd8b54d1b7..37a0b213bf7 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005a.java @@ -33,7 +33,8 @@ public class resume005a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section + static int testCase = -1; static final int PASSED = 0; static final int FAILED = 2; @@ -98,8 +99,10 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume005aTestClass.method(); - break; + case 0: + resume005aTestClass.method(); + waitForTestCase(0); + break; case 1: resume005aTestClass.method(); break; @@ -122,7 +125,16 @@ public static void main (String argv[]) { public static void nullMethod() { throw new NullPointerException("test"); } - + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume005aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java index ba2b22abaa0..50df1acfedb 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume006 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume006 ", sHeader2 = "--> debugger: ", @@ -495,6 +495,7 @@ private void testRun() log2("......--> vm.resume()"); vm.resume(); + informDebuggeeTestCase(i); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } log1(" TESTING ENDS"); @@ -632,5 +633,22 @@ private MethodEntryRequest settingMethodEntryRequest ( ThreadReference thread, throw new JDITestRuntimeException("** FAILURE to set up MethodEntryRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006a.java index ab7677e13fc..3b2332bb8a0 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006a.java @@ -33,7 +33,7 @@ public class resume006a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -41,6 +41,7 @@ public class resume006a { static ArgumentHandler argHandler; static Log log; + static int testCase = -1; //-------------------------------------------------- log procedures @@ -98,8 +99,12 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume006aTestClass.method(); - break; + case 0: + resume006aTestClass.method(); + // Wait for debugger to complete the first test case + // before advancing to the next breakpoint + waitForTestCase(0); + break; case 1: resume006aTestClass.method(); break; @@ -118,7 +123,16 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } - + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume006aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java index ced07a24a09..cc0a3e4b256 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume007 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = Consts.TEST_PASSED; static final int FAILED = Consts.TEST_FAILED; static final int PASS_BASE = Consts.JCK_STATUS_BASE; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume007 ", sHeader2 = "--> debugger: ", @@ -490,6 +490,7 @@ private void testRun() default: throw new JDITestRuntimeException("** default case 1 **"); } + informDebuggeeTestCase(i); } log2("......--> vm.resume()"); @@ -631,5 +632,22 @@ private MethodExitRequest settingMethodExitRequest ( ThreadReference thread, throw new JDITestRuntimeException("** FAILURE to set up MethodExitRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007a.java index a70a4e80246..912a97aa4aa 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007a.java @@ -33,7 +33,8 @@ public class resume007a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section + static int testCase = -1; static final int PASSED = 0; static final int FAILED = 2; @@ -98,8 +99,10 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume007aTestClass.method(); - break; + case 0: + resume007aTestClass.method(); + waitForTestCase(0); + break; case 1: resume007aTestClass.method(); break; @@ -118,7 +121,16 @@ public static void main (String argv[]) { log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } - + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume007aTestClass { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008.java index c011dcd7974..a745f0e40f7 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008.java @@ -50,9 +50,9 @@ * To check up on the method, a debugger, * upon getting new set for the EventSet, * suspends VM with the method VirtualMachine.suspend(), - * gets the List of geduggee's threads calling VM.allThreads(), + * gets the List of debuggee's threads calling VM.allThreads(), * invokes the method EventSet.resume(), and - * gets another List of geduggee's threads. + * gets another List of debuggee's threads. * The debugger then compares values of * each thread's suspendCount from first and second Lists. * @@ -63,6 +63,13 @@ * to be resulting in the event. * - Upon getting new event, the debugger * performs the check corresponding to the event. + * - The debugger informs the debuggee when it completes + * each test case, so it will wait before hitting + * communication breakpoints. + * This prevents the breakpoint SUSPEND_ALL policy + * disrupting the first test case check for + * SUSPEND_NONE, if the debuggee gets ahead of + * the debugger processing. */ public class resume008 extends TestDebuggerType1 { @@ -124,7 +131,9 @@ protected void testRun() { } display("......waiting for new ThreadStartEvent : " + i); - EventSet eventSet = eventHandler.waitForRequestedEventSet(new EventRequest[]{eventRequest}, waitTime, true); + EventSet eventSet = eventHandler + .waitForRequestedEventSet(new EventRequest[]{eventRequest}, + waitTime, true); EventIterator eventIterator = eventSet.eventIterator(); Event newEvent = eventIterator.nextEvent(); @@ -134,7 +143,8 @@ protected void testRun() { } else { String property = (String) newEvent.request().getProperty("number"); - display(" got new ThreadStartEvent with propety 'number' == " + property); + display(" got new ThreadStartEvent with propety 'number' == " + + property); display("......checking up on EventSet.resume()"); display("......--> vm.suspend();"); @@ -144,7 +154,8 @@ protected void testRun() { Map suspendsCounts1 = new HashMap(); for (ThreadReference threadReference : vm.allThreads()) { - suspendsCounts1.put(threadReference.name(), threadReference.suspendCount()); + suspendsCounts1.put(threadReference.name(), + threadReference.suspendCount()); } display(suspendsCounts1.toString()); @@ -154,7 +165,8 @@ protected void testRun() { display(" getting : Map suspendsCounts2"); Map suspendsCounts2 = new HashMap(); for (ThreadReference threadReference : vm.allThreads()) { - suspendsCounts2.put(threadReference.name(), threadReference.suspendCount()); + suspendsCounts2.put(threadReference.name(), + threadReference.suspendCount()); } display(suspendsCounts2.toString()); @@ -163,85 +175,90 @@ protected void testRun() { switch (policy) { - case SUSPEND_NONE : - display(" case SUSPEND_NONE"); - for (String threadName : suspendsCounts1.keySet()) { - display(" checking " + threadName); - if (!suspendsCounts2.containsKey(threadName)) { - complain("ERROR: couldn't get ThreadReference for " + threadName); - testExitCode = TEST_FAILED; - break; - } - int count1 = suspendsCounts1.get(threadName); - int count2 = suspendsCounts2.get(threadName); - if (count1 != count2) { - complain("ERROR: suspendCounts don't match for : " + threadName); - complain("before resuming : " + count1); - complain("after resuming : " + count2); - testExitCode = TEST_FAILED; - break; - } - } - break; - - case SUSPEND_THREAD : - display(" case SUSPEND_THREAD"); - for (String threadName : suspendsCounts1.keySet()) { - display("checking " + threadName); - if (!suspendsCounts2.containsKey(threadName)) { - complain("ERROR: couldn't get ThreadReference for " + threadName); - testExitCode = TEST_FAILED; - break; - } - int count1 = suspendsCounts1.get(threadName); - int count2 = suspendsCounts2.get(threadName); - String eventThreadName = ((ThreadStartEvent)newEvent).thread().name(); - int expectedValue = count2 + (eventThreadName.equals(threadName) ? 1 : 0); - if (count1 != expectedValue) { - complain("ERROR: suspendCounts don't match for : " + threadName); - complain("before resuming : " + count1); - complain("after resuming : " + count2); - testExitCode = TEST_FAILED; - break; - } - } - break; - - case SUSPEND_ALL : - - display(" case SUSPEND_ALL"); - for (String threadName : suspendsCounts1.keySet()) { - display("checking " + threadName); - - if (!newEvent.request().equals(eventRequest)) - break; - if (!suspendsCounts2.containsKey(threadName)) { - complain("ERROR: couldn't get ThreadReference for " + threadName); - testExitCode = TEST_FAILED; - break; - } - int count1 = suspendsCounts1.get(threadName); - int count2 = suspendsCounts2.get(threadName); - if (count1 != count2 + 1) { - complain("ERROR: suspendCounts don't match for : " + threadName); - complain("before resuming : " + count1); - complain("after resuming : " + count2); - testExitCode = TEST_FAILED; - break; - } + case SUSPEND_NONE : + display(" case SUSPEND_NONE"); + for (String threadName : suspendsCounts1.keySet()) { + display(" checking " + threadName); + if (!suspendsCounts2.containsKey(threadName)) { + complain("ERROR: couldn't get ThreadReference for " + + threadName); + testExitCode = TEST_FAILED; + break; } - break; - - default: throw new Failure("** default case 1 **"); + int count1 = suspendsCounts1.get(threadName); + int count2 = suspendsCounts2.get(threadName); + if (count1 != count2) { + complain("ERROR: suspendCounts don't match for : " + + threadName); + complain("before resuming : " + count1); + complain("after resuming : " + count2); + testExitCode = TEST_FAILED; + break; + } + } + break; + + case SUSPEND_THREAD : + display(" case SUSPEND_THREAD"); + for (String threadName : suspendsCounts1.keySet()) { + display("checking " + threadName); + if (!suspendsCounts2.containsKey(threadName)) { + complain("ERROR: couldn't get ThreadReference for " + + threadName); + testExitCode = TEST_FAILED; + break; + } + int count1 = suspendsCounts1.get(threadName); + int count2 = suspendsCounts2.get(threadName); + String eventThreadName = ((ThreadStartEvent)newEvent) + .thread().name(); + int expectedValue = count2 + + (eventThreadName.equals(threadName) ? 1 : 0); + if (count1 != expectedValue) { + complain("ERROR: suspendCounts don't match for : " + + threadName); + complain("before resuming : " + count1); + complain("after resuming : " + count2); + testExitCode = TEST_FAILED; + break; + } + } + break; + + case SUSPEND_ALL : + display(" case SUSPEND_ALL"); + for (String threadName : suspendsCounts1.keySet()) { + display("checking " + threadName); + if (!newEvent.request().equals(eventRequest)) + break; + if (!suspendsCounts2.containsKey(threadName)) { + complain("ERROR: couldn't get ThreadReference for " + + threadName); + testExitCode = TEST_FAILED; + break; + } + int count1 = suspendsCounts1.get(threadName); + int count2 = suspendsCounts2.get(threadName); + if (count1 != count2 + 1) { + complain("ERROR: suspendCounts don't match for : " + + threadName); + complain("before resuming : " + count1); + complain("after resuming : " + count2); + testExitCode = TEST_FAILED; + break; + } + } + break; + default: throw new Failure("** default case 1 **"); } - } + informDebuggeeTestCase(i); + } display("......--> vm.resume()"); vm.resume(); } return; } - private ThreadStartRequest settingThreadStartRequest(int suspendPolicy, String property) { try { @@ -254,5 +271,22 @@ private ThreadStartRequest settingThreadStartRequest(int suspendPolicy, throw new Failure("** FAILURE to set up ThreadStartRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008a.java index 8f0790dfef7..fb3c6ca6df0 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008a.java @@ -33,7 +33,7 @@ public class resume008a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -62,6 +62,7 @@ private static void logErr(String message) { static int exitCode = PASSED; + static int testCase = -1; static int instruction = 1; static int end = 0; // static int quit = 0; @@ -70,6 +71,7 @@ private static void logErr(String message) { static int lineForComm = 2; + // Debugger sets a breakpoint here to track debuggee private static void methodForCommunication() { int i1 = instruction; int i2 = i1; @@ -85,47 +87,38 @@ public static void main (String argv[]) { log1("debuggee started!"); label0: - for (int i = 0; ; i++) { - - if (instruction > maxInstr) { - logErr("ERROR: unexpected instruction: " + instruction); - exitCode = FAILED; - break ; - } - - switch (i) { - + for (int i = 0; ; i++) { + if (instruction > maxInstr) { + logErr("ERROR: unexpected instruction: " + instruction); + exitCode = FAILED; + break ; + } + switch (i) { //------------------------------------------------------ section tested - - case 0: - thread0 = new Threadresume008a("thread0"); - methodForCommunication(); - - threadStart(thread0); - - thread1 = new Threadresume008a("thread1"); - methodForCommunication(); - break; - - case 1: - threadStart(thread1); - - thread2 = new Threadresume008a("thread2"); - methodForCommunication(); - break; - - case 2: - threadStart(thread2); - - //------------------------------------------------- standard end section - - default: - instruction = end; - methodForCommunication(); - break label0; - } + case 0: + thread0 = new Threadresume008a("thread0"); + methodForCommunication(); + threadStart(thread0); + thread1 = new Threadresume008a("thread1"); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); + methodForCommunication(); + break; + case 1: + threadStart(thread1); + thread2 = new Threadresume008a("thread2"); + methodForCommunication(); + break; + case 2: + threadStart(thread2); + //------------------------------------------------- standard end section + default: + instruction = end; + methodForCommunication(); + break label0; } - + } log1("debuggee exits"); System.exit(exitCode + PASS_BASE); } @@ -145,24 +138,29 @@ static int threadStart(Thread t) { } return PASSED; } - + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } static class Threadresume008a extends Thread { - String tName = null; - public Threadresume008a(String threadName) { super(threadName); tName = threadName; } - public void run() { log1(" 'run': enter :: threadName == " + tName); synchronized (waitnotifyObj) { - waitnotifyObj.notify(); + waitnotifyObj.notify(); } log1(" 'run': exit :: threadName == " + tName); return; } } - } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009.java index 5fbee4c1a35..5ab5c979474 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009.java @@ -50,9 +50,9 @@ * To check up on the method, a debugger, * upon getting new set for the EventSet, * suspends VM with the method VirtualMachine.suspend(), - * gets the List of geduggee's threads calling VM.allThreads(), + * gets the List of debuggee's threads calling VM.allThreads(), * invokes the method EventSet.resume(), and - * gets another List of geduggee's threads. + * gets another List of debuggee's threads. * The debugger then compares values of * each thread's suspendCount from first and second Lists. * @@ -63,6 +63,13 @@ * to be resulting in the event. * - Upon getting new event, the debugger * performs the check corresponding to the event. + * - The debugger informs the debuggee when it completes + * each test case, so it will wait before hitting + * communication breakpoints. + * This prevents the breakpoint SUSPEND_ALL policy + * disrupting the first test case check for + * SUSPEND_NONE, if the debuggee gets ahead of + * the debugger processing. */ public class resume009 extends TestDebuggerType1 { @@ -233,6 +240,7 @@ protected void testRun() { default: throw new Failure("** default case 1 **"); } + informDebuggeeTestCase(i); } display("......--> vm.resume()"); @@ -253,5 +261,22 @@ private ThreadDeathRequest settingThreadDeathRequest(int suspendPolicy, throw new Failure("** FAILURE to set up ThreadDeathRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009a.java index 8b93e8a079f..4fbf8d0d2f5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009a.java @@ -33,7 +33,7 @@ public class resume009a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -62,6 +62,7 @@ private static void logErr(String message) { static int exitCode = PASSED; + static int testCase = -1; static int instruction = 1; static int end = 0; // static int quit = 0; @@ -104,6 +105,9 @@ public static void main (String argv[]) { threadRun(thread0); thread1 = new Threadresume009a("thread1"); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); methodForCommunication(); break; @@ -152,6 +156,16 @@ static int threadRun(Thread t) { } return PASSED; } + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } static class Threadresume009a extends Thread { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java index 5940e5e9a4e..8e6aa77a4e5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java @@ -48,9 +48,9 @@ * To check up on the method, a debugger,
* upon getting new set for the EventSet,
* suspends VM with the method VirtualMachine.suspend(),
- * gets the List of geduggee's threads calling VM.allThreads(),
+ * gets the List of debuggee's threads calling VM.allThreads(),
* invokes the method EventSet.resume(), and
- * gets another List of geduggee's threads.
+ * gets another List of debuggee's threads.
* The debugger then compares values of
* each thread's suspendCount from first and second Lists.
*
@@ -87,12 +87,12 @@ public class resume010 { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; static final int PASS_BASE = 95; - //----------------------------------------------------- templete parameters + //----------------------------------------------------- template parameters static final String sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume010 ", sHeader2 = "--> debugger: ", @@ -488,6 +488,7 @@ private void testRun() default: throw new JDITestRuntimeException("** default case 1 **"); } + informDebuggeeTestCase(i); } log2("......--> vm.resume()"); @@ -627,5 +628,22 @@ private StepRequest settingStepRequest ( ThreadReference thread, throw new JDITestRuntimeException("** FAILURE to set up StepRequest **"); } } - + /** + * Inform debuggee which thread test the debugger has completed. + * Used for synchronization, so the debuggee does not move too quickly. + * @param testCase index of just completed test + */ + void informDebuggeeTestCase(int testCase) { + try { + ((ClassType)debuggeeClass) + .setValue(debuggeeClass.fieldByName("testCase"), + vm.mirrorOf(testCase)); + } catch (InvalidTypeException ite) { + throw new Failure("** FAILURE setting testCase **"); + } catch (ClassNotLoadedException cnle) { + throw new Failure("** FAILURE notifying debuggee **"); + } catch (VMDisconnectedException e) { + throw new Failure("** FAILURE debuggee connection **"); + } + } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010a.java index d3a6a084fee..1e59c76fa49 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010a.java @@ -33,7 +33,7 @@ public class resume010a { - //----------------------------------------------------- templete section + //----------------------------------------------------- template section static final int PASSED = 0; static final int FAILED = 2; @@ -60,6 +60,7 @@ private static void logErr(String message) { static int exitCode = PASSED; + static int testCase = -1; static int instruction = 1; static int end = 0; // static int quit = 0; @@ -98,8 +99,12 @@ public static void main (String argv[]) { //------------------------------------------------------ section tested - case 0: resume010aTestClass.method(); - break; + case 0: + resume010aTestClass.method(); + // Wait for debugger to complete the first test case + // before advancing to the first breakpoint + waitForTestCase(0); + break; case 1: resume010aTestClass.method(); break; @@ -117,7 +122,16 @@ public static void main (String argv[]) { System.exit(exitCode + PASS_BASE); } - + // Synchronize with debugger progression. + static void waitForTestCase(int t) { + while (testCase < t) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignored + } + } + } } class resume010aTestClass { From 70862e011ba642a782cf28004d2f9dd807971788 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 20 Sep 2023 13:57:35 +0000 Subject: [PATCH 031/177] 8315863: [GHA] Update checkout action to use v4 Reviewed-by: clanger Backport-of: b74805d38395ca8be9308d882bf6b84e93714849 --- .github/actions/get-jtreg/action.yml | 2 +- .github/workflows/build-cross-compile.yml | 2 +- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-windows.yml | 2 +- .github/workflows/test.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/get-jtreg/action.yml b/.github/actions/get-jtreg/action.yml index 7c49b1054ec..1a6ffeb126b 100644 --- a/.github/actions/get-jtreg/action.yml +++ b/.github/actions/get-jtreg/action.yml @@ -47,7 +47,7 @@ runs: key: jtreg-${{ steps.version.outputs.value }} - name: 'Checkout the JTReg source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: openjdk/jtreg ref: jtreg-${{ steps.version.outputs.value }} diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index bbd9a81add7..88251fded11 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -79,7 +79,7 @@ jobs: steps: - name: 'Checkout the JDK source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Get the BootJDK' id: bootjdk diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 8ebf9744955..646ac5ed3a6 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -78,7 +78,7 @@ jobs: steps: - name: 'Checkout the JDK source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Get the BootJDK' id: bootjdk diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index b8fc0abcd8a..414c07a8080 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -68,7 +68,7 @@ jobs: steps: - name: 'Checkout the JDK source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Get the BootJDK' id: bootjdk diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index ee8da06e740..b85feef030a 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -79,7 +79,7 @@ jobs: steps: - name: 'Checkout the JDK source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Get MSYS2' uses: ./.github/actions/get-msys2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ac6708f9e0..351eb1f6605 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,7 +100,7 @@ jobs: steps: - name: 'Checkout the JDK source' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Get MSYS2' uses: ./.github/actions/get-msys2 From ce1602d1eb02f720e38cae92604e69bd99348c58 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Sep 2023 06:46:33 +0000 Subject: [PATCH 032/177] 8265586: [windows] last button is not shown in AWT Frame with BorderLayout and MenuBar set. 8288993: Make AwtFramePackTest generic by removing @requires tag Backport-of: d2045f9cfa88cb8bea58e5476f5917464f966028 --- .../native/libawt/windows/awt_Window.cpp | 14 +-- test/jdk/java/awt/Frame/AwtFramePackTest.java | 100 ++++++++++++++++++ 2 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 test/jdk/java/awt/Frame/AwtFramePackTest.java diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp index dbca3d778c8..7b80a13deb7 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp @@ -24,7 +24,6 @@ */ #include "awt.h" - #include #include "awt_Component.h" @@ -1396,6 +1395,9 @@ BOOL AwtWindow::UpdateInsets(jobject insets) RECT inside; int extraBottomInsets = 0; + // extra padded border for captioned windows + int extraPaddedBorderInsets = ::GetSystemMetrics(SM_CXPADDEDBORDER); + ::GetClientRect(GetHWnd(), &inside); ::GetWindowRect(GetHWnd(), &outside); @@ -1419,17 +1421,15 @@ BOOL AwtWindow::UpdateInsets(jobject insets) LONG style = GetStyle(); if (style & WS_THICKFRAME) { m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXSIZEFRAME); + ::GetSystemMetrics(SM_CXSIZEFRAME) + extraPaddedBorderInsets; m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYSIZEFRAME); + ::GetSystemMetrics(SM_CYSIZEFRAME) + extraPaddedBorderInsets; } else { m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXDLGFRAME); + ::GetSystemMetrics(SM_CXDLGFRAME) + extraPaddedBorderInsets; m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYDLGFRAME); + ::GetSystemMetrics(SM_CYDLGFRAME) + extraPaddedBorderInsets; } - - /* Add in title. */ m_insets.top += ::GetSystemMetrics(SM_CYCAPTION); } diff --git a/test/jdk/java/awt/Frame/AwtFramePackTest.java b/test/jdk/java/awt/Frame/AwtFramePackTest.java new file mode 100644 index 00000000000..54fd330f3e4 --- /dev/null +++ b/test/jdk/java/awt/Frame/AwtFramePackTest.java @@ -0,0 +1,100 @@ +/* + * 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.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.Panel; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/* + * @test + * @bug 8265586 + * @key headful + * @summary Tests whether insets are calculated correctly on Windows + * for AWT Frame by checking the actual and expected/preferred frame sizes. + * @run main AwtFramePackTest + */ + +public class AwtFramePackTest { + + private static Frame frame; + private static Robot robot; + + public static void main(String[] args) throws AWTException { + try { + robot = new Robot(); + robot.setAutoDelay(300); + + frame = new Frame(); + frame.setLayout(new BorderLayout()); + + Panel panel = new Panel(); + panel.add(new Button("Panel Button B1")); + panel.add(new Button("Panel Button B2")); + frame.add(panel, BorderLayout.CENTER); + + MenuBar mb = new MenuBar(); + Menu m = new Menu("Menu"); + mb.add(m); + frame.setMenuBar(mb); + + frame.pack(); + frame.setVisible(true); + + robot.delay(500); + robot.waitForIdle(); + + Dimension actualFrameSize = frame.getSize(); + Dimension expectedFrameSize = frame.getPreferredSize(); + + if (!actualFrameSize.equals(expectedFrameSize)) { + System.out.println("Expected frame size: "+ expectedFrameSize); + System.out.println("Actual frame size: "+ actualFrameSize); + saveScreenCapture(); + throw new RuntimeException("Expected and Actual frame size" + + " are different. frame.pack() does not work!!"); + } + } finally { + frame.dispose(); + } + } + + // for debugging purpose, saves screen capture when test fails. + private static void saveScreenCapture() { + BufferedImage image = robot.createScreenCapture(frame.getBounds()); + try { + ImageIO.write(image,"png", new File("Frame.png")); + } catch (IOException e) { + e.printStackTrace(); + } + } +} From cd3c64fbfccf76a3c223e19ece4438c5a1869c8c Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Fri, 22 Sep 2023 07:03:30 +0000 Subject: [PATCH 033/177] 8306430: Open source some AWT tests related to TextComponent and Toolkit Backport-of: 36ec05d52a79185d8c6669713fd17933128c032a --- .../PeerlessSetCaret/PeerlessSetCaret.java | 46 +++++ .../SelectionBounds/SelectionBounds.java | 107 +++++++++++ .../TextAreaCRLFTest/TextAreaCRLFTest.java | 150 +++++++++++++++ .../AWTEventListenerProxyTest.java | 172 ++++++++++++++++++ .../ListenerDeadlockTest.java | 87 +++++++++ 5 files changed, 562 insertions(+) create mode 100644 test/jdk/java/awt/TextComponent/PeerlessSetCaret/PeerlessSetCaret.java create mode 100644 test/jdk/java/awt/TextComponent/SelectionBounds/SelectionBounds.java create mode 100644 test/jdk/java/awt/TextComponent/TextAreaCRLFTest/TextAreaCRLFTest.java create mode 100644 test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java create mode 100644 test/jdk/java/awt/Toolkit/ListenersDeadlockTest/ListenerDeadlockTest.java diff --git a/test/jdk/java/awt/TextComponent/PeerlessSetCaret/PeerlessSetCaret.java b/test/jdk/java/awt/TextComponent/PeerlessSetCaret/PeerlessSetCaret.java new file mode 100644 index 00000000000..2182cb338e2 --- /dev/null +++ b/test/jdk/java/awt/TextComponent/PeerlessSetCaret/PeerlessSetCaret.java @@ -0,0 +1,46 @@ +/* + * 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. + */ + +/* + @test + @bug 4257143 + @summary RFE: Cannot set some AWT properties until peer has been created + @key headful +*/ + +import java.awt.EventQueue; +import java.awt.TextArea; +import java.awt.TextField; + +public class PeerlessSetCaret { + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + TextField tf = new TextField("Hello, World!"); + TextArea ta = new TextArea("Hello, World!"); + + // without the fix these will throw IllegalComponentStateException + tf.setCaretPosition(1); + ta.setCaretPosition(1); + }); + } +} diff --git a/test/jdk/java/awt/TextComponent/SelectionBounds/SelectionBounds.java b/test/jdk/java/awt/TextComponent/SelectionBounds/SelectionBounds.java new file mode 100644 index 00000000000..51a075e7016 --- /dev/null +++ b/test/jdk/java/awt/TextComponent/SelectionBounds/SelectionBounds.java @@ -0,0 +1,107 @@ +/* + * 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 + * 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 4118247 + @summary Make sure bounds are enforced correctly on + TextComponent.Select(int, int) + @key headful +*/ + +import java.awt.EventQueue; +import java.awt.TextArea; +import java.awt.TextComponent; + +public class SelectionBounds { + public static TextComponent tc; + + public static int[][] index = { + {0, 0}, // 0 = selectionStart = selectionEnd + {5, 5}, // selectionStart = selectionEnd + {5, 7}, // 0 < selectionStart < selectionEnd < textLength + {-50, 7}, // selectionStart < 0 < selectionEnd < textLength + {-50, 50}, // selectionStart < 0 < textLength < selectionEnd + {5, 50}, // 0 < selectionStart < textLength < selectionEnd + {40, 50}, // 0 < textLength < selectionStart < selectionEnd + {-50, -40}, // selectionStart < selectionEnd < 0 < textLength + {7, 5}, // 0 < selectionEnd < selectionStart < textLength + {7, -50}, // selectionEnd < 0 < selectionStart < textLength + {50, -50}, // selectionEnd < 0 < textLength < selectionStart + {50, 5}, // 0 < selectionEnd < textLength < selectionStart + {50, 40}, // 0 < textLength < selectionEnd < selectionStart + {-40, -50} // selectionEnd < selectionStart < 0 < textLength + }; + + public static String[] selections = { + "", + "", + "56", + "0123456", + "0123456789", + "56789", + "", + "", + "", + "", + "", + "", + "", + "" + }; + + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + tc = new TextArea("0123456789"); + runTheTest(); + }); + } + + private static void runTheTest() { + int i; + String str1; + + for (i=0; i { + aDialog = new Dialog(new Frame()); + aDialog.setTitle("ADialog"); + aDialog.setBackground(Color.lightGray); + aDialog.setLayout(new BorderLayout()); + Panel mainPanel = new Panel(); + mainPanel.setLayout(new BorderLayout(6, 6)); + area = new TextArea(atextCRLF, 25, 68, + TextArea.SCROLLBARS_VERTICAL_ONLY); + area.setFont(new Font("Monospaced", Font.PLAIN, 11)); + mainPanel.add(area, "Center"); + aDialog.add(mainPanel, "Center"); + aDialog.pack(); + System.out.println("before: "+hexEncode(atextCRLF)); + System.out.println(" after: "+hexEncode(area.getText())); + res = area.getText().equals(atextCRLF); + System.out.println("01: " + res + "\n"); + passed = passed && res; + area.setText(atextCRLF); + System.out.println("before: "+hexEncode(atextCRLF)); + System.out.println(" after: "+hexEncode(area.getText())); + res = area.getText().equals(atextCRLF); + System.out.println("02: " + res + "\n"); + passed = passed && res; + + area.setText(""); + atext = "row1"; + area.append(atext+"\r"); + area.append(atext+"\r"); + System.out.println("before: " + +hexEncode(atext+"\r" + atext+"\r")); + System.out.println(" after: "+hexEncode(area.getText())); + res = area.getText().equals(atext + atext); + System.out.println("03: " + res + "\n"); + passed = passed && res; + + area.setText(""); + String atext1 = "fine."; + String atext2 = "messed up."; + atext = atext1 +"\r\n"+ atext2; + for (int i = 0; i < atext.length(); i++) { + area.append(atext.substring(i, i+1)); + } + System.out.println("before: " + +hexEncode(atext1 +"\r\n"+ atext2)); + System.out.println(" after: "+hexEncode(area.getText())); + String s = area.getText(); + String t = s.substring(s.length()-atext2.length()); + res = t.equals(atext2); + System.out.println("04: " + res); + passed = passed && res; + + area.setText(""); + atext = "\r"; + area.append(atext); + System.out.println("before: "+hexEncode(atext)); + System.out.println(" after: "+hexEncode(area.getText())); + res = area.getText().equals(""); + System.out.println("05: " + res + "\n"); + passed = passed && res; + + if (System.getProperty("os.name").toUpperCase(). + startsWith("WIN")) { + if (!passed) { + throw new RuntimeException("TextAreaCRLFTest FAILED."); + } else { + System.out.println("TextAreaCRLFTest PASSED"); + } + } else { + System.out.println("This is a Windows oriented testcase."); + } + }); + } finally { + EventQueue.invokeAndWait(() -> { + if (aDialog != null) { + aDialog.dispose(); + } + }); + } + } + + private static String hexEncode(String str) { + return hexEncode(str.getBytes()); + } + + private static String hexEncode(byte[] bytes) { + StringBuffer buffer = new StringBuffer(bytes.length * 2); + for (int i = 0; i < bytes.length; i++) { + byte b = bytes[i]; + buffer.append(DIGITS[(b & 0xF0) >> 4]); + buffer.append(DIGITS[b & 0x0F]); + } + return buffer.toString(); + } +} diff --git a/test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java b/test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java new file mode 100644 index 00000000000..a2c8613efc9 --- /dev/null +++ b/test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java @@ -0,0 +1,172 @@ +/* + * 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. + */ + +/* + @test + @bug 4290704 + @summary Test use of AWTEventListenerProxyTest class +*/ + +import java.awt.AWTEvent; +import java.awt.EventQueue; +import java.awt.Toolkit; +import java.awt.event.AWTEventListener; +import java.awt.event.AWTEventListenerProxy; +import java.util.EventListener; + +public class AWTEventListenerProxyTest { + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + Toolkit tk = Toolkit.getDefaultToolkit(); + if ("sun.awt.X11.XToolkit".equals(tk.getClass().getName())) { + System.out.println("Do not test for XAWT Toolkit."); + System.out.println("Passing automatically."); + return; + } + + // check that if no listeners added, returns a 0-length array, + // not null + AWTEventListener[] array1 = tk.getAWTEventListeners(); + if (array1 == null || array1.length != 0) { + System.out.println("[Empty array test failed!!]"); + throw new RuntimeException("Test failed -" + + " didn't return 0-sized array"); + } + System.out.println("[Empty array test passed]"); + + // simple add/get test + DumbListener dl1 = new DumbListener(); + final long dl1MASK = AWTEvent.ACTION_EVENT_MASK; + tk.addAWTEventListener(dl1, dl1MASK); + + array1 = tk.getAWTEventListeners(); + if (array1 == null || array1.length != 1) { + System.out.println("[Simple add/get test failed!!]"); + throw new RuntimeException("Test failed - didn't " + + "return array of 1"); + } + AWTEventListenerProxy dp1 = (AWTEventListenerProxy) array1[0]; + EventListener getdl1 = dp1.getListener(); + if (getdl1 != dl1) { + System.out.println("[Simple add/get test failed - " + + "wrong listener!!]"); + throw new RuntimeException("Test failed - wrong " + + "listener in proxy"); + } + + long getmask = dp1.getEventMask(); + if (getmask != dl1MASK) { + System.out.println("[Simple add/get test failed - " + + "wrong mask!!]"); + throw new RuntimeException("Test failed - wrong mask in proxy"); + } + System.out.println("[Simple add/get test passed]"); + + // add the same listener inside a proxy, with a different mask + // should get back one listener, with the ORed mask + final long dl2MASK = AWTEvent.CONTAINER_EVENT_MASK; + AWTEventListenerProxy newp = new AWTEventListenerProxy(dl2MASK, + dl1); + tk.addAWTEventListener(newp, dl2MASK); + array1 = tk.getAWTEventListeners(); + if (array1.length != 1) { + System.out.println("[Proxy add/get test failed!!]"); + throw new RuntimeException("Test failed - added proxy, " + + "but didn't return array of 1"); + } + dp1 = (AWTEventListenerProxy) array1[0]; + getdl1 = dp1.getListener(); + if (getdl1 != dl1) { + System.out.println("[Proxy add/get test " + + "failed - wrong listener!!]"); + throw new RuntimeException("Test failed - added proxy, " + + "wrong listener in proxy"); + } + getmask = dp1.getEventMask(); + if (getmask != (dl1MASK | dl2MASK)) { + System.out.println("[Proxy add/get test failed - " + + "wrong mask!!]"); + throw new RuntimeException("Test failed - added proxy, " + + "wrong mask in proxy"); + } + System.out.println("[Proxy add/get test passed]"); + + // add some other listener + DumbListener dl3 = new DumbListener(); + final long dl3MASK = AWTEvent.FOCUS_EVENT_MASK; + tk.addAWTEventListener(dl3, dl3MASK); + + // test getting with a mask for a listener already added + array1 = tk.getAWTEventListeners(dl1MASK); + if (array1.length != 1) { + System.out.println("[Get w/ mask test failed!! - " + + "not 1 listener!]"); + throw new RuntimeException("Test failed - tried to " + + "get w/ mask"); + } + dp1 = (AWTEventListenerProxy) array1[0]; + getdl1 = dp1.getListener(); + if (getdl1 != dl1) { + System.out.println("[Get w/ mask test failed!! - " + + "wrong listener]"); + throw new RuntimeException("Test failed - tried to get " + + "w/ mask, wrong listener in proxy"); + } + System.out.println("[Get w/ mask test passed]"); + + // test getting with a mask for a listener not added + array1 = tk.getAWTEventListeners(AWTEvent.MOUSE_EVENT_MASK); + if (array1.length != 0) { + System.out.println("[Get w/ mask test 2 failed!! - " + + "not 0 listeners!]"); + throw new RuntimeException("Test failed - tried to get " + + "w/ mask 2"); + } + System.out.println("[Get w/ mask test 2 passed]"); + + + // test getting with a compound mask for a listener already added + array1 = tk.getAWTEventListeners(dl1MASK | dl2MASK); + if (array1.length != 1) { + System.out.println("[Get w/ compound mask test failed!! - " + + "not 1 listeners!]"); + throw new RuntimeException("Test failed - tried to get w/ 2 " + + "ORed masks"); + } + dp1 = (AWTEventListenerProxy) array1[0]; + getdl1 = dp1.getListener(); + if (getdl1 != dl1) { + System.out.println("[Get w/ compound mask test failed!! - " + + "wrong listener]"); + throw new RuntimeException("Test failed - tried to get w/ " + + "compound mask, wrong listener in proxy"); + } + System.out.println("[Get w/ compound mask test passed]"); + }); + } + + public static class DumbListener implements AWTEventListener { + public DumbListener() {} + public void eventDispatched(AWTEvent e) {} + } +} diff --git a/test/jdk/java/awt/Toolkit/ListenersDeadlockTest/ListenerDeadlockTest.java b/test/jdk/java/awt/Toolkit/ListenersDeadlockTest/ListenerDeadlockTest.java new file mode 100644 index 00000000000..11a3f34c1e4 --- /dev/null +++ b/test/jdk/java/awt/Toolkit/ListenersDeadlockTest/ListenerDeadlockTest.java @@ -0,0 +1,87 @@ +/* + * 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. + */ + +/* + @test + @bug 4338463 + @summary excessive synchronization in notifyAWTEventListeners leads to + deadlock +*/ + +import java.awt.AWTEvent; +import java.awt.EventQueue; +import java.awt.Panel; +import java.awt.Toolkit; +import java.awt.event.AWTEventListener; +import java.awt.event.ActionEvent; + +public class ListenerDeadlockTest { + public static final Object lock = new Object(); + + public static final Toolkit toolkit = Toolkit.getDefaultToolkit(); + + public static Panel panel = new Panel(); + + public static final AWTEventListener listener = new AWTEventListener() { + public void eventDispatched(AWTEvent e) { + if (e.getSource() == panel) { + System.out.println(e); + System.out.println("No deadlock"); + synchronized(lock) { + lock.notifyAll(); + } + } + } + }; + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + toolkit.addAWTEventListener(listener, -1); + + Thread thread = new Thread(new Runnable() { + public void run() { + synchronized (toolkit) { + synchronized (lock) { + try { + lock.notifyAll(); + lock.wait(); + } catch (InterruptedException ex) { + } + } + } + } + }); + + synchronized (lock) { + thread.start(); + try { + lock.wait(); + } catch (InterruptedException ex) { + } + } + + panel.dispatchEvent(new ActionEvent(panel, + ActionEvent.ACTION_PERFORMED, "Try")); + }); + } +} From 72d97e05d4d6b61131a69db6f864cf9598027bdb Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Fri, 22 Sep 2023 07:07:30 +0000 Subject: [PATCH 034/177] 8307079: Update test java/awt/Choice/DragOffNoSelect.java Backport-of: 89711f376751d4cfa05758705867afedfafeb602 --- test/jdk/java/awt/Choice/DragOffNoSelectTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/awt/Choice/DragOffNoSelectTest.java b/test/jdk/java/awt/Choice/DragOffNoSelectTest.java index 587fc701e93..a3b808dbcf8 100644 --- a/test/jdk/java/awt/Choice/DragOffNoSelectTest.java +++ b/test/jdk/java/awt/Choice/DragOffNoSelectTest.java @@ -71,7 +71,7 @@ static void createUI() { } frame.add(theChoice); frame.addWindowListener(testInstance); - frame.setSize(400, 400); + frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); From cdc33dc948102798be749e319670bc13a2df133c Mon Sep 17 00:00:00 2001 From: Kimura Yukihiro Date: Fri, 22 Sep 2023 07:09:33 +0000 Subject: [PATCH 035/177] 8313815: The exception messages printed by jcmd ManagementAgent.start are corrupted on Japanese Windows Backport-of: 7286bb8518543501045de4cf970094ac9c1af4fa --- .../share/classes/sun/tools/attach/HotSpotVirtualMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java b/src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java index e0cc4c65ab2..10554ad0eb5 100644 --- a/src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java +++ b/src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java @@ -355,7 +355,7 @@ int readInt(InputStream in) throws IOException { String readErrorMessage(InputStream in) throws IOException { String s; StringBuilder message = new StringBuilder(); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); + BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8")); while ((s = br.readLine()) != null) { message.append(s); } From b2a6484503c757b9abd84ed52e979660bb7deb0e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 22 Sep 2023 15:48:18 +0000 Subject: [PATCH 036/177] 8316178: Better diagnostic header for CodeBlobs Backport-of: d575968b4bde74bd557cb84e89f0fa0f96b04087 --- src/hotspot/share/code/codeBlob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/code/codeBlob.cpp b/src/hotspot/share/code/codeBlob.cpp index b30baddd5a7..0621c615716 100644 --- a/src/hotspot/share/code/codeBlob.cpp +++ b/src/hotspot/share/code/codeBlob.cpp @@ -185,7 +185,8 @@ void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const cha jio_snprintf(stub_id, sizeof(stub_id), "%s%s", name1, name2); if (PrintStubCode) { ttyLocker ttyl; - tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub); + tty->print_cr("Decoding %s " PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (%d bytes)", + stub_id, p2i(stub), p2i(stub->code_begin()), p2i(stub->code_end()), stub->code_size()); Disassembler::decode(stub->code_begin(), stub->code_end()); tty->cr(); } From 2513c89a031fac01e70aca5e1f3f0e9153d10694 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 27 Sep 2023 08:07:43 +0000 Subject: [PATCH 037/177] 8288325: [windows] Actual and Preferred Size of AWT Non-resizable frame are different Reviewed-by: phh Backport-of: eca9749da01d732033c07f2bbb38800a9d80f18d --- .../native/libawt/windows/awt_Window.cpp | 24 +++------ test/jdk/java/awt/Frame/AwtFramePackTest.java | 52 +++++++++++++------ 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp index 7b80a13deb7..8da38d9c798 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp @@ -1393,7 +1393,6 @@ BOOL AwtWindow::UpdateInsets(jobject insets) */ RECT outside; RECT inside; - int extraBottomInsets = 0; // extra padded border for captioned windows int extraPaddedBorderInsets = ::GetSystemMetrics(SM_CXPADDEDBORDER); @@ -1405,12 +1404,13 @@ BOOL AwtWindow::UpdateInsets(jobject insets) if (outside.right - outside.left > 0 && outside.bottom - outside.top > 0) { ::MapWindowPoints(GetHWnd(), 0, (LPPOINT)&inside, 2); m_insets.top = inside.top - outside.top; - m_insets.bottom = outside.bottom - inside.bottom + extraBottomInsets; + m_insets.bottom = outside.bottom - inside.bottom; m_insets.left = inside.left - outside.left; m_insets.right = outside.right - inside.right; } else { m_insets.top = -1; } + if (m_insets.left < 0 || m_insets.top < 0 || m_insets.right < 0 || m_insets.bottom < 0) { @@ -1418,18 +1418,11 @@ BOOL AwtWindow::UpdateInsets(jobject insets) jobject target = GetTarget(env); if (IsUndecorated() == FALSE) { /* Get outer frame sizes. */ - LONG style = GetStyle(); - if (style & WS_THICKFRAME) { - m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXSIZEFRAME) + extraPaddedBorderInsets; - m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYSIZEFRAME) + extraPaddedBorderInsets; - } else { - m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXDLGFRAME) + extraPaddedBorderInsets; - m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYDLGFRAME) + extraPaddedBorderInsets; - } + // System metrics are same for resizable & non-resizable frame. + m_insets.left = m_insets.right = + ::GetSystemMetrics(SM_CXFRAME) + extraPaddedBorderInsets; + m_insets.top = m_insets.bottom = + ::GetSystemMetrics(SM_CYFRAME) + extraPaddedBorderInsets; /* Add in title. */ m_insets.top += ::GetSystemMetrics(SM_CYCAPTION); } @@ -1437,7 +1430,7 @@ BOOL AwtWindow::UpdateInsets(jobject insets) /* fix for 4418125: Undecorated frames are off by one */ /* undo the -1 set above */ /* Additional fix for 5059656 */ - /* Also, 5089312: Window insets should be 0. */ + /* Also, 5089312: Window insets should be 0. */ ::memset(&m_insets, 0, sizeof(m_insets)); } @@ -1450,7 +1443,6 @@ BOOL AwtWindow::UpdateInsets(jobject insets) env->DeleteLocalRef(target); return FALSE; } - m_insets.bottom += extraBottomInsets; env->DeleteLocalRef(target); } diff --git a/test/jdk/java/awt/Frame/AwtFramePackTest.java b/test/jdk/java/awt/Frame/AwtFramePackTest.java index 54fd330f3e4..8ea8a309c1d 100644 --- a/test/jdk/java/awt/Frame/AwtFramePackTest.java +++ b/test/jdk/java/awt/Frame/AwtFramePackTest.java @@ -39,21 +39,37 @@ * @test * @bug 8265586 * @key headful - * @summary Tests whether insets are calculated correctly on Windows - * for AWT Frame by checking the actual and expected/preferred frame sizes. + * @summary Tests whether correct native frame insets are obtained + * for Resizable & Non-Resizable AWT Frame by checking the actual + * and expected/preferred frame sizes. * @run main AwtFramePackTest */ - public class AwtFramePackTest { - private static Frame frame; private static Robot robot; + private static StringBuffer errorLog = new StringBuffer(); public static void main(String[] args) throws AWTException { - try { - robot = new Robot(); - robot.setAutoDelay(300); + robot = new Robot(); + robot.setAutoDelay(300); + + // Resizable frame + createAWTFrame(true); + robot.waitForIdle(); + robot.delay(500); + + // Non-Resizable frame + createAWTFrame(false); + + if (errorLog != null && errorLog.length() > 0) { + throw new RuntimeException("Test failed due to the following" + + " one or more errors: \n" + errorLog); + } + } + + private static void createAWTFrame(boolean isResizable) { + try { frame = new Frame(); frame.setLayout(new BorderLayout()); @@ -67,32 +83,36 @@ public static void main(String[] args) throws AWTException { mb.add(m); frame.setMenuBar(mb); + frame.setResizable(isResizable); frame.pack(); frame.setVisible(true); - robot.delay(500); robot.waitForIdle(); + robot.delay(500); Dimension actualFrameSize = frame.getSize(); Dimension expectedFrameSize = frame.getPreferredSize(); if (!actualFrameSize.equals(expectedFrameSize)) { - System.out.println("Expected frame size: "+ expectedFrameSize); - System.out.println("Actual frame size: "+ actualFrameSize); - saveScreenCapture(); - throw new RuntimeException("Expected and Actual frame size" + - " are different. frame.pack() does not work!!"); + String frameType = isResizable ? "ResizableFrame" : "NonResizableFrame"; + System.out.println("Expected frame size: " + expectedFrameSize); + System.out.println("Actual frame size: " + actualFrameSize); + saveScreenCapture(frameType + ".png"); + errorLog.append(frameType + ": Expected and Actual frame size" + + " are different. frame.pack() does not work!! \n"); } } finally { - frame.dispose(); + if (frame != null) { + frame.dispose(); + } } } // for debugging purpose, saves screen capture when test fails. - private static void saveScreenCapture() { + private static void saveScreenCapture(String filename) { BufferedImage image = robot.createScreenCapture(frame.getBounds()); try { - ImageIO.write(image,"png", new File("Frame.png")); + ImageIO.write(image,"png", new File(filename)); } catch (IOException e) { e.printStackTrace(); } From e7b20779fe72432b50a2f3e3f3b8e29ed9d77942 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 27 Sep 2023 08:21:35 +0000 Subject: [PATCH 038/177] 8316206: Test StretchedFontTest.java fails for Baekmuk font Ignore broken fonts, i.e. the fonts for which GlyphVector(TEXT).getVisualBounds().isEmpty() returns true Backport-of: 00f585bd22f527eca0107a9b4ed366f25754f0be --- .../font/FontScaling/StretchedFontTest.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java b/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java index 52ea3571a03..db804b3fff7 100644 --- a/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java +++ b/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java @@ -26,6 +26,7 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.File; @@ -62,15 +63,19 @@ public final class StretchedFontTest { new Color(0x7F000000, true) }; + /** Locale for getting font names. */ + private static final Locale ENGLISH_LOCALE = Locale.ENGLISH; + private static final AffineTransform STRETCH_TRANSFORM = AffineTransform.getScaleInstance(2.0, 1.0); public static void main(String[] args) { List errors = Arrays.stream(getLocalGraphicsEnvironment() - .getAvailableFontFamilyNames(Locale.ENGLISH)) + .getAvailableFontFamilyNames(ENGLISH_LOCALE)) .map(family -> new Font(family, Font.PLAIN, FONT_SIZE)) .filter(font -> font.canDisplay(TEXT.codePointAt(0))) + .filter(font -> !isBrokenFont(font)) .map(font -> font.deriveFont(STRETCH_TRANSFORM)) .flatMap(StretchedFontTest::testFont) .filter(Objects::nonNull) @@ -83,6 +88,26 @@ public static void main(String[] args) { } } + /** + * Checks whether the font renders the glyph in {@code TEXT} and + * returns {@code true} if the glyph isn't rendered. + * + * @param font the font to test + * @return {@code true} if the visual bounds of {@code TEXT} are empty, and + * {@code false} otherwise + */ + private static boolean isBrokenFont(final Font font) { + final boolean empty = + font.createGlyphVector(new FontRenderContext(null, false, false), + TEXT) + .getVisualBounds() + .isEmpty(); + if (empty) { + System.err.println("Broken font: " + font.getFontName(ENGLISH_LOCALE)); + } + return empty; + } + /** * Tests the font with a set of text antialiasing hints. * @@ -146,7 +171,7 @@ private static String testFont(final Font font, if (verifyImage(image)) { return null; } - String fontName = font.getFontName(Locale.ENGLISH); + String fontName = font.getFontName(ENGLISH_LOCALE); String hintValue = getHintString(hint); String hexColor = String.format("0x%08x", foreground.getRGB()); saveImage(image, fontName + "-" + hintValue + "-" + hexColor); From bcac47f00ac6cf511ad7709fb9d39276ac27b049 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 27 Sep 2023 08:50:55 +0000 Subject: [PATCH 039/177] 8313657: com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors Backport-of: e56d3bc2dab3d32453b6eda66e8434953c436084 --- .../classes/com/sun/jndi/ldap/Connection.java | 53 +++++- .../com/sun/jndi/ldap/SocketCloseTest.java | 168 ++++++++++++++++++ 2 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 test/jdk/com/sun/jndi/ldap/SocketCloseTest.java diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java index 73f0cb26a2b..f591b3567cc 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java @@ -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 @@ -638,14 +638,12 @@ void cleanup(Control[] reqCtls, boolean notifyParent) { ldapUnbind(reqCtls); } } finally { - try { - outStream.flush(); - sock.close(); - unpauseReader(); - } catch (IOException ie) { - if (debug) - System.err.println("Connection: problem closing socket: " + ie); - } + + flushAndCloseOutputStream(); + // 8313657 socket is not closed until GC is run + closeOpenedSocket(); + tryUnpauseReader(); + if (!notifyParent) { LdapRequest ldr = pendingRequests; while (ldr != null) { @@ -679,6 +677,43 @@ void cleanup(Control[] reqCtls, boolean notifyParent) { } } + // flush and close output stream + private void flushAndCloseOutputStream() { + try { + outStream.flush(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.flushOutputStream: OutputStream flush problem " + ioEx); + } + try { + outStream.close(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.closeOutputStream: OutputStream close problem " + ioEx); + } + } + + // close socket + private void closeOpenedSocket() { + try { + sock.close(); + } catch (IOException ioEx) { + if (debug) { + System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); + System.err.println("Socket isClosed: " + sock.isClosed()); + } + } + } + + // unpause reader + private void tryUnpauseReader() { + try { + unpauseReader(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.tryUnpauseReader: unpauseReader problem " + ioEx); + } + } // Assume everything is "quiet" // "synchronize" might lead to deadlock so don't synchronize method diff --git a/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java new file mode 100644 index 00000000000..a33beb6cacc --- /dev/null +++ b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java @@ -0,0 +1,168 @@ +/* + * 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 javax.naming.Context; +import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; +import javax.net.SocketFactory; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Hashtable; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* + * @test + * @bug 8313657 + * @summary make sure socket is closed when the error happens for OutputStream flushing + * The value of provider url can be random, not necessary to be the one in the code + * @library /test/lib + * @run main/othervm SocketCloseTest + */ + +public class SocketCloseTest { + public static String SOCKET_CLOSED_MSG = "The socket has been closed."; + public static String SOCKET_NOT_CLOSED_MSG = "The socket was not closed."; + public static String BAD_FLUSH = "Bad flush!"; + private static final byte[] BIND_RESPONSE = new byte[]{ + 48, 12, 2, 1, 1, 97, 7, 10, 1, 0, 4, 0, 4, 0 + }; + + public static void main(String[] args) throws Exception { + SocketCloseTest scTest = new SocketCloseTest(); + scTest.runCloseSocketScenario(); + } + + public void runCloseSocketScenario() throws Exception { + Hashtable props = new Hashtable<>(); + + props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + props.put(Context.PROVIDER_URL, "ldap://localhost:1389/o=example"); + props.put("java.naming.ldap.factory.socket", CustomSocketFactory.class.getName()); + try { + final DirContext ctx = new InitialDirContext(props); + } catch (Exception e) { + if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0) { + System.out.println(SOCKET_CLOSED_MSG); + } else { + System.out.println(SOCKET_NOT_CLOSED_MSG); + throw e; + } + } + } + + public static class CustomSocketFactory extends SocketFactory { + public static CustomSocket customSocket = new CustomSocket(); + + public static CustomSocketFactory getDefault() { + return new CustomSocketFactory(); + } + + @Override + public Socket createSocket() { + return customSocket; + } + + @Override + public Socket createSocket(String s, int timeout) { + return customSocket; + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, + int localPort) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress host, int port) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress address, int port, + InetAddress localAddress, int localPort) { + return customSocket; + } + } + + private static class LdapInputStream extends InputStream { + private ByteArrayInputStream bos; + + public LdapInputStream() { + } + + @Override + public int read() throws IOException { + bos = new ByteArrayInputStream(BIND_RESPONSE); + return bos.read(); + } + } + + private static class LdapOutputStream extends OutputStream { + + @Override + public void write(int b) throws IOException { + System.out.println("output stream writing"); + } + + @Override + public void flush() throws IOException { + System.out.println(BAD_FLUSH); + throw new IOException(BAD_FLUSH); + } + } + + private static class CustomSocket extends Socket { + private int closeMethodCalled = 0; + private LdapOutputStream output = new LdapOutputStream(); + private LdapInputStream input = new LdapInputStream(); + + public void connect(SocketAddress address, int timeout) { + } + + public InputStream getInputStream() { + return input; + } + + public OutputStream getOutputStream() { + return output; + } + + public int closeMethodCalledCount() { + return closeMethodCalled; + } + + @Override + public void close() throws IOException { + closeMethodCalled++; + super.close(); + } + } +} From c2ac5e2f521e14ef92ba0176903f41b30d11a0f9 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 27 Sep 2023 08:53:17 +0000 Subject: [PATCH 040/177] 8301065: Handle control characters in java_lang_String::print Backport-of: 41d6be4d807921a91339029ae96e8dc14561bea6 --- src/hotspot/share/classfile/javaClasses.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index a83fdb5a189..7cb6e15ab66 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -730,8 +730,13 @@ void java_lang_String::print(oop java_string, outputStream* st) { st->print("\""); for (int index = 0; index < length; index++) { - st->print("%c", (!is_latin1) ? value->char_at(index) : - ((jchar) value->byte_at(index)) & 0xff ); + jchar c = (!is_latin1) ? value->char_at(index) : + ((jchar) value->byte_at(index)) & 0xff; + if (c < ' ') { + st->print("\\x%02X", c); // print control characters e.g. \x0A + } else { + st->print("%c", c); + } } st->print("\""); } From f530f3494406570bf48c9f3598baab63355d1bb1 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 28 Sep 2023 09:20:04 +0000 Subject: [PATCH 041/177] 8313792: Verify 4th party information in src/jdk.internal.le/share/legal/jline.md Backport-of: 87a6acbeee1673526bfc5f8692e0949cb113e841 --- src/jdk.internal.le/share/legal/jline.md | 253 ----------------------- 1 file changed, 253 deletions(-) diff --git a/src/jdk.internal.le/share/legal/jline.md b/src/jdk.internal.le/share/legal/jline.md index 4e5d344b4d1..6840c69cfc0 100644 --- a/src/jdk.internal.le/share/legal/jline.md +++ b/src/jdk.internal.le/share/legal/jline.md @@ -38,257 +38,4 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -4th Party Dependency -============= -org.fusesource.jansi version 2.4.0 -org.apache.sshd 2.9.2 -org.apache.felix.gogo.runtime 1.1.6 -org.apache.felix.gogo.jline 1.1.8 -============= -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -============= -juniversalchardet - -The library is subject to the Mozilla Public License Version 1.1. - -Alternatively, the library may be used under the terms of either the GNU General Public License Version 2 or later, or the GNU Lesser General Public License 2.1 or later. - -================ - -slf4j - -SLF4J source code and binaries are distributed under the MIT license. - - -Copyright (c) 2004-2023 QOS.ch -All rights reserved. - -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. - -These terms are identical to those of the MIT License, also called the X License -or the X11 License, which is a simple, permissive non-copyleft free software license. -It is deemed compatible with virtually all types of licenses, commercial or otherwise. -In particular, the Free Software Foundation has declared it compatible with GNU GPL. -It is also known to be approved by the Apache Software Foundation as compatible with -Apache Software License. - From ffef09805de53c2c0c4ffb436418f82887556052 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 28 Sep 2023 14:03:17 +0000 Subject: [PATCH 042/177] 8290067: Show stack dimensions in UL logging when attaching threads Reviewed-by: lucy Backport-of: 7ff19694dfef947bf65dbd15ec6497acefae39aa --- src/hotspot/os/aix/os_aix.cpp | 6 ++++-- src/hotspot/os/bsd/os_bsd.cpp | 7 ++++--- src/hotspot/os/windows/os_windows.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index f9041dfaf64..153de42cc07 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -988,8 +988,10 @@ bool os::create_attached_thread(JavaThread* thread) { // and save the caller's signal mask os::Aix::hotspot_sigmask(thread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT ").", - os::current_thread_id(), (uintx) kernel_thread_id); + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), (uintx) kernel_thread_id, + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); return true; } diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index f5e4c367cb3..0a93c3f3c8d 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -863,9 +863,10 @@ bool os::create_attached_thread(JavaThread* thread) { // and save the caller's signal mask os::Bsd::hotspot_sigmask(thread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").", - os::current_thread_id(), (uintx) pthread_self()); - + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), (uintx) pthread_self(), + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); return true; } diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index ee826bbded9..53b323b2175 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -544,8 +544,10 @@ bool os::create_attached_thread(JavaThread* thread) { thread->set_osthread(osthread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ").", - os::current_thread_id()); + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", stack: " + PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), p2i(thread->stack_base()), + p2i(thread->stack_end()), thread->stack_size()); return true; } From 166adaacab6b09ecc02b2d1e4aa419e4f525405d Mon Sep 17 00:00:00 2001 From: Soumadipta Roy Date: Thu, 28 Sep 2023 15:18:34 +0000 Subject: [PATCH 043/177] 8315770: serviceability/sa/TestJmapCoreMetaspace.java should run with -XX:-VerifyDependencies Backport-of: 877731d2a20249ce4724a071ba2da1faa56daca4 --- test/hotspot/jtreg/serviceability/sa/TestJmapCore.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java index 717c0e98a15..fdd0d044d2d 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java @@ -88,6 +88,9 @@ static boolean useDefaultUlimit() { static void test(String type) throws Throwable { ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash", "-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", "-XX:-TransmitErrorReport", + // The test loads lots of small classes to exhaust Metaspace, skip method + // dependency verification to improve performance in debug builds. + Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "--show-version", TestJmapCore.class.getName(), type); boolean useDefaultUlimit = useDefaultUlimit(); From 0beae37693826264eae8be4920c8a823d57d28a8 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Sep 2023 09:54:35 +0000 Subject: [PATCH 044/177] 8280004: DCmdArgument::parse_value() should handle NULL input Backport-of: 55f180fb7dfecc859e59c7852d48aeab6c936a5d --- src/hotspot/share/services/diagnosticArgument.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/services/diagnosticArgument.cpp b/src/hotspot/share/services/diagnosticArgument.cpp index eb9a6b38c6e..3209840d40b 100644 --- a/src/hotspot/share/services/diagnosticArgument.cpp +++ b/src/hotspot/share/services/diagnosticArgument.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -28,6 +28,7 @@ #include "memory/resourceArea.hpp" #include "runtime/thread.hpp" #include "services/diagnosticArgument.hpp" +#include "utilities/globalDefinitions.hpp" StringArrayArgument::StringArrayArgument() { _array = new(ResourceObj::C_HEAP, mtInternal)GrowableArray(32, true); @@ -116,13 +117,12 @@ template <> void DCmdArgument::parse_value(const char* str, || sscanf(str, JLONG_FORMAT "%n", &_value, &scanned) != 1 || (size_t)scanned != len) { - ResourceMark rm; - - char* buf = NEW_RESOURCE_ARRAY(char, len + 1); - strncpy(buf, str, len); - buf[len] = '\0'; + const int maxprint = 64; Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalArgumentException(), - "Integer parsing error in command argument '%s'. Could not parse: %s.\n", _name, buf); + "Integer parsing error in command argument '%s'. Could not parse: %.*s%s.\n", _name, + MIN2((int)len, maxprint), + (str == NULL ? "" : str), + (len > maxprint ? "..." : "")); } } From cf722df2a444d0fb5ca2d5b3cf953f8ca7e9f70a Mon Sep 17 00:00:00 2001 From: amosshi Date: Fri, 29 Sep 2023 15:52:16 +0000 Subject: [PATCH 045/177] 8267860: Off-by-one bug when searching arrays in AlpnGreaseTest Backport-of: 2adef6a1f84d478bb38b179795f08ffa43680e36 --- test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java b/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java index d3c656043a2..66efefeee4a 100644 --- a/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java +++ b/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java @@ -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 @@ -83,7 +83,7 @@ public class AlpnGreaseTest implements SSLContextTemplate { new String(greaseBytes, StandardCharsets.ISO_8859_1); private static void findGreaseInClientHello(byte[] bytes) throws Exception { - for (int i = 0; i < bytes.length - greaseBytes.length; i++) { + for (int i = 0; i < bytes.length - greaseBytes.length + 1; i++) { if (Arrays.equals(bytes, i, i + greaseBytes.length, greaseBytes, 0, greaseBytes.length)) { System.out.println("Found greaseBytes in ClientHello at: " + i); From a4b30272bc08e3c799183604f0a606e5f526b9ca Mon Sep 17 00:00:00 2001 From: amosshi Date: Fri, 29 Sep 2023 15:54:07 +0000 Subject: [PATCH 046/177] 8271519: java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java failed with "Total [200] - Expected [400]" Backport-of: 9f94cbec51df7556d34fffa810e59dd9eb8521df --- .../SequencedEvent/MultipleContextsFunctionalTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java b/test/jdk/java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java index 278e862421d..9af56ba044b 100644 --- a/test/jdk/java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java +++ b/test/jdk/java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 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 @@ -35,8 +35,8 @@ import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicReference; import javax.swing.JButton; import javax.swing.JFrame; @@ -55,7 +55,7 @@ public final class MultipleContextsFunctionalTest { private static final int CHECK_LAPSE = 100; private static final int MAX_COUNT = MAX_TIME / INTERVAL; private static final int EXPECTED = MAX_COUNT * NUM_WINDOW; - private static final List WINDOWS = new ArrayList(); + private static final List WINDOWS = new CopyOnWriteArrayList<>(); public static void main(String[] args) { for (int i = 0; i < NUM_WINDOW; i++) { @@ -126,7 +126,7 @@ public void run() { private static final class TestWindow extends JFrame implements ActionListener { private final JButton btn; - private int counter = 0; + private volatile int counter = 0; private final Timer t; TestWindow(final int num) { From 51a80ddd92573bcf7bdb58e891ff04616e71f840 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 3 Oct 2023 19:58:15 +0000 Subject: [PATCH 047/177] 8293466: libjsig should ignore non-modifying sigaction calls Backport-of: b1ed40a87ab357d1b51ac5102bba181f21ffa9b6 --- src/java.base/unix/native/libjsig/jsig.c | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/java.base/unix/native/libjsig/jsig.c b/src/java.base/unix/native/libjsig/jsig.c index f59012c34f9..a7479b2227e 100644 --- a/src/java.base/unix/native/libjsig/jsig.c +++ b/src/java.base/unix/native/libjsig/jsig.c @@ -278,17 +278,28 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { signal_unlock(); return 0; } else if (jvm_signal_installing) { - /* jvm is installing its signal handlers. Install the new - * handlers and save the old ones. */ + /* jvm is installing its signal handlers. + * - if this is a modifying sigaction call, we install a new signal handler and store the old one + * as chained signal handler. + * - if this is a non-modifying sigaction call, we don't change any state; we just return the existing + * signal handler in the system (not the stored one). + * This works under the assumption that there is only one modifying sigaction call for a specific signal + * within the JVM_begin_signal_setting-JVM_end_signal_setting-window. There can be any number of non-modifying + * calls, but they will only return the expected preexisting handler if executed before the modifying call. + */ res = call_os_sigaction(sig, act, &oldAct); - sact[sig] = oldAct; - if (oact != NULL) { - *oact = oldAct; + if (res == 0) { + if (act != NULL) { + /* store pre-existing handler as chained handler */ + sact[sig] = oldAct; + /* Record the signals used by jvm. */ + sigaddset(&jvmsigs, sig); + } + if (oact != NULL) { + *oact = oldAct; + } } - /* Record the signals used by jvm. */ - sigaddset(&jvmsigs, sig); - signal_unlock(); return res; } else { From ac0bc1b81c0d56afc86d32b2267efd7a88666cc6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 3 Oct 2023 20:10:56 +0000 Subject: [PATCH 048/177] 8306883: Thread stacksize is reported with wrong units in os::create_thread logging Backport-of: 27c5c1070ac559caa8dbad598337046f59355464 --- src/hotspot/os/aix/os_aix.cpp | 4 ++-- src/hotspot/os/bsd/os_bsd.cpp | 4 ++-- src/hotspot/os/linux/os_linux.cpp | 2 +- src/hotspot/os/windows/os_windows.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 153de42cc07..db8a11d934b 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -989,9 +989,9 @@ bool os::create_attached_thread(JavaThread* thread) { os::Aix::hotspot_sigmask(thread); log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT - ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).", os::current_thread_id(), (uintx) kernel_thread_id, - p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K); return true; } diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 0a93c3f3c8d..9931ad5a0f1 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -864,9 +864,9 @@ bool os::create_attached_thread(JavaThread* thread) { os::Bsd::hotspot_sigmask(thread); log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT - ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).", os::current_thread_id(), (uintx) pthread_self(), - p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K); return true; } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 7e6580e8eed..8519ac6879b 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -1114,7 +1114,7 @@ bool os::create_attached_thread(JavaThread* thread) { os::Linux::hotspot_sigmask(thread); log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT - ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).", os::current_thread_id(), (uintx) pthread_self(), p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K); diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 53b323b2175..638ad55f51d 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -545,9 +545,9 @@ bool os::create_attached_thread(JavaThread* thread) { thread->set_osthread(osthread); log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", stack: " - PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).", os::current_thread_id(), p2i(thread->stack_base()), - p2i(thread->stack_end()), thread->stack_size()); + p2i(thread->stack_end()), thread->stack_size() / K); return true; } From fb7e6e3899a55ba2381018e9a13a1f3a0c79ca4b Mon Sep 17 00:00:00 2001 From: Soumadipta Roy Date: Wed, 4 Oct 2023 15:54:08 +0000 Subject: [PATCH 049/177] 8315766: Parallelize gc/stress/TestStressIHOPMultiThread.java test Backport-of: edd454b502b9bacde55492820e52655bbac63b89 --- .../gc/stress/TestStressIHOPMultiThread.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java b/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java index 16eb328d52f..2e7d9d15358 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java +++ b/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java @@ -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 @@ -24,7 +24,7 @@ package gc.stress; /* - * @test TestStressIHOPMultiThread + * @test * @bug 8148397 * @key stress * @summary Stress test for IHOP @@ -34,21 +34,41 @@ * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread1.log * -Dtimeout=2 -DheapUsageMinBound=30 -DheapUsageMaxBound=80 * -Dthreads=2 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx256m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=2m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread2.log * -Dtimeout=2 -DheapUsageMinBound=60 -DheapUsageMaxBound=90 * -Dthreads=3 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx256m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=4m -XX:-G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread3.log * -Dtimeout=2 -DheapUsageMinBound=40 -DheapUsageMaxBound=90 * -Dthreads=5 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx128m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=8m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread4.log * -Dtimeout=2 -DheapUsageMinBound=20 -DheapUsageMaxBound=90 * -Dthreads=10 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx512m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread5.log From 96e3db73bc59eca7448df277a585bb75402e909a Mon Sep 17 00:00:00 2001 From: Soumadipta Roy Date: Wed, 4 Oct 2023 21:07:19 +0000 Subject: [PATCH 050/177] 8315937: Enable parallelism in vmTestbase/nsk/stress/numeric tests Backport-of: eb1f67b160c4d2b8feb7330786ecd8e53ed53946 --- .../nsk/stress/numeric/TEST.properties | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties b/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties deleted file mode 100644 index 8b51b2a9115..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -exclusiveAccess.dirs=. From 059f73cf900bf8c3d31375c5d34fd351888e82fb Mon Sep 17 00:00:00 2001 From: Yuri Nesterenko Date: Thu, 5 Oct 2023 11:24:32 +0000 Subject: [PATCH 051/177] 8242330: Arrays should be cloned in several JAAS Callback classes Reviewed-by: clanger Backport-of: 8cd9241448f818b5e307d408ac4395b518791096 --- .../auth/callback/ChoiceCallback.java | 18 ++-- .../auth/callback/ConfirmationCallback.java | 25 +++-- .../security/auth/callback/Mutability.java | 96 +++++++++++++++++++ 3 files changed, 121 insertions(+), 18 deletions(-) create mode 100644 test/jdk/javax/security/auth/callback/Mutability.java diff --git a/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java b/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java index b11f8943a15..561af912a7f 100644 --- a/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java +++ b/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -42,23 +42,23 @@ public class ChoiceCallback implements Callback, java.io.Serializable { * @serial * @since 1.4 */ - private String prompt; + private final String prompt; /** * @serial the list of choices * @since 1.4 */ - private String[] choices; + private final String[] choices; /** * @serial the choice to be used as the default choice * @since 1.4 */ - private int defaultChoice; + private final int defaultChoice; /** * @serial whether multiple selections are allowed from the list of * choices * @since 1.4 */ - private boolean multipleSelectionsAllowed; + private final boolean multipleSelectionsAllowed; /** * @serial the selected choices, represented as indexes into the * {@code choices} list. @@ -109,7 +109,7 @@ public ChoiceCallback(String prompt, String[] choices, } this.prompt = prompt; - this.choices = choices; + this.choices = choices.clone(); this.defaultChoice = defaultChoice; this.multipleSelectionsAllowed = multipleSelectionsAllowed; } @@ -129,7 +129,7 @@ public String getPrompt() { * @return the list of choices. */ public String[] getChoices() { - return choices; + return choices.clone(); } /** @@ -180,7 +180,7 @@ public void setSelectedIndex(int selection) { public void setSelectedIndexes(int[] selections) { if (!multipleSelectionsAllowed) throw new UnsupportedOperationException(); - this.selections = selections; + this.selections = selections == null ? null : selections.clone(); } /** @@ -192,6 +192,6 @@ public void setSelectedIndexes(int[] selections) { * @see #setSelectedIndexes */ public int[] getSelectedIndexes() { - return selections; + return selections == null ? null : selections.clone(); } } diff --git a/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java b/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java index 78113195ebf..4a3be94e472 100644 --- a/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java +++ b/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -121,31 +121,32 @@ public class ConfirmationCallback implements Callback, java.io.Serializable { /** ERROR message type. */ public static final int ERROR = 2; + /** * @serial * @since 1.4 */ - private String prompt; + private final String prompt; /** * @serial * @since 1.4 */ - private int messageType; + private final int messageType; /** * @serial * @since 1.4 */ - private int optionType = UNSPECIFIED_OPTION; + private final int optionType; /** * @serial * @since 1.4 */ - private int defaultOption; + private final int defaultOption; /** * @serial * @since 1.4 */ - private String[] options; + private final String[] options; /** * @serial * @since 1.4 @@ -205,8 +206,10 @@ public ConfirmationCallback(int messageType, break; } + this.prompt = null; this.messageType = messageType; this.optionType = optionType; + this.options = null; this.defaultOption = defaultOption; } @@ -252,8 +255,10 @@ public ConfirmationCallback(int messageType, throw new IllegalArgumentException(); } + this.prompt = null; this.messageType = messageType; - this.options = options; + this.optionType = UNSPECIFIED_OPTION; + this.options = options.clone(); this.defaultOption = defaultOption; } @@ -318,6 +323,7 @@ public ConfirmationCallback(String prompt, int messageType, this.prompt = prompt; this.messageType = messageType; this.optionType = optionType; + this.options = null; this.defaultOption = defaultOption; } @@ -370,7 +376,8 @@ public ConfirmationCallback(String prompt, int messageType, this.prompt = prompt; this.messageType = messageType; - this.options = options; + this.optionType = UNSPECIFIED_OPTION; + this.options = options.clone(); this.defaultOption = defaultOption; } @@ -422,7 +429,7 @@ public int getOptionType() { * an {@code optionType} instead of {@code options}. */ public String[] getOptions() { - return options; + return options == null ? null : options.clone(); } /** diff --git a/test/jdk/javax/security/auth/callback/Mutability.java b/test/jdk/javax/security/auth/callback/Mutability.java new file mode 100644 index 00000000000..3a0dff0ce6e --- /dev/null +++ b/test/jdk/javax/security/auth/callback/Mutability.java @@ -0,0 +1,96 @@ +/* + * 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 8242330 + * @library /test/lib + * @summary Arrays should be cloned in several JAAS Callback classes + */ + +import javax.security.auth.callback.ChoiceCallback; +import javax.security.auth.callback.ConfirmationCallback; + +import static jdk.test.lib.Asserts.assertEQ; + +public class Mutability { + public static void main(String[] args) { + + // #1. ConfirmationCallback.new(3) + String[] i11 = {"1", "2"}; + ConfirmationCallback c1 = new ConfirmationCallback( + ConfirmationCallback.INFORMATION, + i11, + 0); + + // Modify argument of constructor + i11[0] = "x"; + String[] o11 = c1.getOptions(); + assertEQ(o11[0], "1"); + // Modify output + o11[0] = "y"; + String[] o12 = c1.getOptions(); + assertEQ(o12[0], "1"); + + // #2. ConfirmationCallback.new(4) + String[] i21 = {"1", "2"}; + ConfirmationCallback c2 = new ConfirmationCallback( + "Hi", + ConfirmationCallback.INFORMATION, + i21, + 0); + + // Modify argument of constructor + i21[0] = "x"; + assertEQ(c2.getOptions()[0], "1"); + + // #3. ChoiceCallback.new + String[] i31 = {"1", "2"}; + ChoiceCallback c3 = new ChoiceCallback( + "Hi", + i31, + 0, + true); + + // Modify argument of constructor + i31[0] = "x"; + String[] o31 = c3.getChoices(); + assertEQ(o31[0], "1"); + // Modify output of getChoices + o31[0] = "y"; + String[] o32 = c3.getChoices(); + assertEQ(o32[0], "1"); + + int[] s31 = {0, 1}; + c3.setSelectedIndexes(s31); + + // Modify argument of setSelectedIndexes + s31[0] = 1; + int[] s32 = c3.getSelectedIndexes(); + assertEQ(s32[0], 0); + // Modify output of getSelectedIndexes + s32[1] = 0; + int[] s33 = c3.getSelectedIndexes(); + assertEQ(s33[1], 1); + } +} From 682bcf22312a5ec8cadec3b0241507cca42dec60 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 5 Oct 2023 12:31:01 +0000 Subject: [PATCH 052/177] 8316514: Better diagnostic header for VtableStub Backport-of: 6c61bc195090abf73683b811e214810a1226d299 --- src/hotspot/share/code/vtableStubs.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/code/vtableStubs.cpp b/src/hotspot/share/code/vtableStubs.cpp index 7892cc85b39..3c986f40ff7 100644 --- a/src/hotspot/share/code/vtableStubs.cpp +++ b/src/hotspot/share/code/vtableStubs.cpp @@ -223,8 +223,9 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) { enter(is_vtable_stub, vtable_index, s); if (PrintAdapterHandlers) { - tty->print_cr("Decoding VtableStub %s[%d]@" INTX_FORMAT, - is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location())); + tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (" SIZE_FORMAT " bytes)", + is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location()), + p2i(s->code_begin()), p2i(s->code_end()), pointer_delta(s->code_end(), s->code_begin(), 1)); Disassembler::decode(s->code_begin(), s->code_end()); } // Notify JVMTI about this stub. The event will be recorded by the enclosing From 0aba9b7b5c74ac6530cc872ac5cbed8f716f80ac Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Fri, 6 Oct 2023 09:04:17 +0000 Subject: [PATCH 053/177] 8316710: Exclude java/awt/font/Rotate/RotatedTextTest.java Backport-of: 31422d70d09277d604446a9bccad859c1ae9f3c2 --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index e33259f388c..db0315821a8 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -441,6 +441,7 @@ java/awt/Modal/OnTop/OnTopTKModal6Test.java 8198666 macosx-all java/awt/List/SingleModeDeselect/SingleModeDeselect.java 8196367 windows-all java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235 macosx-all javax/print/PrintSEUmlauts/PrintSEUmlauts.java 8135174 generic-all +java/awt/font/Rotate/RotatedTextTest.java 8219641 linux-all java/awt/font/TextLayout/LigatureCaretTest.java 8197821 generic-all java/awt/Graphics2D/DrawString/RotTransText.java 8197797 generic-all java/awt/image/VolatileImage/CustomCompositeTest.java 8199002 windows-all,linux-all From df5ff37ba2059b5931502bccf79e1585e90f35dc Mon Sep 17 00:00:00 2001 From: Soumadipta Roy Date: Mon, 9 Oct 2023 18:49:49 +0000 Subject: [PATCH 054/177] 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java Reviewed-by: phh Backport-of: 4415261688dc258b6d254668bcf8818c61cc65ea --- .../util/concurrent/tck/JSR166TestCase.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java index c936a3e9e27..5ff3898fb2d 100644 --- a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java +++ b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java @@ -35,30 +35,45 @@ */ /* - * @test - * @summary JSR-166 tck tests, in a number of variations. - * The first is the conformance testing variant, - * while others also test implementation details. + * @test id=default + * @summary Conformance testing variant of JSR-166 tck tests. * @build * * @modules java.management * @run junit/othervm/timeout=1000 JSR166TestCase + */ + +/* + * @test id=forkjoinpool-common-parallelism + * @summary Test implementation details variant of JSR-166 + * tck tests with ForkJoinPool common parallelism. + * @build * + * @modules java.management * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED * -Djsr166.testImplementationDetails=true + * -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 * JSR166TestCase * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED * -Djsr166.testImplementationDetails=true - * -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 + * -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 + * -Djava.util.secureRandomSeed=true * JSR166TestCase + */ + +/* + * @test id=others + * @summary Remaining test implementation details variant of + * JSR-166 tck tests apart from ForkJoinPool common + * parallelism. + * @build * + * @modules java.management * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED * -Djsr166.testImplementationDetails=true - * -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 - * -Djava.util.secureRandomSeed=true * JSR166TestCase * @run junit/othervm/timeout=1000/policy=tck.policy * --add-opens java.base/java.util.concurrent=ALL-UNNAMED From c4faab66933b5977a466f28c31cba9fc099c8fb4 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Wed, 11 Oct 2023 07:28:28 +0000 Subject: [PATCH 055/177] 8308592: Framework for CA interoperability testing Reviewed-by: mbaesken Backport-of: cb535e2d52221bfc23e4c26a730399bceb573547 --- .../certification/ActalisCA.java | 217 ------ .../certification/AmazonCA.java | 613 ----------------- .../certification/BuypassCA.java | 330 --------- .../certification/CAInterop.java | 561 +++++++++++++++ .../{CertignaRoots.java => CertignaCA.java} | 95 +-- .../certification/ComodoCA.java | 643 ------------------ .../certification/EntrustCA.java | 319 --------- .../certification/GlobalSignR6CA.java | 212 ------ .../certification/GoDaddyCA.java | 346 ---------- .../certification/GoogleCA.java | 621 ----------------- .../certification/LetsEncryptCA.java | 180 ----- .../certification/MicrosoftTLS.java | 348 ---------- .../certification/QuoVadisCA.java | 495 -------------- .../certification/SSLCA.java | 489 ------------- .../certification/TWCAGlobalCA.java | 206 ------ .../certification/TeliaSoneraCA.java | 195 ------ .../certification/ValidatePathWithURL.java | 231 +++++++ 17 files changed, 803 insertions(+), 5298 deletions(-) delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java create mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java rename test/jdk/security/infra/java/security/cert/CertPathValidator/certification/{CertignaRoots.java => CertignaCA.java} (74%) delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java delete mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java create mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java deleted file mode 100644 index cd1db71c418..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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 - * 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 8189131 - * @summary Interoperability tests with Actalis CA - * @build ValidatePathWithParams - * @run main/othervm/timeout=180 -Djava.security.debug=certpath ActalisCA OCSP - * @run main/othervm/timeout=180 -Djava.security.debug=certpath ActalisCA CRL - */ - - /* - * Obtain test artifacts for Actalis CA from: - * - * Test website with *active* TLS Server certificate: - * https://ssltest-active.actalis.it/ - * - * Test website with *revoked* TLS Server certificate: - * https://ssltest-revoked.actalis.it/ - * - * Test website with *expired* TLS Server certificate: - * https://ssltest-expired.actalis.it/ - */ -public class ActalisCA { - - // Owner: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p.A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Issuer: CN=Actalis Authentication Root CA, O=Actalis S.p.A ./03358520967, - // L=Milan, C=IT - // Serial number: 5c3b3f37adfc28fe0fcfd3abf83f8551 - // Valid from: Mon Jul 06 00:20:55 PDT 2020 until: Sun Sep 22 04:22:02 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdTCCBV2gAwIBAgIQXDs/N638KP4Pz9Or+D+FUTANBgkqhkiG9w0BAQsFADBr\n" + - "MQswCQYDVQQGEwJJVDEOMAwGA1UEBwwFTWlsYW4xIzAhBgNVBAoMGkFjdGFsaXMg\n" + - "Uy5wLkEuLzAzMzU4NTIwOTY3MScwJQYDVQQDDB5BY3RhbGlzIEF1dGhlbnRpY2F0\n" + - "aW9uIFJvb3QgQ0EwHhcNMjAwNzA2MDcyMDU1WhcNMzAwOTIyMTEyMjAyWjCBiTEL\n" + - "MAkGA1UEBhMCSVQxEDAOBgNVBAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRlIFNh\n" + - "biBQaWV0cm8xFzAVBgNVBAoMDkFjdGFsaXMgUy5wLkEuMTQwMgYDVQQDDCtBY3Rh\n" + - "bGlzIE9yZ2FuaXphdGlvbiBWYWxpZGF0ZWQgU2VydmVyIENBIEczMIICIjANBgkq\n" + - "hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAs73Ch+t2owm3ayTkyqy0OPuCTiybxTyS\n" + - "4cU4y0t2RGSwCNjLh/rcutO0yoriZxVtPrNMcIRQ544BQhHFt/ypW7e+t8wWKrHa\n" + - "r3BkKwSUbqNwpDWP1bXs7IJTVhHXWGAm7Ak1FhrrBmtXk8QtdzTzDDuxfFBK7sCL\n" + - "N0Jdqoqb1V1z3wsWqAvr4KlSCFW05Nh4baWm/kXOmb8U+XR6kUmuoVvia3iBhotR\n" + - "TzAHTO9SWWkgjTcir/nhBvyL2RoqkgYyP/k50bznaVOGFnFWzfl0XnrM/salfCBh\n" + - "O0/1vNaoU8elR6AtbdCFAupgQy95GuFIRVS8n/cF0QupfPjUl+kGSLzvGAc+6oNE\n" + - "alpAh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C9Cd8vojN3qlDgaNLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0B\n" + - "AQsFAAOCAgEAJbygMnKJ5M6byr5Ectq05ODqwNMtky8TEF3O55g6RHhxblf6OegZ\n" + - "4ui4+ElHNOIXjycbeuUGuFA4LScCC9fnI1Rnn8TI2Q7OP5YWifEfnrdp99t/tJzQ\n" + - "hfdi7ZTdRRZZGV9x+grfR/RtjT2C3Lt9X4lcbuSxTea3PHAwwi0A3bYRR1L5ciPm\n" + - "eAnYtG9kpat8/RuC22oxiZZ5FdjU6wrRWkASRLiIwNcFIYfvpUbMWElaCUhqaB2y\n" + - "YvWF8o02pnaYb4bvTCg4cVabVnojUuuXH81LeQhhsSXLwcdwSdew0NL4zCiNCn2Q\n" + - "iDZpz2biCWDggibmWxsUUF6AbqMHnwsdS8vsKXiFQJHeAdNAhA+kwpqYAdhUiCdj\n" + - "RTUdtRNUucLvZEN1OAvVYyog9xYCfhtkqgXQROMANP+Z/+yaZahaP/Vgak/V00se\n" + - "Hdh7F+B6h5HVdwdh+17E2jl+aMTfyvBFcg2H/9Qjyl4TY8NW/6v0DPK52sVt8a35\n" + - "I+7xLGLPohAl4z6pEf2OxgjMNfXXCXS33smRgz1dLQFo8UpAb3rf84zkXaqEI6Qi\n" + - "2P+5pibVFQigRbn4RcE+K2a/nm2M/o+WZTSio+E+YXacnNk71VcO82biOof+jBKT\n" + - "iC3Xi7rAlypmme+QFBw9F1J89ig3smV/HaN8tO0lfTpvm7Zvzd5TkMs=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=ssltest-active.actalis.it, O=Actalis S.p.A., L=Ponte San Pietro, - // ST=Bergamo, C=IT - // Issuer: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Serial number: 4a49e2afcd448af3b7f5f14e1cd5954 - // Valid from: Tue Mar 08 08:00:57 PST 2022 until: Wed Mar 08 08:00:57 PST 2023 - private static final String VALID = "-----BEG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qbQC\n" + - "IQCrpcYqt53tX/rSMoGnjFhDGnMhnYyc2AqzpokfhmdcVTANBgkqhkiG9w0BAQsF\n" + - "AAOCAgEAfXISBKP1dZQv1kkWZVDXiVY/fv+068DKq2e8hgBcsN6b9a2rlVfBU2iq\n" + - "W9KqFNET5GDWf1wjM71Itjau8b1A3+apcNdEGQk3eqIOymK5kVtVvAI2ahp4926x\n" + - "Kkt/sexmi1pJGA+eLfTixkCoaESh5P8U7HDW/vUFXm2AtLQih+oT5OVoYt5e9pXr\n" + - "hr8oadm/ZDJxiyDL1vcTIsl2TM4/Fpo2IWxYzUC+YshnuLiRwWI840maJmWFx/lJ\n" + - "Pzdik3P51Uef7VsCSBhTxER09/B4IrEUMDAhVgG5QNbcFSHvnmpV8JLrNuBKUROU\n" + - "xnDsWieKlb5YO6S6PjGOncOrd+k4RCIYRaekSnx52WBKkpqxMEv/rjY1Glx4Cota\n" + - "mpNiYDvZHGzrRQtY2eH17XhFatBxEEbJMA+0QPbFksHcKxAxJgMDncqag4TDq5fT\n" + - "I2NUxqiB51F5w0x+++lyLnUZ+z4BJFZ73VdtfoJ2fsuRhemOoZjHPi/V2exXpAfb\n" + - "pomha3KCrTcuFv1lj8mPx5L4ciNPxuDFgjeXEaTGjS8IvdNoJIrgdHdahMwkwS/y\n" + - "wei7FJ1Ey0maqRUpUlAY6sIQPQ/KDltTuKX/C94C5pYLI0JXCScr5xg6C+r2ckbA\n" + - "rjhpn3C/NptVyZgT8bL4XT5ITrAjwPciBj0yxYzUkrLZO1wKQSQ=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=ssltest-revoked.actalis.it, O=Actalis S.p.A., L=Ponte San Pietro, ST=Bergamo, C=IT - // Issuer: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p.A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Serial number: 320955171b78d49507508910da2c5bc4 - // Valid from: Tue Sep 27 03:40:43 PDT 2022 until: Wed Sep 27 03:40:43 PDT 2023 - private static final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\n" + - "hAvFAiAvBE0rbxgm8TpZLG2TaMk3dqZj7Q6FFdLlqTsvwhKa3jANBgkqhkiG9w0B\n" + - "AQsFAAOCAgEAEnPALMVp1pySJgHhugLWAUgiD6stpDWCKfaBxPr+jf34A5wS+m5r\n" + - "2VhYyNQpOwIQB76K2RSJQrdpg7Dg2L6EiUnbbClSTrOkZ4XX5ggBIjldDEx4ZxhI\n" + - "zwSw4KB6+DDAVMwsCL0q0E7AAPOMaZ0RDLteusqQYIYm08TXfJPWD8LjQPt/8Uie\n" + - "LOqm1eLUuwJc+eHFWV+Xr8Uea6SFwqNEj7qPHb2MElctET/MhSIIUKI1ObmrFwyB\n" + - "ElKEPaUh9L0HXpnuD8IWc7tw2mdvnWJhuGG8G6JkasTGvtZ4gKIDBdTrJcuj7MCS\n" + - "amz3ZBCY47tP1ohgImjqwg4ITYjX6UQXgj/nBVDdu+nXkEhx16uPJkTYWaun9Nio\n" + - "8RjYIOxXmDD39QbGUElP0Epsr2wcVT9tIFYMGzUpIO51mCk3Aq1AmiQZwZZhqOIN\n" + - "RDx7lGESPj3IgdVfJi9Ing/OUNtS46Ug9DSuDcGqdY7KnTYEUdWGsUJNtnpjd4lS\n" + - "U6oIAeW1aKuOve6iNg1vsFAN57aJNh1ih3BOup58J9ve42bNlAYWN8wiNxM+Aeba\n" + - "ArUSTnH/QEYCyMRD0XqIREVR9VhNODgSZbL3XedYBAW9wImi1whp+u+8aReXd7lC\n" + - "Q3kD9KRyfZ9Kk05Glf3DsZMWvp1N2ZZWaU2Ms5U3ijUheCiBrqrs8a8=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Sep 27 03:52:40 PDT 2022", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java deleted file mode 100644 index dec0ff8872a..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java +++ /dev/null @@ -1,613 +0,0 @@ -/* - * 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 - * 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 8233223 - * @summary Interoperability tests with Amazon's CA1, CA2, CA3, and CA4 - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath AmazonCA OCSP - * @run main/othervm -Djava.security.debug=certpath AmazonCA CRL - */ - -/* - * Obtain TLS test artifacts for Amazon CAs from: - * - * Amazon Root CA 1 - * Valid - https://good.sca1a.amazontrust.com/ - * Revoked - https://revoked.sca1a.amazontrust.com/ - * Amazon Root CA 2 - * Valid - https://good.sca2a.amazontrust.com/ - * Revoked - https://revoked.sca2a.amazontrust.com/ - * Amazon Root CA 3 - * Valid - https://good.sca3a.amazontrust.com/ - * Revoked - https://revoked.sca3a.amazontrust.com/ - * Amazon Root CA 4 - * Valid - https://good.sca4a.amazontrust.com/ - * Revoked - https://revoked.sca4a.amazontrust.com/ - */ -public class AmazonCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new AmazonCA_1().runTest(pathValidator); - new AmazonCA_2().runTest(pathValidator); - new AmazonCA_3().runTest(pathValidator); - new AmazonCA_4().runTest(pathValidator); - } -} - -class AmazonCA_1 { - - // Owner: CN=Amazon RSA 2048 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 773124a4bcbd44ec7b53beaf194842d3a0fa1 - // Valid from: Tue Aug 23 15:25:30 PDT 2022 until: Fri Aug 23 15:25:30 PDT 2030 - private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEXjCCA0agAwIBAgITB3MSSkvL1E7HtTvq8ZSELToPoTANBgkqhkiG9w0BAQsF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjUzMFoXDTMwMDgyMzIyMjUzMFowPDEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + - "QSAyMDQ4IE0wMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtDGMZa\n" + - "qHneKei1by6+pUPPLljTB143Si6VpEWPc6mSkFhZb/6qrkZyoHlQLbDYnI2D7hD0\n" + - "sdzEqfnuAjIsuXQLG3A8TvX6V3oFNBFVe8NlLJHvBseKY88saLwufxkZVwk74g4n\n" + - "WlNMXzla9Y5F3wwRHwMVH443xGz6UtGSZSqQ94eFx5X7Tlq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- "4zl+EoNaWdpnWndvSpAEkq2P\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=Amazon RSA 2048 M01, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 77312380b9d6688a33b1ed9bf9ccda68e0e0f - // Valid from: Tue Aug 23 15:21:28 PDT 2022 until: Fri Aug 23 15:21:28 PDT 2030 - private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEXjCCA0agAwIBAgITB3MSOAudZoijOx7Zv5zNpo4ODzANBgkqhkiG9w0BAQsF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjEyOFoXDTMwMDgyMzIyMjEyOFowPDEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + - "QSAyMDQ4IE0wMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOtxLKnL\n" + - "H4gokjIwr4pXD3i3NyWVVYesZ1yX0yLI2qIUZ2t88Gfa4gMqs1YSXca1R/lnCKeT\n" + - "epWSGA+0+fkQNpp/L4C2T7oTTsddUx7g3ZYzByDTlrwS5HRQQqEFE3O1T5tEJP4t\n" + - "f+28IoXsNiEzl3UGzicYgtzj2cWCB41eJgEmJmcf2T8TzzK6a614ZPyq/w4CPAff\n" + - "nAV4coz96nW3AyiE2uhuB4zQUIXvgVSycW7sbWLvj5TDXunEpNCRwC4kkZjK7rol\n" + - "jtT2cbb7W2s4Bkg3R42G3PLqBvt2N32e/0JOTViCk8/iccJ4sXqrS1uUN4iB5Nmv\n" + - "JK74csVl+0u0UecCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD\n" + - "VR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNV\n" + - "HQ4EFgQUgbgOY4qJEhjl+js7UJWf5uWQE4UwHwYDVR0jBBgwFoAUhBjMhTTsvAyU\n" + - "lC4IWZzHshBOCggwewYIKwYBBQUHAQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8v\n" + - "b2NzcC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDov\n" + - "L2NydC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8E\n" + - "ODA2MDSgMqAwhi5odHRwOi8vY3JsLnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jv\n" + - "b3RjYTEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IB\n" + - "AQCtAN4CBSMuBjJitGuxlBbkEUDeK/pZwTXv4KqPK0G50fOHOQAd8j21p0cMBgbG\n" + - "kfMHVwLU7b0XwZCav0h1ogdPMN1KakK1DT0VwA/+hFvGPJnMV1Kx2G4S1ZaSk0uU\n" + - "5QfoiYIIano01J5k4T2HapKQmmOhS/iPtuo00wW+IMLeBuKMn3OLn005hcrOGTad\n" + - "hcmeyfhQP7Z+iKHvyoQGi1C0ClymHETx/chhQGDyYSWqB/THwnN15AwLQo0E5V9E\n" + - "SJlbe4mBlqeInUsNYugExNf+tOiybcrswBy8OFsd34XOW3rjSUtsuafd9AWySa3h\n" + - "xRRrwszrzX/WWGm6wyB+f7C4\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca1.demo.amazontrust.com - // Issuer: CN=Amazon RSA 2048 M02, O=Amazon, C=US - // Serial number: 60c6e837b2e7586d8464eb34f4a85fe - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIGKDCCBRCgAwIBAgIQBgxug3sudYbYRk6zT0qF/jANBgkqhkiG9w0BAQ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/p7Ta3Uky6std/GM6XbPRdBEFboFR\n" + - "B2IP0divd9c74Q+tLgpsAz5yXm9LtYPMcEPC2YRN2PgBg67c5+A7eIOluuw=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca1.demo.amazontrust.com - // Issuer: CN=Amazon RSA 2048 M01, O=Amazon, C=US - // Serial number: e1023665b1268d788cc25bf69a9d05e - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGMjCCBRqgAwIBAgIQDhAjZlsSaNeIzCW/aanQXjANBgkqhkiG9w0BAQsFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDIwNDggTTAxMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLzEt\n" + - "MCsGA1UEAxMkcmV2b2tlZC5yb290Y2ExLmRlbW8uYW1hem9udHJ1c3QuY29tMIIB\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxSPd1PWACxZohFCAJT1JWuXK\n" + - "GY29wZZ9yY0zoiq6+qYiUIU0crktytUNNI1ZpW/3qXpEw2ZQkM6WF1LshXtwGwrA\n" + - "zJwSeX1L9T5rOKhoBvoFeqfX7xu4VBM1/fDGt5X+NRFfD9Op9UfK5OsnL05TYach\n" + - "rdnfOA5wKGvMgFiN5CeOD0AtumXSuAnTZC85ojJTHjPF+hqV893WvrrUxLyyxtvh\n" + - "lq/WttFOjhfQu2IkfyDAFiH939uzUi0WSTAdsbsHuko5mDTDnOfMRbaaWZu0At01\n" + - "EgaIPeK+kGdi7EYwVndIwTKLeQ4mjIM8aj8Heg/y2hZ0kOmfCUZdUmJFlNoCIQID\n" + - "AQABo4IDOzCCAzcwHwYDVR0jBBgwFoAUgbgOY4qJEhjl+js7UJWf5uWQE4UwHQYD\n" + - "VR0OBBYEFMeBhIOkuWUY4DYqFrfgbD2eUeFtMG0GA1UdEQRmMGSCJHJldm9rZWQu\n" + - "cm9vdGNhMS5kZW1vLmFtYXpvbnRydXN0LmNvbYIdcmV2b2tlZC5zY2EwYS5hbWF6\n" + - "b250cnVzdC5jb22CHXJldm9rZWQuc2NhMWEuYW1hem9udHJ1c3QuY29tMA4GA1Ud\n" + - "DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0f\n" + - "BDQwMjAwoC6gLIYqaHR0cDovL2NybC5yMm0wMS5hbWF6b250cnVzdC5jb20vcjJt\n" + - "MDEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggr\n" + - "BgEFBQcwAYYhaHR0cDovL29jc3AucjJtMDEuYW1hem9udHJ1c3QuY29tMDYGCCsG\n" + - "AQUFBzAChipodHRwOi8vY3J0LnIybTAxLmFtYXpvbnRydXN0LmNvbS9yMm0wMS5j\n" + - "ZXIwDAYDVR0TAQH/BAIwADCCAX4GCisGAQQB1nkCBAIEggFuBIIBagFoAHYA7s3Q\n" + - "ZNXbGs7FXLedtM0TojKHRny87N7DUUhZRnEftZsAAAGIB72TggAABAMARzBFAiAZ\n" + - "naLbRHRuaRrE304GSuWX/79MU/e+SSlr0cNJ0kNNaAIhAPnz9HayL4txhkTEZiMs\n" + - "nttNnNqD17I0J17JLVOF4i/4AHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/\n" + - "qznYhHMAAAGIB72TmwAABAMARzBFAiEAgEqT7CYGQ/u36/3YcxBH78QfknI9kgcY\n" + - "sgJLkurUF6cCIFZZ/b803+ek6o+bmdV/uVx2UlskAyyolZ2okBAb6IscAHYA2ra/\n" + - "az+1tiKfm8K7XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGIB72TbQAABAMARzBFAiEA\n" + - "6z2RSoK263hvYF71rj1d0TpC70/6zagSRR4glHOT6IACICYvaMAnrCNSTSiZ20Wz\n" + - "Ju5roTippO3BWKhQYrTKZuu4MA0GCSqGSIb3DQEBCwUAA4IBAQB4S1JGulFpMIaP\n" + - "NtLUJmjWz8eexQdWLDVF+H8dd6xpZgpiYtig/Ynphzuk1IIF8DkT3CeK/9vrezgI\n" + - "igNjneN9B4eIuzi/rJzIKeUwpZ2k5D+36Ab4esseoc+TopmNerw8hidt2g818jER\n" + - "D71ppSMakeQFPGe/Hs2/cVa/G1DNVcU2XAut45yRZ/+xsZ0/mcBDVsG9P5uGCN5O\n" + - "7SAp4J959WnKDqgVuU9WowPE5IjmS9BAv2gjniFYdDV2yksyf7+8edHd1KfSVX06\n" + - "pLx6CuCVZGJFG4Q2Aa1YAh1Wvt9hqWeXXpNRO2/wChL5rhT4GajsrGepsk4bjxYX\n" + - "Wf2iZ8mX\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT_VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:36:57 PDT 2023", System.out); - } -} - -class AmazonCA_2 { - - // Owner: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 2, O=Amazon, C=US - // Serial number: 773125b0c34c3c940299a9f04a39e5a52ccd9 - // Valid from: Tue Aug 23 15:29:13 PDT 2022 until: Fri Aug 23 15:29:13 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGXjCCBEagAwIBAgITB3MSWww0w8lAKZqfBKOeWlLM2TANBgkqhkiG9w0BAQwF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAyMB4XDTIyMDgyMzIyMjkxM1oXDTMwMDgyMzIyMjkx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bjMp7P3pOZSPr6G1WkNy9mX8\n" + - "rVc=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca2.demo.amazontrust.com - // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Serial number: 662f7646d76193cbb76946d111e49fa - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIICzCCBfOgAwIBAgIQBmL3ZG12GTy7dpRtER5J+jANBgkqhkiG9w0BAQwFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDQwOTYgTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLTEr\n" + - "MCkGA1UEAxMidmFsaWQucm9vdGNhMi5kZW1vLmFtYXpvbnRydXN0LmNvbTCCAiIw\n" + - "DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAON5EbEKoBiujI7Ja8mLZLJbaY7f\n" + - "RtoWIjU/F0l9ueWFogXmEaA1jWsl97F3WTHTyGKz6ChCjPMSyoXXpY+yoE90QUyX\n" + - "w35uWEhNrc40drMJkyN+QXitSrH346GCOKvpYVvu18UD4W8hDhg8vvbOQYhtmSf7\n" + - "Rfrs7/qUdXpzpvR9VjWktbQAzJT8fB/jFNjNQJTknynjGiYO5GF51+peOCLK6qw8\n" + - "9kKYEigR4K8/aWL283rC4xRxZqVioy433VG02l/Fwdv8o/vL9YYIqkyspCB9fpFw\n" + - "Q50yYrwEomxuOz7rXhmdfeNaFYuyTtOUSKff6p2oqO0S7pcLujUVMlO4dYBDELQF\n" + - "cabByNjwblviCtGKJMIzD6Thkgamp3iXQgcU498+P5r7N5CYbMmkJEdcuILg+bgJ\n" + - "/LUUTT+IMt2txYlO/ld3N0EHlgVt7rztW5mtm6Ba8jN7cLSh7ZWu6Fr1+oK7bl5T\n" + - "wPxSfq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B5Hmd9F31un6jundEuG4+S4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca2.demo.amazontrust.com - // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Serial number: 788baa8f47bc5b1c624424216240fd3 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIEjCCBfqgAwIBAgIQB4i6qPR7xbHGJEJCFiQP0zANBgkqhkiG9w0BAQwFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDQwOTYgTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLzEt\n" + - "MCsGA1UEAxMkcmV2b2tlZC5yb290Y2EyLmRlbW8uYW1hem9udHJ1c3QuY29tMIIC\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzJfddWdrWhA9dSJdmy23veN9\n" + - "oLvSqpM4YaXGZmPtKUmbFMLs2I3vCKrzflRKeOpl3MCc2hh6TH/3z+Q/fGugXLsY\n" + - "H8QcjSbiIOd15n+3dUFTLKaoWMyseMcWiOIVaN5rCDVXiAHdt1pc147wyFQIzqNK\n" + - "J/xiV1u9eT2MFue+4bd7kUNAcmI8M+SXruhto4jtAV8ugpTEChTDlyO/l8xmaM1Q\n" + - "HkijsHX7Aq72Q/3PH/U+wbJ9pmpTp4x2AEJoo45IGfB/NKDTrv5otLBuiP8Y0M7b\n" + - "K7irRPDFBqMNZw7S7p39SnC+V/WibJQk5Bo/8vcwDJX+WnDkw1QD/uXu3ugDzSDD\n" + - "iBDViMOdN+3K47s4x2kdssoh4WWScMlAVb4vyN7IA3J4TnwA/1uCWhw4LE1WvY7N\n" + - "etekhVP1eWF8IzNY0oo2u2ie79777xvBtmtp7RnvYLGv7I+xVhjH5qGNzn9fRCUm\n" + - "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xxSActW3SyB2bu/qznYhHMAAAGIB72DDgAA\n" + - "BAMARzBFAiAvfNcgtFEwk5C9dvMUYANbIAv0IOdF1new8Umn3cM+JwIhALbs/3L9\n" + - "0ndF7sRKDZmfronNruptFlrI528P5Qi2P528AHUA2ra/az+1tiKfm8K7XGvocJFx\n" + - "bLtRhIU0vaQ9MEjX+6sAAAGIB72CxQAABAMARjBEAiBKUns2FPbs0cThb6e7SnyL\n" + - "y4/qP3V1Q/ASt/ZDRTeEQQIgWSQO4Gsz32srtqYuTM9AsFd92WA44kJHincdcGVX\n" + - "XbIwDQYJKoZIhvcNAQEMBQADggIBAAnaNbn2wXylTCS7dtgB3rWdUf6hja1UDuvB\n" + - "uZEL2dUOvyXfVFLNxKdeWBPzqpwEBNNwPQXhoI97TXlyu2x60jLzQamoGoRQ3s0P\n" + - "NLhasLGEIQH/oYdMV/yp8EI8fUuRVE3xyw39FRqOrmsUFAnxNQmBO/09JM7sLcvS\n" + - "wwh14p9dFTTolJHgnL4ZEtmZxSddFG+GBSTJ/A7dVSmwIudwzd+goA6173BI6yeT\n" + - "hhQumLctQiOM7y1MzFeV8rL+oIpd2xuzyhKKT1EgvU6/wyt0Ib8QqsFsrXPnUOKk\n" + - "HAq3SeZyq35QUaTKoaH9L1iZMbSCG9Jm6FMb12SdAz53653tYvAiUS76oD8Jot13\n" + - "RZu5NUlWAVLLq0OaEtuGp0bh+cVtzVnCC9m1qa46YpY0SojpvSbakgQMMGIgDlT3\n" + - "wFE7tST4WlsDC1f/m+H9V5qz/j0U8D3eNNdowxPqx/JZq/sk9ZK5KyMFARrvM+fh\n" + - "YrVYjKt91mu7JaS4pPOyZmJ8OQ14EvrN7BXc7IkNrI1reeaRFe49k5DAETB8VmP5\n" + - "2F0SWou2KkgtJvU4Z7YjlZ2HNHnpjTK5KdPNpRSt7EUy2zn9NCNoyQhnws70FyXv\n" + - "oPFyG92lnUQOKaAUhVRwTr9fvnkdMOzSKg/spxi2Ogdzym5Jw68eguwi0dVqX2+9\n" + - "3zViP2aH\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:38:54 PDT 2023", System.out); - } -} - -class AmazonCA_3 { - - // Owner: CN=Amazon ECDSA 256 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 773126de2c2fafd2c47ad88b1566e0182046d - // Valid from: Tue Aug 23 15:33:24 PDT 2022 until: Fri Aug 23 15:33:24 PDT 2030 - private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIC1DCCAnmgAwIBAgITB3MSbeLC+v0sR62IsVZuAYIEbTAKBggqhkjOPQQDAjA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTIyMDgyMzIyMzMyNFoXDTMwMDgyMzIyMzMyNFowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDI1NiBNMDIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS9vQLD4W/Kg4AnFRl8\n" + - "x/FUbLqtd5ICYjUijGsytF9hmgb/Dyk+Ebt4cw6rAlGbaiOLapSJKZiZr+UQdh3I\n" + - "QOr+o4IBWjCCAVYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + - "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBS7eJrXaDMy\n" + - "nRq7bP2xNEwB3svQdTAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + - "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + - "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + - "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSQAwRgIhAKSYEcDcp3kcPMzh\n" + - "OIYDWZOLu4InPod4fQhRTmc2zBAgAiEAmwdGE4AuNWhw9N8REhf82rJLNm7h9Myg\n" + - "TsR9Wu0bQYU=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=Amazon ECDSA 256 M01, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 773126684d577c0fcf8d3a342bea86f94fc8f - // Valid from: Tue Aug 23 15:31:46 PDT 2022 until: Fri Aug 23 15:31:46 PDT 2030 - private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIC0zCCAnmgAwIBAgITB3MSZoTVd8D8+NOjQr6ob5T8jzAKBggqhkjOPQQDAjA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTIyMDgyMzIyMzE0NloXDTMwMDgyMzIyMzE0NlowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDI1NiBNMDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT80w+2RwNHzyXmVUM/\n" + - "OUKBZpJkTzHyCKDl4sBrUfjzVjot/lNba9kYzMKSHYv95CUDoMaF2h2KAqx65uLQ\n" + - "Y8ago4IBWjCCAVYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + - "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBRPWfy8BhYo\n" + - "v6LI2wj7zxMkumlCXDAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + - "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + - "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + - "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSAAwRQIhALRfxq3SQIhj5xA4\n" + - "S5UAY/KlKqayZDpnbBdCDH8Kqmf/AiAUVZddALefnqRe+ifxN2FUp461LL6/cgVM\n" + - "EH3Ty27f1Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca3.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 256 M02, O=Amazon, C=US - // Serial number: 8e2f14864fb28e4a1da0f15a5118cc8 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEfjCCBCWgAwIBAgIQCOLxSGT7KOSh2g8VpRGMyDAKBggqhkjOPQQDAjA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMjU2IE0wMjAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTl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AAAEAwBHMEUCIF7wDDmWxTHwBZM7Me8eOCM1aQ/g1c1rJg/I+NJa\n" + - "HkZYAiEA8p+IviuY5piHBELjUtVlZLiS9XSSMxpQNhUerqC/YFoAdQDatr9rP7W2\n" + - "Ip+bwrtca+hwkXFsu1GEhTS9pD0wSNf7qwAAAYgHvXKvAAAEAwBGMEQCIFLskZDs\n" + - "UG4+/88D/5/QbD9zT6ZmZlwXiPZ6H2YR/KiJAiBvi4vvNsb9KNAhJMgI2T2iCg9U\n" + - "CIru+US6y3ua7dKKDTAKBggqhkjOPQQDAgNHADBEAiAzvgzKV/kvBbKWCT1NNUBD\n" + - "AF9okIEcJx/ukFgzmYMwUQIgXeJeVf3izkxsgiEUSknwHsErLFs/cEme2PSRj2AW\n" + - "dYA=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca3.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 256 M01, O=Amazon, C=US - // Serial number: c458bfaeedae16a5e61fe64773fc898 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEhzCCBC2gAwIBAgIQDEWL+u7a4WpeYf5kdz/ImDAKBggqhkjOPQQDAjA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMjU2IE0wMTAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTlaMC8xLTAr\n" + - "BgNVBAMTJHJldm9rZWQucm9vdGNhMy5kZW1vLmFtYXpvbnRydXN0LmNvbTBZMBMG\n" + - "ByqGSM49AgEGCCqGSM49AwEHA0IABAsSs5kW5TZlS0SDrMb9iUQAqEaKa12Fc6SN\n" + - "9UR6qtOFdW/1UuziDq3Hl5dqsAYZJkbJSPCIsD2HTP/EGTMKITCjggMbMIIDFzAf\n" + - "BgNVHSMEGDAWgBRPWfy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ZrPO6d1HEVPQGo7wLzkl8CIGHp3PQmmrEofl76\n" + - "4da7bY0L+csFW0sB8clN0KziMfe6MAoGCCqGSM49BAMCA0gAMEUCIQC+6VdX9X5g\n" + - "x3NSUmJ7py01Zxf26TNBv1ildxqesvZ/7wIgIrefriRzPiIFDHCUbdjk0VlmMwZR\n" + - "VzXXHINsGCiCKOs=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT_VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:41:22 PDT 2023", System.out); - } -} - -class AmazonCA_4 { - - // Owner: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 4, O=Amazon, C=US - // Serial number: 773127dfaa6b9e2b95538aa76dde4307f17c4 - // Valid from: Tue Aug 23 15:36:58 PDT 2022 until: Fri Aug 23 15:36:58 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDETCCApagAwIBAgITB3MSffqmueK5VTiqdt3kMH8XxDAKBggqhkjOPQQDAzA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSA0MB4XDTIyMDgyMzIyMzY1OFoXDTMwMDgyMzIyMzY1OFowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDM4NCBNMDIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATNYzWQDXV0NoNmR0hJPwJq\n" + - "hjYOOS9z0B2Z7MQudxg5x3Vsib6N+tJkq8dljRq5o6K0bbh/kRVfoi9wfKhB03Yz\n" + - "gkerrwRCH7Z9gU5nbBY+Y5+EtImq4yOB0n7JQgQxWemjggFaMIIBVjASBgNVHRMB\n" + - "Af8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcD\n" + - "AQYIKwYBBQUHAwIwHQYDVR0OBBYEFKbZqzuHmTP/6Gj4i2GDbNCyuq+9MB8GA1Ud\n" + - "IwQYMBaAFNPsxzplbszh2naaVvuc84ZtV+WBMHsGCCsGAQUFBwEBBG8wbTAvBggr\n" + - "BgEFBQcwAYYjaHR0cDovL29jc3Aucm9vdGNhNC5hbWF6b250cnVzdC5jb20wOgYI\n" + - "KwYBBQUHMAKGLmh0dHA6Ly9jcnQucm9vdGNhNC5hbWF6b250cnVzdC5jb20vcm9v\n" + - "dGNhNC5jZXIwPwYDVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NybC5yb290Y2E0LmFt\n" + - "YXpvbnRydXN0LmNvbS9yb290Y2E0LmNybDATBgNVHSAEDDAKMAgGBmeBDAECATAK\n" + - "BggqhkjOPQQDAwNpADBmAjEA2zCG6x0xMlgSXWEGLN8+1XN+OCYF5vj0Z1jtVy+A\n" + - "pdLlzuxNt9HBWn3hvqvO2W8KAjEApNdsZOCmk5uZBYiuCSBnDH3jyKhN6dWyuuHW\n" + - "9Wj7SxKnOU5+wYWZA0BQAv1KT62i\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca4.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Serial number: f579bed3369f1a147ea5d0e8e6532d3 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEvjCCBESgAwIBAgIQD1eb7TNp8aFH6l0OjmUy0zAKBggqhkjOPQQDAzA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMzg0IE0wMjAeFw0yM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eRPio1ehgmeYH1PHXxCqHIGYAdgBI\n" + - "sONr2qZHNA/lagL6nTDrHFIBy1bdLIHZu7+rOdiEcwAAAYgHvZB1AAAEAwBHMEUC\n" + - "IF9hbi82CLU5umfRze4NpX6u4jlT+N8KSaBe6UbhqjBZAiEAi2Y6PTt2+107LxtM\n" + - "oBpHprph7hQvGfjPE+p+rfM/X+EAdgDatr9rP7W2Ip+bwrtca+hwkXFsu1GEhTS9\n" + - "pD0wSNf7qwAAAYgHvZBeAAAEAwBHMEUCIAI+m4mVE3HtZOEMC5VI7m0nEPdPPJUq\n" + - "fxUKPpeIVmk5AiEA0scVJy7g3Fv+2nTVhbcwWCwn/Gvc+0txQrc529juflcwCgYI\n" + - "KoZIzj0EAwMDaAAwZQIxAKV837BpqlNHg35EsCCtrJPoQ6RuY9UoHm1O2CdsCXGR\n" + - "Z3kAnlgIV8A/waI6wQqfsQIwdCqaC+qN60JCnX09YKRD15eQjq1rN3w+llI+lEbS\n" + - "FSMsnoHJcqMZLo9s+4Rf0zS3\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca4.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Serial number: 4a5d392936b4decb818b7fb106ebbd8 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIExjCCBEygAwIBAgIQBKXTkpNrTey4GLf7EG672DAKBggqhkjOPQQDAzA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMzg0IE0wMjAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTlaMC8xLTAr\n" + - "BgNVBAMTJHJldm9rZWQucm9vdGNhNC5kZW1vLmFtYXpvbnRydXN0LmNvbTB2MBAG\n" + - "ByqGSM49AgEGBSuBBAAiA2IABFYf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G9tz94CIQDGwBiV\n" + - "Tslt11+W3ZaNsS7UtUIiB45YHUc4qKm5ry2fTAB2ANq2v2s/tbYin5vCu1xr6HCR\n" + - "cWy7UYSFNL2kPTBI1/urAAABiAe9kAgAAAQDAEcwRQIgPvKfSpMJKRocGk9+GNr3\n" + - "hUj8x8WySB//0X116TNgA0gCIQDhGRqxnEZmEFGEfj5GY9vjEfm0kKwcL0lCuwBu\n" + - "NZG4dzAKBggqhkjOPQQDAwNoADBlAjEA1PLdsrko3tDs50aAeEU9Gn+0CG8QKy7R\n" + - "fQaXBTjGETDgGJk/7zGNpGelKPr/UYV9AjASwdA32S8jIADxA8HrqiMsVYDFMnbU\n" + - "jLLwR6CTLtAcWtwVmoQ2x0usvTvN8YJBPoA=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:42:48 PDT 2023", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java deleted file mode 100644 index 9ad20271bec..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2017, 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 8189131 - * @summary Interoperability tests with Buypass Class 2 and Class 3 CA - * @build ValidatePathWithParams - * @run main/othervm/timeout=180 -Djava.security.debug=certpath BuypassCA OCSP - * @run main/othervm/timeout=180 -Djava.security.debug=certpath BuypassCA CRL - */ - - /* - * Obtain test artifacts for Buypass Class 2 and Class 3 CAs from: - * Buypass Class 3 CA 2 - * https://valid.qcevident.ca23.ssl.buypass.no/ - * https://revoked.qcevident.ca23.ssl.buypass.no/ - * https://expired.qcevident.ca23.ssl.buypass.no/ - * https://valid.evident.ca23.ssl.buypass.no/ - * https://revoked.evident.ca23.ssl.buypass.no/ - * https://expired.evident.ca23.ssl.buypass.no/ - * https://valid.businessplus.ca23.ssl.buypass.no - * https://revoked.businessplus.ca23.ssl.buypass.no - * https://expired.businessplus.ca23.ssl.buypass.no - - * Buypass Class 2 CA 2 - * https://valid.business.ca22.ssl.buypass.no - * https://revoked.business.ca22.ssl.buypass.no - * https://expired.business.ca22.ssl.buypass.no - * https://valid.domain.ca22.ssl.buypass.no - * https://revoked.domain.ca22.ssl.buypass.no - * https://expired.domain.ca22.ssl.buypass.no/ - */ -public class BuypassCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new BuypassClass2().runTest(pathValidator); - new BuypassClass3().runTest(pathValidator); - } -} - -class BuypassClass2 { - - // Owner: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Issuer: CN=Buypass Class 2 Root CA, O=Buypass AS-983163327, C=NO - // Serial number: 1b781c6d5e34ce1f77 - // Valid from: Mon Mar 25 05:17:10 PDT 2019 until: Sat Oct 26 02:16:17 PDT 2030 - private static final String INT_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIFKTCCAxGgAwIBAgIJG3gcbV40zh93MA0GCSqGSIb3DQEBCwUAME4xCzAJBgNV\n" + - "BAYTAk5PMR0wGwYDVQQKDBRCdXlwYXNzIEFTLTk4MzE2MzMyNzEgMB4GA1UEAwwX\n" + - "QnV5cGFzcyBDbGFzcyAyIFJvb3QgQ0EwHhcNMTkwMzI1MTIxNzEwWhcNMzAxMDI2\n" + - "MDkxNjE3WjBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMx\n" + - "NjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMIIBIjANBgkqhkiG\n" + - "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKtnxpZLDQ+R0uzKzDMr83L8Dn+5ToSpD31z\n" + - "qiYMykj7I2geNQ7javKsBOzhgeVr7GP4yJ5bK/P0dhoKesYvQITihfwztbMP6DyH\n" + - "q1QJLQBqQnF0Lk8GhxSSNAZnlkCgX3aazoL32p9BeEfHuUE/8BlPywJY/RyE5/39\n" + - "w3EKmWylhUkeRCMo3dUZr4khJq8JwGp/feKFs9n5FouM5PGhpFpZO+WQXEeqxpnc\n" + - "CxbvWpInBoTnmX3+ofjm+fmY+sdAnyHkuOBBw3koGbFQygDaJP9VItOGByCX4iSV\n" + - "ty/2uzppowIkf7Mpu5v5HJGKObLMP1gGv5lNqjAe8mz0bn25kwIDAQABo4IBCzCC\n" + - "AQcwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTJgHfgYpKC9Uac87r3TMPe\n" + - "uKOtOTAdBgNVHQ4EFgQUkq1libIAD8tRDcEj7JROj8EEP3cwDgYDVR0PAQH/BAQD\n" + - "AgEGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjARBgNVHSAECjAIMAYG\n" + - "BFUdIAAwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2NybC5idXlwYXNzLm5vL2Ny\n" + - "bC9CUENsYXNzMlJvb3RDQS5jcmwwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzAB\n" + - "hhdodHRwOi8vb2NzcC5idXlwYXNzLmNvbTANBgkqhkiG9w0BAQsFAAOCAgEApNka\n" + - "48a+qhJXXS9R24p34CWnirlyxPMhxFfQyvPFXnwBQGHvrm7H5KY3/9/etShFXdY/\n" + - "N05Aq6UnE8my8jR4iHMm2e9iEf4v+O2E2JGH/5/H8wup160GBAsp4zAmJIT8KEgh\n" + - "YAA1j+NaClVryZfEaaDfAdF6LbU3cW0ZgooILPMeeCEXso23KsdCD1Q+SMvD6nQJ\n" + - "86iTvzWPY2GFJyEmvG/N2f29nBaHxWwZBwCfWB4Hqsw9wdKfY5M9SE/AGSLZ7LRM\n" + - "BmkkF9nqkWxxISadx12nbxn0LsU2k8Xyt830DqhHGSoYHEC/iGxbU4Bub8NC0uw/\n" + - "QNBj5Gd5cXLFhRUWLLBTq4p6P6kLc7JudpM4FNQ+stWK/eDZylbDLN3iCBRnHH4p\n" + - "qg6HAlWuieiAKVsidBMxPUyDLJ/8Dt+aW8Z3vCNcYC2n7wqrLZz5e4FG+Wn9teFW\n" + - "Rt5pO6ZUZAkDS59ZVojbbjOdQzNw3QHtZl0IMHeNYXJlPIUlHi4hGL3maGZ9sBF+\n" + - "AMfMLDu56+J2DewIuTXPzCeJeSTam/ybNt5FxTznxCSCIDqwmZMy3AQEz9nGSbE8\n" + - "zfwB5VT2ijLB0PpPX4YbLf33Vodf0NAkBUv6N5It30XiTUPhdk+caBYPoljz/J9U\n" + - "15T5+EGHs8ccHQWyYQ6gqYk8o4JgP4rSJqO1sMI=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.domain.ca22.ssl.buypass.no - // Issuer: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 34e2bff8063debd18d79 - // Valid from: Mon Sep 23 04:12:34 PDT 2019 until: Mon Oct 11 14:59:00 PDT 2021 - private static final String VALID_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIF8jCCBNqgAwIBAgIKNOK/+AY969GNeTANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMB4XDTE5MDkyMzExMTIzNFoXDTIxMTAxMTIx\n" + - "NTkwMFowKzEpMCcGA1UEAwwgdmFsaWQuZG9tYWluLmNhMjIuc3NsLmJ1eXBhc3Mu\n" + - "bm8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCeu/8j7y55R3OucDek\n" + - "gtdoVOEJQb2XaCR4OwiRzn74hLYhKGdFmFwSp+bPCT62NzjdK1urVeKrCQdC1Gkm\n" + - "e7iSOsHHO5aC8oxkgdv8mwEwwvH7xHCcpEVLDlE5Oc0d4cS4QIwFAhNIC77slixL\n" + - "fEdupc5e8FfQf3MlnhX+8gpgRzTx3iw8sb3gUwi3+7PRommHOhC7Ll+iI9LiLODJ\n" + - "qrkHnCbM2HJMK+SGTOQ/whiQwMCnkLaEG0WO1rYc4BGRGfFb8qmQWw/tDKkEey7X\n" + - "nLIFHSC33OiexQshAwRIAE7r1h9gMY1aAAB2Uxwi9/3l6fsd/VPmK7s7lYTBsrpK\n" + - "r4bTAgMBAAGjggL2MIIC8jAJBgNVHRMEAjAAMB8GA1UdIwQYMBaAFJKtZYmyAA/L\n" + - "UQ3BI+yUTo/BBD93MB0GA1UdDgQWBBSy+COaEmU2/BeF4g1OglFvAEYkIDAOBgNV\n" + - "HQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1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Uq9Kahpj5k63Z7tN8KTeOUE8wZGmHyvVcPP6mkC94RbjYIb4gd13eYxd2Vv1a7YX\n" + - "dNI+J3g7sX5ijssfJxzDd0hORj2584YY2WiKKvIGxwDnLkxk09i3IvjEKsAi4Cgn\n" + - "5798X5sSL1Q9C6gHEWt+cB5UtfILCfbLNRczS9zGku6gjh1c8dB7zc63mn7oCf1C\n" + - "gnQ2xqwbZb3Wau8CPwcMqJWgQZLQFPbZd+4Xo5SDDqYppV4oN2A=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.domain.ca22.ssl.buypass.no - // Issuer: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 34e4b97261795f98c495 - // Valid from: Mon Sep 23 04:52:42 PDT 2019 until: Thu Sep 23 14:59:00 PDT 2021 - private static final String REVOKED_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIF9zCCBN+gAwIBAgIKNOS5cmF5X5jElTANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMB4XDTE5MDkyMzExNTI0MloXDTIxMDkyMzIx\n" + - "NTkwMFowLTErMCkGA1UEAwwicmV2b2tlZC5kb21haW4uY2EyMi5zc2wuYnV5cGFz\n" + - "cy5ubzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOiChajGbQktGjbl\n" + - "k/i5PtqfMN6cMyjJdOirxzXdUG8dT+QErC5zcElCwuyy5MH7DQJRbSYsPxQmr6z5\n" + - "OSheBxX0lPPLjJFfEafBZ+Fw1xmCVy3Xjt3GEl85iqv5y0/E/UlQPc0f7s6WxU0L\n" + - "cItkyN0rWAa+uQY018qDFn+gDYIKWPzTCf5nkXIgob/IgBM1Bj7vSZ/LI1iB+I+G\n" + - "dgLbSGBlJgK6lhCTc1tunZlSbKd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1N2rDHwMRnYmQCkURX/\n" + - "dxUcEdkCwQApBo2yCJo32RMAAAFtXfeBSQAABAMASDBGAiEAyrR31T85HGekHZdD\n" + - "r/m6flxqQaUIGcAJ5WcrBuIBuYkCIQD0rDdm+vM5/lNXIfjjrPLhATFEvrxpXJvu\n" + - "+sW4Ntm94jANBgkqhkiG9w0BAQsFAAOCAQEAjbMEFeNXFy3YQSr8O0+fY7qwaAzk\n" + - "vq65Ef/B2zvqO375+JI21grUikmFUnDiAaM8Y+8PJkOXDiuxR2/XCLsXpxCcPqQh\n" + - "V0MZlqXtjKZjBACILBX7aqGibojJTIlo0Dkd+LfPwswfXscTbb1CUXpUPn7CiUj5\n" + - "0WwfvjjQXny0NAB6WEkBMEBx6/Q75dvltoV9N1BZVer9hov6UTDuSad86faX2QF2\n" + - "aIEjrTJY3m2HqnIYf/lQxuDUDW0h7ddGGsIEBDM8z7M/rvT068ssRqJ8uecGjMaz\n" + - "JElX8VDgMux2kyjTAiAFD5QO+KTfySri9QXptik3wo66zDOmkVES1snvVQ==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID_CLASS_2, INT_CLASS_2}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED_CLASS_2, INT_CLASS_2}, - ValidatePathWithParams.Status.REVOKED, - "Mon Sep 23 04:53:18 PDT 2019", System.out); - } -} - -class BuypassClass3 { - - // Owner: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Issuer: CN=Buypass Class 3 Root CA, O=Buypass AS-983163327, C=NO - // Serial number: 1be0dc6a3e7f220475 - // Valid from: Mon Mar 25 05:12:16 PDT 2019 until: Sat Oct 26 01:16:17 PDT 2030 - private static final String INT_CLASS_3 = "-----BEGIN CERTIFICATE-----\n" + - "MIIFKTCCAxGgAwIBAgIJG+Dcaj5/IgR1MA0GCSqGSIb3DQEBCwUAME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CCsGAQUFBzAB\n" + - "hhdodHRwOi8vb2NzcC5idXlwYXNzLmNvbTANBgkqhkiG9w0BAQsFAAOCAgEAo42Y\n" + - "fp96nUiZbZsqvYBID3Sqtx3jJfU8gNHFeXgkS0pxYHHYUwsVSVRjw+BGVEGUswpF\n" + - "MaYMCZD37ZL0JpvvXWrCDaMb/GqDJAQHLLTyVKPGGGIWCZH/FrhnNvcpt2XXA8lU\n" + - "Ujzp5nZPuqvenzQ/aXHI4sH5sN/QjyKVMSa/6RbWBeQmvIdgyM+0jIR5/r6UGiKM\n" + - "ar55trZgnlIbvQJ/w8QTmI/NwvA5CtRaOslQBxeKoAR0BuA/lRWnocXa/BM5uO6P\n" + - "ULL7ct/uI1bS+YThHXHmFybI6kDf+RhRzWY9165ZP96PBph6smQkxPDAz2b8v+mh\n" + - "LThH+5hkqnoetYfK2MdBYinceGPP3gZ+uBSDDI2o6vdVvdg7G96GP1OEtgTEqZa3\n" + - "glVafckpn/8F5CisypdQuZ5zyy/6SXZCKkPcikR87ysSKnjtteXbxMWVtwkeBALT\n" + - "K7DbJA+5aOCYRNj6CJGULQKiGlC01/ipORKewf5J3yus81lLHzBmgQMA5l9RL8rV\n" + - "6dI246mPpQ+8WDLsDrK3ydSDv5izgdVHzhL0tT2u4vwSq2WUqCgi4xLIA1N/fA2H\n" + - "xEW7zh0X/3YVz++g/6bd7iqRD9nRRZxACekRbza7AqU5xN1UjvVtCJQ9VC74K9KP\n" + - "pBoLWE2Bz5ksL9VUc4kS+WGORvZrSE1EpBq6cHc=\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=983163327, CN=valid.businessplus.ca23.ssl.buypass.no, O=BUYPASS AS, - // L=OSLO, OID.2.5.4.17=0484, C=NO - // Issuer: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 267b7a9f0c3da9b94b39 - // Valid from: Mon Sep 23 04:17:42 PDT 2019 until: Mon Oct 11 14:59:00 PDT 2021 - private static final String VALID_C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" + - "MJPL62nXW6Z/mkyystuBNtON420iWL/gS/vduxSZE/iBB4znctDpXS917/XWf31Y\n" + - "ZonemF3MSfi/s9V0Ic82ZY/+HZ4NLTDyKRd4kFF58OoH9RZNb6g8MbTp+gPadiUG\n" + - "UcfPGV3yGiugQa7WHTl7QJ9ishyafiZ4hpeKem6TMDEztgGyLIZ4MSxQvoeI2jJP\n" + - "KjHd5fW/HClbEcrN+w0a0MUNMaAOaZfMS7jS6sDpaVL8D0EX5A==\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=983163327, CN=revoked.businessplus.ca23.ssl.buypass.no, O=BUYPASS AS, - // L=OSLO, OID.2.5.4.17=0484, C=NO - // Issuer: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 267cee3fab06c615fb27 - // Valid from: Mon Sep 23 04:56:56 PDT 2019 until: Thu Sep 23 14:59:00 PDT 2021 - private static final String REVOKED_CLASS_3 = "-----BEGIN CERTIFICATE-----\n" + - "MIIGWDCCBUCgAwIBAgIKJnzuP6sGxhX7JzANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMyBDQSAyMB4XDTE5MDkyMzExNTY1NloXDTIxMDkyMzIx\n" + - "NTkwMFowgYcxCzAJBgNVBAYTAk5PMQ0wCwYDVQQRDAQwNDg0MQ0wCwYDVQQHDARP\n" + - "U0xPMRMwEQYDVQQKDApCVVlQQVNTIEFTMTEwLwYDVQQDDChyZXZva2VkLmJ1c2lu\n" + - "ZXNzcGx1cy5jYTIzLnNzbC5idXlwYXNzLm5vMRIwEAYDVQQFEwk5ODMxNjMzMjcw\n" + - "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDtpNExWd+hjl/ouL/B/pdc\n" + - "InUzEywQO3rzXs3psBdQ1lDhG/9Fc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722HZy/XgD6fiQySp\n" + - "FhHDO3CYagB2AKS5CZC0GFgUh7sTosxncAo8NZgE+RvfuON3zQ7IDdwQAAABbV37\n" + - "Y7wAAAQDAEcwRQIgD8j40M03oLMCg5WmFBN7VL6169F7rKatE12btLQRYtYCIQC0\n" + - "rDhQiZP7j14Y4JqEFQx6UHl3dvxLxZTDW34Z54IUWQB3AG9Tdqwx8DEZ2JkApFEV\n" + - "/3cVHBHZAsEAKQaNsgiaN9kTAAABbV37YOUAAAQDAEgwRgIhANTGHD1g2pbsTtoN\n" + - "CJ2m6nfxm9jB3huftKGDjeo7EyxHAiEA3EYNUc6hr+4Q9lMAphUgpW6oyaNCsIzl\n" + - "izbNhq8dBRYwDQYJKoZIhvcNAQELBQADggEBADUuO4MmYjPkmkik5tjUPiiDDXEQ\n" + - "A41jr72qmdleYdkhnaKAJa8Enn6j/ySRV0enA7yqJeNp1qgPQFvlOh3TqFB3Ae5b\n" + - "XAfL2B7vKbegpjKm8dVH5RurqVm9xZcXb1nbwfu2k3lqqsp/uwqvLBItJDvA8pfi\n" + - "2R46sEtj2gFpAlKFDwepuaklqhrvEoIjIaAL0RrGfKY0oRQw1YMbPNIebsVaWr04\n" + - "rt6tlxrq7PyW1w9Mt3445WA1NzSWc7pAjFLfY6u87QaPHI4ES31H9xxRDsxmr6Y3\n" + - "BJmiWd5uUxev0nVw0saqvlo4yAEBq4rI/DieKcQI4qEI8myzoS0R0azMfLM=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID_CLASS_3, INT_CLASS_3}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED_CLASS_3, INT_CLASS_3}, - ValidatePathWithParams.Status.REVOKED, - "Mon Sep 23 04:57:31 PDT 2019", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java new file mode 100644 index 00000000000..abc7bbe3272 --- /dev/null +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -0,0 +1,561 @@ +/* + * 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 id=actalisauthenticationrootca + * @bug 8189131 + * @summary Interoperability tests with Actalis CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp + * CAInterop actalisauthenticationrootca OCSP + * @run main/othervm/timeout=180 -Djava.security.debug=certpath,ocsp + * CAInterop actalisauthenticationrootca CRL + */ + +/* + * @test id=amazonrootca1 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca1 CRL + */ + +/* + * @test id=amazonrootca2 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA2 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca2 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca2 CRL + */ + +/* + * @test id=amazonrootca3 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA3 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca3 CRL + */ + +/* + * @test id=amazonrootca4 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA4 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca4 CRL + */ + +/* + * @test id=buypassclass2ca + * @bug 8189131 + * @summary Interoperability tests with Buypass Class 2 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca CRL + */ + +/* + * @test id=buypassclass3ca + * @bug 8189131 + * @summary Interoperability tests with Buypass Class 3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca CRL + */ + +/* + * @test id=comodorsaca + * @bug 8189131 + * @summary Interoperability tests with Comodo RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodorsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop comodorsaca CRL + */ + +/* + * @test id=comodoeccca + * @bug 8189131 + * @summary Interoperability tests with Comodo ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodoeccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop comodoeccca CRL + */ + +/* + * @test id=usertrustrsaca + * @bug 8189131 + * @summary Interoperability tests with Comodo userTrust RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrustrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop usertrustrsaca CRL + */ + +/* + * @test id=usertrusteccca + * @bug 8189131 + * @summary Interoperability tests with Comodo userTrust ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrusteccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop usertrusteccca CRL + */ + +/* + * @test id=letsencryptisrgx1 + * @bug 8189131 + * @summary Interoperability tests with Let's Encrypt CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT + */ + +/* + * @test id=globalsignrootcar6 + * @bug 8216577 + * @summary Interoperability tests with GlobalSign R6 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsignrootcar6 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsignrootcar6 CRL + */ + +/* + * @test id=entrustrootcaec1 + * @bug 8195774 + * @summary Interoperability tests with Entrust CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcaec1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcaec1 CRL + */ + +/* + * @test id=entrustrootcag4 + * @bug 8243321 + * @summary Interoperability tests with Entrust CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcag4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcag4 CRL + */ + +/* + * @test id=godaddyrootg2ca + * @bug 8196141 + * @summary Interoperability tests with GoDaddy CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop godaddyrootg2ca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop godaddyrootg2ca CRL + */ + +/* + * @test id=starfieldrootg2ca + * @bug 8196141 + * @summary Interoperability tests with Starfield CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop starfieldrootg2ca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop starfieldrootg2ca CRL + */ + +/* + * @test id=globalsigneccrootcar4 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsigneccrootcar4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsigneccrootcar4 CRL + */ + +/* + * @test id=gtsrootcar1 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootcar1 CRL + */ + +/* + * @test id=gtsrootcar2 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar2 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootcar2 CRL + */ + +/* + * @test id=gtsrootecccar3 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootecccar3 CRL + */ + +/* + * @test id=gtsrootecccar4 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootecccar4 CRL + */ + +/* + * @test id=microsoftecc2017 + * @bug 8304760 + * @summary Interoperability tests with Microsoft TLS root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftecc2017 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftecc2017 CRL + */ + +/* + * @test id=microsoftrsa2017 + * @bug 8304760 + * @summary Interoperability tests with Microsoft TLS root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftrsa2017 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftrsa2017 CRL + */ + +/* + * @test id=quovadisrootca1g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA1 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca1g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca1g3 CRL + */ + +/* + * @test id=quovadisrootca2g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA2 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca2g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca2g3 CRL + */ + +/* + * @test id=quovadisrootca3g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA3 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca3g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca3g3 CRL + */ + +/* + * @test id=sslrootrsaca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootrsaca CRL + */ + +/* + * @test id=sslrootevrsaca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's EV RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootevrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootevrsaca CRL + */ + +/* + * @test id=sslrooteccca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrooteccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrooteccca CRL + */ + +/* + * @test id=teliasonerarootcav1 + * @bug 8210432 + * @summary Interoperability tests with TeliaSonera Root CA v1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliasonerarootcav1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop teliasonerarootcav1 CRL + */ + +/* + * @test id=twcaglobalrootca + * @bug 8305975 + * @summary Interoperability tests with TWCA Global Root CA from TAIWAN-CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop twcaglobalrootca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop twcaglobalrootca CRL + */ + +/* + * @test id=certignarootca + * @bug 8314960 + * @summary Interoperability tests with Certigna Root CAs from Dhimyotis + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certignarootca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop certignarootca CRL + */ + +/** + * Collection of certificate validation tests for interoperability with external CAs + */ +public class CAInterop { + + /** + * Returns the test configuration for CA + * + * @param alias from the cacerts file without [jdk] + * @return CATestURLs + */ + private CATestURLs getTestURLs(String alias) { + switch (alias) { + case "actalisauthenticationrootca": + return new CATestURLs("https://ssltest-active.actalis.it", + "https://ssltest-revoked.actalis.it"); + + case "amazonrootca1": + return new CATestURLs("https://valid.rootca1.demo.amazontrust.com", + "https://revoked.rootca1.demo.amazontrust.com"); + case "amazonrootca2": + return new CATestURLs("https://valid.rootca2.demo.amazontrust.com", + "https://revoked.rootca2.demo.amazontrust.com"); + case "amazonrootca3": + return new CATestURLs("https://valid.rootca3.demo.amazontrust.com", + "https://revoked.rootca3.demo.amazontrust.com"); + case "amazonrootca4": + return new CATestURLs("https://valid.rootca4.demo.amazontrust.com", + "https://revoked.rootca4.demo.amazontrust.com"); + + case "buypassclass2ca": + return new CATestURLs("https://valid.business.ca22.ssl.buypass.no", + "https://revoked.business.ca22.ssl.buypass.no"); + case "buypassclass3ca": + return new CATestURLs("https://valid.qcevident.ca23.ssl.buypass.no", + "https://revoked.qcevident.ca23.ssl.buypass.no"); + + case "comodorsaca": + return new CATestURLs("https://comodorsacertificationauthority-ev.comodoca.com", + "https://comodorsacertificationauthority-ev.comodoca.com:444"); + case "comodoeccca": + return new CATestURLs("https://comodoecccertificationauthority-ev.comodoca.com", + "https://comodoecccertificationauthority-ev.comodoca.com:444"); + case "usertrustrsaca": + return new CATestURLs("https://usertrustrsacertificationauthority-ev.comodoca.com", + "https://usertrustrsacertificationauthority-ev.comodoca.com:444"); + case "usertrusteccca": + return new CATestURLs("https://usertrustecccertificationauthority-ev.comodoca.com", + "https://usertrustecccertificationauthority-ev.comodoca.com:444"); + + case "letsencryptisrgx1": + return new CATestURLs("https://valid-isrgrootx1.letsencrypt.org", + "https://revoked-isrgrootx1.letsencrypt.org"); + + case "globalsignrootcar6": + return new CATestURLs("https://valid.r6.roots.globalsign.com", + "https://revoked.r6.roots.globalsign.com"); + + case "entrustrootcaec1": + return new CATestURLs("https://validec.entrust.net", + "https://revokedec.entrust.net"); + case "entrustrootcag4": + return new CATestURLs("https://validg4.entrust.net", + "https://revokedg4.entrust.net"); + + case "godaddyrootg2ca": + return new CATestURLs("https://valid.gdig2.catest.godaddy.com", + "https://revoked.gdig2.catest.godaddy.com"); + case "starfieldrootg2ca": + return new CATestURLs("https://valid.sfig2.catest.starfieldtech.com", + "https://revoked.sfig2.catest.starfieldtech.com"); + + case "globalsigneccrootcar4": + return new CATestURLs("https://good.gsr4.demo.pki.goog", + "https://revoked.gsr4.demo.pki.goog"); + case "gtsrootcar1": + return new CATestURLs("https://good.gtsr1.demo.pki.goog", + "https://revoked.gtsr1.demo.pki.goog"); + case "gtsrootcar2": + return new CATestURLs("https://good.gtsr2.demo.pki.goog", + "https://revoked.gtsr2.demo.pki.goog"); + case "gtsrootecccar3": + return new CATestURLs("https://good.gtsr3.demo.pki.goog", + "https://revoked.gtsr3.demo.pki.goog"); + case "gtsrootecccar4": + return new CATestURLs("https://good.gtsr4.demo.pki.goog", + "https://revoked.gtsr4.demo.pki.goog"); + + case "microsoftecc2017": + return new CATestURLs("https://acteccroot2017.pki.microsoft.com", + "https://rvkeccroot2017.pki.microsoft.com"); + case "microsoftrsa2017": + return new CATestURLs("https://actrsaroot2017.pki.microsoft.com", + "https://rvkrsaroot2017.pki.microsoft.com"); + + case "quovadisrootca1g3": + return new CATestURLs("https://quovadis-root-ca-1-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-1-g3-revoked.chain-demos.digicert.com"); + case "quovadisrootca2g3": + return new CATestURLs("https://quovadis-root-ca-2-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-2-g3-revoked.chain-demos.digicert.com"); + case "quovadisrootca3g3": + return new CATestURLs("https://quovadis-root-ca-3-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-3-g3-revoked.chain-demos.digicert.com"); + + case "sslrootrsaca": + return new CATestURLs("https://test-dv-rsa.ssl.com", + "https://revoked-rsa-dv.ssl.com"); + case "sslrootevrsaca": + return new CATestURLs("https://test-ev-rsa.ssl.com", + "https://revoked-rsa-ev.ssl.com"); + case "sslrooteccca": + return new CATestURLs("https://test-dv-ecc.ssl.com", + "https://revoked-ecc-dv.ssl.com"); + + case "teliasonerarootcav1": + return new CATestURLs("https://juolukka.cover.sonera.net:10443", + "https://juolukka.cover.sonera.net:10444"); + + case "twcaglobalrootca": + return new CATestURLs("https://evssldemo6.twca.com.tw", + "https://evssldemo7.twca.com.tw"); + + case "certignarootca": + return new CATestURLs("https://valid.servicesca.dhimyotis.com", + "https://revoked.servicesca.dhimyotis.com"); + + default: throw new RuntimeException("No test setup found for: " + alias); + } + } + + public static void main(String[] args) throws Exception { + if (args.length < 2) { + throw new RuntimeException("Run as: CAInterop "); + } + + String caAlias = args[0]; + + CAInterop caInterop = new CAInterop(args[1]); + CATestURLs caTestURLs = caInterop.getTestURLs(caAlias); + + caInterop.validate(caAlias + " [jdk]", + caTestURLs.getVALID_URL(), + caTestURLs.getREVOKED_URL()); + } + + static class CATestURLs { + final String VALID_URL; + final String REVOKED_URL; + + public CATestURLs(String validURL, + String revokedURL) { + VALID_URL = validURL; + REVOKED_URL = revokedURL; + } + + public String getVALID_URL() { + return VALID_URL; + } + + public String getREVOKED_URL() { + return REVOKED_URL; + } + } + + /** + * Constructor for interoperability test with third party CA. + * + * @param revocationMode revocation checking mode to use + */ + public CAInterop(String revocationMode) { + if ("CRL".equalsIgnoreCase(revocationMode)) { + ValidatePathWithURL.enableCRLOnly(); + } else if ("OCSP".equalsIgnoreCase(revocationMode)) { + ValidatePathWithURL.enableOCSPOnly(); + } else { + // OCSP and CRL check by default + ValidatePathWithURL.enableOCSPAndCRL(); + } + + ValidatePathWithURL.logRevocationSettings(); + } + + /** + * Validates provided URLs using HttpsURLConnection making sure they + * anchor to the root CA found in cacerts using provided alias. + * + * @param caAlias CA alis from cacerts file + * @param validCertURL valid test URL + * @param revokedCertURL revoked test URL + * @throws Exception thrown when certificate can't be validated as valid or revoked + */ + public void validate(String caAlias, + String validCertURL, + String revokedCertURL) throws Exception { + + ValidatePathWithURL validatePathWithURL = new ValidatePathWithURL(caAlias); + + if (validCertURL != null) { + validatePathWithURL.validateDomain(validCertURL, false); + } + + if (revokedCertURL != null) { + validatePathWithURL.validateDomain(revokedCertURL, true); + } + } +} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java similarity index 74% rename from test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java rename to test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java index 92744eac3d0..f1dd2d6229a 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java @@ -23,70 +23,13 @@ /* * @test - * @bug 8245654 8314960 + * @bug 8245654 8256895 * @summary Interoperability tests with Certigna Root CAs from Dhimyotis * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath CertignaRoots OCSP - * @run main/othervm -Djava.security.debug=certpath CertignaRoots CRL + * @run main/othervm -Djava.security.debug=certpath CertignaCA OCSP + * @run main/othervm -Djava.security.debug=certpath CertignaCA CRL */ - -/* - * Obtain TLS test artifacts for Certigna Root CAs from: - * - * Valid TLS Certificates: - * https://valid.servicesca.dhimyotis.com/ - * - * Revoked TLS Certificates: - * https://revoked.servicesca.dhimyotis.com/ - */ -public class CertignaRoots { - - // Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, - // OU=0002 48146308100036, O=DHIMYOTIS, C=FR - // Issuer: CN=Certigna Root CA, OU=0002 48146308100036, O=Dhimyotis, C=FR - // Serial number: fd30cf04344fc38dd90c4e70753d0623 - // Valid from: Wed Nov 25 03:37:21 PST 2015 until: Fri Jun 03 04:37:21 PDT 2033 - private static final String INT_CERTIGNA_ROOT_CA = "-----BEGIN CERTIFICATE-----\n" + - "MIIHETCCBPmgAwIBAgIRAP0wzwQ0T8ON2QxOcHU9BiMwDQYJKoZIhvcNAQELBQAw\n" + - "WjELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAw\n" + - "MiA0ODE0NjMwODEwMDAzNjEZMBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0x\n" + - "NTExMjUxMTM3MjFaFw0zMzA2MDMxMTM3MjFaMH0xCzAJBgNVBAYTAkZSMRIwEAYD\n" + - "VQQKDAlESElNWU9USVMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgxMDAwMzYxHTAb\n" + - "BgNVBGEMFE5UUkZSLTQ4MTQ2MzA4MTAwMDM2MR0wGwYDVQQDDBRDZXJ0aWduYSBT\n" + - "ZXJ2aWNlcyBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALPM+7Lp\n" + - "WBz9wFcPaTc3xnB+5g0XrnptB0EPPfrR04vO52Ykm4ky1d4ZLd10tbM1fa1RqNSO\n" + - "VWWg93O4pL7zCFKlz6JV74ZZVhHpEAwzBwv2oPnxvVbxtSN67xsSY66ahUYxjzs8\n" + - "+3FhmsiRxqwnTYvK2u70uglUvRisOKyTL/M6JnrC4y8tlmoz7OSa5BmBMVplJFQt\n" + - "vmON6N9aHLvYMz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2VydGlnbmFyb290Y2EuY3JsMDGgL6AthitodHRwOi8vY3Js\n" + - "LmRoaW15b3Rpcy5jb20vY2VydGlnbmFyb290Y2EuY3JsMA0GCSqGSIb3DQEBCwUA\n" + - "A4ICAQCI5QbprXJ93L+JWHYpUTinXAMSvXMx2dmNm4mIiJRAbGnBOoEYx7M61fbL\n" + - "L5EJIYZhw8jLmeYVFuMao5OJLwda+RMmVzE7lyTGsY64IDKdwogByNCqbKzrlhnU\n" + - "8myyMNB0BDs2jgwQe2Dj9v+MddeHr7sDqvs7R1tSS5hoASLtdQhO7oxUzr3m7M8q\n" + - "+lh4jszli+cjfiPUVS2ADFu4ccQIh4OsIX6SWdU+8R+c/fn0FV6ip4SAVbNyCToz\n" + - "0ZbZKO8YTJgORxRmvrop9dPyuLWjaRrZ0LMx4a3EM3sQDPDqmsG0lHtfFj2PiJvq\n" + - "4lEYA+gDiLKODI+3DJMqo559m3QSS52DsShomHX/Txd0lJoZwepCE6X4KkG9FHjV\n" + - "WXyLgYFwCOcn+hkLhdpblms0wtjeSPITGOioSkefzhleJnDgJ9X4M3svd0HLTpJi\n" + - "lC1DmDZgdrXWITVdOoCogr2LFKNiGd0tbpKG533eKpfBALlm+afc6j73p1KhJEAn\n" + - "AfydDZqBRqv6+HHYplNDn/K2I1CZdkwaGrx3HOR/voGUi1sUI+hYbsPAFu8ZxrhD\n" + - "9UiysmLCfEUhqkbojony+L2mKsoLqyd24emQzn7GgMa7emlWX2jQUTwrD4SliZ2u\n" + - "OetVaZX5RLyqJWs4Igo/xye0xtMQN8INJ4hSZvnMQ1qFtuSRcQ==\n" + - "-----END CERTIFICATE-----"; - +public class CertignaCA { // Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, // OU=0002 48146308100036, O=DHIMYOTIS, C=FR // Issuer: CN=Certigna, O=Dhimyotis, C=FR @@ -239,28 +182,12 @@ public class CertignaRoots { "-----END CERTIFICATE-----"; public static void main(String[] args) throws Exception { - // OCSP check by default - boolean ocspEnabled = args.length < 1 || !"CRL".equalsIgnoreCase(args[0]); - - // CN=Certigna - new CertignaCAs().runTest(ocspEnabled, - VALID, - REVOKED, - INT_CERTIGNA); - // CN=Certigna Root CA - new CertignaCAs().runTest(ocspEnabled, - VALID, - REVOKED, - INT_CERTIGNA_ROOT_CA); - } -} + // Added to test for JDK-8256895 + System.setProperty("jdk.security.certpath.ocspNonce", "true"); -class CertignaCAs { - public void runTest(boolean ocspEnabled, - final String VALID, - final String REVOKED, - final String INT_CERT) throws Exception { + // OCSP check by default + boolean ocspEnabled = args.length < 1 || !"CRL".equalsIgnoreCase(args[0]); ValidatePathWithParams pathValidator; String[] validChainToValidate; @@ -270,11 +197,11 @@ public void runTest(boolean ocspEnabled, pathValidator = new ValidatePathWithParams(null); pathValidator.enableCRLCheck(); - validChainToValidate = new String[]{VALID, INT_CERT}; - revChainToValidate = new String[]{REVOKED, INT_CERT}; + validChainToValidate = new String[]{VALID, INT_CERTIGNA}; + revChainToValidate = new String[]{REVOKED, INT_CERTIGNA}; } else { // int certificate doesn't specify OCSP responder - pathValidator = new ValidatePathWithParams(new String[]{INT_CERT}); + pathValidator = new ValidatePathWithParams(new String[]{INT_CERTIGNA}); pathValidator.enableOCSPCheck(); validChainToValidate = new String[]{VALID}; diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java deleted file mode 100644 index 73d7171b906..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright (c) 2017, 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 8189131 8231887 - * @summary Interoperability tests with Comodo RSA, ECC, userTrust RSA, and - * userTrust ECC CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath ComodoCA OCSP - * @run main/othervm -Djava.security.debug=certpath ComodoCA CRL - */ - - /* - * Obtain TLS test artifacts for Comodo CAs from: - * - * Valid TLS Certificates: - * https://comodorsacertificationauthority-ev.comodoca.com - * https://comodoecccertificationauthority-ev.comodoca.com - * https://usertrustrsacertificationauthority-ev.comodoca.com - * https://usertrustecccertificationauthority-ev.comodoca.com - * - * Revoked TLS Certificates: - * https://comodorsacertificationauthority-ev.comodoca.com:444 - * https://comodoecccertificationauthority-ev.comodoca.com:444 - * https://usertrustrsacertificationauthority-ev.comodoca.com:444 - * https://usertrustecccertificationauthority-ev.comodoca.com:444 - */ -public class ComodoCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new ComodoRSA().runTest(pathValidator); - new ComodoECC().runTest(pathValidator); - new ComodoUserTrustRSA().runTest(pathValidator); - new ComodoUserTrustECC().runTest(pathValidator); - } -} - -class ComodoRSA { - - // Owner: CN=COMODO RSA Extended Validation Secure Server CA, - // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB - // Issuer: CN=COMODO RSA Certification Authority, O=COMODO CA Limited, - // L=Salford, ST=Greater Manchester, C=GB - // Serial number: 6a74380d4ebfed435b5a3f7e16abdd8 - // Valid from: Sat Feb 11 16:00:00 PST 2012 until: Thu Feb 11 15:59:59 PST 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIGDjCCA/agAwIBAgIQBqdDgNTr/tQ1taP34Wq92DANBgkqhkiG9w0BAQwFADCB\n" - + "hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n" - + "A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV\n" - + "BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTIwMjEy\n" - + "MDAwMDAwWhcNMjcwMjExMjM1OTU5WjCBkjELMAkGA1UEBhMCR0IxGzAZBgNVBAgT\n" - + "EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR\n" - + "Q09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMTL0NPTU9ETyBSU0EgRXh0ZW5kZWQg\n" - + "VmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\n" - + "AQ8AMIIBCgKCAQEAlVbeVLTf1QJJe9FbXKKyHo+cK2JMK40SKPMalaPGEP0p3uGf\n" - + "CzhAk9HvbpUQ/OGQF3cs7nU+e2PsYZJuTzurgElr3wDqAwB/L3XVKC/sVmePgIOj\n" - + "vdwDmZOLlJFWW6G4ajo/Br0OksxgnP214J9mMF/b5pTwlWqvyIqvgNnmiDkBfBzA\n" - + "xSr3e5Wg8narbZtyOTDr0VdVAZ1YEZ18bYSPSeidCfw8/QpKdhQhXBZzQCMZdMO6\n" - + "WAqmli7eNuWf0MLw4eDBYuPCGEUZUaoXHugjddTI0JYT/8ck0YwLJ66eetw6YWNg\n" - + "iJctXQUL5Tvrrs46R3N2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HQSTC8xjOnB3xBLAer2VBvNfzu9\n" - + "XJ/B288ByvK6YBIhMe2pZLiySVgXbVrXzYxtvp5/4gJYp9vDLVj2dAZqmvZh+fYA\n" - + "tmnYOosxWd2R5nwnI4fdAw+PKowegwFOAWEMUnNt/AiiuSpm5HZNMaBWm9lTjaK2\n" - + "jwLI5jqmBNFI+8NKAnb9L9K8E7bobTQk+p0pisehKxTxlgBzuRPpwLk6R1YCcYAn\n" - + "pLwltum95OmYdBbxN4SBB7SC\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, - // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 9eb246629030e0b527ca2f93e5ebf25a - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHSzCCBjOgAwIBAgIRAJ6yRmKQMOC1J8ovk+Xr8lowDQYJKoZIhvcNAQELBQAw\n" + - "gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" + - "BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD\n" + - "VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" + - "ciBDQTAeFw0yMTAzMDIwMDAwMDBaFw0yMjA0MDIyMzU5NTlaMIIBNzERMA8GA1UE\n" + - "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PA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H9eWfbPvn\n" + - "OW4owV1ChpiEHh40i/NQkTn9JzjlZepI9+EsSdhn2tpis7tko6PX/plgw8bRgm7f\n" + - "ong2QaX/DE6z4VIdomW8TQhB9turhKxwjzPTbtYDQIgZfRP/H1S5jYutqbE5yL5B\n" + - "r+VOiSuB8234P4xWg1IBL2EFbxPdgOSMTWRJutUcj44kJKmwp5GUQtySSccw4gk=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, - // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: a0c7cabcc25ed9358ded02cc1d485545 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIH0TCCBrmgAwIBAgIRAKDHyrzCXtk1je0CzB1IVUUwDQYJKoZIhvcNAQELBQAw\n" + - "gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" + - "BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD\n" + - "VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" + - "ciBDQTAeFw0xOTA5MzAwMDAwMDBaFw0yMTEyMjgyMzU5NTlaMIIBPjERMA8GA1UE\n" + - "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n" + - "dGUgT3JnYW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5NP1n+w3SX9qWcN7QT7ExdrnZSl\n" + - "Ygn0PF2fx4gz7cvNKucbpQJNA4C9awGydyYK8/o5KDUXt3K7eb1OAZ/NZBjygsJs\n" + - "ikXvxlBh8oEoqBOfOtr24l0NGUWnP8Qeu/VPcIMER4V8qX+in0pCXkSd67nkp6Bs\n" + - "EcqhDPgmzdSC1gQHsZuBdotG14OfdH1cG1bRK6GadISLG1h8BFukVem42B149v8F\n" + - "MCIUQAYprAVv2WlTZKBx9XzuK6IK3+klHZ07Jfvjvt7PPG5HKSMWBMnMaTHKcyQI\n" + - "G3t91yw7BnNNInZlBSsFtqjbHhDcr7uruZdbi0rerSsi2qDr0w==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:51:39 PST 2021", System.out); - } -} - -class ComodoECC { - - // Owner: CN=COMODO ECC Extended Validation Secure Server CA, - // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB - // Issuer: CN=COMODO ECC Certification Authority, O=COMODO CA Limited, - // L=Salford, ST=Greater Manchester, C=GB - // Serial number: 61d4643b412b5d8d715499d8553aa03 - // Valid from: Sun Apr 14 17:00:00 PDT 2013 until: Fri Apr 14 16:59:59 PDT 2028 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIDojCCAyigAwIBAgIQBh1GQ7QStdjXFUmdhVOqAzAKBggqhkjOPQQDAzCBhTEL\n" - + "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n" - + "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT\n" - + "IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdG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SvlTWEYpmK7eXSgmRUgoBDeQ0yDK\n" - + "lnxmeeOBnnCaDIxAcA3aCj2Gtdt3sA==\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, O=Sectigo Limited, STREET="3rd Floor, - // 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: db437a31e5be29a62443e3caa1479001 - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFvzCCBWWgAwIBAgIRANtDejHlvimmJEPjyqFHkAEwCgYIKoZIzj0EAwIwgZIx\n" + - "CzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNV\n" + - "BAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYDVQQD\n" + - "Ey9DT01PRE8gRUNDIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD\n" + - "QTAeFw0yMTAzMDIwMDAwMDBaFw0yMjA0MDIyMzU5NTlaMIIBNzERMA8GA1UEBRMI\n" + - "MDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZhdGUg\n" + - "T3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRMwEQYD\n" + - "VQQIEwpNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRYwFAYDVQQJEw1UcmFm\n" + - "Zm9yZCBSb2FkMRYwFAYDVQQJ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uY29tMIIBBAYKKwYBBAHWeQIEAgSB9QSB8gDwAHYA\n" + - "RqVV63X6kSAwtaKJafTzfREsQXS+/Um4havy/HD+bUcAAAF38qtH4AAABAMARzBF\n" + - "AiBsKoB1TTfoUYUNqF160/vlOENHyK1zzARcnfGKYURHTwIhANKYWg1CO7jyCPk+\n" + - "IrrLaR+461snNK4LJZXJm4o/9GeeAHYAb1N2rDHwMRnYmQCkURX/dxUcEdkCwQAp\n" + - "Bo2yCJo32RMAAAF38qtJIAAABAMARzBFAiEA1hgxkYZb5Tc9+vQsDnsfXVewClN2\n" + - "7gzwd4hZdqAsOSYCID9CWcBvkKrL44mfe9ky1Z6BnAWHUBMCxTjt8MO/IMZ8MAoG\n" + - "CCqGSM49BAMCA0gAMEUCIBa3sfOiVb0q4LcXU9umKjzVw3Ib8VdiPTtXSnyl0oLb\n" + - "AiEAnpRB53UtLAF7xw98ELmK/LEk1b5KSlqoO8sFHgwQ8vI=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 7972d9d8472a2d52ad1ee6edfb16cbe1 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGPzCCBeWgAwIBAgIQeXLZ2EcqLVKtHubt+xbL4TAKBggqhkjOPQQDAjCBkjEL\n" + - "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\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wkIm1A70ayqOf1FexoQCIQC8tBTn//RCfrhcgTjd\n" + - "ER4wRjFfFoc6lC68OHGVg9CZZg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:53:40 PST 2021", System.out); - } -} - -class ComodoUserTrustRSA { - - // Owner: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Issuer: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, ST=New Jersey, C=US - // Serial number: 284e39c14b386d889c7299e58cd05a57 - // Valid from: Thu Nov 01 17:00:00 PDT 2018 until: Tue Dec 31 15:59:59 PST 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGNDCCBBygAwIBAgIQKE45wUs4bYiccpnljNBaVzANBgkqhkiG9w0BAQwFADCB\n" + - "iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl\n" + - "cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV\n" + - "BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTgx\n" + - "MTAyMDAwMDAwWhcNMzAxMjMxMjM1OTU5WjCBkTELMAkGA1UEBhMCR0IxGzAZBgNV\n" + - "BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEYMBYGA1UE\n" + - "ChMPU2VjdGlnbyBMaW1pdGVkMTkwNwYDVQQDEzBTZWN0aWdvIFJTQSBFeHRlbmRl\n" + - "ZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ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Lyy3IjUUmVl7FaxrHsXQq2z\n" + - "Zt2gKnHQShuA+5xpRPNndjvhHk4D08PZXUe6Im7E5knqxtyl5aYdldb+HI/7f+zd\n" + - "W/1ub2N4Vq4ZYUjcZ1ECOFK7Z2zoNicDmU+Fe/TreXPuPsDicTG/tMcWEVM558OQ\n" + - "TJkB2LK3ZhGukWM/RTMRcRdXaXOX8Lh0ylzRO1O0ObXytvOFpkkkD92HGsfS06i7\n" + - "NLDPJEeZXqzHE5Tqj7VSAj+2luwfaXaPLD8lQEVci8xmsPGOn0mXE1ZzsChEPhVq\n" + - "FYQUsbiRJRhidKauhd+G2CkRTcR5fpsuz+iStB9s5Fks9lKoXnn0hv78VYjvR78C\n" + - "Cvj5FW/ounHjWTWMb3il9S5ngbFGcelB1l/MQkR63+1ybdi2OpjNWJCftxOWUpkC\n" + - "xaRdnOnSj7GQY0NLn8Gtq9FcSZydtkVgXpouSFZkXNS/MYwbcCCcRKBbrk8ss0SI\n" + - "Xg1gTURjh9VP1OHm0OktYcUw9e90wHIDn7h0qA+bWOsZquSRzT4s2crF3ZSA3tuV\n" + - "/UJ33mjdVO8wBD8aI5y10QreSPJvZHHNDyCmoyjXvNhR+u3arXUoHWxO+MZBeXbi\n" + - "iF7Nwn/IEmQvWBW8l6D26CXIavcY1kAJcfyzHkrPbLo+fAOa/KFl3lIU+0biEVNk\n" + - "Q9zXE6hC6X4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, O=Sectigo Limited, STREET="3rd Floor, - // 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 4e484426dbfed0c222b2ed152465614a - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHTzCCBjegAwIBAgIQTkhEJtv+0MIisu0VJGVhSjANBgkqhkiG9w0BAQsFADCB\n" + - "kTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n" + - "A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTkwNwYDVQQD\n" + - "EzBTZWN0aWdvIFJTQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIg\n" + - "Q0EwHhcNMjEwMzAyMDAwMDAwWhcNMjIwNDAyMjM1OTU5WjCCAToxETAPBgNVBAUT\n" + - "CDA0MDU4NjkwMRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0wGwYDVQQPExRQcml2YXRl\n" + - "IE9yZ2FuaXphdGlvbjELMAkGA1UEBhMCR0IxDzANBgNVBBETBk01IDNFUTETMBEG\n" + - "A1UECBMKTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEWMBQGA1UECRMNVHJh\n" + - "ZmZvcmQgUm9hZDEWMBQGA1UECRMNRXhjaGFuZ2UgUXVheTElMCMGA1UECRMcM3Jk\n" + - "IEZsb29yLCAyNiBPZmZpY2UgVmlsbGFnZTEYMBYGA1UEChMPU2VjdGlnbyBMaW1p\n" + - "dGVkMTswOQYDVQQDEzJ1c2VydHJ1c3Ryc2FjZXJ0aWZpY2F0aW9uYXV0aG9yaXR5\n" + - "LWV2LmNvbW9kb2NhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" + - "AJ4f68XomMKS2uudXi7xp0fkRK4Q1pE2bamXB8PTsuyS9rhC8hD2zPr9Gs+NHAR0\n" + - "tG0GSWW1plzbpDFDEsCG+M+7fDl5cc/br8RLn75agZeKngv89y6RQUURxHq6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L8cP5t\n" + - "RwAAAXfyrRCwAAAEAwBIMEYCIQCeOHfnABa6cl0EHTzyMj2t2qBqORBAC16hJIIl\n" + - "Y52W4QIhAKHDk1m9lW0kmcZJWEko3eA9QKJSDLNLpdUoBPzNNc76AHYAb1N2rDHw\n" + - "MRnYmQCkURX/dxUcEdkCwQApBo2yCJo32RMAAAF38q0R6wAABAMARzBFAiEAywsh\n" + - "8Ki6fFOExwR6de0qzTmf7bJMuQcY0Ry463/9R44CIDeAcX7Z9S1vlRB9gzVomNIN\n" + - "vkcnUazq7dowPnr5rYMOMA0GCSqGSIb3DQEBCwUAA4IBAQA3a+PBgH1SBVEDpgAN\n" + - "mWaqIQzJzMRfSgvopQ6nC8iD95SfYD/rvic7aOeBLh/5aEs/CknJsg6o0qB3wz1v\n" + - "T5JXd5JldRWw3nP80jkIaYgq97RUIkjcHhuw4hTyQP6wk7XVlPVLvBo9ePWxJjmn\n" + - "whxlSyxQ5A5NdrTqZOJmu9nFr2HXpX75kGwCkUKZI050FAZZydsK3LfMBTqe1Xwi\n" + - "PKyjXDWd40LjOEg31sA43ofO8n2pySP5LG5XAsvoAyPCy3zXhx5cdtmQFLIkntus\n" + - "DCfN+n51HPUo8r4PUhQtOiRUB3K871LTdwyv4/CRXS2fIhtO1pxYNKFOw0yrUf6j\n" + - "ECgk\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, - // OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: b07fd164b5790c9d5d1fddff5819cdb2 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIH5TCCBs2gAwIBAgIRALB/0WS1eQydXR/d/1gZzbIwDQYJKoZIhvcNAQELBQAw\n" + - "gZExCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" + - "BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE5MDcGA1UE\n" + - "AxMwU2VjdGlnbyBSU0EgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVy\n" + - "IENBMB4XDTE5MDkzMDAwMDAwMFoXDTIxMTIyODIzNTk1OVowggFWMREwDwYDVQQF\n" + - "EwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0\n" + - "ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExEzAR\n" + - "BgNVBAgTCk1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAUBgNVBAkTDVRy\n" + - "YWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4Y2hhbmdlIFF1YXkxJTAjBgNVBAkTHDNy\n" + - "ZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxhZ2UxGDAWBgNVBAoTD1NlY3RpZ28gTGlt\n" + - "aXRlZDEaMBgGA1UECxMRQ09NT0RPIEVWIFNHQyBTU0wxOzA5BgNVBAMTMnVzZXJ0\n" + - "cnVzdHJzYWNlcnRpZmljYXRpb25hdXRob3JpdHktZXYuY29tb2RvY2EuY29tMIIB\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnh/rxeiYwpLa651eLvGnR+RE\n" + - "rhDWkTZtqZcHw9Oy7JL2uELyEPbM+v0az40cBHS0bQZJZbWmXNukMUMSwIb4z7t8\n" + - "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XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFtgzv54wAABAMARzBF\n" + - "AiB5PmhsK3zU3XdKvyxw/wWHMmLI7apHLa1yKdjkA8H+ggIhALdUx7Tl8aeWhK6z\n" + - "lh+PHvMAdCcAJK6w9qBJGQtSrYO5AHUAVYHUwhaQNgFK6gubVzxT8MDkOHhwJQgX\n" + - "L6OqHQcT0wwAAAFtgzv5zgAABAMARjBEAiBumSwAUamibqJXTN2cf/H3mjd0T35/\n" + - "UK9w2hu9gFobxgIgSXTLndHyqFUmcmquu3It0WC1yl6YMceGixbQL1e8BQcAdwC7\n" + - "2d+8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAAAW2DO/nXAAAEAwBIMEYC\n" + - "IQDHRs10oYoXE5yq6WsiksjdQsUWZNpbSsrmz0u+KlxTVQIhAJ4rvHItKSeJLkaN\n" + - "S3YpVZnkN8tOwuxPsYeyVx/BtaNpMA0GCSqGSIb3DQEBCwUAA4IBAQAPFIsUFymo\n" + - "VTp0vntHrZpBApBQzDeriQv7Bi7tmou/Ng47RtXW3DjGdrePGSfOdl7h62k8qprU\n" + - "JeLyloDqhvmT/CG/hdwrfZ3Sv3N2xpetGcnW5S3oEi3m+/M1ls9eD+x1vybqV9Kd\n" + - "lcjuV7SYDlbvAS9w7TcygudhdW0cI8XTCvesGKohBkAlqaQ/MWYpt4WvsxHjbWgn\n" + - "5ZlIYR6A1ZFEjADifViH/5AA79lgGhAskkIWPjvRFalEVKTKtjhRK76eCfZs4Frr\n" + - "CEOpon+BeNKk+x/K/r10dSoWe0SV2uGVxTD83zkP++eREwo1hTgn8bXn7ftlnA3j\n" + - "7ml+Usz6udaD\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:55:42 PST 2021", System.out); - } -} - -class ComodoUserTrustECC { - - // Owner: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Issuer: CN=USERTrust ECC Certification Authority, O=The USERTRUST Network, L=Jersey City, ST=New Jersey, C=US - // Serial number: 80f5606d3a162b143adc12fbe8c2066f - // Valid from: Thu Nov 01 17:00:00 PDT 2018 until: Tue Dec 31 15:59:59 PST 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDyTCCA0+gAwIBAgIRAID1YG06FisUOtwS++jCBm8wCgYIKoZIzj0EAwMwgYgx\n" + - "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJz\n" + - "ZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYDVQQD\n" + - "EyVVU0VSVHJ1c3QgRUNDIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTE4MTEw\n" + - "MjAwMDAwMFoXDTMwMTIzMTIzNTk1OVowgZExCzAJBgNVBAYTAkdCMRswGQYDVQQI\n" + - "ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoT\n" + - "D1NlY3RpZ28gTGltaXRlZDE5MDcGA1UEAxMwU2VjdGlnbyBFQ0MgRXh0ZW5kZWQg\n" + - "VmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + - "AQcDQgAEAyJ5Ca9JyXq8bO+krLVWysbtm7fdMSJ54uFD23t0x6JAC4IjxevfQJzW\n" + - "z4T6yY+FybTBqtOa++ijJFnkB5wKy6OCAY0wggGJMB8GA1UdIwQYMBaAFDrhCYbU\n" + - "zxnClnZ0SXbc4DXGY2OaMB0GA1UdDgQWBBTvwSqVDDLa+3Mw3IoT2BVL9xPo+DAO\n" + - "BgNVHQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHSUEFjAUBggr\n" + - "BgEFBQcDAQYIKwYBBQUHAwIwOgYDVR0gBDMwMTAvBgRVHSAAMCcwJQYIKwYBBQUH\n" + - "AgEWGWh0dHBzOi8vY3BzLnVzZXJ0cnVzdC5jb20wUAYDVR0fBEkwRzBFoEOgQYY/\n" + - "aHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VTRVJUcnVzdEVDQ0NlcnRpZmljYXRp\n" + - "b25BdXRob3JpdHkuY3JsMHYGCCsGAQUFBwEBBGowaDA/BggrBgEFBQcwAoYzaHR0\n" + - "cDovL2NydC51c2VydHJ1c3QuY29tL1VTRVJUcnVzdEVDQ0FkZFRydXN0Q0EuY3J0\n" + - "MCUGCCsGAQUFBzABhhlodHRwOi8vb2NzcC51c2VydHJ1c3QuY29tMAoGCCqGSM49\n" + - "BAMDA2gAMGUCMQCjHztBDL90GCRXHlGqm0H7kzP04hd0MxwakKjWzOmstXNFLONj\n" + - "RFa0JqI/iKUJMFcCMCbLgyzcFW7DihtY5XE0XCLCw+git0NjxiFB6FaOFIlyDdqT\n" + - "j+Th+DJ92JLvICVD/g==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, - // ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 9aa5da67480446fd7bf408fd5fdaa1d8 - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----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kBqFRUSt\n" + - "zzM3AiAw5tw3cv/oabDsYdU+lmp5kZ/S3Z97ANAAaHE0AfXe/Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 8b72489b7f505a55e2a22659c90ed2ab - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGRTCCBeugAwIBAgIRAItySJt/UFpV4qImWckO0qswCgYIKoZIzj0EAwIwgZEx\n" + - "CzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNV\n" + - "BAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE5MDcGA1UEAxMw\n" + - "U2VjdGlnbyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n" + - "MB4XDTE5MDkzMDAwMDAwMFoXDTIxMTIyODIzNTk1OVowggFBMREwDwYDVQQFEwgw\n" + - "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n" + - "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExEDAOBgNV\n" + - "BAcTB1NhbGZvcmQxFjAUBgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4\n" + - "Y2hhbmdlIFF1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bmF1dGhvcml0eS1ldi5jb21vZG9jYS5jb20wggF/BgorBgEEAdZ5AgQC\n" + - "BIIBbwSCAWsBaQB2AO5Lvbd1zmC64UJpH6vhnmajD35fsHLYgwDEe4l6qP3LAAAB\n" + - "bYL/SJoAAAQDAEcwRQIhAL7EJt/Rgz6NBnx2v8Hevux3Gpcxy64kaeyLVgFeNqFk\n" + - "AiBRf+OWLOtZzEav/oERljrk8hgZB4CR1nj/Tn98cmRrwwB2AFWB1MIWkDYBSuoL\n" + - "m1c8U/DA5Dh4cCUIFy+jqh0HE9MMAAABbYL/SIgAAAQDAEcwRQIgVtZZaiBMC2lu\n" + - "atBzUHQmOq4qrUQP7nS83cd3VzPhToECIQDnlpOCdaxJwr8C0MtkvYpKSabwBPFL\n" + - "ASEkwmOpjuQErAB3ALvZ37wfinG1k5Qjl6qSe0c4V5UKq1LoGpCWZDaOHtGFAAAB\n" + - "bYL/SJoAAAQDAEgwRgIhAI8OgzP/kzF1bOJRHU2S/ewij/6HpGPy7Mbm7Hyuv3IU\n" + - "AiEAxDmX2FmORlgeerQmQ+ar3D9/TwA9RQckVDu5IrgweREwCgYIKoZIzj0EAwID\n" + - "SAAwRQIhAPwQWGWd3oR7YJ7ngCDQ9TAbdPgND51SiR34WfEgaTQtAiAxD4umKm02\n" + - "59GEMj5NpyF2ZQEq5mEGcjJNojrn+PC4zg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:59:25 PST 2021", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java deleted file mode 100644 index 40b01309ccb..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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 8195774 8243321 - * @summary Interoperability tests with Entrust CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath EntrustCA OCSP - * @run main/othervm -Djava.security.debug=certpath EntrustCA CRL - */ - -/* - * Obtain test artifacts for Entrust CA from: - * - * EC CA: - * Valid: https://validec.entrust.net - * Revoked https://revokedec.entrust.net - * - * G4 CA: - * Valid: https://validg4.entrust.net - * Revoked: https://revokedg4.entrust.net - */ -public class EntrustCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new Entrust_ECCA().runTest(pathValidator, ocspEnabled); - new Entrust_G4().runTest(pathValidator, ocspEnabled); - } -} - -class Entrust_ECCA { - - // Owner: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Issuer: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIID5zCCA2ygAwIBAgIQCoPUgD5+n1EAAAAAUdTB9zAKBggqhkjOPQQDAzCBvzEL\n" + - "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + - "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEy\n" + - "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UE\n" + - "AxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4X\n" + - "DTE2MDQwNTIwMTk1NFoXDTM3MTAwNTIwNDk1NFowgboxCzAJBgNVBAYTAlVTMRYw\n" + - "FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu\n" + - "bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNiBFbnRydXN0LCBJbmMu\n" + - "IC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3QgQ2Vy\n" + - "dGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowdjAQBgcqhkjOPQIBBgUrgQQAIgNi\n" + - "AAT14eFXmpQX/dEf7NAxrMH13n0btz1KKvH2S1rROGPAKex2CY8yxznbffK/MbCk\n" + - "F7ByYXGs1+8kL5xmTysU/c+YmjOZx2mMSAk2DPw30fijJ3tRrwChZ+TBpgtB6+A5\n" + - "MsCjggEuMIIBKjAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAz\n" + - "BggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3Qu\n" + - "bmV0MDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvZWMx\n" + - "cm9vdC5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6\n" + - "Ly93d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF\n" + - "BQcDAjAdBgNVHQ4EFgQUw/lFA77I+Qs8RTXz63Ls5+jrlJswHwYDVR0jBBgwFoAU\n" + - "t2PnGt2N6QimVYOk4GpQQWURQkkwCgYIKoZIzj0EAwMDaQAwZgIxAPnVAOqxKDd7\n" + - "v37EBmpPqWCCWBFPKW6HpRx3GUWc9caeQIw8rO2HXYgf92pb/TsJYAIxAJhI0MpR\n" + - "z5L42xF1R9UIPfQxCMwgsnWBqIqcfMrMO+2DxQy6GIP3cFFj9gRyxguKWw==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=validec.entrust.net, SERIALNUMBER=D15576572, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", - // OID.1.3.6.1.4.1.311.60.2.1.2=Maryland, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFrTCCBTKgAwIBAgIQYtgW4DLwh74AAAAAVqBXkTAKBggqhkjOPQQDAjCBujEL\n" + - "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + - "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2\n" +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37wfinG1k5Qjl6qSe0c4V5UKq1LoGpCWZDaOHtGFAAABZDcxpTsAAAQD\n" + - "AEgwRgIhAPCBqVqSvAEIXMPloV0tfBEEdjRrAhiG407cPqYwt9AFAiEAuQf4R5os\n" + - "MLkD3XhxvrTDvnD+PUOf8PzPevsWkuxNqcQwDgYDVR0PAQH/BAQDAgeAMB0GA1Ud\n" + - "JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBjBggrBgEFBQcBAQRXMFUwIwYIKwYB\n" + - "BQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MC4GCCsGAQUFBzAChiJodHRw\n" + - "Oi8vYWlhLmVudHJ1c3QubmV0L2wxai1lYzEuY2VyMDMGA1UdHwQsMCowKKAmoCSG\n" + - "Imh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvbGV2ZWwxai5jcmwwSgYDVR0gBEMwQTA2\n" + - "BgpghkgBhvpsCgECMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuZW50cnVzdC5u\n" + - "ZXQvcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFMP5RQO+yPkLPEU18+ty7Ofo65Sb\n" + - "MB0GA1UdDgQWBBT+J7OhS6gskCanmOGnx10DPSF8ATAJBgNVHRMEAjAAMAoGCCqG\n" + - "SM49BAMCA2kAMGYCMQCQLUQABT74TmdHzAtB97uNF5+Zy15wzkmlKeRSOXCIf2C5\n" + - "YKjsgdkR1OdzZXcpjNgCMQDfWcdPhodNXZC4l1lLPOPaTzPPw6uVqqoITQlc6r1t\n" + - "dRkkD6K9ii/X8EtwoFp7s80=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revokedec.entrust.net, SERIALNUMBER=115868500, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", - // OID.1.3.6.1.4.1.311.60.2.1.2=Texas, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGJzCCBaygAwIBAgIRAM0WDfag1taIAAAAAFagJ5gwCgYIKoZIzj0EAwIwgbox\n" + - "CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9T\n" + - "ZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAx\n" + - "NiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNV\n" + - "BAMTJUVudHJ1c3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowHhcNMTcw\n" + - "NTI0MTcwNzA4WhcNMTkwNTI0MTczNjU1WjCByDELMAkGA1UEBhMCQ0ExEDAOBgNV\n" + - "BAgTB09udGFyaW8xDzANBgNVBAcTBkthbmF0YTETMBEGCysGAQQBgjc8AgEDEwJV\n" + - "UzEWMBQGCysGAQQBgjc8AgECEwVUZXhhczEWMBQGA1UEChMNRW50cnVzdCwgSW5j\n" + - "LjEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEjAQBgNVBAUTCTExNTg2\n" + - "ODUwMDEeMBwGA1UEAxMVcmV2b2tlZGVjLmVudHJ1c3QubmV0MFkwEwYHKoZIzj0C\n" + - "AQYIKoZIzj0DAQcDQgAEN5MP/59yrs9uwVM/Mrc8IuHonMChAZgN2twwvh8KTnR2\n" + - "3stfem/R+NtLccq+4ds1+8ktnXgP7u1x0as6IJOH1qOCA4EwggN9MCAGA1UdEQQZ\n" + - "MBeCFXJldm9rZWRlYy5lbnRydXN0Lm5ldDCCAfcGCisGAQQB1nkCBAIEggHnBIIB\n" + - "4wHhAHYA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFcO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AUw/lFA77I+Qs8RTXz63Ls5+jrlJswHQYDVR0OBBYEFIj28ytR8ulo1p2t\n" + - "ZnBQOLK0rlLUMAkGA1UdEwQCMAAwCgYIKoZIzj0EAwIDaQAwZgIxANzqGRI0en5P\n" + - "gSUDcdwoQSNKrBPBfGz2AQVLHAXsxvIlGhKZAQtM49zxA8AdFy/agwIxAMEjJH6A\n" + - "4UbcGZc40eYu6wUbAxiUDD3gwSElNQ8Z6IhNLPCCdMM6KZORyaagAcXn4A==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Wed May 24 10:39:28 PDT 2017", System.out); - } -} - -class Entrust_G4 { - - // Owner: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Issuer: CN=Entrust Root Certification Authority - G4, OU="(c) 2015 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGMjCCBBqgAwIBAgIRAKvsd/8bQQwHAAAAAFVl2AUwDQYJKoZIhvcNAQELBQAw\n" + - "gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL\n" + - "Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg\n" + - "MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw\n" + - "BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0\n" +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YfaHR0cDovL2NybC5lbnRydXN0Lm5ldC9nNGNhLmNybDAdBgNVHQ4EFgQU7kfR\n" + - "hXHx/S23P7s+Y1h3F0lADpUwHwYDVR0jBBgwFoAUnzjEViPDOeigcWzoVEzk6Dqx\n" + - "v2cwDQYJKoZIhvcNAQELBQADggIBACMeFFgsWmC7h6D1v8DJUkOpm/m5UhVhO0hb\n" + - "pQMQKMhKkl744Y9SWG4WNmpQy743TTciEJPZFhc7ke2R6VmK8ZJUqro2awOw1RWZ\n" + - "OtHla59Btf1NQd41vOVdU+qFhs8lFfXg9sK7YHTrfxHtMXLoGnkkamK3xJgn7sXa\n" + - "/zUvUDBTpDCXcpO9SyHoKIQswmkIPpRyIdPF4biRdR3N+9MYmlfqN/Nk3OEZ73xZ\n" + - "AUZP6Gu+f9cEiHTA8NdYHCPLJWyFnIHWK+QuTFEnKYnOYxCeroLBNOO64e8JWZ39\n" + - "kZ22BBXhHzqOCCczS7JOJTRF+JgvWuxbFwRstj8qf3fE+JndWmq2FC4hTHtpuK5K\n" + - "ENuiRm5gdkXfsXmB+qB6y5gaajiTIMscGIcZIKTe2YdKrLoicvEz8k+loM7favik\n" + - "vzFioTNTDHYGx3mkfElBE7ycY8n+jZE3QBBv33k28MeQi7XNgEaMc4tYwoZIdE9A\n" + - "xVccXTzEQzka82dOkRB1dU0XZId9XAWv+CtNc2TjF6Wgx2seA/c6H8S0IfgQBIV2\n" + - "8iN2wZns2QFdawkdy3hMUqPnA++kuGhLW3GemsIY5dP/WxY8rd+OfLb/Ks9T1pCd\n" + - "28t7PQRcQsgkYmouzrOW9ASBvYqLLdhl4y+fFXff8RkPIKMNoYP06WJvRKmky9R/\n" + - "41/nXRas\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=validg4.entrust.net, SERIALNUMBER=1913605, OID.2.5.4.15=Private Organization, - // O=Entrust Datacard Limited, OID.1.3.6.1.4.1.311.60.2.1.2=Ontario, OID.1.3.6.1.4.1.311.60.2.1.3=CA, - // L=Ottawa, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Serial number: 83790beb78eeb966007ad3dbf11d570 - // Valid from: Fri May 29 13:29:00 PDT 2020 until: Sun Aug 28 13:34:23 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFpjCCBI6gAwIBAgIQCDeQvreO65ZgB609vxHVcDANBgkqhkiG9w0BAQsFADCB\n" + - "ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT\n" + - "H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy\n" + - "MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG\n" + - "A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y\n" + - "MDA1MjkyMDI5MDBaFw0yMjA4MjgyMDM0MjNaMIHRMQswCQYDVQQGEwJDQTEQMA4G\n" + - "A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT\n" + - "AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xITAfBgNVBAoTGEVudHJ1c3Qg\n" + - "RGF0YWNhcmQgTGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "EDAOBgNVBAUTBzE5MTM2MDUxHDAaBgNVBAMTE3ZhbGlkZzQuZW50cnVzdC5uZXQw\n" + - "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC508f77Kp/kfbqs9DHfa+V\n" + - "977gsVzI78TzfN4tF3ujwnPgd9mzLArM71VJvceOJUto7ywRasxmFxOLHf7WN2Kg\n" + - "U1y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ExqLiwGu9oI9Ozm3/mo11ixmhvSFXH+FZf93qvvCSO+XTGGrLv5ja\n" + - "Tkazn/HgnwUBHd1TiO0jLhAdc+rZyd/SDjXMAXsa99zVfc2MY0Mb8+MohNHOwqYg\n" + - "tuYuirvtt9P0oteauL+iEBCRcqsmJaHGeaEyJH2QMxC5W22KpW245eHisW7rMoGQ\n" + - "9nbGmfe97p7bHQ==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revokedg4.entrust.net, SERIALNUMBER=1913605, OID.2.5.4.15=Private Organization, - // O=Entrust Datacard Limited, OID.1.3.6.1.4.1.311.60.2.1.2=Ontario, OID.1.3.6.1.4.1.311.60.2.1.3=CA, - // L=Ottawa, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Serial number: 24c5f46412b9dcc242a93017176979d6 - // Valid from: Fri May 29 13:36:00 PDT 2020 until: Sun Aug 28 13:40:43 PDT 2022 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFqjCCBJKgAwIBAgIQJMX0ZBK53MJCqTAXF2l51jANBgkqhkiG9w0BAQsFADCB\n" + - "ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT\n" + - "H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy\n" + - "MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG\n" + - "A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y\n" + - "MDA1MjkyMDM2MDBaFw0yMjA4MjgyMDQwNDNaMIHTMQswCQYDVQQGEwJDQTEQMA4G\n" + - "A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMw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n" + - "bGV2ZWwxbi5jcmwwIAYDVR0RBBkwF4IVcmV2b2tlZGc0LmVudHJ1c3QubmV0MEsG\n" + - "A1UdIAREMEIwNwYKYIZIAYb6bAoBAjApMCcGCCsGAQUFBwIBFhtodHRwczovL3d3\n" + - "dy5lbnRydXN0Lm5ldC9ycGEwBwYFZ4EMAQEwDQYJKoZIhvcNAQELBQADggEBAGab\n" + - "wtgpooQW3YL2Cqk9RDJFbNct5BSbzgY9qN1TOe4L7gbjV0BJBCcsHOCjvbgEuzME\n" + - "FC/kAmBu7eMnKVAqCCsWaI8XV7xB7P/BqHpvf9LI/GyHg4wCYdxgFGBXHOjlSy+8\n" + - "YWRM5UnFUknqbj1B4u2/U+U3X66QXi+MWrmBdjpcMahpY5zP1Bh90OmIc8DY4arf\n" + - "widObgJe2H/VFScudLf5JMpBso2v772GYTRr5Tqqq3ouS9WvDf0NBvoStt1oiUMP\n" + - "oowesfNiaYa/rZzWRlhYNs089KUeLhjOZswtIY5LCyy+Wt3CHgXljGEQFgi7p59s\n" + - "gk0aMRYM9Gri26VbD5A=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri May 29 13:42:13 PDT 2020", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java deleted file mode 100644 index 244ef26c2ca..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8216577 8249176 - * @summary Interoperability tests with GlobalSign R6 CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GlobalSignR6CA OCSP - * @run main/othervm -Djava.security.debug=certpath GlobalSignR6CA CRL - */ - - /* - * - * Obtain TLS test artifacts for GlobalSign R6 CA from: - * - * Valid TLS Certificates: - * https://valid.r6.roots.globalsign.com/ - * - * Revoked TLS Certificates: - * https://revoked.r6.roots.globalsign.com/ - */ -public class GlobalSignR6CA { - - // Owner: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign Root CA - R6 - // Serial number: 7803182afbecd89eb19309bb4a25bdaa - // Valid from: Mon Jul 27 17:00:00 PDT 2020 until: Sat Jul 27 17:00:00 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGwDCCBKigAwIBAgIQeAMYKvvs2J6xkwm7SiW9qjANBgkqhkiG9w0BAQwFADBM\n" + - "MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xv\n" + - "YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0z\n" + - "MDA3Mjg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ljYWCURbfsYz7+Zxb94+4yzva49p8T6lALoK3s2kqIVLKN\n" + - "s6qAnk/qX6JihkaR3W+iViHMC5tqQX/pd8QIXccF3PA2OdeNGU4iUNZqUbYB4VZd\n" + - "AaOaeaUl0LwAta6DB5w344eUIqDgaitSwQZBnxppmwL3tGzP1ero2e2RvBmphbxI\n" + - "atIdxA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.r6.roots.globalsign.com, - // O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent, - // C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB - // Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Serial number: 1aff2829dd8bf07aa65a7b3c920ca4b - // Valid from: Thu Aug 27 00:20:06 PDT 2020 until: Tue Sep 28 00:20:06 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHyjCCBbKgAwIBAgIQAa/ygp3YvweqZaezySDKSzANBgkqhkiG9w0BAQsFADBV\n" + - "MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTErMCkGA1UE\n" + - "AxMiR2xvYmFsU2lnbiBBdGxhcyBSNiBFViBUTFMgQ0EgMjAyMDAeFw0yMDA4Mjcw\n" + - "NzIwMDZaFw0yMTA5MjgwNzIwMDZaMIH6MRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0w\n" + - "GwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjERMA8GA1UEBRMIMDQ3MDU2Mzkx\n" + - "CzAJBgNVBAYTAkdCMQ0wCwYDVQQIDARLZW50MRIwEAYDVQQHDAlNYWlkc3RvbmUx\n" + - "ETAPBgNVBBEMCE1FMTQgMkxQMSkwJwYDVQQJDCBTcHJpbmdmaWVsZCBIb3VzZSwg\n" + - "U2FuZGxpbm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5gueyF1t545vECCE4PeGZNAeWqdbrj7xaS8\n" + - "3rKQdgwF9r6p7F5HHwEVCckhovEYU4DNFzYb9n/YmC3hmskFB1keTYqydKUYEGZ5\n" + - "fvLvsjRj9xwOCqIs5j1vuKw2CaqmHxrfYaDMMSZPq/iYrOWrf72wZIvtnAHePt3X\n" + - "atQMqNbDMQrjul31ljDP9CIbbtuZSkSACyMxiC10l4uTTLQiTxtZPkwIazOjnbBe\n" + - "A4fruOEQ2k1gu5oFgqmo+xuclOKNjwd/RkK4FXnD\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.r6.roots.globalsign.com, - // O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent, - // C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB - // Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Serial number: 1df30d84796ac20c47da63b8e681e8f - // Valid from: Thu Aug 27 00:37:53 PDT 2020 until: Tue Sep 28 00:37:53 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHzzCCBbegAwIBAgIQAd8w2EeWrCDEfaY7jmgejzANBgkqhkiG9w0BAQsFADBV\n" + - "MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTErMCkGA1UE\n" + - "AxMiR2xvYmFsU2lnbiBBdGxhcyBSNiBFViBUTFMgQ0EgMjAyMDAeFw0yMDA4Mjcw\n" + - "NzM3NTNaFw0yMTA5MjgwNzM3NTNaMIH8MRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0w\n" + - "GwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjERMA8GA1UEBRMIMDQ3MDU2Mzkx\n" + - "CzAJBgNVBAYTAkdCMQ0wCwYDVQQIDARLZW50MRIwEAYDVQQHDAlNYWlkc3R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8q0oY/97o2udnuDQaNdrLgW3VofMeBIMNPBgkLDicOH6bLwNf\n" + - "lV68qi1ZBxBuOdoOqQyZ9RU9d3EL50XEJ4MtUvjJRAT5EWdFaB8SGGZbD5fyza8c\n" + - "KmeO5tkZWYecLd8CKqwKcW7umPflEwOzw60Cxg6eyBYA8Jfagpbdb/kXsF6Ov8IW\n" + - "vxNdHCnXnR3oBWm2uHddESO2zGF1ZfOb0O3cHHG5nCgVkWW68VpgX/LaN90u6Dzw\n" + - "diJX7esZV5ZaniqD+flWldgAdcfeXlJ5b7I7GnFr61ycmZT/qupagUS1WDq/zfct\n" + - "QcB4QmnAzGe6kcqiDOSyIYWpiw09jha63KpJtJDWRemrlQI=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Aug 27 00:38:11 PDT 2020", System.out); - } -} - diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java deleted file mode 100644 index e8971b987ca..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * @test - * @bug 8196141 - * @summary Interoperability tests with GoDaddy/Starfield CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GoDaddyCA OCSP - * @run main/othervm -Djava.security.debug=certpath GoDaddyCA CRL - */ - -/* - * Obtain test artifacts for GoDaddy/Starfield CAs from: - * - * Go Daddy Root Certificate Authority - G2: - * valid: https://valid.gdig2.catest.godaddy.com/ - * expired: https://expired.gdig2.catest.godaddy.com/ - * revoked: https://revoked.gdig2.catest.godaddy.com/ - * - * Starfield Root Certificate Authority - G2: - * valid: https://valid.sfig2.catest.starfieldtech.com/ - * expired: https://expired.sfig2.catest.starfieldtech.com/ - * revoked: https://revoked.sfig2.catest.starfieldtech.com/ - */ -public class GoDaddyCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - // CRL check - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new GoDaddyGdig2().runTest(pathValidator); - new GoDaddySfig2().runTest(pathValidator); - } -} - -class GoDaddyGdig2 { - - // Owner: CN=Go Daddy Secure Certificate Authority - G2, - // OU=http://certs.godaddy.com/repository/, O="GoDaddy.com, Inc.", - // L=Scottsdale, ST=Arizona, C=US - // Issuer: CN=Go Daddy Root Certificate Authority - G2, O="GoDaddy.com, Inc.", - // L=Scottsdale, ST=Arizona, C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MII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NIMwojPX+2yz8LQsgM4wHwYDVR0jBBgwFoAUOpqFBxBnKLbv\n" - + "9r0FQW4gwZTaD94wNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8v\n" - + "b2NzcC5nb2RhZGR5LmNvbS8wNQYDVR0fBC4wLDAqoCigJoYkaHR0cDovL2NybC5n\n" - + "b2RhZGR5LmNvbS9nZHJvb3QtZzIuY3JsMEYGA1UdIAQ/MD0wOwYEVR0gADAzMDEG\n" - + "CCsGAQUFBwIBFiVodHRwczovL2NlcnRzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkv\n" - + "MA0GCSqGSIb3DQEBCwUAA4IBAQAIfmyTEMg4uJapkEv/oV9PBO9sPpyIBslQj6Zz\n" - + "91cxG7685C/b+LrTW+C05+Z5Yg4MotdqY3MxtfWoSKQ7CC2iXZDXtHwlTxFWMMS2\n" - + "RJ17LJ3lXubvDGGqv+QqG+6EnriDfcFDzkSnE3ANkR/0yBOtg2DZ2HKocyQetawi\n" - + "DsoXiWJYRBuriSUBAA/NxBti21G00w9RKpv0vHP8ds42pM3Z2Czqrpv1KrKQ0U11\n" - + "GIo/ikGQI31bS/6kA1ibRrLDYGCD+H1QQc7CoZDDu+8CL9IVVO5EFdkKrqeKM+2x\n" - + "LXY2JtwE65/3YR8V3Idv7kaWKK2hJn0KCacuBKONvPi8BDAB\n" - + "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private - // Organization/serialNumber=5510922, C=US, ST=Arizona, L=Scottsdale, O=GoDaddy INC., CN=valid.gdig2.catest.godaddy.com - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHbzCCBlegAwIBAgIIC3Go9uPeseowDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRow\n" + - "G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6H25GdAAAEAwBHMEUCIBQrE+FqILUhI0wdp2X+lf/e3UG1\n" + - "gyxHmSVeN2+CkrXPAiEA1mIIVmLNURGyI8wnZ5KRnBPOKYM2MC54RJ8CFrEHIz4w\n" + - "DQYJKoZIhvcNAQELBQADggEBADInvf3eS6SgQ1qxPx4RT2hPeU5frlWJWcOWUdZB\n" + - "6mVNcmUQMkYnjkg8+PQ782HGP0DvAfcIRDhSfXdIqzEk8MPUq1XHEOfwRzLpTiCN\n" + - "FQDQIt1LXnzESCUurJS8r4mxgaVLAwHFytOTDrQn0Xfs93dm0tnRGAg7iBg+N33V\n" + - "zOR4aqojdDUWa1Rr4WFqZMkZIxzREQCYC8HXSYqLA1oPuoMMog8dId7XSalBmGJ4\n" + - "KQVsZ0/Hpi0y9k/Zw5obGcEYJWMbuU1iaEkvdtXOiXEQfJ1WS+Yy55J4GSjpIiop\n" + - "qDZD88xA9r7ttzM/khao7jfIpVWG2HuX0JlHWdh3y9aegiw=\n" + - "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private - // Organization/serialNumber=5510922, C=US, ST=Arizona, L=Scottsdale, O=GoDaddy INC., CN=revoked.gdig2.catest.godaddy.com - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdDCCBlygAwIBAgIIEBJV3vmogM8wDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRow\n" + - "GAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjEtMCsGA1UECxMkaHR0cDovL2NlcnRz\n" + - "LmdvZGFkZHkuY29tL3JlcG9zaXRvcnkvMTMwMQYDVQQDEypHbyBEYWRkeSBTZWN1\n" + - "cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIwHhcNMTcwOTE1MjMyMzAzWhcN\n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gbp+mH1Cs1lZA3qldMDxKXgNiodFqU/e4VewasQ9tJMmDXrTZIHualJGmIvq\n" + - "ISvV0ZUfSW/sJmo0ZDw8iBM993LDkA4wSc6SunhjOwu3LBfl9aKkeq6IhUEAG8X7\n" + - "54oO4iApt+APLMyeV9lZ/T7MGVbAjwdm+T1RMa/Ca99BahaRWN7hiM+zS3Ly+l6G\n" + - "7kqAkBFuJWbbZImADZ2RPldY6hBzTk6MT2hLCV40UD8JqwJo+qq7nGfJdTaFyZI6\n" + - "nJvrVATO7jL64YFP3xlVi8EQaCeKdZdn+BCCNA/ja0mWMj8EU9Islg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, null, System.out); - } -} - -class GoDaddySfig2 { - - // Owner: CN=Starfield Secure Certificate Authority - G2, - // OU=http://certs.starfieldtech.com/repository/, O="Starfield Technologies, Inc.", - // L=Scottsdale, ST=Arizona, C=US - // Issuer: CN=Starfield Root Certificate Authority - G2, - // O="Starfield Technologies, Inc.", L=Scottsdale, ST=Arizona, C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIFADCCA+igAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx\n" - + "EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\n" - + "HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs\n" - + "ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTExMDUwMzA3MDAw\n" - + "MFoXDTMxMDUwMzA3MDAwMFowgcYxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6\n" - + "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lcnRzLnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkv\n" - + "MA0GCSqGSIb3DQEBCwUAA4IBAQBWZcr+8z8KqJOLGMfeQ2kTNCC+Tl94qGuc22pN\n" - + "QdvBE+zcMQAiXvcAngzgNGU0+bE6TkjIEoGIXFs+CFN69xpk37hQYcxTUUApS8L0\n" - + "rjpf5MqtJsxOYUPl/VemN3DOQyuwlMOS6eFfqhBJt2nk4NAfZKQrzR9voPiEJBjO\n" - + "eT2pkb9UGBOJmVQRDVXFJgt5T1ocbvlj2xSApAer+rKluYjdkf5lO6Sjeb6JTeHQ\n" - + "sPTIFwwKlhR8Cbds4cLYVdQYoKpBaXAko7nv6VrcPuuUSvC33l8Odvr7+2kDRUBQ\n" - + "7nIMpBKGgc0T0U7EPMpODdIm8QC3tKai4W56gf0wrHofx1l7\n" - + "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Arizona/businessCategory=Private - // Organization/serialNumber=R17247416, C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, LLC, - // CN=valid.sfig2.catest.starfieldtech.com - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHuzCCBqOgAwIBAgIIaZoUcUIjkGwwDQYJKoZIhvcNAQELBQAwgcYxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUw\n" + - "IwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTMwMQYDVQQLEypo\n" + - "dHRwOi8vY2VydHMuc3RhcmZpZWxkdGVjaC5jb20vcmVwb3NpdG9yeS8xNDAyBgNV\n" + - "BAMTK1N0YXJmaWVsZCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIw\n" + - "HhcNMTcwOTE3MDM0ODAxWhcNMTkwOTE3MDM0ODAxWjCB6zETMBEGCysGAQ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vwxqrkPYm/ssbN9cpVWlrQPw3DblsAEV6gnrrTJMd7HB042H3HLUiitddRjO40\n" + - "0EJM/tUOSGcWfqnJHWFDKoWzdrF5lHAzSRkMjdXgY9TTN5K5tUMEpfRjtink/zoY\n" + - "pNyc5ua4SXn94KfMZcOYGRvUM+0q6vLRBBMH541E3M6q6JbEBqZJFY8gBWwYqHH0\n" + - "xNGahm5++v4trFFCJzSfvfV1v+rnqy8tRivi7ZFLXWCcSyAqMH+T9Q36lKeFtaw4\n" + - "Sapf+dh2yrd2IBLW5eaAD13nCAjO/W0GuC7zw4+4mhW5+DTVJXrCkK5XddkVLhML\n" + - "k5pMoIv5EsFIm0Cs+DfF\n" + - "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Arizona/businessCategory=Private - // Organization/serialNumber=R17247416, C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, LLC, - // CN=revoked.sfig2.catest.starfieldtech.com - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHwTCCBqmgAwIBAgIJAPc1qVz+WDxpMA0GCSqGSIb3DQEBCwUAMIHGMQswCQYD\n" + - "VQQGEwJVUzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEl\n" + - "MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEzMDEGA1UECxMq\n" + - "aHR0cDovL2NlcnRzLnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkvMTQwMgYD\n" + - "VQQDEytTdGFyZmllbGQgU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcy\n" + - "MB4XDTE3MDkxOTEzMDkwMVoXDTE5MDkxOTEzMDkwMVowge0xEzARBgsrBgEEAYI3\n" + - "PAIBAxMCVVMxGDAWBgsrBgEEAYI3PAIBAhMHQXJpem9uYTEdMBsGA1UEDxMUUHJp\n" + - "dmF0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XpDjGgp6J/mUTijD9WcFx4lp5JnPaIbShHWCyIlRVZJzrZc\n" + - "UYhR56xXOKDYKYOIvM6qTqegXyEynJrIVTArMk7jQf0oNQLLHzXE1fVS1zut0H5l\n" + - "GE+TBgjasMEa1o1e/H/heSytb2zFNsZr8oxojzGBmlKyfCoIIcCv3PxX2ur57zJE\n" + - "9ADWoYK/7gYVba0JmLV4nQltDPp06nOYT9imxBWTrFahgPx1jOQDLgIpitkjyCy4\n" + - "xpmxUk8L6yc3O3aSD9OU/fzk/t/d\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, null, System.out); - } -} - diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java deleted file mode 100644 index 95ac059de03..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java +++ /dev/null @@ -1,621 +0,0 @@ -/* - * 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 8307134 - * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GoogleCA OCSP - * @run main/othervm -Djava.security.debug=certpath GoogleCA CRL - */ - -/* - * Obtain TLS test artifacts for Google CAs from: - * - * https://pki.goog/repository/ - */ -public class GoogleCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new GoogleGSR4().runTest(pathValidator); - new GoogleGTSR1().runTest(pathValidator); - new GoogleGTSR2().runTest(pathValidator); - new GoogleGTSR3().runTest(pathValidator); - new GoogleGTSR4().runTest(pathValidator); - } -} - -class GoogleGSR4 { - - // Owner: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign ECC Root CA - R4 - // Serial number: 21668f1cd0a2a8f847d8aad34 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDBDCCAqugAwIBAgINAhZo8c0KKo+EfYqtNDAKBggqhkjOPQQDAjBQMSQwIgYD\n" + - "VQQLExtHbG9iYWxTaWduIEVDQyBSb290IENBIC0gUjQxEzARBgNVBAoTCkdsb2Jh\n" + - "bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMjIxMDA1MDAwMDQyWhcNMjcw\n" + - "OTMwMDAwMDQyWjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0\n" + - "IFNlcnZpY2VzIExMQzETMBEGA1UEAxMKR1RTIENBIDJENDBZMBMGByqGSM49AgEG\n" + - "CCqGSM49AwEHA0IABPQdCdV61990MPueGTVpXAjRmp2JIxt0Yuy59RZYT/XKg1lN\n" + - "gpRc0eh/bHtpehigtqe+llKTiVEkMhSMURoQQsOjggFyMIIBbjAOBgNVHQ8BAf8E\n" + - "BAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQI\n" + - "MAYBAf8CAQAwHQYDVR0OBBYEFKiI2Yo5rGXVgks3qJVsZUPNRAHgMB8GA1UdIwQY\n" + - "MBaAFFSwe61FuOJAf/sKbvu+M8k8o4TVMGYGCCsGAQUFBwEBBFowWDAlBggrBgEF\n" + - "BQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyNDAvBggrBgEFBQcwAoYjaHR0\n" + - "cDovL3BraS5nb29nL3JlcG8vY2VydHMvZ3NyNC5kZXIwMgYDVR0fBCswKTAnoCWg\n" + - "I4YhaHR0cDovL2NybC5wa2kuZ29vZy9nc3I0L2dzcjQuY3JsME0GA1UdIARGMEQw\n" + - "CAYGZ4EMAQIBMDgGCisGAQQB1nkCBQMwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9w\n" + - "a2kuZ29vZy9yZXBvc2l0b3J5LzAKBggqhkjOPQQDAgNHADBEAiBi+ikli1YBHQGs\n" + - "b5mnyBo5mydw04o386BPgaPpiBzgagIgbcpwQJCalLIekv8XRMoWFr3nV5XJfWRU\n" + - "5QPpOX0rXbg=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gsr4.demo.pki.goog - // Issuer: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Serial number: 4c435754ee6e013c10efaff908a58cbb - // Valid from: Mon Mar 27 12:41:45 PDT 2023 until: Sun Jun 25 12:41:44 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEsTCCBFegAwIBAgIQTENXVO5uATwQ76/5CKWMuzAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UE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BgNVHR8ENTAzMDGgL6AthitodHRw\n" + - "Oi8vY3Jscy5wa2kuZ29vZy9ndHMyZDQvSUlXMzNMVUVwV3cuY3JsMIIBBAYKKwYB\n" + - "BAHWeQIEAgSB9QSB8gDwAHcA6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0G\n" + - "vW4AAAGHJM62ygAABAMASDBGAiEAkeiqmfYYCVEmGA12/RJUZPdmxRP2ZXF0Xm30\n" + - "Oz+q2tgCIQCgSYqT/6RH+PCOauOVW4uaoshT+HfqurghVCzwGgBFvwB1ALc++yTf\n" + - "nE26dfI5xbpY9Gxd/ELPep81xJ4dCYEl7bSZAAABhyTOttoAAAQDAEYwRAIgBXao\n" + - "3Pry1nCHu3bngW3q3CHSLzmNHmO4cXMSdN2sAOkCIDE5DUyok3TRsOIHu1QTB0R2\n" + - "UxPeFm9KS73TBT8JEZykMAoGCCqGSM49BAMCA0gAMEUCIG1m91VOq3tghyLPA6YR\n" + - "/Pkq+gQylyM8wGJgnRMRE0lhAiEAxBgYXImtVqbfymq2MYwhV9KmG9gPIfqN6qWi\n" + - "lzblUM0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gsr4.demo.pki.goog - // Issuer: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Serial number: 1f9bd55e26716b3710b2614cec6fff02 - // Valid from: Mon Mar 27 12:48:37 PDT 2023 until: Sun Jun 25 12:48:36 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEtzCCBFygAwIBAgIQH5vVXiZxazcQsmFM7G//AjAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJENDAeFw0yMzAzMjcxOTQ4MzdaFw0yMzA2MjUxOTQ4\n" + - "MzZaMCUxIzAhBgNVBAMTGnJldm9rZWQuZ3NyNC5kZW1vLn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wMhOFTTvS\n" + - "K8E6V6NS61IAAAGHJNUx1gAABAMARzBFAiEAj/RgXx1ScnsOf9R9N3eyPMJtH33C\n" + - "mOrRCOodG8QXmE0CIHwNJC5E53BVmfMzZwJH9f2BiUx31SGHWFvG283zVtX/AHUA\n" + - "6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0GvW4AAAGHJNUxnAAABAMARjBE\n" + - "AiAI7pcrKatsz0G4QYPKmS74VQVEgnHqgKSoqv0ghTJXTgIgPyoYubz4MEHYirBu\n" + - "69BLC2jioXr8+wS7MK1IPqjdH44wCgYIKoZIzj0EAwIDSQAwRgIhAI4NdZ5JwTuW\n" + - "P+RH2bsAc5xrb804G9mOc3WMRVxTUKesAiEA/jHMJ2YdPv0WXKjKY7nUyFjUPdin\n" + - "BHRHfBeltynaFzU=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:49:33 PDT 2023", System.out); - } -} - -class GoogleGTSR1 { - - // Owner: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R1, O=Google Trust Services LLC, C=US - // Serial number: 2008eb2023336658b64cddb9b - // Valid from: Wed Aug 12 17:00:42 PDT 2020 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFjDCCA3SgAwIBAgINAgCOsgIzNmWLZM3bmzANBgkqhkiG9w0BAQsFADBHMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU\n" + - "MBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMjAwODEzMDAwMDQyWhcNMjcwOTMwMDAw\n" + - "MDQyWjBGMQ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9yZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAgEA\n" + - "IVToy24jwXUr0rAPc924vuSVbKQuYw3nLflLfLh5AYWEeVl/Du18QAWUMdcJ6o/q\n" + - "FZbhXkBH0PNcw97thaf2BeoDYY9Ck/b+UGluhx06zd4EBf7H9P84nnrwpR+4GBDZ\n" + - "K+Xh3I0tqJy2rgOqNDflr5IMQ8ZTWA3yltakzSBKZ6XpF0PpqyCRvp/NCGv2KX2T\n" + - "uPCJvscp1/m2pVTtyBjYPRQ+QuCQGAJKjtN7R5DFrfTqMWvYgVlpCJBkwlu7+7KY\n" + - "3cTIfzE7cmALskMKNLuDz+RzCcsYTsVaU7Vp3xL60OYhqFkuAOOxDZ6pHOj9+OJm\n" + - "YgPmOT4X3+7L51fXJyRH9KfLRP6nT31D5nmsGAOgZ26/8T9hsBW1uo9ju5fZLZXV\n" + - "VS5H0HyIBMEKyGMIPhFWrlt/hFS28N1zaKI0ZBGD3gYgDLbiDT9fGXstpk+Fmc4o\n" + - "lVlWPzXe81vdoEnFbr5M272HdgJWo+WhT9BYM0Ji+wdVmnRffXgloEoluTNcWzc4\n" + - "1dFpgJu8fF3LG0gl2ibSYiCi9a6hvU0TppjJyIWXhkJTcMJlPrWx1VytEUGrX2l0\n" + - "JDwRjW/656r0KVB02xHRKvm2ZKI03TglLIpmVCK3kBKkKNpBNkFt8rhafcCKOb9J\n" + - "x/9tpNFlQTl7B39rJlJWkR17QnZqVptFePFORoZmFzM=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr1.demo.pki.goog - // Issuer: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Serial number: 19c08d5cde41fc84108f54c8d2a1aeca - // Valid from: Mon Mar 27 12:33:43 PDT 2023 until: Sun Jun 25 12:33:42 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFcjCCBFqgAwIBAgIQGcCNXN5B/IQQj1TI0qGuyjANBgkqhkiG9w0BAQsFAD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YMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAvoC2G\n" + - "K2h0dHA6Ly9jcmxzLnBraS5nb29nL2d0czFkNC92My1EUW1sYi1ZWS5jcmwwggEC\n" + - "BgorBgEEAdZ5AgQCBIHzBIHwAO4AdQC3Pvsk35xNunXyOcW6WPRsXfxCz3qfNcSe\n" + - "HQmBJe20mQAAAYckx1OMAAAEAwBGMEQCICQ4Do1cKFsqmm/swKZkdM/qGluDbctL\n" + - "tIgp0YnoZTlEAiByAeAEaVQiU27AnpUerimnjPnThQq26vqvnWdstb0mwgB1AK33\n" + - "vvp8/xDIi509nB4+GGq0Zyldz7EMJMqFhjTr3IKKAAABhyTHU7UAAAQDAEYwRAIg\n" + - "WAIAOov42kcgOj0rYO3qb4/HTsW3o69x4IKd8ycsaVkCICIQUaeKwNp4aW/civO9\n" + - "No/v5Ner5bmlwheqFAJcR/HCMA0GCSqGSIb3DQEBCwUAA4IBAQBEKKdwuzuAhdir\n" + - "3hbPQIosD6H9vatr8tExWCDmw+PHOoiWIUTBu5fVZPQ27EgehTIA6kNhQj2g7fkF\n" + - "Bd5zAl4k7WdsDZCeOHml6XXQZHvc+p4DYBKTTt3h81lsMLw8aWCOaiSmrQ0hZS/E\n" + - "iuaqvlOFpOTd0x+MN2qcU14hi8SKxBgpraqR/s7OCwUFltxcPq0GAybzDGc9lgB+\n" + - "Jt56QviN641s7hxThyGhFIHSePgWuwbT1grJKQiSW35yI4PJO90HoCpd2MLrC5Ic\n" + - "B89ykY8mQcx+naGPZQdwdpx9GvKwSZdn+cq3kZwD66iXnwhqmiEdq4eBZr8ygSya\n" + - "lnGV2OW+\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr1.demo.pki.goog - // Issuer: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Serial number: c414c34e6c2cc66c102b8d3502be3bb4 - // Valid from: Mon Mar 27 12:42:39 PDT 2023 until: Sun Jun 25 12:42:38 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFfDCCBGSgAwIBAgIRAMQUw05sLMZsECuNNQK+O7QwDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCVVMxIjAgBgNVBAoTGUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBM\n" + - "TEMxEzARBgNVBAMTCkdUUyBDQSAxRDQwHhcNMjMwMzI3MTk0MjM5WhcNMjMwNjI1\n" + - "MTk0MjM4WjAmMSQwIgYDVQQDExtyZXZva2VkLmd0c3IxLmRlbW8ucGtpLmdvb2cw\n" + - "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCOeL80aphh8K8Cz41Sl2Cv\n" + - "cI3Elrrm/2sQH5Q0nxNuoZcxTGk3hD75Ntf6eqgclUQXJDEGbfoo3q7kYIQPXEIy\n" + - "+AuiMTd80ZRHuPBp8ci/wkh6N7B9mE/rjzJz77QgJluykoXRx9SiDyE4Yn9sRbBH\n" + - "jNm/KBv8wMV6hzJZYaALyDpGVNuAx9cHE91LaSvamPiccJn4wb9zDtyFduS3yYbz\n" + - "FREt960j420TeHjeWFkuXXVQMnPeRAWugclhJKzLz1U1gm5PWGxThMgVIy0v8v63\n" + - "3qFT09I4avi0AzBaRtINCaS39Mo2AoX1jZNjFDNLzRO1fSSJpzJmWyXJ2jRI7MwF\n" + - "AgMBAAGjggKDMIICfzAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUH\n" + - "AwEwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUCuJDEKGIdbWqxyVFZmIZoyQZ4T4w\n" + - "HwYDVR0jBBgwFoAUJeIYDrJXkZQq5dRdhpCD3lOzuJIweAYIKwYBBQUHAQEEbDBq\n" + - "MDUGCCsGAQUFBzABhilodHRwOi8vb2NzcC5wa2kuZ29vZy9zL2d0czFkNC9rb2Zm\n" + - "cmFBODZBdzAxBggrBgEFBQcwAoYlaHR0cDovL3BraS5nb29nL3JlcG8vY2VydHMv\n" + - "Z3RzMWQ0LmRlcjAmBgNVHREEHzAdghtyZXZva2VkLmd0c3IxLmRlbW8ucGtpLmdv\n" + - "b2cwIQYDVR0gBBowGDAIBgZngQwBAgEwDAYKKwYBBAHWeQIFAzA8BgNVHR8ENTAz\n" + - "MDGgL6AthitodHRwOi8vY3Jscy5wa2kuZ29vZy9ndHMxZDQvODJFckFFQVVsR1ku\n" + - "Y3JsMIIBBQYKKwYBBAHWeQIEAgSB9gSB8wDxAHYArfe++nz/EMiLnT2cHj4YarRn\n" + - "KV3PsQwkyoWGNOvcgooAAAGHJM+cawAABAMARzBFAiB568monxGD3NiHsqNmsy+t\n" + - "IL4kCc71UNCCJthgnlL7HgIhAKSYf7P7CFO2wWdAt8LBMrsLoip9lytrinj0JR8R\n" + - "CYK9AHcAtz77JN+cTbp18jnFulj0bF38Qs96nzXEnh0JgSXttJkAAAGHJM+cZAAA\n" + - "BAMASDBGAiEAj8nBf1ihput8Gb8qCqVgvqAxPv9t4xLVhWg3tqv8gGMCIQDPiNbu\n" + - "vsyOi9nE6pDm86nggExXRa13wwCtr2wjAn5IpDANBgkqhkiG9w0BAQsFAAOCAQEA\n" + - "ezldM/NCUH58eXPZnbPaMMKrT5oNBxv+hypDy96+PyAqKtbC2bK+7sobGMZkfpG5\n" + - "8dW0mFmfazzjgbZUj54ZVHG4KaHeit8Nq1s07wh2Jo1c2JQdKxEXAOItax/IOfEd\n" + - "tqSg8AwSmhogQeiA7EXRspw4dYXL5uP/8jPPqByMI3PRmm3y7wyQLKNlNAfSgn7m\n" + - "wkrZxMRAENML4JND5UKxg7zo9e/Wvf4UPtEVVZaEj6ZxOe4JljvErCtayaw03t5p\n" + - "I18IAhXRpqm8JG1UGWjn49O8vkjB0bf/7iVXXI4rg6gGVia+HFuxKVGk5OQzo4Qd\n" + - "wBl6yOc8tpUH3phFPYbiMg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:43:25 PDT 2023", System.out); - } -} - -class GoogleGTSR2 { - - // Owner: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R2, O=Google Trust Services LLC, C=US - // Serial number: 219c15ac025a1b0a5c1d9d501 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFjDCCA3SgAwIBAgINAhnBWsAlobClwdnVATANBgkqhkiG9w0BAQsFADBHMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU\n" + - "MBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMjIxMDA1MDAwMDQyWhcNMjcwOTMwMDAw\n" + - "MDQyWjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp\n" + - "Y2VzIExMQzETMBEGA1UEAxMKR1RTIENBIDFEODCCASIwDQYJKoZIhvcNAQEBBQAD\n" + - "ggEPADCCAQoCggEBAKgpBAgi9bhOp5nCIELI/W+1rMoxNH3isu2LuDI3pPEPYJ0o\n" + - "YDxXB1zKHvUqn1VWDlF+K4vLPzjTRv2MUw8fHH9IAd/Rx+mrUHUxffTPU5O41tPj\n" + - "OdzFRO+FOr5RqZfbtXWbEUNyv7wyyCYr9gaDvDeQgDnHTfHAafdoDracNLm2LS3r\n" + - "8iznvJltsboRm+fBwTH99nHciN/h/hHEWlRriUGZ+Cz+5YVB9Tm4gAOByyYYbAa4\n" + - "ES0PhzkIUHaq+56cTDVhK0DM5ZtnZJqV8amhBFssswPttAXT9pNCzoDLCtxeZ2Lw\n" + - "r7bca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1vy4wPnNUoa4+CA6JypT6ODUWcXZa8pWOdyHpbg0IeL389D\n" + - "s67kirG8/eKQxFzckbhL5AD8BJS3wkF7O7A8Gd+2VvSWhmEQzzOBHcvT/lqrCSe0\n" + - "7R7CV/Pw4E9C2GBLGfw8opxGXrdfJRjU6nHf5c+tC4xIjH/i3PQjaIFLG3D60mav\n" + - "0nkS92iorZl2dCiHTKxaD/J4B6VV03lpEcUdVg4WeGAmTClsXUnMOjCnlVYMLg9v\n" + - "URq0LbylxbGBelBrCNyqBS5UO6+9F4/Yi4vzoIvvbJ0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr2.demo.pki.goog - // Issuer: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Serial number: 428fe99edb0df46e1008e4452f6cbfd2 - // Valid from: Mon Mar 27 12:52:12 PDT 2023 until: Sun Jun 25 12:52:11 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFdDCCBFygAwIBAgIQQo/pntsN9G4QCORFL2y/0jANBgkqhkiG9w0BAQsFADBG\n" + - "MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM\n" + - "QzETMBEGA1UEAxMKR1RTIENBIDFEODAeFw0yMzAzMjcxOTUyMTJaFw0yMzA2MjUx\n" + - "OTUyMTFaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjIuZGVtby5wa2kuZ29vZzCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMaC0h20vohsggOQ0XGL5ca3Gqyf\n" + - "2n44PhYBrhzPpbq9/Mk9BKYYFy9osH0HwTFkYRYnI5fDeK6s/7svufiEwH8LtXK7\n" + - "A3juxf3k65cJ8M5bbBwDDW7Prgp86ueUd6pzqv23rLPc9Kv6vvtNYzgaTd4COU38\n" + - "3zFnuudAh8gvEbIQD+Nqis+kc4kEO3JfZBlAF883YRQZRpm6c4bWxKm1Atco53/6\n" + - "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t7KAVt2VAGMRB4H8kwDQYJKoZIhvcNAQELBQADggEBAGf9hz7NJRow\n" + - "veCSrfeVav2tDkx8s9VU7VD+lApip1mdqOGsqkCkeaA5hsGfhqleQFwsOAjduBFA\n" + - "nSV6KgiqFsgHSuS9zuSp2aVe8xhxq6mpr4LngkeUDc32mB9tW9AMaiYp8UeYyFGq\n" + - "hvjUb7/H2wFlT6qO+Qp/+hmfulKqNnrSzpZLIl+x2EBn3L6CFe5xaKzNaANgbShI\n" + - "cQsyKdaUrSAzNJZWnHwaAyQ1msqqXXoVzKmjAGMgZrXZNxv8Lh9V1v+F9WHDIjeQ\n" + - "TtahntIgq38eGtZAnyjdrUtfQwBlQI3zaE0n7n6Fq8ocglJE5woRlL/eTmSKiZr9\n" + - "rrEY0sJ0fCw=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr2.demo.pki.goog - // Issuer: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Serial number: df9af5c19e9dbdf6107cb03548ffbd06 - // Valid from: Mon Mar 27 12:45:09 PDT 2023 until: Sun Jun 25 12:45:08 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFejCCBGKgAwIBAgIRAN+a9cGenb32EHywNUj/vQYwDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCVVMxIjAgBgNVBAoTGUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBM\n" + - "TEMxEzARBgNVBAMTCkdUUyBDQSAxRDgwHhcNMjMwMzI3MTk0NTA5WhcNMjMwNjI1\n" + - "MTk0NTA4WjAmMSQwIgYDVQQDExtyZXZva2VkLmd0c3IyLmRlbW8ucGtpLmdvb2cw\n" + - "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFJUSh0aOOjj6BXJqBFDOD\n" + - "GFjnr1VKDfWYdGWfB3QNhcbjz7qJRLeZDSYQZ3H2D5pkOQhl6xYLOZ1L0v+0TWW9\n" + - "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lryQPTy9ERa+zraeF3fW0GvW4AAAGHJNGphwAA\n" + - "BAMARjBEAiBa5aSnTCc2ceQj/asKFYRRGbwzXTnaDbvNMMeB4ogEXAIgZykyJVPh\n" + - "4Sfkroi8tvV6dwxexp0dT2EXHAmr+/GzZU0wDQYJKoZIhvcNAQELBQADggEBAHVn\n" + - "uWbk/OaljXKeyhlDCgdvnzJGCFQXwGyIJzNDkCs8k3iA1iwJKArvpkczxnCBxCPE\n" + - "imW2MHWCayT9JXKuO4ppU0oTh6GYvRV6DV1OkuWXsna7+dGf3+tkm9k0wauI6J8X\n" + - "H1T8Dq3W0+S+8UNSftduYSR1wTcN15OxIzlZ/FrV3LLRDxH2RKSsXfXBLgP1befh\n" + - "m+8SPQTpZ5NdMl7my0gmVgNF5ZIbFiHYzJkF2vS4iXJCI6fTWyoA1u/7jQyHdLOy\n" + - "pY0s6gKWEwwtpYC1lWI6ek/wLfuNrJbiRRiRs8e3HHQymn8K3T1PM+7n8huDy95b\n" + - "f1EgLMjvEtx6xpIqrqg=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:45:40 PDT 2023", System.out); - } -} - -class GoogleGTSR3 { - - // Owner: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R3, O=Google Trust Services LLC, C=US - // Serial number: 21668d8d65bc4320e5b8e5e76 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDIDCCAqagAwIBAgINAhZo2NZbxDIOW45edjAKBggqhkjOPQQDAzBHMQswCQYD\n" + - "VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN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fYIyY\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr3.demo.pki.goog - // Issuer: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Serial number: 7d08ad6716e51d1210bfc149e3d0af19 - // Valid from: Mon Mar 27 12:37:41 PDT 2023 until: Sun Jun 25 12:37:40 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEszCCBFmgAwIBAgIQfQitZxblHRIQv8FJ49CvGTAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJEMzAeFw0yMzAzMjcxOTM3NDFaFw0yMzA2MjUxOTM3\n" + - "NDBaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjMuZGVtby5wa2kuZ29vZzCCASIwDQYJ\n" + - "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAL7R40feuILVPC65FhoVh3kZ8mJuEKpJ\n" + - "SiSB9gbKRkaKBr4kHOm7+sa0RkAm3Zgbomd2JGiJbYYcQ4lY8MMlXruFLLY+0AMf\n" + - "Pf5mQbn6i+oSyfaNwV0Hk1q1MhZL5WSKLywXS0NVw50JGQw/SiIRhmR22DdOtxuh\n" + - "VC7ZOebYTbHzTBSYTxvoyJZ0bGUQMWQ0rI2lzOp+2kqSTDMmRejXUNm14ZrsdXUb\n" + - "F8nOunZpT5ppESFvsK7TFrWJlAFHNVxJjPkNaRyfIaR7G+hORoV5tHGaNeTzmFkO\n" + - "3ySGcRlvL41IWqBN4LwLiS6QN+Je7nIBDojEPTBVhPCzP++1uLKEKusCAwEAAaOC\n" + - "An8wggJ7MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNV\n" + - "HRMBAf8EAjAAMB0GA1UdDgQWBBRRhq17jer1cVfi0eFV+LIwk+Lk8jAfBgNVHSME\n" + - "GDAWgBS/qVO/G2nYhSk0mmlDy9Z61Jn/bTB4BggrBgEFBQcBAQRsMGowNQYIKwYB\n" + - "BQUHMAGGKWh0dHA6Ly9vY3NwLnBraS5nb29nL3MvZ3RzMmQzL09KOENlY2cwdWNV\n" + - "MDEGCCsGAQUFBzAChiVodHRwOi8vcGtpLmdvb2cvcmVwby9jZXJ0cy9ndHMyZDMu\n" + - "ZGVyMCMGA1UdEQQcMBqCGGdvb2QuZ3RzcjMuZGVtby5wa2kuZ29vZzAhBgNVHSAE\n" + - "GjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAvoC2GK2h0\n" + - "dHA6Ly9jcmxzLnBraS5nb29nL2d0czJkMy9WREItNVdJSTVRSS5jcmwwggEEBgor\n" + - "BgEEAdZ5AgQCBIH1BIHyAPAAdgDoPtDaPvUGNTLnVyi8iWvJA9PL0RFr7Otp4Xd9\n" + - "bQa9bgAAAYckzOfmAAAEAwBHMEUCIF0wxIlFnHLMan20Gtbnia+mzuA1Re0dhoIS\n" + - "wOAO7aC4AiEA7cYfSflOAA0DLxHsHAXpVs2LuLYlq34bSxbyUa85UyYAdgCzc3cH\n" + - "4YRQ+GOG1gWp3BEJSnktsWcMC4fc8AMOeTalmgAAAYckzOf5AAAEAwBHMEUCICza\n" + - "2nef9GWr9tF/ZXxhMYP15JQsdWPWmpQkdS/xUBWyAiEAs9AaeMarT7EaBVoSatAT\n" + - "Poj6cOhdvF/uDOHigyQdVd8wCgYIKoZIzj0EAwIDSAAwRQIhALv6jaEFgAIe3NbX\n" + - "87YEjhMMymK7wl435DQD9syoOEx2AiBbcYXr6nLNWA1pPoRiA1WvHgTVJFWftpYt\n" + - "e8CkUXnIxA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr3.demo.pki.goog - // Issuer: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Serial number: 7ffa6a827df64c6010ebc47b5ca3eda7 - // Valid from: Mon Mar 27 12:45:58 PDT 2023 until: Sun Jun 25 12:45:57 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEuTCCBF+gAwIBAgIQf/pqgn32TGAQ68R7XKPtpzAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJEMzAeFw0yMzAzMjcxOTQ1NThaFw0yMzA2MjUxOTQ1\n" + - "NTdaMCYxJDAiBgNVBAMTG3Jldm9rZWQuZ3RzcjMuZGVtby5wa2kuZ29vZzCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKpn78KglifqiS3f5hPLH64og4aH\n" + - "7a1tDBza2ebTLYB74i1u65EIENCyzvz6OYvh8kKzhqZMPFbORd8OCESzebjv/Dc2\n" + - "BJJV498N3BfSZYWN+baVxKuOZ4HWXV5NyP85rEvbcaAWcmqvh++G88FOCTQvYd4D\n" + - "/RKgAMptDjM+4X6V2NIRXcmOZJWZ2iItao76FARvbKH0D2UJLG4ENdOznRonnItP\n" + - "74UEVfNCb/i7I+NMJYTuDA4/rr+AS6pttvsVM9pqWkIJqOloEVNcCyyr1buflfJO\n" + - "j4A8Nz9fTUffpfApQnPi394iUcdCVyCrcjB2ta2eMR/3AyhiSXOmxcGjUcECAwEA\n" + - "AaOCAoIwggJ+MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAM\n" + - "BgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSg57WFIkW4b1eTcWX+qZsN+JEewTAfBgNV\n" + - "HSMEGDAWgBS/qVO/G2nYhSk0mmlDy9Z61Jn/bTB4BggrBgEFBQcBAQRsMGowNQYI\n" + - "KwYBBQUHMAGGKWh0dHA6Ly9vY3NwLnBraS5nb29nL3MvZ3RzMmQzL1pEZWExWTdT\n" + - "SlBZMDEGCCsGAQUFBzAChiVodHRwOi8vcGtpLmdvb2cvcmVwby9jZXJ0cy9ndHMy\n" + - "ZDMuZGVyMCYGA1UdEQQfMB2CG3Jldm9rZWQuZ3RzcjMuZGVtby5wa2kuZ29vZzAh\n" + - "BgNVHSAEGjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAv\n" + - "oC2GK2h0dHA6Ly9jcmxzLnBraS5nb29nL2d0czJkMy9WREItNVdJSTVRSS5jcmww\n" + - "ggEEBgorBgEEAdZ5AgQCBIH1BIHyAPAAdQDoPtDaPvUGNTLnVyi8iWvJA9PL0RFr\n" + - "7Otp4Xd9bQa9bgAAAYck00MJAAAEAwBGMEQCIALwbMReWy/zrvUwV1G5XOxN8koN\n" + - "VJ1pp7s1d7ClE9ebAiBYWwJeccnfHLIh9AJTdeuN+R/pDzEudVBSC2rIdo3HhgB3\n" + - "ALc++yTfnE26dfI5xbpY9Gxd/ELPep81xJ4dCYEl7bSZAAABhyTTQzMAAAQDAEgw\n" + - "RgIhAOEO0oyiRgMNDdWvRTobr7sex2SUFsjpKmwenYAULrRiAiEA6uKFK1sbnJ1J\n" + - "lW8Tw2G4jGpEFIc4C9duRbU6DIbGnckwCgYIKoZIzj0EAwIDSAAwRQIgN3byD4lu\n" + - "a8A0hzUR1OnPoXSyfus6HOhmBozH6coY9MICIQDsT5jj5GKVtxtlcki5iE08K70Z\n" + - "gt/tkcE1Fkk4RsZORA==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:47:24 PDT 2023", System.out); - } -} - -class GoogleGTSR4 { - - // Owner: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R4, O=Google Trust Services LLC, C=US - // Serial number: 2166825e1700440612491f540 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDITCCAqagAwIBAgINAhZoJeFwBEBhJJH1QDAKBggqhkjOPQQDAzBHMQswCQYD\n" + - "VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIG\n" + - "A1UEAxMLR1RTIFJvb3QgUjQwHhcNMjIxMDA1MDAwMDQyWhcNMjcwOTMwMDAwMDQy\n" + - "WjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2Vz\n" + - "IExMQzETMBEGA1UEAxMKR1RTIENBIDJQMjBZMBMGByqGSM49AgEGCCqGSM49AwEH\n" + - "A0IABKdQkzjAHqOUsb/TkH7cz5lRtD374tNZ8rYrCUb1mxypE+VmCb1Jgzq+93tR\n" + - "dE78GRzPI4+q6raha1TEyWgoniOjggF2MIIBcjAOBgNVHQ8BAf8EBAMCAYYwHQYD\n" + - "VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAw\n" + - "HQYDVR0OBBYEFIcjqVBIDgeJVApxMPYz0gpH9p2sMB8GA1UdIwQYMBaAFIBM1ut0\n" + - "/0k2o9XY/LU+xWrwlB2MMGgGCCsGAQUFBwEBBFwwWjAmBggrBgEFBQcwAYYaaHR0\n" + - "cDovL29jc3AucGtpLmdvb2cvZ3RzcjQwMAYIKwYBBQUHMAKGJGh0dHA6Ly9wa2ku\n" + - "Z29vZy9yZXBvL2NlcnRzL2d0c3I0LmRlcjA0BgNVHR8ELTArMCmgJ6AlhiNodHRw\n" + - "Oi8vY3JsLnBraS5nb29nL2d0c3I0L2d0c3I0LmNybDBNBgNVHSAERjBEMAgGBmeB\n" + - "DAECATA4BgorBgEEAdZ5AgUDMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vcGtpLmdv\n" + - "b2cvcmVwb3NpdG9yeS8wCgYIKoZIzj0EAwMDaQAwZgIxAMnbIiQb5fsdexUuVGoB\n" + - "MVwsDPGd7VC13Y0OBezt7FqFHDwqm8nnVdV/FkNyXNv9/AIxAN51NGqMcbexMOYK\n" + - "pLC0zXfjNwvqBsZhmzCCQIM6MVyBID0rjjxPu7laIaHqAu6T5Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr4.demo.pki.goog - // Issuer: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Serial number: 743c4f78750e30f0d407a19254ba96a - // Valid from: Mon Mar 27 12:40:42 PDT 2023 until: Sun Jun 25 12:40:41 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEsTCCBFegAwIBAgIQB0PE94dQ4w8NQHoZJUupajAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJQMjAeFw0yMzAzMjcxOTQwNDJaFw0yMzA2MjUxOTQw\n" + - "NDFaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjQuZGVtby5wa2kuZ29vZzCCASIwDQYJ\n" + - "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOdkWBg3i5CxzH1dvlBoWHtIUyk78OAA\n" + - "bZdq7pKWB8i8C9Rf089uQ+7jQWOmqCNxU+OXdjumPfk/4MQvvtkmaqKi7HCN1bvQ\n" + - "0CrW7Zhi5jx11QuzEEZVdvXcchzmodp9GSl9t6zK/ItNiIYVisH9dqRWrZ/KZnO+\n" + - "y13dlr5UXAXVvNKx1L4TjhGlam7IEJdrAjkLJk4wXAFhv9HaPNJnjj0306xNm2h+\n" + - "VzldpMPlaXGN9JcGQdMVFpa9f0AI/r7SF7I2EDXaIKFToJ4jQurEGc3oxayiv9wB\n" + - "QapXqSTbPztb5SPGdX1yaw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vpM2OH/oN30Na+EJJDqWxousN\n" + - "6t9L8FQ=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr4.demo.pki.goog - // Issuer: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Serial number: 6b2d650d4bc3bd3f11a595bf05187915 - // Valid from: Mon Mar 27 12:47:43 PDT 2023 until: Sun Jun 25 12:47:42 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEuDCCBF6gAwIBAgIQay1lDUvDvT8RpZW/BRh5FTAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJQMjAeFw0yMzAzMjcxOTQ3NDNaFw0yMzA2MjUxOTQ3\n" + - "NDJaMCYxJDAiBgNVBAMTG3Jldm9rZWQuZ3RzcjQuZGVtby5wa2kuZ29vZzCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOEKoC1Zv/m2G8DrGkOgLq5TPSeC\n" + - "X3cClcI6s4JS5Cld2DKX7m4P8rXAxJyVHvlmkxZQoD6Y7JxsavlJ/Yw0qdqkNLTv\n" + - "kviEiLNYEn8Qu0SoRLNanzoFUINZkAZ4/0Lfvsrl9tTigLsCJ4jQauemGmGcmKUy\n" + - "qsKisfrMC0ZG9EP9WRjc9WF13Jqe55+gZ7LqaAAoPVR/7J6T1VAKteaYaXrORtVF\n" + - "uMeinE4c9YuxRCLa+3X1qqc3HAsvZEBOdb35fC0cN/ILktCQpq1Fj+QD4jfR6bVQ\n" + - "E8eA6Jy+5qHSg2VjAm6wNLd5QkfE7D8uC9sYs638r48ahcXhy3zwpzGhuH0CAwEA\n" + - "AaOCAoEwggJ9MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAM\n" + - "BgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQl5Uh4jTR3l8PkcLdBwtwQXkUzBjAfBgNV\n" + - "HSMEGDAWgBSHI6lQSA4HiVQKcTD2M9IKR/adrDB4BggrBgEFBQcBAQRsMGowNQYI\n" + - "KwYBBQUHMAGGKWh0dHA6Ly9vY3NwLnBraS5nb29nL3MvZ3RzMnAyL3h5WmtBTEE3\n" + - "aGY0MDEGCCsGAQUFBzAChiVodHRwOi8vcGtpLmdvb2cvcmVwby9jZXJ0cy9ndHMy\n" + - "cDIuZGVyMCYGA1UdEQQfMB2CG3Jldm9rZWQuZ3RzcjQuZGVtby5wa2kuZ29vZzAh\n" + - "BgNVHSAEGjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAv\n" + - "oC2GK2h0dHA6Ly9jcmxzLnBraS5nb29nL2d0czJwMi9sU1htaTNxZWRoYy5jcmww\n" + - "ggEDBgorBgEEAdZ5AgQCBIH0BIHxAO8AdgCt9776fP8QyIudPZwePhhqtGcpXc+x\n" + - "DCTKhYY069yCigAAAYck1BYGAAAEAwBHMEUCIGM5ykDTU3mqgLIk+fPmVn6JGUXB\n" + - "W4xouGUA1iiNs7G0AiEAtuWnV/J5llcxB7ZTwkCb6cviyv4Z6O396ZGW8GsrqAQA\n" + - "dQC3Pvsk35xNunXyOcW6WPRsXfxCz3qfNcSeHQmBJe20mQAAAYck1BYIAAAEAwBG\n" + - "MEQCIHcK1H025GIv8klzQGSZAL9NnuH5EzeGra0jRRg5RM4UAiAQaJyJDBkJRL/C\n" + - "F9WCg9Lmp8bdsXkG5WPreI24ansAPTAKBggqhkjOPQQDAgNIADBFAiBehPLU7raP\n" + - "509khaP9yiKiL3mbygtfQo4MDpBnd2RI6wIhAOdlQythGgU+nOENodsB+wUOQXOb\n" + - "akcBOxrDWfyhxmpk\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:48:18 PDT 2023", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java deleted file mode 100644 index d97342ae8d2..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2017, 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 8189131 - * @summary Interoperability tests with Let's Encrypt CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath LetsEncryptCA OCSP - * @run main/othervm -Djava.security.debug=certpath LetsEncryptCA CRL - */ - - /* - * Obtain TLS test artifacts for Let's Encrypt CA from: - * - * Valid TLS Certificates: - * https://valid-isrgrootx1.letsencrypt.org/ - * - * Revoked TLS Certificates: - * https://revoked-isrgrootx1.letsencrypt.org/ - * - * Test artifacts don't have CRLs listed and intermediate cert doesn't have OCSP. - */ -public class LetsEncryptCA { - - // Owner: CN=R3, O=Let's Encrypt, C=US - // Issuer: CN=ISRG Root X1, O=Internet Security Research Group, C=US - // Serial number: 912b084acf0c18a753f6d62e25a75f5a - // Valid from: Thu Sep 03 17:00:00 PDT 2020 until: Mon Sep 15 09:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw\n" + - "TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh\n" + - "cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw\n" + - "WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg\n" + - "RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP\n" + - "R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx\n" + - "sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm\n" + - "NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg\n" + - "Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG\n" + - "/kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC\n" + - "AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB\n" + - "Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA\n" + - "FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw\n" + - "AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw\n" + - "Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB\n" + - "gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W\n" + - "PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl\n" + - "ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz\n" + - "CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm\n" + - "lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4\n" + - "avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2\n" + - "yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O\n" + - "yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids\n" + - "hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+\n" + - "HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv\n" + - "MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX\n" + - "nLRbwHOoq7hHwg==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid-isrgrootx1.letsencrypt.org - // Issuer: CN=R3, O=Let's Encrypt, C=US - // Serial number: 46326744d1c2f3feeca7148ed59353144a6 - // Valid from: Wed Jun 02 08:00:18 PDT 2021 until: Tue Aug 31 08:00:18 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFSDCCBDCgAwIBAgISBGMmdE0cLz/uynFI7Vk1MUSmMA0GCSqGSIb3DQEBCwUA\n" + - "MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD\n" + - "EwJSMzAeFw0yMTA2MDIxNTAwMThaFw0yMTA4MzExNTAwMThaMCsxKTAnBgNVBAMT\n" + - "IHZhbGlkLWlzcmdyb290eDEubGV0c2VuY3J5cHQub3JnMIIBIjANBgkqhkiG9w0B\n" + - "AQEFAAOCAQ8AMIIBCgKCAQEAmdx7jlaUZ0MgEvqzYWXItAFxVAOmR3KF+79vU195\n" + - "O5X54Go1+GU+eyFAeTqr6W1gC/MIrSA9LO4neJUx5AWCYaLq7IE7/YnmXTT6BB0x\n" + - "WFN3V1OJg9bAqpcEclQp6fbQS6DjdQvUUaEvVIwPzaen6Hmtw6LuHOYOdLk4fUSm\n" + - "zadWiyNlMm0/ts+MLHY5iQd9ypGhJED7KBDQ4d4wvyMYo/MYKOUQ+dTXcIegh7p4\n" + - "0OVtbrkdCuGJL+cEw1IUtSNQD+MnvUIu1je7Yb6iZ6Qd3iopNLykHYZb8YemakGX\n" + - "SDdC54yi35NU+Y+l23vycbVmRd8vK1sizhjRSE+ufmEqXQIDAQABo4ICXTCCAlkw\n" + - "DgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAM\n" + - "BgNVHRMBAf8EAjAAMB0GA1UdDgQWBBR300bKVFG2auzS0mO4+E57SN6QLzAfBgNV\n" + - "HSMEGDAWgBQULrMXt1hWy65QCUDmH6+dixTCxjBVBggrBgEFBQcBAQRJMEcwIQYI\n" + - "KwYBBQUHMAGGFWh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ATE-----"; - - // Owner: CN=revoked-isrgrootx1.letsencrypt.org - // Issuer: CN=R3, O=Let's Encrypt, C=US - // Serial number: 4f1333011635d76d6356c5f1fb8a7273617 - // Valid from: Fri Jun 25 08:18:10 PDT 2021 until: Thu Sep 23 08:18:09 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFSTCCBDGgAwIBAgISBPEzMBFjXXbWNWxfH7inJzYXMA0GCSqGSIb3DQEBCwUA\n" + - "MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD\n" + - "EwJSMzAeFw0yMTA2MjUxNTE4MTBaFw0yMTA5MjMxNTE4MDlaMC0xKzApBgNVBAMT\n" + - "InJldm9rZWQtaXNyZ3Jvb3R4MS5sZXRzZW5jcnlwdC5vcmcwggEiMA0GCSqGSIb3\n" + - "DQEBAQUAA4IBDwAwggEKAoIBAQCkCp4fq7FnN5lfAWX0vhCcyC5WO9TuU6ckuYYj\n" + - "8/wQ8GQ/FIl+vXCAmHIfIX14irQN8TISeVdMOP0C7sa73d3GSawX7qMaRhddXn7V\n" + - "EL+4CbHQ6qit5YkakwhHz9tKbYX16wPj+inn22kJVwi8iLbhYB9WWSvv7OyiNSHv\n" + - "nmlYUkMv8+9UhgPT4yCKF1OEI5ajUOuecjOKc+EzsT/JqPRErvBOIKn3PRn4h8UM\n" + - "0BJDrDtZMpkvD4/lyRs3g/BLsf3DQjlEgKit0hvc72yyhiDbKd41EmBoQC5rNF7o\n" + - "B0CnBXhDLHbC/YRunVrYGsF0h2J9hw4055BdaXbS2BJnPEFnAgMBAAGjggJcMIIC\n" + - "WDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC\n" + - "MAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFJBkf3Z/ICoCTUx3JCgrBeoMyedQMB8G\n" + - "A1UdIwQYMBaAFBQusxe3WFbLrl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KLQx0BA3AL+3Nnj1fT\n" + - "NEKwCWWylIND6z/9Xw==\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - pathValidator.enableCRLCheck(); - - // Validate int, EE certs don't have CRLs - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } - - // OCSP check by default - // intermediate cert R3 doesn't specify OCSP responder - ValidatePathWithParams pathValidator = new ValidatePathWithParams(new String[]{INT}); - pathValidator.enableOCSPCheck(); - - // Validate valid - pathValidator.validate(new String[]{VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 25 09:18:12 PDT 2021", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java deleted file mode 100644 index e21aad61b83..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java +++ /dev/null @@ -1,348 +0,0 @@ -/* - * 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 8304760 - * @summary Interoperability tests with Microsoft TLS root CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath MicrosoftTLS OCSP - * @run main/othervm -Djava.security.debug=certpath MicrosoftTLS CRL - */ - -/* - * Microsoft ECC Root Certificate Authority 2017: - * Valid: http://acteccroot2017.pki.microsoft.com/ - * Revoked: http://rvkeccroot2017.pki.microsoft.com/ - * Expired: http://expeccroot2017.pki.microsoft.com/ - * - * Microsoft RSA Root Certificate Authority 2017: - * Valid: http://actrsaroot2017.pki.microsoft.com/ - * Revoked: http://rvkrsaroot2017.pki.microsoft.com/ - * Expired: http://exprsaroot2017.pki.microsoft.com/ - */ -public class MicrosoftTLS { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new MicrosoftECCTLS().runTest(pathValidator); - new MicrosoftRSATLS().runTest(pathValidator); - } -} - -class MicrosoftECCTLS { - - // Owner: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Issuer: CN=Microsoft ECC Root Certificate Authority 2017, O=Microsoft - // Corporation, C=US - // Serial number: 33000000282bfd23e7d1add707000000000028 - // Valid from: Thu Jun 24 12:58:36 PDT 2021 until: Wed Jun 24 12:58:36 PDT 2026 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIESTCCA8+gAwIBAgITMwAAACgr/SPn0a3XBwAAAAAAKDAKBggqhkjOPQQDAzBl\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw\n" + - "NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5\n" + - "ID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29jc3AwcAYDVR0gBGkwZzAIBgZngQwBAgEwCAYGZ4EMAQICMFEGDCsGAQQBgjdM\n" + - "g30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtp\n" + - "b3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wCgYIKoZIzj0EAwMDaAAwZQIxANmPydUj\n" + - "lgj/2K77UnMeMkSGIgXzOhcTsixzZL+NmTR1Bq2hSPeA6Y3mn3lMlwxZmAIwIio6\n" + - "KrgItH4YmLWKd8QClIrE9QjbDlR7oFqaU3J34bWbMlAEjRARdZhhQlNwdORe\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 3300000154e1c6007ee3d5c903000000000154 - // Valid from: Fri Oct 14 13:44:52 PDT 2022 until: Mon Oct 09 13:44:52 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIF3zCCBWSgAwIBAgITMwAAAVThxgB+49XJAwAAAAABVDAKBggqhkjOPQQDAzBb\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSww\n" + - "KgYDVQQDEyNNaWNyb3NvZnQgRUNDIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAeFw0y\n" + - "MjEwMTQyMDQ0NTJaFw0yMzEwMDkyMDQ0NTJaMFQxCzAJBgNVBAYTAlVTMRMwEQYD\n" + - "VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\n" + - "b3NvZnQgQ29ycG9yYXRpb24wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARk86yqvyiv\n" + - "jH2Frg2l6bmh1f0CqiKAEHdA2S2vTQhR4CtvFArkrPdqcKrhAAfQSgnC8KJQ08gl\n" + - "Qv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wYDVR0RBCQwIoIgYWN0ZWNjcm9vdDIw\n" + - "MTcucGtpLm1pY3Jvc29mdC5jb20waAYDVR0fBGEwXzBdoFugWYZXaHR0cDovL3d3\n" + - "dy5taWNyb3NvZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwRUNDJTIwVExT\n" + - "JTIwSXNzdWluZyUyMEFPQyUyMENBJTIwMDEuY3JsMGYGA1UdIARfMF0wUQYMKwYB\n" + - "BAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93d3cubWljcm9zb2Z0LmNv\n" + - "bS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTAIBgZngQwBAgIwHwYDVR0jBBgw\n" + - "FoAUMVu5zlEbfNGqA8Dr7TZdwp3TieEwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYI\n" + - "KoZIzj0EAwMDaQAwZgIxAOKV8s3SpXVd6zho8zQa4uGXkxPVocYo410FdTwu0lw7\n" + - "G/MQPhLmj4DNsQJ/nYzDcwIxAMw7iZExsY9Is66/EaAty4rA+yuliwCag88VnDRH\n" + - "9cjiongZgpddIYS8xf76B2pi/Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 3300000155ea28117be8708034000000000155 - // Valid from: Fri Oct 14 13:50:39 PDT 2022 until: Mon Oct 09 13:50:39 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIF3TCCBWOgAwIBAgITMwAAAVXqKBF76HCANAAAAAABVTAKBggqhkjOPQQDAzBb\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSww\n" + - "KgYDVQQDEyNNaWNyb3NvZnQgRUNDIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAeFw0y\n" + - "MjEwM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ZYwZQYIKwYBBQUHMAKGWWh0dHA6Ly93d3cubWljcm9z\n" + - "b2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwRUNDJTIwVExTJTIwSXNz\n" + - "dWluZyUyMEFPQyUyMENBJTIwMDEuY3J0MC0GCCsGAQUFBzABhiFodHRwOi8vb25l\n" + - "b2NzcC5taWNyb3NvZnQuY29tL29jc3AwHQYDVR0OBBYEFN3cgtHESQ8o7thvaL42\n" + - "bD7mpfktMA4GA1UdDwEB/wQEAwIHgDArBgNVHREEJDAigiBydmtlY2Nyb290MjAx\n" + - "Ny5wa2kubWljcm9zb2Z0LmNvbTBoBgNVHR8EYTBfMF2gW6BZhldodHRwOi8vd3d3\n" + - "Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBFQ0MlMjBUTFMl\n" + - "MjBJc3N1aW5nJTIwQU9DJTIwQ0ElMjAwMS5jcmwwZgYDVR0gBF8wXTBRBgwrBgEE\n" + - "AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t\n" + - "L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMAgGBmeBDAECAjAfBgNVHSMEGDAW\n" + - "gBQxW7nOURt80aoDwOvtNl3CndOJ4TATBgNVHSUEDDAKBggrBgEFBQcDATAKBggq\n" + - "hkjOPQQDAwNoADBlAjBBhbuh/iukcibeEh/Op3RfNf6jUSyza4lZvsJsRiEVwySa\n" + - "ofmg8OvBO2l2+9MjoCUCMQCoiyS1tDgtjW9gguKDgPXypURpL27KfnCzwx6ar2LN\n" + - "gCZ/soGnLsgPIscuNH/BK20=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Oct 14 15:46:18 PDT 2022", System.out); - } -} - -class MicrosoftRSATLS { - - // Owner: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Issuer: CN=Microsoft RSA Root Certificate Authority 2017, O=Microsoft - // Corporation, C=US - // Serial number: 330000002ffaf06f6697e2469c00000000002f - // Valid from: Thu Jun 24 13:57:35 PDT 2021 until: Wed Jun 24 13:57:35 PDT 2026 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIHmDCCBYCgAwIBAgITMwAAAC/68G9ml+JGnAAAAAAALzANBgkqhkiG9w0BAQwF\n" + - "ADBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MTYwNAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y\n" + - "aXR5IDIwMTcwHhcNMjEwNjI0MjA1NzM1WhcNMjYwNjI0MjA1NzM1WjBbMQswCQYD\n" + - "VQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSwwKgYDVQQD\n" + - "EyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTCCAiIwDQYJKoZI\n" + - "hvcNAQEBBQADggIPADCCAgoCggIBAKAYz8zB6I+LeiWYURf1QUaISydvRgxWfcc6\n" + - "UvEiwvryj2UsRfFuREo2ErLTvP9qQ9E0YBTyWEqI2TXn4jo2uZ2cpGODiQQWlixe\n" + - "aAFcYgSqLzidFXj401vzQsz4E0zylD/ZeY+xkQ6xrdg5312x2u2Ap7AWLzqolZHZ\n" + - "gR0aicn9gcO6M4qn6Uuge8mOve1N7U6j8ebhSiw0KlkzY9ha1Kvrez+NXQdeLC+V\n" + - "PDWPPPlBWeysTnIM6dusbV1v2/C7Ooz9TuGb8wiXRriPpI7+igSIPqBebF00rHGJ\n" + - "Dmx9eN3g78VF9JpTr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haHR0cDovL29uZW9jc3AubWljcm9zb2Z0LmNv\n" + - "bS9vY3NwMHAGA1UdIARpMGcwCAYGZ4EMAQIBMAgGBmeBDAECAjBRBgwrBgEEAYI3\n" + - "TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3Br\n" + - "aW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMA0GCSqGSIb3DQEBDAUAA4ICAQAkucWk\n" + - "Mrgs2ahYrG7y4sY2yZno4f9TGyk7p+Srg4Yz/g7LmVeyOob9o579Omw9AiyeDK8Y\n" + - "/dXnTTof+sKJrlNTpIzyEBkzCiGGkWtp7x2yxLCm12L65wtmD/6OAV9Bm1kOhf3p\n" + - "7v+d3gtFt7cw46W35lr+fguy62s7uuytTV9hfhQ0pp2E2E9F6B7U71jR4bC+6zGq\n" + - "+34AmqTirjKHwXOhWDRDpEJIkaFAh+qdz/nqJktZj3n5GdC94jfWrMUJjClGjlc4\n" + - "+Ws3AxN46oFpx8oIXDG9wIPfFhUf0SdnCYJL8TD5+qBNp0H5q/V2R31Wi8rijHGQ\n" + - "4CxHqzP5VJbjgvRQgxAp39BrmLQ+JSvf9e5VqQqaH4NYgpB1WObq12B73BJHjBOv\n" + - "pRrULFjPqDW8sPRBzBTRXkXOPEdZbzQj6O/CWEFsg6ilO4thk3n3drb9FEJjVh9u\n" + - "GtRXV6Ea5bNaPvJppZNXb7M9mORk3mddx/K1FgOETQE3quh+mU4ojbSRUWMVmjcb\n" + - "6bKF5oQd+Q0do4yaEIfH1oVnIas/FIE/xu3Z4fvBs0qdiNLCeNT6uS26vqD2PEvV\n" + - "lFWb683Do3Ls59MMCxhy6Erb7kFQgu1oUWXGFhbMQkeLN4TXGi6X3loXYfING9om\n" + - "nWa/udxvPRwAZmcHU2l2W8cwVXiy6uucsh3kPQ==\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 330000014a3b44c12636e54b9f00000000014a - // Valid from: Fri Oct 14 13:55:34 PDT 2022 until: Mon Oct 09 13:55:34 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIILDCCBhSgAwIBAgITMwAAAUo7RMEmNuVLnwAAAAABSjANBgkqhkiG9w0BAQwF\n" + - "ADBbMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MSwwKgYDVQQDEyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAe\n" + - "Fw0yMjEwMTQyMDU1MzRaFw0yMzEwMDkyMDU1MzRaMFQxCzAJBgNVBAYTAlVTMRMw\n" + - "EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN\n" + - "aWNyb3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQDTo/3ysrrKP2eOLQ8JUFhQT09HJM1lUr0nH7RiP4VAKFrGFMIQSCsq17y7\n" + - "PuTHxW53Fvxb5s/EKZobzhlgv4rHQxvoMuGWRBgJN6KfspQAuFnUVG+3y70fHy/O\n" + - "PiVUJdfTupsys/fjzERqzx6FZoU1RzQ08na36SicSOQmj5svtHHxL8ZibDD48Xzp\n" + - "oIEBh2uUDhevkZedBmqlIdAhNgKXqf2lieLjWXZQLzUyXHikQJxNFOHFVjBqH3pu\n" + - "pYt2XD78bS/xeKRbGLw52+o3/u4eaPyiJoG0GaVSG2HRGcplu7Auk6ycD3htispr\n" + - "dviXfHa3tW1hO52PrQBOWvpsP3jdAgMBAAGjggPuMIID6jCCAX4GCisGAQQB1nkC\n" + - "BAIEggFuBIIBagFoAHUA6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0GvW4A\n" + - "AAGD2FEl4wA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cJHxYy41U=\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 330000014b4c2b0b9955688feb00000000014b - // Valid from: Fri Oct 14 13:56:58 PDT 2022 until: Mon Oct 09 13:56:58 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIKjCCBhKgAwIBAgITMwAAAUtMKwuZVWiP6wAAAAABSzANBgkqhkiG9w0BAQwF\n" + - "ADBbMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MSwwKgYDVQQDEyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAe\n" + - "Fw0yMjEwMTQyMDU2NThaFw0yMzEwMDkyMDU2NThaMFQxCzAJBgNVBAYTAlVTMRMw\n" + - "EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN\n" + - "aWNyb3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQD2UxPzrv61IqG8jCFPWM3KeQpBeBlxh3mzvWVFmo340r0J1C3uLaUTPYLo\n" + - "P+Xndq2GqYLlm/5FEY7ynU1as57SH0tHbKCIYYJezn/ZJHUYcOY80uGKpP3bdbRq\n" + - "W51Xo7/gzTrXFJ2Nrn05d9mKBq+Oxs71+Nj7QuzjHYAF0n8OWNwZCBOBdAX3EDVQ\n" + - "4HBMSkIzriodM0FD2zkT8RIvZ7WbpLxvZXqWbynAeLirTRYE2lY9UalxrP+wCef9\n" + - "DARxcpEgF30nwRnALfOhnuOhdrtdLYhArfQMyDcvJnDyzCWEZCaPNtBhdsziJjf9\n" + - "A8R4/qdnlQE4/24O9MXQja5dwyyRAgMBAAGjggPsMIID6DCCAXwGC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GjuenPYsCmabzydiAeMIQirCCLSTqXrSw1YL\n" + - "2+608l1nqYy1JOrSq/zFp3c5buSFbjj7jVJB5LEh\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Oct 14 15:46:18 PDT 2022", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java deleted file mode 100644 index e171bafe1ad..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java +++ /dev/null @@ -1,495 +0,0 @@ -/* - * 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 - * 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 8189131 8207059 - * @key intermittent - * @summary Interoperability tests with QuoVadis Root CA1, CA2, and CA3 G3 CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath QuoVadisCA OCSP - * @run main/othervm -Djava.security.debug=certpath QuoVadisCA CRL - */ - -/* - * Obtain TLS test artifacts for QuoVadis CAs from: - * - * https://www.quovadisglobal.com/download-roots-crl/ - * - */ -public class QuoVadisCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new RootCA1G3().runTest(pathValidator); - new RootCA2G3().runTest(pathValidator); - new RootCA3G3().runTest(pathValidator); - } -} - -class RootCA1G3 { - - // Owner: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Issuer: CN=QuoVadis Root CA 1 G3, O=QuoVadis Limited, C=BM - // Serial number: 2837d5c3c2b57294becf99afe8bbdcd1bb0b20f1 - // Valid from: Wed Jan 06 12:50:51 PST 2021 until: Sat Jan 04 12:50:51 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFgDCCA2igAwIBAgIUKDfVw8K1cpS+z5mv6Lvc0bsLIPEwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0yMTAxMDYyMDUwNTFaFw0z\n" + - "MTAxMDQyMDUwNTFaMFkxCzAJBgNVBAYTAlVTMRYwFAYDVQQKDA1EaWdpQ2VydCwg\n" + - "SW5jMTIwMAYDVQQDDClEaWdpQ2VydCBRdW9WYWRpcyBUTFMgSUNBIFFWIFJvb3Qg\n" + - "Q0EgMSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALMrbkb9kz/4\n" + - "y00r7tfK+uDRomMNd5iCDVMWOvSx1VygKoBn3aavw7gq9Vfb2fIMIWkWG0GMxWbG\n" + - "cx3wDHLWemd7yl9MxRUTGXkvH6/dNEavAQh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BMbO5e9iqK1Hcj5Wv\n" + - "ZXvU45j2r5y9WML4fc8CvphzbF6ezr1e51i+yabNmfld33gRX48V5oNk16wX32ed\n" + - "kQ83sKNomQm1dXURWK8aSDcZFAvJQ8vKTLIE9wiQmtjfSGoJzQhKLaN+egrp4L9y\n" + - "fjpFIeK4zgAH39P4s4kaPWTdfXe2n6P5o7Xolp4R22SVkI76d8d+5Iv7Rtqd+mqI\n" + - "y1hkwyTBbOBLtyF7yMtJQewkkZ0MWxkPvWg193RbYVRx8w1EycnxMgNwy2sJw7MR\n" + - "XM6Mihkw910BkvlbsFUXw4uSvRkkRWSBWVrkM5hvZGtbIJkqrdnj55RSk4DLOOT/\n" + - "LUyji/KpgD7YCi7emFA4tH6OpkNrjUJ3gdRnD4GwQj/87tYeoQWZ6uCl0MHDUCmw\n" + - "73bpxSkjPrYbmKo9mGEAMhW1ZxY=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-1-g3.chain-demos.digicert.com, O="DigiCert, Inc.", - // L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Serial number: a94cc08600f5fe5d3f0659bfcfec6f0 - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIG/DCCBeSgAwIBAgIQCpTMCGAPX+XT8GWb/P7G8DANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDEgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjB9MQswCQYDVQQGEwJVUzENMAsGA1UE\n" + - "CBMEVXRhaDENMAsGA1UEBxMETGVoaTEXMBUGA1UEChMOR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\n" + - "HNYVASYcrdld90jVJaeI/V3EkJAX7/Eyo9JqzivEwGM0e0JhCLekcVSzhjGoAlbQ\n" + - "tIzCIaeVUlWKKiNXSKr1WD4oCD3ky4Y5VekTGzyUf/0LYzV+Y7p8epc5vTWKwYx/\n" + - "vQwJ4RsgFit+c84mSg4qug==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-1-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Serial number: e7eff4cdd14ebed1daa7bb7e07300ed - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHDjCCBfagAwIBAgIQDn7/TN0U6+0dqnu34HMA7TANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDEgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjCBhTELMAkGA1UEBhMCVVMxDTALBgNV\n" + - "BAgTBFV0YWgxDTALBgNVBAcTBExlaGkxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMu\n" + - "MT8wPQYDVQQDEzZxdW92YWRpcy1yb290LWNhLTEtZzMtcmV2b2tlZC5jaGFpbi1k\n" + - "ZW1vcy5kaWdpY2VydC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n" + - "AQDCQQ2S25TEDDGHa/zvFUex4mD7pUAS7g80g8mQVII2v9Cg6F2tIEbay/IDhV3D\n" + - "NtxJcaqiMpT9oMA5jhMSOqcoq8QFzdqugtIvxQ3obrIZysxjjluB2b1T5Uhl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A1UdEwQCMAAwggF+\n" + - "BgorBgEEAdZ5AgQCBIIBbgSCAWoBaAB3AOg+0No+9QY1MudXKLyJa8kD08vREWvs\n" + - "62nhd31tBr1uAAABf1xeMeAAAAQDAEgwRgIhALuEk3mDbnEEkboc95mrKMgibE0K\n" + - "0QAWMu1gI/teH06xAiEA7dbuLv66ScQkOq0zbfnUM8ih1Bw+Wb29jQRyTEXCaxEA\n" + - "dgA1zxkbv7FsV78PrUxtQsu7ticgJlHqP+Eq76gDwzvWTAAAAX9cXjIwAAAEAwBH\n" + - "MEUCIBvEfG23Yewp6oXQJExXQ+Am7z4i0X5NqSz8ohAXT3NiAiEAhDjy2H2Z5CV5\n" + - "gZ8TACTVgNyvEIH0cS4DjH6/ILknLDEAdQCzc3cH4YRQ+GOG1gWp3BEJSnktsWcM\n" + - "C4fc8AMOeTalmgAAAX9cXjJBAAAEAwBGMEQCIGuxWoTPcFYQlVF9q/F1JbaZj/VT\n" + - "O6Oa8ionxCC/8aqrAiAUCUoDcwphZ25ZFC+xGiP0kUiWgUwuQH7lBpTgoZp/BjAN\n" + - "BgkqhkiG9w0BAQsFAAOCAQEAFrVjcQxq81PXEgHCf48+FOle8kUpJGxpH1n1Sp0p\n" + - "V95wrXj47oT1Vt9WqXPrNDfDkxwAvvXrCMXjHEg2YN0FCEanVec8GciuRRRtXrOE\n" + - "QOXAqGv5j+KG7bEvMNUFS90fesxfxVAQkr1zIT70nMAOKV1NOyQ/q8bZ+jehcRZB\n" + - "wUKrCWAzvOw4DPytrDcQmflvQN+Bw92T3uDuoYT/oBcobpVfKpfuW/+ZxxXTIp4L\n" + - "sixlx82SZNTo6e3LOqsgZnR6TFyRJ63sK65M+W0d55bHvleUAHRCOiGhhgqE/cby\n" + - "z50hDzJMLnjskMSpkxMoeSeutAS2e7oIvA//7C37LrQccQ==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 08 11:22:28 PST 2022", System.out); - } -} - -class RootCA2G3 { - - // Owner: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Issuer: CN=QuoVadis Root CA 2 G3, O=QuoVadis Limited, C=BM - // Serial number: 65e9bcd53e791df22dffeb5ecc2bc7a5588d0883 - // Valid from: Mon Mar 16 12:39:42 PDT 2020 until: Thu Mar 14 12:39:42 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFbzCCA1egAwIBAgIUZem81T55HfIt/+tezCvHpViNCIMwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0yMDAzMTYxOTM5NDJaFw0z\n" + - "MDAzMTQxOTM5NDJaMEoxCzAJBgNVBAYTAlVTMRcwFQYDVQQKDA5EaWdpQ2VydCwg\n" + - "SW5jLjEiMCAGA1UEAwwZRGlnaUNlcnQgUVYgRVYgVExTIElDQSBHMTCCASIwDQYJ\n" + - "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMhwn6I+pGrJsnisnzP7EU5cFN9UT5XF\n" + - "auA13F3jHeUUZmBOcMSOJEhx/e7oeVScTnmKpe7t7uey7lIIC9DWFmP8klbtLBgL\n" + - "0jY4MPlCkVyxUIhZ73EHCPqDCX9bo+rMB6C758/tKZOPcoWRixQypPwoC4cXNOOk\n" + - "ntqFPRxFSZoBdTDNlAmkAQJCRsXGCEC5pZ0JqzGcAA0/Pw1fB8lSPAti3trubYmd\n" + - "aaPFAKzGK7vsexxpuSUKO0opNkFWbLdHZ8jkr86R80oo1vhURJXWNeMS74ws5nbt\n" + - "Ll9sJTDW33MQPS0/JO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pJMxP3JEGkjlKCenmc29r2u1\n" + - "KE4TeCs2xxjR1PusTfX91bBW3YAoAPDTRQKZjolegLUY44j3uKSzAdhMEbZQhovH\n" + - "Lraqx1WjTayTuq1Vuakcia5shmgFVSNcE+NVgLEIe32oTOm/G6Kd1lcm9C4Ph1Cg\n" + - "nfDuqohZrk76kJTk8poAY5aFCQHhVzbpSw3zooMGjjvWnkG+/DC6SZM8rKoOdKiB\n" + - "cy+N\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-2-g3.chain-demos.digicert.com, O="DigiCert, - // Inc.", L=Lehi, ST=Utah, C=US, SERIALNUMBER=5299537-0142, OID.1.3.6.1.4 - // 1.311.60.2.1.2=Utah, OID.1.3.6.1.4.1.311.60.2.1.3=US, - // OID.2.5.4 .15=Private Organization - // Issuer: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Serial number: 9c5e9d5f169d3a59e64db208d3e849d - // Valid from: Wed Feb 02 16:00:00 PST 2022 until: Mon Mar 06 15:59:59 PST 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHNDCCBhygAwIBAgIQCcXp1fFp06WeZNsgjT6EnTANBgkqhkiG9w0BAQsFADBK\n" + - "MQswCQYDVQQGEwJVUzEXMBUGA1UECgwORGlnaUNlcnQsIEluYy4xIjAgBgNVBAMM\n" + - "GURpZ2lDZXJ0IFFWIEVWIFRMUyBJQ0EgRzEwHhcNMjIwMjAzMDAwMDAwWhcNMjMw\n" + - "MzA2MjM1OTU5WjCB3zEdMBsGA1UEDwwUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzAR\n" + - "BgsrBgEEAYI3PAIBAxMCVVMxFTATBgsrBgEEAYI3PAIBAhMEVXRhaDEVMBMGA1UE\n" + - "BRMMNTI5OTUzNy0wMTQyMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRhaDENMAsG\n" + - "A1UEBxMETGVoaTEXMBUGA1UEChMORGlnaUNlcnQsIEluY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STJRGZad7L0\n" + - "Oz48CRhm94iaEjFcVKT3vcDUrtCKpkmhBACcdA3NNqDq10i/SLspOeDLSESkkJKF\n" + - "w8w3YCqXjZn5JyV3sVHYNezNKtLdCxn4\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-2-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US, SERIALNUMBER=5299537-0142, - // OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Utah, - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Serial number: 3f84605850df3ac98fcc15adec269f8 - // Valid from: Sun Apr 17 17:00:00 PDT 2022 until: Fri May 19 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHQDCCBiigAwIBAgIQA/hGBYUN86yY/MFa3sJp+DANBgkqhkiG9w0BAQsFADBK\n" + - "MQswCQYDVQQGEwJVUzEXMBUGA1UECgwORGlnaUNlcnQsIEluYy4xIjAgBgNVBAMM\n" + - "GURpZ2lDZXJ0IFFWIEVWIFRMUyBJQ0EgRzEwHhcNMjIwNDE4MDAwMDAwWhcNMjMw\n" + - "NTE5MjM1OTU5WjCB5zETMBEGCysGAQQBgjc8AgEDEwJVUzEVMBMGCysGAQQBgjc8\n" + - "AgECEwRVdGFoMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjEVMBMGA1UE\n" + - "BRMMNTI5OTUzNy0wMTQyMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRhaDENMAsG\n" + - "A1UEBxMETGVoaTEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xPzA9BgNVBAMTNnF1\n" + - "b3ZhZGlzLXJvb3QtY2EtMi1nMy1yZXZva2VkLmNoYWluLWRlbW9zLmRpZ2ljZXJ0\n" + - "LmNvbTCCASIwDQYJKoZIhvcNAQ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cDovL2NhY2VydHMu\n" + - "ZGlnaWNlcnQuY29tL0RpZ2lDZXJ0UVZFVlRMU0lDQUcxLmNydDAJBgNVHRMEAjAA\n" + - "MIIBfAYKKwYBBAHWeQIEAgSCAWwEggFoAWYAdQDoPtDaPvUGNTLnVyi8iWvJA9PL\n" + - "0RFr7Otp4Xd9bQa9bgAAAYA+bejFAAAEAwBGMEQCIFDhmaB4BXmOw2SKONPFBU8t\n" + - "qXb7DXeG6JHGcONDqITjAiAqozEj7/1ULu6t/uzfwOSgC7xEmUsLGzQVnaOF9m3s\n" + - "swB1ADXPGRu/sWxXvw+tTG1Cy7u2JyAmUeo/4SrvqAPDO9ZMAAABgD5t6QkAAAQD\n" + - "AEYwRAIgfVEs7Ph+wOpoCGl4woa3aUWH1COGx1SwvHZ8lH21xfsCIBI1IpR6goya\n" + - "iz47tT/Uz+26RnkHiAApYsdMOPyevkzhAHYAs3N3B+GEUPhjhtYFqdwRCUp5LbFn\n" + - "DAuH3PADDnk2pZoAAAGAPm3pPgAABAMARzBFAiAKBon1PVoqJAF49jMQd2c222TK\n" + - "sWkL5sLFqLVZj2vOugIhAODd/OUy236+9alC2U5nxl1oej9fOF4por2OZMFQfpFF\n" + - "MA0GCSqGSIb3DQEBCwUAA4IBAQAyrJzyOiRAETfoYddTmRmbnFNuHx4YAkkdxn2d\n" + - "BXdy4jPn0kTtDo4592KnbTdieSCWghmEmcEY1sQXdX6iqKwzmp408jfUDohl5evV\n" + - "oZrum3P3zgLRz1qswFM5a2HteWzCWWi/n6d6nKXj6PGGVAMQfk1s6PaWhYBuiaag\n" + - "myYss/LTPzaLGUfFzlt/HfomiD+BNuBOVa+pPrmTWhex+e02z95n6RPYCiazuZNZ\n" + - "xiarN83pRNu/fIjVXw2jENg7+kaC1wwLqET0x6/EJa6YI3Xa7Aumb8Pp2r2UZ5Tr\n" + - "7BUhmiRLkvw/9SI8ceXNSwuTTGK2fKHm2/CWqI0cS3zWk3dC\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Apr 18 14:07:46 PDT 2022", System.out); - } -} - -class RootCA3G3 { - - // Owner: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Issuer: CN=QuoVadis Root CA 3 G3, O=QuoVadis Limited, C=BM - // Serial number: 427dd33a8ff51d8152e813c7dec93ba76312a7d8 - // Valid from: Wed Jan 06 12:55:40 PST 2021 until: Sat Jan 04 12:55:40 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFgDCCA2igAwIBAgIUQn3TOo/1HYFS6BPH3sk7p2MSp9gwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0yMTAxMDYyMDU1NDBaFw0z\n" + - "MTAxMDQyMDU1NDBaMFkxCzAJBgNVBAYTAlVTMRYwFAYDVQQKDA1EaWdpQ2VydCwg\n" + - "SW5jMTIwMAYDVQQDDClEaWdpQ2VydCBRdW9WYWRpcyBUTFMgSUNBIFFWIFJvb3Qg\n" + - "Q0EgMyBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALxNTdqnFD+A\n" + - "MhketYfVfVUWQKPkVEuyYj7Y2uwXBMRP4RStO4CoQih+hX/h94vRlObOIsqcNnyC\n" + - "ElwBnLbmusaWYLYnDEWoROL8uN0pkWk0asfhhEsXTkAJ6FLHUD85WBkED4gIVWPi\n" + - "Sp4AOwiA+/zpbwgVAgdjJTO3jjMsp4F1lBrdViYSwoPRACH1ZMjJG572oXTpZkQX\n" + - "uWmEKLU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wDM/8jkt16epFAdw0fXemyM8FdHJDnB++3d8SyjOOQ8j+VHW\n" + - "31NWx27sORa5CgRchlldXWDzIIEwbc82a1OAfGUmNAsdEHjMl1HMcZHbjCmdSdsw\n" + - "fmyldZrj2YmvOI5ZlE9z4vzi35KyqlxWCtu9O/SJq/rBvYS0TPmm8HbhJQbeMe6p\n" + - "vJGrxcb1muSBANn9T9wvukjiNNw32ciSDCjZ0h4N+CGxbzoZtgIAQ29IunYdnJix\n" + - "ZiP+ED6xvwgVRBkDSgWD2W/hex/+z4fNmGQJDcri51/tZCqHHv2Y7XReuf4Fk+nP\n" + - "l8Sd/Kpqwde/sJkoqwDcBSJygh0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-3-g3.chain-demos.digicert.com, O="DigiCert, Inc.", - // L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Serial number: f27ee3fad1d754ae78d7866da0a4f6f - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIG/jCCBeagAwIBAgIQDyfuP60ddUrnjXhm2gpPbzANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDMgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjB9MQswCQYDVQQGEwJVUzENMAsGA1UE\n" + - "CBMEVXRhaDENMAsGA1UEBxMETGVoaTEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4x\n" + - "NzA1BgNVBAMTLnF1b3ZhZGlzLXJvb3QtY2EtMy1nMy5jaGFpbi1kZW1vcy5kaWdp\n" + - "Y2VydC5jb20wggEiMA0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TA1Q+VoPVMiU6\n" + - "osdBQGUbbWrqm1fnoFW1VvUt\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-3-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Serial number: aafa7cafda91796626f5fc8bcb38702 - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHDTCCBfWgAwIBAgIQCq+nyv2pF5Zib1/IvLOHAjANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDMgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjCBhTELMAkGA1UEBhMCVVMxDTALBgNV\n" + - "BAgTBFV0YWgxDTALBgNVBAcTBExlaGkxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMu\n" + - "MT8wPQYDVQQDEzZxdW92YWRpcy1yb290LWNhLTMtZzMtcmV2b2tlZC5jaGFpbi1k\n" + - "ZW1vcy5kaWdpY2VydC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n" + - "AQDofDJ1xHHWMhbWwU7e4cY3u2NjvE4ur/A0Y13UK53zoH8qDunV6ORAXQ+zSpev\n" + - "kPlnIbdjYOK1v5RJn2ZRgCafj8Bc/9GnfQ1uE7P9dRkC9ZQwvb6Eh6f4RT7gaOPX\n" + - "UXSXwtr96xdXDvtlJqWx13YQPnSGXUNNT1NH8bs2Myr9j+I5bUcUGsKsGheZoib3\n" + - "6IFINss+ouOhZ+HP6ganS5cQVsUGk5u6BT6oH9Vg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6UFe2jgbM3FjYRMmcNaXfpleT\n" + - "E8hmYfmAVy5lSoUCIDPCV27IP9wpdGoxnnCMBwuekg6E4SB0lj49+o9OHHjDAHUA\n" + - "Nc8ZG7+xbFe/D61MbULLu7YnICZR6j/hKu+oA8M71kwAAAF/XBzQ0QAABAMARjBE\n" + - "AiBO6vYHFci7OWvqDHRlgTn+Q6zNG/LysZEOlrO4W8ZZ2gIgDY5+qjlar3esPN0b\n" + - "JUR5vfITl7UiZoqINJSm1gZ4Nm4AdwCzc3cH4YRQ+GOG1gWp3BEJSnktsWcMC4fc\n" + - "8AMOeTalmgAAAX9cHNDdAAAEAwBIMEYCIQCB52OPhdnYybsWzmkdSGSbgQVmS0V7\n" + - "ZumbThJSJwpuiwIhAP+JRx+Eu3MYRp5iyLb+xlWqghMnDnF9aCfm1VuW4aDuMA0G\n" + - "CSqGSIb3DQEBCwUAA4IBAQBO/4LljBpMGYYxBang12UIQ+FIjxAfKqqIklSa+du2\n" + - "ea0VHqaRrdfh/aTxzb0WaU++bgQN+MeHmQdvwYSgAyU/lY7mIvDTNxFOO6IG2vfR\n" + - "+JAUnS9iVUQ1rXHU72cxUsne5aRyLQ0W/2Zayx85O6/C9gIUJgJVRuk0dTPZ6tnq\n" + - "FoW1S4GwqEpzTuJU8rP5IvMYoYo8jItpjzS0W90gtDvev/XBRs1ig28Ky7ZS5AtQ\n" + - "S2Q6Ikg9YzegE9YNj2wqdZnEneoce0G1InysM/geY1BZ57G9RAUZkzWVTJRLJgbg\n" + - "2nWSqpQJ765gg9JdsRo+zqj1kUBbUYoTSlaAJG6ucrlB\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 08 11:23:06 PST 2022", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java deleted file mode 100644 index 1d31833398b..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java +++ /dev/null @@ -1,489 +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 8243320 - * @summary Interoperability tests with SSL.com's RSA, EV RSA, and ECC CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath SSLCA OCSP - * @run main/othervm -Djava.security.debug=certpath SSLCA CRL - */ - -/* - * Obtain TLS test artifacts for SSL.com CAs from: - * - * SSL.com RSA CA - * Valid - https://test-dv-rsa.ssl.com - * Revoked - https://revoked-rsa-dv.ssl.com/ - * SSL.com EV RSA CA - * Valid - https://test-ev-rsa.ssl.com - * Revoked - https://revoked-rsa-ev.ssl.com/ - * SSL.com ECC CA - * Valid - https://test-dv-ecc.ssl.com - * Revoked - https://revoked-ecc-dv.ssl.com/ - */ -public class SSLCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new SSLCA_RSA().runTest(pathValidator, ocspEnabled); - new SSLCA_EV_RSA().runTest(pathValidator, ocspEnabled); - new SSLCA_ECC().runTest(pathValidator, ocspEnabled); - } -} - -class SSLCA_RSA { - - // Owner: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com Root Certification Authority RSA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 997ed109d1f07fc - // Valid from: Fri Feb 12 10:48:52 PST 2016 until: Wed Feb 12 10:48:52 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGbzCCBFegAwIBAgIICZftEJ0fB/wwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE\n" + - "BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK\n" + - "DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp\n" + - "Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTg0ODUyWhcNMzEwMjEyMTg0\n" + - "ODUyWjBpMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv\n" + - "dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEeMBwGA1UEAwwVU1NMLmNv\n" + - "bSBSU0EgU1NMIHN1YkNBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\n" + - "hPYpOunhcxiF6xNzl6Tsm/Q89rnu2jVTXTBOZPaBkSD1Ic4lm7qkYwlZ/UgV5nn1\n" + - "5ohhceYDC2AlR9RvGbP+26qrNcuE0XOdHJOB4SoY4d6OqLAQ6ZB0LdERK1Saa5lp\n" + - "QlqHE8936dpr3h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VBHtHvo62jMoHY3Xunc/EofbeS4aHdYBvgkn6CNTj\n" + - "VkCU+psWwcT3Pg83uP4k4Thu7bXvrClfS+XBlbJiCF/PSJxLrKnxRn+XIGiYl62H\n" + - "glBhq9K8/fZrI2Qh1mZJmWE0FlxEDCb4i8SBNi8lmDogaFi8/yl32Z9ahmhxcLit\n" + - "DU/XyKA0yOqvIrOGKH95v+/l8fQkzE1VEFvj+iyv4TXd7mRZDOsfqfIDZhrpou02\n" + - "kXH/hcXlrR++t8kjj9wt8HHQ+FkryWI6bU3KPRJR6N8EH2EHi23Rp8/kyMs+gwaz\n" + - "zMqnkNPbMME723rXk6/85sjOUaZCmhmRIx9rgqIWQesU962J0FruGOOasLT7WbZi\n" + - "FsmSblmpjUAo49sIRi7X493qegyCEAa412ynybhQ7LVsTLEPxVbdmGVih3jVTif/\n" + - "Nztr2Isaaz4LpMEo4mGCiGxec5mKr1w8AE9n6D91CvxR5/zL1VU1JCVC7sAtkdki\n" + - "vnN1/6jEKFJvlUr5/FX04JXeomIjXTI8ciruZ6HIkbtJup1n9Zxvmr9JQcFTsP2c\n" + - "bRbjaT7JD6MBidAWRCJWClR/5etTZwWwWrRCrzvIHC7WO6rCzwu69a+l7ofCKlWs\n" + - "y702dmPTKEdEfwhgLx0LxJr/Aw==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=test-dv-rsa.ssl.com - // Issuer: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 4ceada4ade82a6ccd0b2ae32c0dbfd62 - // Valid from: Fri Jun 28 07:06:50 PDT 2019 until: Sun Jun 27 07:06:50 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHTjCCBTagAwIBAgIQTOraSt6CpszQsq4ywNv9YjANBgkqhkiG9w0BAQsFADBp\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "GDAWBgNVBA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pYjE8R7SxrqcvOLtwvOVew6TuCUl6RNpl\n" + - "xeC9Oa1dgf+QRXN7LvmBXUP2nOCnwJE1ENvThPLw9BXLatVJgkA/v/mYWE5VjzIL\n" + - "hboPH2fNWemUv5QMzxUkqhgHgrhr8wnhI6xYIYciGDbmmfnItHex7bxktT7axoCD\n" + - "3dTQQe01YfK/LlkHtnBmJf/t0F33m8KXcQ51fic/TR2U5Tampxp2kdFdTyvRRqMl\n" + - "igqo3EhiPmB9bKsnXDA2AnvdjZT9uFwbUu5lNxjiMQcSZikjQAjJPgjCZ9BQOGbL\n" + - "eqgZcw2CxWMxFSTLL3TIBlNL/0GpRlTvr3IGyvHEr7EESXKD+Ar8XW+4VlMc1s8F\n" + - "cdtnus71s7wm+JUSXcM0WJUkRUvWqHlPi3Ucfe7k6x6BG9Mb42ECjorefPXvFu7v\n" + - "OT4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked-rsa-dv.ssl.com - // Issuer: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 3f527e677d00558272ac90d1620b67f4 - // Valid from: Fri Jun 28 07:13:48 PDT 2019 until: Sun Jun 27 07:13:48 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHVzCCBT+gAwIBAgIQP1J+Z30AVYJyrJDRYgtn9DANBgkqhkiG9w0BAQsFADBp\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "GDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEeMBwGA1UEAwwVU1NMLmNvbSBSU0Eg\n" + - "U1NMIHN1YkNBMB4XDTE5MDYyODE0MTM0OFoXDTIxMDYyNzE0MTM0OFowITEfMB0G\n" + - "A1UEAwwWcmV2b2tlZC1yc2EtZHYuc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD\n" + - "ggEPADCCAQoCggEBAMKtMVe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po+0jcoMAW6JgMD+otn8gofBq+Za1N4X\n" + - "xckvLWbMDAj4lELBHXu7gLHHLJCL9GGPD5HKjH/RyLtKKaRgT/AV6jl/woKTAzGF\n" + - "SPqgNQsu+sCdUbO0nDONkXDxhfan8XNrd32KMPGucJySiyjpHkurobMuGbs/LQzd\n" + - "JLTSTIIIPpEHBk7PHRGPSFewIhi0aDhupgZLU9UGrLRw/xV/KlGqTcGFWBvvOC+I\n" + - "CSZFRr0hWBv/dfw=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 28 07:25:02 PDT 2019", System.out); - } -} - -class SSLCA_EV_RSA { - - // Owner: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV Root Certification Authority RSA R2, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 56b629cd34bc78f6 - // Valid from: Wed May 31 11:14:37 PDT 2017 until: Fri May 30 11:14:37 PDT 2042 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIG4DCCBMigAwIBAgIQA6P00GAwUqM3zjgKiDAxjDANBgkqhkiG9w0BAQsFADCB\n" + - "gjELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9u\n" + - "MRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xNzA1BgNVBAMMLlNTTC5jb20gRVYg\n" + - "Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBSU0EgUjIwHhcNMTkwMzI2MTc0\n" + - "NjUzWhcNMzQwMzIyMTc0NjUzWjByMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4\n"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Ao8FJwTgXRNO1c0ACf0rXEJy3GRAXRWiTvuGahR\n" + - "JVM3Jnn0G6o3+vTfwa7CKR/9Jc4t25iRU3xmSgiusg4u8i5x\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.1.3.6.1.4.1.311.60.2.1.3=US, OID.1.3.6.1.4.1.311.60.2.1.2=Nevada, STREET=3100 Richmond Ave, - // OID.2.5.4.15=Private Organization, OID.2.5.4.17=77098, CN=test-ev-rsa.ssl.com, SERIALNUMBER=NV20081614243, - // O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 558089b221d7cd9c7a4bc4a7fd7e2969 - // Valid from: Mon Jul 01 13:28:01 PDT 2019 until: Wed Jun 30 13:28:01 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIISTCCBjGgAwIBAgIQVYCJsiHXzZx6S8Sn/X4paTANBgkqhkiG9w0BAQsFADBy\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "ETAPBgNVBAoMCFNTTCBDb3JwMS4wLAYDVQQDDCVTU0wuY29tIEVWIFNTTCBJbnRl\n" + - "cm1lZGlhdGUgQ0EgUlNBIFIzMB4XDTE5MDcwMTIwMjgwMVoXDTIxMDYzMDIwMjgw\n" + - "MVowgfExCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91\n" + - "c3RvbjERMA8GA1UECgwIU1NMIENvcnAxFjAUBgNVBAUTDU5WMjAwODE2MTQyNDMx\n" + - "HDAaBgNVBAMME3Rlc3QtZXYtcnNhLnNzbC5jb20xDjAMBgNVBBEMBTc3MDk4MR0w\n" + - "GwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjEaMBgGA1UECQwRMzEwMCBSaWNo\n" + - "bW9uZCBBdmUxFzAV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y9aC8k8TjQAM\n" + - "v/YT7Bggpv300hWvBGw0QT8l7Nk1PZFBagAhqRCKRsR1pUZ8CyZzwNkNyUSYV4Or\n" + - "n0vYwVEgpMeSMu/ObWwWPM7QKSNcSSIV5lxmsZX+wS76OpDMHm27P94RTEePF4sG\n" + - "QmvY6hgHSlREJUL0vyGGY2Rbm3cL3zaM4qTquN18v61uUVKakELYIcRZwVTyBj5M\n" + - "KxOkjGXnLYpDOLFHD4WB1q7J+SorG43V+nbmTEN5fshGUjjWoz5ykfErnyJa1+Py\n" + - "FXWoPFb425DelhuDe94btROuJELRfzhqDXoKrhDgSQGV2qM3sk6uIPOaoH4N31ko\n" + - "C41bezSdJ5r4mif8iA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.1.3.6.1.4.1.311.60.2.1.3=US, OID.1.3.6.1.4.1.311.60.2.1.2=Nevada, STREET=3100 Richmond Ave, - // OID.2.5.4.15=Private Organization, OID.2.5.4.17=77098, CN=revoked-rsa-ev.ssl.com, SERIALNUMBER=NV20081614243, - // O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 1ea7f53492bded2d425135bdf525889f - // Valid from: Mon Jul 01 13:29:02 PDT 2019 until: Wed Jun 30 13:29:02 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIUzCCBjugAwIBAgIQHqf1NJK97S1CUTW99SWInzANBgkqhkiG9w0BAQsFADBy\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "ETAPBgNVBAoMCFNTTCBDb3JwMS4wLAYDVQQDDCVTU0wuY29tIEVWIFNTTCBJbnRl\n" + - "cm1lZGlhdGUgQ0EgUlNBIFIzMB4XDTE5MDcwMTIwMjkwMloXDTIxMDYzMDIwMjkw\n" + - "MlowgfQxCzAJBgNVBAYTAl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PxkbHPFVHlfenDgZHUNU6DKH4HdCUG7\n" + - "GSAyajLiYRkcrDtBfp5MtNUAqnOJbh2NWiJ3FgSdAjfeSXPhhGfQ3U+0YCWarBfO\n" + - "xZ49eyhTzhHMoW+caJV3jC442Ebzh2X243MwcxqIkjgzWs6duiHnpHfT9gZBl3ou\n" + - "eu85LVFwzxNdrrAx1yG9PA05wCsYYlzwx7fC8ycfbvs+2ORIztiEScyr9VCg5sho\n" + - "YGuBFuP38sWRwiV5K7+EqpGjY+4R3BLWol7lzWsqWJC1J4zkd6Df5reSGBt0wlbx\n" + - "7MdUTXzHMtP8NDIYpdMBrPbkzOKIDzO6bDMsBWWFz7rWCmxUI6sSf0yknPtmBgCd\n" + - "rJAq25V/DqSRGrkaY4Dx1CPGtwYN34fCDLxKeN69rG5mkR2w7HRR5eMXek6oi3Pr\n" + - "hQrKt5NgrYjO6HJ6ABI5xoDM9doXy9BYbz5RX43RTU399aIqyXZh0d3W0rr7wggt\n" + - "+PFRU1OJqhpPQgKsB5zFT3G2HgVBD0hawHS+0Hu+CHpngiDziH+eyvTk3tdhIq2x\n" + - "oDZXs7SSZK6hf/im+7OFSkROy6CwhAn3nxRI9lpag1tTgF4kVSctBv+301ev0twX\n" + - "0w6RymKcvEbcuSDHkzOYWxc1cqwOxjA=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Jul 01 20:53:13 PDT 2019", System.out); - } -} - -class SSLCA_ECC { - - // Owner: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com Root Certification Authority ECC, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 75e6dfcbc1685ba8 - // Valid from: Fri Feb 12 10:14:03 PST 2016 until: Tue Feb 12 10:14:03 PST 2041 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDejCCAv+gAwIBAgIQHNcSEt4VENkSgtozEEoQLzAKBggqhkjOPQQDAzB8MQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xGDAW\n" + - "BgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBSb290IENl\n" + - "cnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzAeFw0xOTAzMDcxOTQyNDJaFw0zNDAz\n" + - "MDMxOTQyNDJaMG8xCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UE\n" + - "BwwHSG91c3RvbjERMA8GA1UECgwIU1NMIENvcnAxKzApBgNVBAMMIlNTTC5jb20g\n" + - "U1NMIEludGVybWVkaWF0ZSBDQSBFQ0MgUjIwdjAQBgcqhkjOPQIBBgUrgQQAIgNi\n" + - "AASEOWn30uEYKDLFu4sCjFQ1VupFaeMtQjqVWyWSA7+KFljnsVaFQ2hgs4cQk1f/\n" + - "RQ2INSwdVCYU0i5qsbom20rigUhDh9dM/r6bEZ75eFE899kSCI14xqThYVLPdLEl\n" + - "+dyjggFRMIIBTTASBgNVHRMBAf8ECDAGAQH/AgEAMB8GA1UdIwQYMBaAFILRhXMw\n" + - "5zUE044CkvvlpNHEIejNMHgGCCsGAQUFBwEBBGwwajBGBggrBgEFBQcwAoY6aHR0\n" + - "cDovL3d3dy5zc2wuY29tL3JlcG9zaXRvcnkvU1NMY29tLVJvb3RDQS1FQ0MtMzg0\n" + - "LVIxLmNydDAgBggrBgEFBQcwAYYUaHR0cDovL29jc3BzLnNzbC5jb20wEQYDVR0g\n" + - "BAowCDAGBgRVHSAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATA7BgNV\n" + - "HR8ENDAyMDCgLqAshipodHRwOi8vY3Jscy5zc2wuY29tL3NzbC5jb20tZWNjLVJv\n" + - "b3RDQS5jcmwwHQYDVR0OBBYEFA10Zgpen+Is7NXCXSUEf3Uyuv99MA4GA1UdDwEB\n" + - "/wQEAwIBhjAKBggqhkjOPQQDAwNpADBmAjEAxYt6Ylk/N8Fch/3fgKYKwI5A011Q\n" + - "MKW0h3F9JW/NX/F7oYtWrxljheH8n2BrkDybAjEAlCxkLE0vQTYcFzrR24oogyw6\n" + - "VkgTm92+jiqJTO5SSA9QUa092S5cTKiHkH2cOM6m\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=test-dv-ecc.ssl.com - // Issuer: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 1bfbd8e4bea894f3d1887c50e7d366d7 - // Valid from: Fri Jun 28 06:58:27 PDT 2019 until: Sun Jun 27 06:58:27 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIE9TCCBHqgAwIBAgIQG/vY5L6olPPRiHxQ59Nm1zAKBggqhkjOPQQDAzBvMQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xETAP\n" + - "BgNVBAoMCFNTTCBDb3JwMSswKQYDVQQDDCJTU0wuY29tIFNTTCBJbnRlcm1lZGlh\n" + - "dGUgQ0EgRUNDIFIyMB4XDTE5MDYyODEzNTgyN1oXDTIxMDYyNzEzNTgyN1owHjEc\n" + - "MBoGA1UEAwwTdGVzdC1kdi1lY2Muc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49\n" + - "AwEHA0IABJ5u0b8BID+8+TKxn+os0rdwvWB7mUJ4lcCthTADMhnr1VUWBbmBEelB\n" + - "666WbvbVXooPMUbhE5JvhXCTDyI7RRmjggNHMIIDQzAfBgNVHSMEGDAWgBQNdGYK\n" + - "Xp/iLOzVwl0lBH91Mrr/fTB7BggrBgEFBQcBAQRv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gwRgIhAI/27txsvzpbBXkMICi/UOzE\n" + - "t8uZidbF9KSwmGRPT/6gAiEAhm/VeWHDeWK8gFMU+f0/x4jK7UbzySGBvPzbPpNd\n" + - "EDwwCgYIKoZIzj0EAwMDaQAwZgIxAJKn8Hr68Z/2rA+VHfZo8eeIFaZ3nvSvQO92\n" + - "1Byl6cPAm8DsdCnYT16uNSL8Zb5IQAIxAOFLsqPDCSAYkpgutAnVgwI+c549SIRU\n" + - "k8ol+wUx6zgMmt8VHYagyj6IO0GRDjm/eA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked-ecc-dv.ssl.com - // Issuer: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 423c2b57dfa379d0c45ffceb6284ed99 - // Valid from: Fri Jun 28 07:09:30 PDT 2019 until: Sun Jun 27 07:09:30 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIE+TCCBH+gAwIBAgIQQjwrV9+jedDEX/zrYoTtmTAKBggqhkjOPQQDAzBvMQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xETAP\n" + - "BgNVBAoMCFNTTCBDb3JwMSswKQYDVQQDDCJTU0wuY29tIFNTTCBJbnRlcm1lZGlh\n" + - "dGUgQ0EgRUNDIFIyMB4XDTE5MDYyODE0MDkzMFoXDTIxMDYyNzE0MDkzMFowITEf\n" + - "MB0GA1UEAwwWcmV2b2tlZC1lY2MtZHYuc3NsLmNvbTBZMBMGByqGSM49AgEGCCqG\n" + - "SM49AwEHA0IABH4nWtnAwPIdcQOSNI72IJJ/I1ZL2XQUAfa3ox5taFQQAalng6N9\n" + - "Od9t9de1vIMDzUvs5sMWw4YrqAlywFKMraajggNJMIIDRTAfBgNVHSMEGDAWgBQN\n" + - "dGYKXp/iLOzVwl0lBH91Mrr/fTB7BggrBgEFBQcBAQRvMG0wSQYIKwYBBQUH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6k5BMSFN3FnD4\n" + - "UFbyJJG/Bujh+OFTYzVM8vuIBoU0AiAhBe+air4wHvd68ykK6xOPv9Qshje9F6LC\n" + - "gxTqbMOEkDAKBggqhkjOPQQDAwNoADBlAjEAyayBtbcCQB0fE+cCc7OHLuNvb9tl\n" + - "uiHWy/Ika6IA72WJLLmED971ik08OMa2mGt4AjAklxdElQ5Z/nSeJ2CNEwD7pcYz\n" + - "468kkrMoGU2lk3QmwcXZscPIoh4Pwew6QteY4J0=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 28 07:59:20 PDT 2019", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java deleted file mode 100644 index 48c4d77a6ba..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 8305975 - * @summary Interoperability tests with TWCA Global Root CA from TAIWAN-CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath TWCAGlobalCA OCSP - * @run main/othervm -Djava.security.debug=certpath TWCAGlobalCA CRL - */ - -/* - * Obtain TLS test artifacts for TWCA Global Root CA from: - * - * Valid TLS Certificates: - * https://evssldemo6.twca.com.tw - * - * Revoked TLS Certificates: - * https://evssldemo7.twca.com.tw - */ -public class TWCAGlobalCA { - - // Owner: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, O=TAIWAN-CA, C=TW - // Issuer: CN=TWCA Global Root CA, OU=Root CA, O=TAIWAN-CA, C=TW - // Serial number: 40013304f70000000000000cc042cd6d - // Valid from: Thu Aug 23 02:53:30 PDT 2012 until: Fri Aug 23 08:59:59 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFdzCCA1+gAwIBAgIQQAEzBPcAAAAAAAAMwELNbTANBgkqhkiG9w0BAQsFADBR\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290\n" + - "IENBMRwwGgYDVQQDExNUV0NBIEdsb2JhbCBSb290IENBMB4XDTEyMDgyMzA5NTMz\n" + - "MFoXDTMwMDgyMzE1NTk1OVowczELMAkGA1UEBhMCVFcxEjAQBgNVBAoTCVRBSVdB\n" + - "Ti1DQTEcMBoGA1UECxMTR2xvYmFsIEVWU1NMIFN1Yi1DQTEyMDAGA1UEAxMpVFdD\n" + - "QSBHbG9iYWwgRVZTU0wgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqG\n" + - "SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7MIaeq4wMnTjA5C2LsR6HJUj6rZbs8Nmq\n" + - "sSqFoqu6LwjrMbzkAg274EL6913MQ6eOy6VUDRzqAf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kLZFDCyJuFkoezjWL4AH\n" + - "ratXdoHtqvqtPoy97LyGrLrJeh+0hkO9u8QOt2gF7BEhNfid7o5dnsPRk+8l77Hn\n" + - "T1dvBs++M0r0QG4AWMSMj9uUn6rhl4FGTvAsyB1fA8p/xCLoIEetIpKRP3BD+ve2\n" + - "eYjWPorR/0W77iMTeoQEeuxDIxi2J/U9QLKKvzzqBy1TYrqqPe5YxqHLNAcfHZvo\n" + - "BTPPbtP0WAiXrJiELTYcqFXETvQcGw0XjoUZNvJE8RD7vssSNT17RKU8iBRX7CbL\n" + - "AB3T8gYykPMJTUqQSmdgEdVRBcqRMMdU+XRAEoU/Mz5oHAkm3ZNTDNwsEp2Dg1/b\n" + - "qzfPMhg4/3/YyWzGrzNeCSWZkjYImAzLCvN0D5rbdVHEmFIrEJt+igocGozroq5x\n" + - "DT5KhixlrqexzWE=\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.2.5.4.17=100, STREET="10F.,NO.85,Yanping S. Rd.,Taipei City 100,Taiwan (R.O.C)", - // SERIALNUMBER=70759028, OID.1.3.6.1.4.1.311.60.2.1.3=TW, OID.1.3.6.1.4.1.311.60.2.1.2=Taiwan, - // OID.1.3.6.1.4.1.311.60.2.1.1=Taipei, OID.2.5.4.15=Private Organization, - // CN=evssldemo6.twca.com.tw, O=TAIWAN-CA INC., L=Taipei, ST=Taiwan, C=TW - // Issuer: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, - // O=TAIWAN-CA, C=TW - // Serial number: 47e70000001258ff71d89af7f0353fef - // Valid from: Thu Mar 02 00:49:56 PST 2023 until: Sun Mar 31 08:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIH7zCCBtegAwIBAgIQR+cAAAASWP9x2Jr38DU/7zANBgkqhkiG9w0BAQsFADBz\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRwwGgYDVQQLExNHbG9i\n" + - "YWwgRVZTU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QXAAABhqGDh8YAAAQDAEcwRQIgYT7aPr9YCtF5TCTp\n" + - "NICK9c5eiL6Ku/y9wM6ARgG2k1UCIQDomqlwGur+AMI4YIc1SNqyNVCyxgP1DxXP\n" + - "FYkX6BX17gB2AO7N0GTV2xrOxVy3nbTNE6Iyh0Z8vOzew1FIWUZxH7WbAAABhqGD\n" + - "iKkAAAQDAEcwRQIhAKTMliyTn48vvP9hN8jucD6rGZwRCqQI6suE6ADpN7bNAiB3\n" + - "zFZFdH8eJRn3RXjD/mzbmF201sNLitp9SOYAazubljANBgkqhkiG9w0BAQsFAAOC\n" + - "AQEAOOtzqtRFvxlJro61O0dEkDottToFh88vib3N3AofS5uW0nDpoS0L27XR8IDd\n" + - "2NfN+2XKAQXdz2BqHnjW1nAMXUx4TAMi4jG8XpOkvpSDXbjghD5EB10FyAzCuGmv\n" + - "mKxkVOU1DzL0kSLLQjLaJ57WUYsoE97f5O6rY9jlJpid32o1WgM1oZsBjPhO8Kiy\n" + - "KJ5zZHppolGPtuFYMUcatiqv//pH/5piwtlYSkbwMj5nYidSrSBciBzO53HFk1pE\n" + - "TABXFcoK3gmhWM04lysmJMwAzRUbNQVizpGDICbRjCOVnwCbutnSnka8pDHkq4Zy\n" + - "BrUeZe2xJe8jWvukwqvNzIIvwg==\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.2.5.4.17=100, STREET="10F.,NO.85,Yanping S. Rd.,Taipei City 100,Taiwan (R.O.C)", - // SERIALNUMBER=70759028, OID.1.3.6.1.4.1.311.60.2.1.3=TW, OID.1.3.6.1.4.1.311.60.2.1.2=Taiwan, - // OID.1.3.6.1.4.1.311.60.2.1.1=Taipei, OID.2.5.4.15=Private Organization, - // CN=evssldemo7.twca.com.tw, O=TAIWAN-CA INC., L=Taipei, ST=Taiwan, C=TW - // Issuer: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, - // O=TAIWAN-CA, C=TW - // Serial number: 47e70000001258f036a5b513091ccb2e - // Valid from: Tue Feb 07 02:03:08 PST 2023 until: Thu Mar 07 07:59:59 PST 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdjCCBl6gAwIBAgIQR+cAAAASWPA2pbUTCRzLLjANBgkqhkiG9w0BAQsFADBz\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRwwGgYDVQQLExNHbG9i\n" + - "YWwgRVZTU0wgU3ViLUNBMTIwMAYDVQQDEylUV0NBIEdsb2JhbCBFVlNTTCBDZXJ0\n" + - "aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0yMzAyMDcxMDAzMDhaFw0yNDAzMDcxNTU5\n" + - "NTlaMIIBMzELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEPMA0GA1UEBxMG\n" + - "VGFpcGVpMRcwFQYDVQQKEw5UQUlXQU4tQ0EgSU5DLjEfMB0GA1UEAxMWZXZzc2xk\n" + - "ZW1vNy50d2NhLmNvbS50dzEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "FzAVBgsrBgEEAYI3PAIBARMGVGFpcGVpMRcwFQYLKwYBBAGCNzwCAQITBlRhaXdh\n" + - "bjETMBEGCysGAQQBgjc8AgEDEwJUVzERMA8GA1UEBRMINzA3NTkwMjgxQTA/BgNV\n" + - "BAkTODEwRi4sTk8uODUsWWFucGluZyBTLiBSZC4sVGFpcGVpIENpdHkgMTAwLFRh\n" + - "aXdhbiAoUi5PLkMpMQwwCgYDVQQREwMxMDAwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + - "DwAwggEKAoIBAQDSX3co7XUdwxv8OEj7Mipq0Ot+1w+VYTFlPvdnryrv9st7ERLb\n" + - "+xJPJo7swgqbHeHKWlwYu4lkzJq6s3nAOkuYIP/O3uVmGDiilLSAVkukz9MooyjB\n" + - "466eArXY1VT9vpXVNmSLunAp5RU8H+2WWOUMmtJx/oYojqEbtWqnltlErvEjb2TM\n" + - "vR16d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O7N0GTV2xrOxVy3nbTNE6Iyh0Z8vOzew1FIWUZxH7WbAAABhitU\n" + - "RycAAAQDAEYwRAIgcU5n4DJaGWvTr3wZug59ItynMgCZ5z0ZVrZr2KwV70wCIHEv\n" + - "DAwNBLGsdj5IX/4E5hnzJvS7WroSLnRB6OW931JbAHYAdv+IPwq2+5VRwmHM9Ye6\n" + - "NLSkzbsp3GhCCp/mZ0xaOnQAAAGGK1RKDwAABAMARzBFAiBvlIvOnE8PhYJQueMh\n" + - "AOCwgREvnAsk3Edt59lcuqPrrQIhAOSRb3UmBYkHQ6k5pUJva0Mgk0GmnLR0de0s\n" + - "VxW3TTASMA0GCSqGSIb3DQEBCwUAA4IBAQAQB7oaouXBI6VpLzL+kzOZXSTbSClv\n" + - "LS33DTEBI3A8LTXHbFq6c4/ZdqieUzy42Kd0i9e3hI1hwQYPgEwxpROOcldX72r0\n" + - "EUTh0L+XrxN3YEgod6aCsjIiJlWYy6J2ZXVURnk/iWYAwYLa0JmmBGuWFjEnq4lO\n" + - "xL1C3M2mYAEC+Beb7Xyq1rcu97p4P8igJYM+VfwXNwYYRCXUr9f4ESD7t5vXlYoE\n" + - "c4m5KiBQD9XtZS77QRon9JCQklxTvMkxuLwWvSdzicEUzWeFp+kN/fcXL2SVsb17\n" + - "xDPMMsMMh7L/f+uMWDYZ+wH17LYQxOLi7VXT3fv8nl2X2iD3d4CCh0Tu\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Mar 23 17:30:19 PDT 2023", System.out); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java deleted file mode 100644 index 3dc0c94abc2..00000000000 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8210432 - * @summary Interoperability tests with TeliaSonera Root CA v1 - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath TeliaSoneraCA OCSP - * @run main/othervm -Djava.security.debug=certpath TeliaSoneraCA CRL - */ - -/* - * Obtain TLS test artifacts for TeliaSonera Root CA v1 from: - * - * Valid TLS Certificates: - * https://juolukka.cover.sonera.net:10443/ - * - * Revoked TLS Certificates: - * https://juolukka.cover.sonera.net:10444/ - */ -public class TeliaSoneraCA { - - // Owner: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - // Issuer: CN=TeliaSonera Root CA v1, O=TeliaSonera - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIHHjCCBQagAwIBAgIQTEYq9tv794BPhMF8/qlytjANBgkqhkiG9w0BAQsFADA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fdql6E8Lo3dKVD4UG10mtd+iPbJiBiW/a9VbEe3NVKIv4H2y\n" - + "HqYcxDXAeUI66E3K2cjCmKoQaa0Ywt02ikZFd0v1OWNPS7YWbEJWkVR1PcPMESK9\n" - + "6HKI4xhG2tJesmXjQ8q8aSx2u79Zts3ewjKqTmurf6FXW3u9TpSCUe6Drr/3X7Ve\n" - + "nBy4M0sLwCecD/L9gjTa+EItQTYzCkpxiMO49tQdX/BpwgWju4Kg3qkaBNTzvSlk\n" - + "gdnRJqCUkVuzwK4yBqUoyRz3prlhvvRGdZJKf6IXRDhncpey5pm0PQYQ4cArx7Go\n" - + "AaAKz0ZTHOKjnM2KIdUhBJQybL7oPklSfkeMWoUoYED6R4YMTt/JXX4ixEb5DgDJ\n" - + "0F+bNcF7qGrJTkTx0Ccy4BuuY05hJckd72E7WdmjN7DDeosghgWZNV/6D7N5tfxo\n" - + "nlU=\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=juolukka.cover.sonera.net, OU=security, O=Telia Finland Oyj, L=helsinki, C=FI - // Issuer: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHiDCCBXCgAwIBAgIPAWOq14hk136UDQY3WSjLMA0GCSqGSIb3DQEBCwUAMEYx\n" + - "CzAJBgNVBAYTAkZJMRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEhMB8GA1UEAwwYVGVs\n" + - "aWFTb25lcmEgU2VydmVyIENBIHYyMB4XDTE4MDUyOTA3NDA0MVoXDTE5MDUyOTA3\n" + - "NDA0MVowczELMAkGA1UEBhMCRkkxETAPBgNVBAcMCGhlbHNpbmtpMRowGAYDVQQK\n" + - "DBFUZWxpYSBGaW5sYW5kIE95ajERMA8GA1UECwwIc2VjdXJpdHkxIjAgBgNVBAMM\n" + - "GWp1b2x1a2thLmNvdmVyLnNvbmVyYS5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + - "DwAwggEKAoIBA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ThbF6hxN7HAlq/xIbTKlZjkLlc14W\n" + - "fB8vkxJyy/tgBZ4dCj9Y1Y32d4eFT5JZJgqgkN59SmX56BswNXncGrk/vWZFFx+g\n" + - "9dgb8QSe8KseD1iSLc7SsqVDv8NPYdaI3eZ90W8Wv0/CDls321O6UbAmURzQwFGB\n" + - "w8WnteoVBi6Wf6M1TxIfJsXBYeIN0BB6AYc8cmZIOtx2C8aH4JJT45MyFnBv3ac5\n" + - "Ahs9pGn/+K+5yb2e\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=juolukka.cover.sonera.net, OU=Security, O=TeliaSonera Finland, L=Helsinki, C=FI - // Issuer: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGEDCCA/igAwIBAgIRAKWJTjs6v04ZTyb2wJxfnJswDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCRkkxFDASBgNVBAoMC1RlbGlhU29uZXJhMSEwHwYDVQQDDBhU\n" + - "ZWxpYVNvbmVyYSBTZXJ2ZXIgQ0EgdjIwHhcNMTYxMjIzMDcwMTQ2WhcNMTkxMjIz\n" + - "MDcwMTQ2WjB1MQswCQYDVQQGEwJGSTERMA8GA1UEBwwISGVsc2lua2kxHDAaBgNV\n" + - "BAoME1RlbGlhU29uZXJhIEZpbmxhbmQxETAPBgNVBAsMCFNlY3VyaXR5MSIwIAYD\n" + - "VQQDDBlqdW9sdWtrYS5jb3Zlci5zb25lcmEubmV0MIIBIjANBgkqhkiG9w0BAQEF\n" + - "AAOCAQ8AMIIBCgKCAQEAt2u92TgTFdm1OEfmWFPe+ESBi+2ox4y1EDoin8RydMyO\n" + - "DI6+0HHnKfDZa1YViI5b6MLJKWIAyUszAg5hc0S3upElfSsBvUW6zuQTxMi2vTYE\n" + - "4tcqwIEyCUaiv4wC+DuO5CyGR32yR6HB/W5Ny200dPs2SO03ESEJ+LH4Tw5AI8JJ\n" + - "UZHW+lA+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4daIVCYK3VOoBbM2F36ecAKvRU5vIWM\n" + - "urXsfANL3u4qgJpaM0DclzFsOkVsRPffzToko/Nr6pGXYjt47IzTRlwLMnLehoZW\n" + - "ZZMGMVVOlR7XGf81UjWB6OsKeoQ4FWgcb/rIJcZusm+LqvnsCHuC3gtuC2nGA7lr\n" + - "fseUlG7QZN9/QfUIyvL69wAzeVj1cUcd7GHcAH9DyZJfI8orv4PyUvitDdgISkFu\n" + - "GZ562O7cGmCv00/6I4t0z9wZal8a5lRDoKXAYy+u/adrO1JjLwi11y/DTw9LQ7sJ\n" + - "gVP/v2GsI0ajF9A6z33UHN9uxXZVmQNvOiMkcJiGLovFgu5zxoAg2W3pHjbBbeL8\n" + - "v5MPqgsKafgzaSRtXBBvaISHi9hhRR8v/qSwO3NyLm8uAhQD4x+OPHrmQ/s16j45\n" + - "Ib53UHj1k6byXGUqDgzFBsmEPV6Shf2C4/HcRHpAX8wQx3xVwDtRzDpNUR6vnNfi\n" + - "PwzRU1xsQKd8llmgl4l+fYV0tBA=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Dec 22 23:14:55 PST 2016", System.out); - - // reset validation date back to current date - pathValidator.resetValidationDate(); - } -} diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java new file mode 100644 index 00000000000..80aaa710de8 --- /dev/null +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java @@ -0,0 +1,231 @@ +/* + * 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 jtreg.SkippedException; + +import javax.net.ssl.*; +import javax.security.auth.x500.X500Principal; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.security.*; +import java.security.cert.*; +import java.security.cert.Certificate; + +public class ValidatePathWithURL { + + private final X509Certificate rootCertificate; + private final X500Principal rootPrincipal; + + /** + * Enables the certificate revocation checking and loads the certificate from + * cacerts file for give caAlias + * + * @param caAlias CA alias for CA certificate in cacerts file + * @throws Exception when fails to get CA certificate from cacerts file + */ + public ValidatePathWithURL(String caAlias) throws Exception { + System.setProperty("com.sun.net.ssl.checkRevocation", "true"); + Security.setProperty("ssl.TrustManagerFactory.algorithm", "SunPKIX"); + + // some test sites don't have correct hostname specified in test certificate + HttpsURLConnection.setDefaultHostnameVerifier(new CustomHostnameVerifier()); + + String FS = System.getProperty("file.separator"); + String CACERTS_STORE = + System.getProperty("test.jdk") + FS + "lib" + FS + "security" + FS + "cacerts"; + + KeyStore cacerts = KeyStore.getInstance("PKCS12"); + try (FileInputStream fis = new FileInputStream(CACERTS_STORE)) { + cacerts.load(fis, null); + } + + rootCertificate = (X509Certificate) cacerts.getCertificate(caAlias); + rootPrincipal = rootCertificate.getSubjectX500Principal(); + } + + /** + * Enable revocation checking using OCSP and disables CRL check + */ + public static void enableOCSPOnly() { + System.setProperty("com.sun.security.enableCRLDP", "false"); + Security.setProperty("ocsp.enable", "true"); + } + + /** + * Enable revocation checking using CRL + */ + public static void enableCRLOnly() { + System.setProperty("com.sun.security.enableCRLDP", "true"); + Security.setProperty("ocsp.enable", "false"); + } + + /** + * Enable revocation checking using OCSP or CRL + */ + public static void enableOCSPAndCRL() { + System.setProperty("com.sun.security.enableCRLDP", "true"); + Security.setProperty("ocsp.enable", "true"); + } + + /** + * Logs revocation settings + */ + public static void logRevocationSettings() { + System.out.println("====================================================="); + System.out.println("CONFIGURATION"); + System.out.println("====================================================="); + System.out.println("http.proxyHost :" + System.getProperty("http.proxyHost")); + System.out.println("http.proxyPort :" + System.getProperty("http.proxyPort")); + System.out.println("https.proxyHost :" + System.getProperty("https.proxyHost")); + System.out.println("https.proxyPort :" + System.getProperty("https.proxyPort")); + System.out.println("https.socksProxyHost :" + + System.getProperty("https.socksProxyHost")); + System.out.println("https.socksProxyPort :" + + System.getProperty("https.socksProxyPort")); + System.out.println("jdk.certpath.disabledAlgorithms :" + + Security.getProperty("jdk.certpath.disabledAlgorithms")); + System.out.println("com.sun.security.enableCRLDP :" + + System.getProperty("com.sun.security.enableCRLDP")); + System.out.println("ocsp.enable :" + Security.getProperty("ocsp.enable")); + System.out.println("====================================================="); + } + + /** + * Validates end entity certificate used in provided test URL using + * HttpsURLConnection. Validation is skipped on network error or if + * the certificate is expired. + * + * @param testURL URL to validate + * @param revokedCert if true then validate is REVOKED certificate + * @throws Exception on failure to validate certificate + */ + public void validateDomain(final String testURL, + final boolean revokedCert) + throws Exception { + System.out.println(); + System.out.println("===== Validate " + testURL + "====="); + if (!validateDomainCertChain(testURL, revokedCert)) { + throw new RuntimeException("Failed to validate " + testURL); + } + System.out.println("======> SUCCESS"); + } + + private boolean validateDomainCertChain(final String testURL, + final boolean revokedCert) + throws Exception { + HttpsURLConnection httpsURLConnection = null; + try { + URL url = new URL(testURL); + httpsURLConnection = (HttpsURLConnection) url.openConnection(); + httpsURLConnection.setInstanceFollowRedirects(false); + httpsURLConnection.connect(); + + // certain that test certificate anchors to trusted CA for VALID certificate + // if the connection is successful + Certificate[] chain = httpsURLConnection.getServerCertificates(); + httpsURLConnection.disconnect(); + validateAnchor(chain); + } catch (SSLHandshakeException e) { + System.out.println("SSLHandshakeException: " + e.getMessage()); + Throwable cause = e.getCause(); + + while (cause != null) { + if (cause instanceof CertPathValidatorException) { + CertPathValidatorException cpve =(CertPathValidatorException)cause; + if (cpve.getReason() == CertPathValidatorException.BasicReason.REVOKED + || cpve.getCause() instanceof CertificateRevokedException) { + System.out.println("Certificate is revoked"); + + // We can validate anchor for revoked certificates as well + Certificate[] chain = cpve.getCertPath().getCertificates().toArray(new Certificate[0]); + validateAnchor(chain); + + if (revokedCert) { + return true; + } + } else if (cpve.getReason() == CertPathValidatorException.BasicReason.EXPIRED + || cpve.getCause() instanceof CertificateExpiredException) { + System.out.println("Certificate is expired"); + throw new SkippedException("Certificate is expired, skip the test"); + } + break; + } + cause = cause.getCause(); + } + + throw new RuntimeException("Unhandled exception", e); + } catch (SSLException e) { + // thrown if root CA is not included in cacerts + throw new RuntimeException(e); + } catch (IOException e) { + throw new SkippedException("Network setup issue, skip this test", e); + } finally { + if (httpsURLConnection != null) { + httpsURLConnection.disconnect(); + } + } + + return !revokedCert; + } + + private void validateAnchor(Certificate[] chain) throws Exception { + X509Certificate interCert = null; + + // fail if there is no intermediate CA or self-signed + if (chain.length < 2) { + throw new RuntimeException("Cert chain too short " + chain.length); + } else { + System.out.println("Finding intermediate certificate issued by CA"); + for (Certificate cert : chain) { + if (cert instanceof X509Certificate) { + X509Certificate certificate = (X509Certificate)cert; + System.out.println("Checking: " + certificate.getSubjectX500Principal()); + System.out.println("Issuer: " + certificate.getIssuerX500Principal()); + if (certificate.getIssuerX500Principal().equals(rootPrincipal)) { + interCert = certificate; + break; + } + } + } + } + + if (interCert == null) { + throw new RuntimeException("Intermediate Root CA not found in the chain"); + } + + // validate intermediate CA signed by root CA under test + System.out.println("Found intermediate root CA: " + interCert.getSubjectX500Principal()); + System.out.println("intermediate CA Issuer: " + interCert.getIssuerX500Principal()); + interCert.verify(rootCertificate.getPublicKey()); + System.out.println("Verified: Intermediate CA signed by test root CA"); + } + + private static class CustomHostnameVerifier implements HostnameVerifier { + @Override + public boolean verify(String hostname, SSLSession session) { + // Allow any hostname + return true; + } + } +} From b017f76f3446ac7707548614b94c468d1a18cb93 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 11 Oct 2023 08:21:48 +0000 Subject: [PATCH 056/177] 8210168: JCK test .vm.classfmt.ins.code__002.code__00201m1.code__00201m1 hangs with -noverify Check for 'bc_length > 0' to handle lengths of -1. Backport-of: d36066fdadb281f2cac363f92a22826a4c0b5f65 --- src/hotspot/share/interpreter/rewriter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/interpreter/rewriter.cpp b/src/hotspot/share/interpreter/rewriter.cpp index 5e7f27b81ca..265eb645b19 100644 --- a/src/hotspot/share/interpreter/rewriter.cpp +++ b/src/hotspot/share/interpreter/rewriter.cpp @@ -400,7 +400,9 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err } } - assert(bc_length != 0, "impossible bytecode length"); + // Continuing with an invalid bytecode will fail in the loop below. + // So guarantee here. + guarantee(bc_length > 0, "Verifier should have caught this invalid bytecode"); switch (c) { case Bytecodes::_lookupswitch : { From a75f34ff0034c5b4ebebd3c1f30c6daa8e22fe06 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 11 Oct 2023 08:24:43 +0000 Subject: [PATCH 057/177] 8232933: Javac inferred type does not conform to equality constraint Backport-of: 7a85441a85b2472215ca7bc66e636dff06d9ebf3 --- .../tools/javac/comp/InferenceContext.java | 11 +++++ .../DontMinimizeInfContextTest.java | 49 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java index da9128d0a39..dacecbbc66d 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java @@ -337,6 +337,17 @@ InferenceContext min(List roots, boolean shouldSolve, Warner warn) { if (roots.length() == inferencevars.length()) { return this; } + /* if any of the inference vars is a captured variable bail out, this is because + * we could end up generating more than necessary captured variables in an outer + * inference context and then when we need to propagate back to an inner inference + * context that has been minimized it could be that some bounds constraints doesn't + * hold like subtyping constraints between bonds etc. + */ + for (Type iv : inferencevars) { + if (iv.hasTag(TypeTag.TYPEVAR) && ((TypeVar)iv).isCaptured()) { + return this; + } + } ReachabilityVisitor rv = new ReachabilityVisitor(); rv.scan(roots); if (rv.min.size() == inferencevars.length()) { diff --git a/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java b/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java new file mode 100644 index 00000000000..40784555112 --- /dev/null +++ b/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8232933 + * @summary Javac inferred type does not conform to equality constraint + * @compile DontMinimizeInfContextTest.java + */ + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +class DontMinimizeInfContextTest { + void m() { + List> a = new LinkedList<>(); + Map>> b = a.stream().collect( + Collectors.groupingBy(A::getval, Collectors.toList()) + ); + } + + class A { + String getval() { + return "s"; + } + } +} From 8336e3e256784a9c3c6bbc04998a3b3818324e72 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 11 Oct 2023 08:27:12 +0000 Subject: [PATCH 058/177] 8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere Reviewed-by: phh Backport-of: 6f76b65ace50b2361221dddab120e91b057497c1 --- src/hotspot/share/compiler/compilerOracle.cpp | 19 ++----- .../parser/TestCompileOnly.java | 52 +++++++++++++++++++ 2 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java diff --git a/src/hotspot/share/compiler/compilerOracle.cpp b/src/hotspot/share/compiler/compilerOracle.cpp index 3357343a43b..befe4427e85 100644 --- a/src/hotspot/share/compiler/compilerOracle.cpp +++ b/src/hotspot/share/compiler/compilerOracle.cpp @@ -827,21 +827,10 @@ void CompilerOracle::parse_compile_only(char * line) { } } - if (*line == method_sep) { - if (className == NULL) { - className = ""; - c_match = MethodMatcher::Any; - } - } else { - // got foo or foo/bar - if (className == NULL) { - ShouldNotReachHere(); - } else { - // missing class name handled as "Any" class match - if (className[0] == '\0') { - c_match = MethodMatcher::Any; - } - } + if (className == NULL || className[0] == '\0') { + // missing class name handled as "Any" class match + className = ""; + c_match = MethodMatcher::Any; } // each directive is terminated by , or NUL or . followed by NUL diff --git a/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java b/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java new file mode 100644 index 00000000000..e129bf7ab48 --- /dev/null +++ b/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java @@ -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 + * @bug 8312573 + * @summary Test -XX:CompileOnly= with invalid arguments + * @library /test/lib / + * @run driver compiler.compilercontrol.parser.TestCompileOnly + */ + +package compiler.compilercontrol.parser; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class TestCompileOnly { + + public static void main(String[] args) throws Exception { + test(","); + test(" "); + test(", "); + test(" ,"); + test(",,"); + test(" "); + } + + public static void test(String compileOnlyCommand) throws Exception { + OutputAnalyzer output = ProcessTools.executeTestJvm("-XX:CompileOnly=" + compileOnlyCommand, "-version"); + output.shouldHaveExitValue(0); + } +} From 2a39b98459cff050b137fb70c6b394d0cd2561d9 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:16:15 +0000 Subject: [PATCH 059/177] 8197825: [Test] Intermittent timeout with javax/swing JColorChooser Test Backport-of: c0084100bc335676a277881f99e138a4abfc5362 --- test/jdk/ProblemList.txt | 1 - .../swing/JColorChooser/Test6827032.java | 66 +++++++++++-------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index db0315821a8..cfe9b2bdcfb 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -686,7 +686,6 @@ javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 80134 javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all # The next test below is an intermittent failure javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all -javax/swing/JColorChooser/Test6827032.java 8197825 windows-all javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all diff --git a/test/jdk/javax/swing/JColorChooser/Test6827032.java b/test/jdk/javax/swing/JColorChooser/Test6827032.java index fff9834d687..096d6b1eeba 100644 --- a/test/jdk/javax/swing/JColorChooser/Test6827032.java +++ b/test/jdk/javax/swing/JColorChooser/Test6827032.java @@ -24,7 +24,7 @@ /* * @test * @key headful - * @bug 6827032 + * @bug 6827032 8197825 * @summary Color chooser with drag enabled shouldn't throw NPE * @author Peter Zhelezniakov * @library ../regtesthelpers @@ -38,47 +38,57 @@ public class Test6827032 { - private static volatile Point point; + private static JFrame frame; private static JColorChooser cc; public static void main(String[] args) throws Exception { - UIManager.setLookAndFeel(new NimbusLookAndFeel()); - - Robot robot = new Robot(); - robot.setAutoDelay(50); - - - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - createAndShowGUI(); + try { + UIManager.setLookAndFeel(new NimbusLookAndFeel()); + + Robot robot = new Robot(); + robot.setAutoDelay(100); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + + robot.waitForIdle(); + robot.delay(1000); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel"); + point = previewPanel.getLocationOnScreen(); + } + }); + + point.translate(5, 5); + + robot.mouseMove(point.x, point.y); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + robot.delay(1000); + } finally { + if (frame != null) { + SwingUtilities.invokeAndWait(() -> frame.dispose()); } - }); - - robot.waitForIdle(); - - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel"); - point = previewPanel.getLocationOnScreen(); - } - }); - - point.translate(5, 5); - - robot.mouseMove(point.x, point.y); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + } } private static void createAndShowGUI() { - JFrame frame = new JFrame(Test6827032.class.getName()); + frame = new JFrame(Test6827032.class.getName()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); cc = new JColorChooser(); cc.setDragEnabled(true); frame.add(cc); frame.pack(); + frame.setLocationRelativeTo(null); frame.setVisible(true); } } From 6e34daa2881209c64059122071a94d8bda5f6642 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:18:18 +0000 Subject: [PATCH 060/177] 8282404: DrawStringWithInfiniteXform.java failed with "RuntimeException: drawString with InfiniteXform transform takes long time" Backport-of: a53be204cbc8671ab998e1165f983af3a50e4ae2 --- .../DrawStringWithInfiniteXform.java | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java b/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java index 829eb31ce37..394905e1d19 100644 --- a/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java +++ b/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ * @test * @bug 8023213 * @summary Font/Text APIs should not crash/takes long time - * if transform includes INIFINITY + * if transform includes INFINITY * @run main DrawStringWithInfiniteXform */ -import java.awt.*; -import java.awt.font.*; -import java.awt.geom.*; -import java.awt.image.*; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; import java.util.Timer; import java.util.TimerTask; @@ -41,15 +41,22 @@ public class DrawStringWithInfiniteXform { class ScheduleTask extends TimerTask { public void run() { - if (!done) { - throw new - RuntimeException("drawString with InfiniteXform transform takes long time"); + System.out.println("Task running at " + System.currentTimeMillis()); + System.out.flush(); + synchronized (DrawStringWithInfiniteXform.class) { + System.out.println( + "Checking done at " + System.currentTimeMillis()); + System.out.flush(); + if (!done) { + throw new RuntimeException( + "drawString with InfiniteXform transform takes long time"); + } } } } public DrawStringWithInfiniteXform() { timer = new Timer(); - timer.schedule(new ScheduleTask(), 20000); + timer.schedule(new ScheduleTask(), 30000); } public static void main(String [] args) { @@ -58,11 +65,15 @@ public static void main(String [] args) { } private void start() { + System.out.println("start at " + System.currentTimeMillis()); + System.out.flush(); float[] vals = new float[6]; - for (int i=0;i<6;i++) vals[i]=Float.POSITIVE_INFINITY; + for (int i=0; i<6; i++) { + vals[i] = Float.POSITIVE_INFINITY; + } AffineTransform nanTX = new AffineTransform(vals); - BufferedImage bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB); + BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); g2d.rotate(Float.POSITIVE_INFINITY); @@ -73,8 +84,12 @@ private void start() { g2d.setFont(xfiniteFont); g2d.drawString("abc", 20, 20); } - done = true; - timer.cancel(); + System.out.println("Loop done at " + System.currentTimeMillis()); + System.out.flush(); + synchronized (DrawStringWithInfiniteXform.class) { + done = true; + timer.cancel(); + } System.out.println("Test passed"); } } From 75b7c7946ffc81fe98c517584804901a95d09684 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:20:47 +0000 Subject: [PATCH 061/177] 8300405: Screen capture for test JFileChooserSetLocationTest.java, failure case Backport-of: db8fa1be052c8558398ea5fea2105458f1a3cd16 --- .../JFileChooser/JFileChooserSetLocationTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/jdk/javax/swing/JFileChooser/JFileChooserSetLocationTest.java b/test/jdk/javax/swing/JFileChooser/JFileChooserSetLocationTest.java index 9df8816b0a7..0e1831afb31 100644 --- a/test/jdk/javax/swing/JFileChooser/JFileChooserSetLocationTest.java +++ b/test/jdk/javax/swing/JFileChooser/JFileChooserSetLocationTest.java @@ -23,17 +23,23 @@ import java.awt.Component; import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; import java.awt.Point; +import java.awt.Rectangle; import java.awt.Robot; import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; +import java.awt.image.BufferedImage; +import java.io.File; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import javax.imageio.ImageIO; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFileChooser; @@ -175,12 +181,18 @@ private static Point getActualLocation(final MyFileChooser fcoo) return pt.get(); } - public static void verify(int x1, int x2, int y1, int y2) { + public static void verify(int x1, int x2, int y1, int y2) throws Exception { System.out.println("verify " + x1 + "==" + x2 + "; " + y1 + "==" + y2); if ((Math.abs(x1 - x2) < TOLERANCE_LEVEL) && (Math.abs(y1 - y2) < TOLERANCE_LEVEL)) { System.out.println("Test passed"); } else { + GraphicsConfiguration gc = GraphicsEnvironment. + getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); + Rectangle gcBounds = gc.getBounds(); + BufferedImage bufferedImage = robot.createScreenCapture( + new Rectangle(gcBounds)); + ImageIO.write(bufferedImage, "png",new File("FailureImage.png")); throw new RuntimeException( "Test Failed, setLocation() is not working properly"); } From 47802875747bd09e6cd6e5e7e66879e188d31819 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:21:24 +0000 Subject: [PATCH 062/177] 8252713: jtreg time out of CtrlASCII.java seems to hang the Xserver. Backport-of: 6d6046b3799217c281d077f12bce1ec590149849 --- test/jdk/ProblemList.txt | 1 - .../event/KeyEvent/KeyTyped/CtrlASCII.java | 346 +++++++++--------- 2 files changed, 174 insertions(+), 173 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index cfe9b2bdcfb..e09fc957ba5 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -170,7 +170,6 @@ java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java 8129778 generic-all java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java 8129778 generic-all -java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java 8252713 linux-all java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java 8129778 generic-all java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all diff --git a/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java b/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java index 0e1f06e2cf1..e8f3e21de11 100644 --- a/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java +++ b/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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,13 +25,20 @@ @test @key headful @bug 6497426 - @summary ests that pressing of Ctrl+ascii mostly fires KEY_TYPED with a Unicode control symbols - @run main CtrlASCII + @summary Tests that pressing of Ctrl+ascii mostly fires KEY_TYPED with a Unicode control symbols + @run main/timeout=600 CtrlASCII */ -import java.awt.*; -import java.awt.event.*; -import java.util.*; +import java.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.util.HashMap; // // In this test, a key listener for KEY_TYPED checks if a character typed has @@ -42,136 +49,135 @@ // produce a unicode character, so there will be no KEY_TYPED and no problem. // Test doesn't try to verify Ctrl+deadkey behavior. // -public class CtrlASCII extends Frame implements KeyListener -{ +public class CtrlASCII extends Frame implements KeyListener { // Declare things used in the test, like buttons and labels here - static Hashtable keycharHash = new Hashtable(); - static boolean testFailed = false; - //Frame frame; + static final HashMap KEYCHAR_MAP = new HashMap<>(); + static volatile boolean testFailed = false; + TextField tf; Robot robot; - static void fillHash( boolean isMSWindows ) { - keycharHash.put( (char)0x20 , KeyEvent.VK_SPACE ); /*32,x20*/ /*' ' */ - keycharHash.put( (char)0x21 , KeyEvent.VK_EXCLAMATION_MARK ); /*33,x21*/ /*'!' fr*/ - keycharHash.put( (char)0x22 , KeyEvent.VK_QUOTEDBL ); /*34,x22*/ /*'"' fr*/ - keycharHash.put( (char)0x23 , KeyEvent.VK_NUMBER_SIGN ); /*35,x23*/ /*'#' de*/ - keycharHash.put( (char)0x24 , KeyEvent.VK_DOLLAR ); /*36,x24*/ /*'$', de_CH*/ - //keycharHash.put('%', (char)0x25 ); /*37,x25*/ /*no VK, cannot test*/ - keycharHash.put( (char)0x26 , KeyEvent.VK_AMPERSAND ); /*38,x26*/ /*'&', fr*/ - keycharHash.put( (char)0x27 , KeyEvent.VK_QUOTE ); /*39,x27*/ /*''', fr*/ - keycharHash.put( (char)0x28 , KeyEvent.VK_LEFT_PARENTHESIS ); /*40,x28*/ /*'(', fr*/ - keycharHash.put( (char)0x29 , KeyEvent.VK_RIGHT_PARENTHESIS ); /*41,x29*/ /*')', fr*/ - keycharHash.put( (char)0x2a , KeyEvent.VK_ASTERISK ); /*42,x2a*/ /*'*', fr*/ - keycharHash.put( (char)0x2b , KeyEvent.VK_PLUS ); /*43,x2b*/ /*'+', de*/ - keycharHash.put( (char)0x2c , KeyEvent.VK_COMMA ); /*44,x2c*/ /*','*/ - keycharHash.put( (char)0x2d , KeyEvent.VK_MINUS ); /*45,x2d*/ /*'-'*/ - keycharHash.put( (char)0x2e , KeyEvent.VK_PERIOD ); /*46,x2e*/ /*'.'*/ - keycharHash.put( (char)0x2f , KeyEvent.VK_SLASH ); /*47,x2f*/ /*'/'*/ - keycharHash.put( (char)0x30 , KeyEvent.VK_0 ); /*48,x30*/ - keycharHash.put( (char)0x31 , KeyEvent.VK_1 ); /*49,x31*/ - keycharHash.put( (char)0x32 , KeyEvent.VK_2 ); /*50,x32*/ - keycharHash.put( (char)0x33 , KeyEvent.VK_3 ); /*51,x33*/ - keycharHash.put( (char)0x34 , KeyEvent.VK_4 ); /*52,x34*/ - keycharHash.put( (char)0x35 , KeyEvent.VK_5 ); /*53,x35*/ - keycharHash.put( (char)0x36 , KeyEvent.VK_6 ); /*54,x36*/ - keycharHash.put( (char)0x37 , KeyEvent.VK_7 ); /*55,x37*/ - keycharHash.put( (char)0x38 , KeyEvent.VK_8 ); /*56,x38*/ - keycharHash.put( (char)0x39 , KeyEvent.VK_9 ); /*57,x39*/ - keycharHash.put( (char)0x3a , KeyEvent.VK_COLON ); /*58,x3a*/ /*':', fr*/ - keycharHash.put( (char)0x3b , KeyEvent.VK_SEMICOLON ); /*59,x3b*/ /*';'*/ - keycharHash.put( (char)0x3c , KeyEvent.VK_LESS ); /*60,x3c*/ /*'<' us 102*/ - keycharHash.put( (char)0x3d , KeyEvent.VK_EQUALS ); /*61,x3d*/ - keycharHash.put( (char)0x3e , KeyEvent.VK_GREATER ); /*62,x3e*/ /*'>' ?????? where???*/ - // Javadoc says: "there is no keycode for the question mark because - // there is no keyboard for which it appears on the primary layer." - // Well, it's Lithuanian standard. - //keycharHash.put('?', (char)0x3f ); /*63,x3f*/ /*no VK, cannot test*/ - keycharHash.put( (char)0x40 , KeyEvent.VK_AT ); /*64,x40*/ /*'@' ?????? where???*/ - keycharHash.put( (char)0x1 , KeyEvent.VK_A ); /*65,x41*/ - keycharHash.put( (char)0x2 , KeyEvent.VK_B ); /*66,x42*/ - keycharHash.put( (char)0x3 , KeyEvent.VK_C ); /*67,x43*/ - keycharHash.put( (char)0x4 , KeyEvent.VK_D ); /*68,x44*/ - keycharHash.put( (char)0x5 , KeyEvent.VK_E ); /*69,x45*/ - keycharHash.put( (char)0x6 , KeyEvent.VK_F ); /*70,x46*/ - keycharHash.put( (char)0x7 , KeyEvent.VK_G ); /*71,x47*/ - keycharHash.put( (char)0x8 , KeyEvent.VK_H ); /*72,x48*/ - keycharHash.put( (char)0x9 , KeyEvent.VK_I ); /*73,x49*/ - keycharHash.put( (char)0xa , KeyEvent.VK_J ); /*74,x4a*/ - keycharHash.put( (char)0xb , KeyEvent.VK_K ); /*75,x4b*/ - keycharHash.put( (char)0xc , KeyEvent.VK_L ); /*76,x4c*/ - keycharHash.put( (char)0xd , KeyEvent.VK_M ); /*77,x4d*/ - keycharHash.put( (char)0xe , KeyEvent.VK_N ); /*78,x4e*/ - keycharHash.put( (char)0xf , KeyEvent.VK_O ); /*79,x4f*/ - keycharHash.put( (char)0x10 , KeyEvent.VK_P ); /*80,x50*/ - keycharHash.put( (char)0x11 , KeyEvent.VK_Q ); /*81,x51*/ - keycharHash.put( (char)0x12 , KeyEvent.VK_R ); /*82,x52*/ - keycharHash.put( (char)0x13 , KeyEvent.VK_S ); /*83,x53*/ - keycharHash.put( (char)0x14 , KeyEvent.VK_T ); /*84,x54*/ - keycharHash.put( (char)0x15 , KeyEvent.VK_U ); /*85,x55*/ - keycharHash.put( (char)0x16 , KeyEvent.VK_V ); /*86,x56*/ - keycharHash.put( (char)0x17 , KeyEvent.VK_W ); /*87,x57*/ - keycharHash.put( (char)0x18 , KeyEvent.VK_X ); /*88,x58*/ - keycharHash.put( (char)0x19 , KeyEvent.VK_Y ); /*89,x59*/ - keycharHash.put( (char)0x1a , KeyEvent.VK_Z ); /*90,x5a*/ - - keycharHash.put( (char)0x1b , KeyEvent.VK_OPEN_BRACKET ); /*91,x5b*/ /*'['*/ - keycharHash.put( (char)0x1c , KeyEvent.VK_BACK_SLASH ); /*92,x5c*/ /*'\'*/ - keycharHash.put( (char)0x1d , KeyEvent.VK_CLOSE_BRACKET ); /*93,x5d*/ /*']'*/ - keycharHash.put( (char)0x5e , KeyEvent.VK_CIRCUMFLEX ); /*94,x5e*/ /*'^' ?? nodead fr, de??*/ - keycharHash.put( (char)0x1f , KeyEvent.VK_UNDERSCORE ); /*95,x5f*/ /*'_' fr*/ - keycharHash.put( (char)0x60 , KeyEvent.VK_BACK_QUOTE ); /*96,x60*/ - /********* Same as uppercase*/ - //keycharHash.put( (char)0x1 , KeyEvent.VK_a );/*97,x61*/ - //keycharHash.put( (char)0x2 , KeyEvent.VK_b );/*98,x62*/ - //keycharHash.put( (char)0x3 , KeyEvent.VK_c );/*99,x63*/ - //keycharHash.put( (char)0x4 , KeyEvent.VK_d );/*100,x64*/ - //keycharHash.put( (char)0x5 , KeyEvent.VK_e );/*101,x65*/ - //keycharHash.put( (char)0x6 , KeyEvent.VK_f );/*102,x66*/ - //keycharHash.put( (char)0x7 , KeyEvent.VK_g );/*103,x67*/ - //keycharHash.put( (char)0x8 , KeyEvent.VK_h );/*104,x68*/ - //keycharHash.put( (char)0x9 , KeyEvent.VK_i );/*105,x69*/ - //keycharHash.put( (char)0xa , KeyEvent.VK_j );/*106,x6a*/ - //keycharHash.put( (char)0xb , KeyEvent.VK_k );/*107,x6b*/ - //keycharHash.put( (char)0xc , KeyEvent.VK_l );/*108,x6c*/ - //keycharHash.put( (char)0xd , KeyEvent.VK_m );/*109,x6d*/ - //keycharHash.put( (char)0xe , KeyEvent.VK_n );/*110,x6e*/ - //keycharHash.put( (char)0xf , KeyEvent.VK_o );/*111,x6f*/ - //keycharHash.put( (char)0x10 , KeyEvent.VK_p );/*112,x70*/ - //keycharHash.put( (char)0x11 , KeyEvent.VK_q );/*113,x71*/ - //keycharHash.put( (char)0x12 , KeyEvent.VK_r );/*114,x72*/ - //keycharHash.put( (char)0x13 , KeyEvent.VK_s );/*115,x73*/ - //keycharHash.put( (char)0x14 , KeyEvent.VK_t );/*116,x74*/ - //keycharHash.put( (char)0x15 , KeyEvent.VK_u );/*117,x75*/ - //keycharHash.put( (char)0x16 , KeyEvent.VK_v );/*118,x76*/ - //keycharHash.put( (char)0x17 , KeyEvent.VK_w );/*119,x77*/ - //keycharHash.put( (char)0x18 , KeyEvent.VK_x );/*120,x78*/ - //keycharHash.put( (char)0x19 , KeyEvent.VK_y );/*121,x79*/ - //keycharHash.put( (char)0x1a , KeyEvent.VK_z );/*122,x7a*/ + static void fillHash() { + KEYCHAR_MAP.put((char) 0x20, KeyEvent.VK_SPACE); /*32,x20*/ /*' ' */ + KEYCHAR_MAP.put((char) 0x21, KeyEvent.VK_EXCLAMATION_MARK); /*33,x21*/ /*'!' fr*/ + KEYCHAR_MAP.put((char) 0x22, KeyEvent.VK_QUOTEDBL); /*34,x22*/ /*'"' fr*/ + KEYCHAR_MAP.put((char) 0x23, KeyEvent.VK_NUMBER_SIGN); /*35,x23*/ /*'#' de*/ + KEYCHAR_MAP.put((char) 0x24, KeyEvent.VK_DOLLAR); /*36,x24*/ /*'$', de_CH*/ + //keycharHash.put('%', (char)0x25 ); /*37,x25*/ /*no VK, cannot test*/ + KEYCHAR_MAP.put((char) 0x26, KeyEvent.VK_AMPERSAND); /*38,x26*/ /*'&', fr*/ + KEYCHAR_MAP.put((char) 0x27, KeyEvent.VK_QUOTE); /*39,x27*/ /*''', fr*/ + KEYCHAR_MAP.put((char) 0x28, KeyEvent.VK_LEFT_PARENTHESIS); /*40,x28*/ /*'(', fr*/ + KEYCHAR_MAP.put((char) 0x29, KeyEvent.VK_RIGHT_PARENTHESIS); /*41,x29*/ /*')', fr*/ + KEYCHAR_MAP.put((char) 0x2a, KeyEvent.VK_ASTERISK); /*42,x2a*/ /*'*', fr*/ + KEYCHAR_MAP.put((char) 0x2b, KeyEvent.VK_PLUS); /*43,x2b*/ /*'+', de*/ + KEYCHAR_MAP.put((char) 0x2c, KeyEvent.VK_COMMA); /*44,x2c*/ /*','*/ + KEYCHAR_MAP.put((char) 0x2d, KeyEvent.VK_MINUS); /*45,x2d*/ /*'-'*/ + KEYCHAR_MAP.put((char) 0x2e, KeyEvent.VK_PERIOD); /*46,x2e*/ /*'.'*/ + KEYCHAR_MAP.put((char) 0x2f, KeyEvent.VK_SLASH); /*47,x2f*/ /*'/'*/ + KEYCHAR_MAP.put((char) 0x30, KeyEvent.VK_0); /*48,x30*/ + KEYCHAR_MAP.put((char) 0x31, KeyEvent.VK_1); /*49,x31*/ + KEYCHAR_MAP.put((char) 0x32, KeyEvent.VK_2); /*50,x32*/ + KEYCHAR_MAP.put((char) 0x33, KeyEvent.VK_3); /*51,x33*/ + KEYCHAR_MAP.put((char) 0x34, KeyEvent.VK_4); /*52,x34*/ + KEYCHAR_MAP.put((char) 0x35, KeyEvent.VK_5); /*53,x35*/ + KEYCHAR_MAP.put((char) 0x36, KeyEvent.VK_6); /*54,x36*/ + KEYCHAR_MAP.put((char) 0x37, KeyEvent.VK_7); /*55,x37*/ + KEYCHAR_MAP.put((char) 0x38, KeyEvent.VK_8); /*56,x38*/ + KEYCHAR_MAP.put((char) 0x39, KeyEvent.VK_9); /*57,x39*/ + KEYCHAR_MAP.put((char) 0x3a, KeyEvent.VK_COLON); /*58,x3a*/ /*':', fr*/ + KEYCHAR_MAP.put((char) 0x3b, KeyEvent.VK_SEMICOLON); /*59,x3b*/ /*';'*/ + KEYCHAR_MAP.put((char) 0x3c, KeyEvent.VK_LESS); /*60,x3c*/ /*'<' us 102*/ + KEYCHAR_MAP.put((char) 0x3d, KeyEvent.VK_EQUALS); /*61,x3d*/ + KEYCHAR_MAP.put((char) 0x3e, KeyEvent.VK_GREATER); /*62,x3e*/ /*'>' ?????? where???*/ + // Javadoc says: "there is no keycode for the question mark because + // there is no keyboard for which it appears on the primary layer." + // Well, it's Lithuanian standard. + //keycharHash.put('?', (char)0x3f); /*63,x3f*/ /*no VK, cannot test*/ + KEYCHAR_MAP.put((char) 0x40, KeyEvent.VK_AT); /*64,x40*/ /*'@' ?????? where???*/ + KEYCHAR_MAP.put((char) 0x1, KeyEvent.VK_A); /*65,x41*/ + KEYCHAR_MAP.put((char) 0x2, KeyEvent.VK_B); /*66,x42*/ + KEYCHAR_MAP.put((char) 0x3, KeyEvent.VK_C); /*67,x43*/ + KEYCHAR_MAP.put((char) 0x4, KeyEvent.VK_D); /*68,x44*/ + KEYCHAR_MAP.put((char) 0x5, KeyEvent.VK_E); /*69,x45*/ + KEYCHAR_MAP.put((char) 0x6, KeyEvent.VK_F); /*70,x46*/ + KEYCHAR_MAP.put((char) 0x7, KeyEvent.VK_G); /*71,x47*/ + KEYCHAR_MAP.put((char) 0x8, KeyEvent.VK_H); /*72,x48*/ + KEYCHAR_MAP.put((char) 0x9, KeyEvent.VK_I); /*73,x49*/ + KEYCHAR_MAP.put((char) 0xa, KeyEvent.VK_J); /*74,x4a*/ + KEYCHAR_MAP.put((char) 0xb, KeyEvent.VK_K); /*75,x4b*/ + KEYCHAR_MAP.put((char) 0xc, KeyEvent.VK_L); /*76,x4c*/ + KEYCHAR_MAP.put((char) 0xd, KeyEvent.VK_M); /*77,x4d*/ + KEYCHAR_MAP.put((char) 0xe, KeyEvent.VK_N); /*78,x4e*/ + KEYCHAR_MAP.put((char) 0xf, KeyEvent.VK_O); /*79,x4f*/ + KEYCHAR_MAP.put((char) 0x10, KeyEvent.VK_P); /*80,x50*/ + KEYCHAR_MAP.put((char) 0x11, KeyEvent.VK_Q); /*81,x51*/ + KEYCHAR_MAP.put((char) 0x12, KeyEvent.VK_R); /*82,x52*/ + KEYCHAR_MAP.put((char) 0x13, KeyEvent.VK_S); /*83,x53*/ + KEYCHAR_MAP.put((char) 0x14, KeyEvent.VK_T); /*84,x54*/ + KEYCHAR_MAP.put((char) 0x15, KeyEvent.VK_U); /*85,x55*/ + KEYCHAR_MAP.put((char) 0x16, KeyEvent.VK_V); /*86,x56*/ + KEYCHAR_MAP.put((char) 0x17, KeyEvent.VK_W); /*87,x57*/ + KEYCHAR_MAP.put((char) 0x18, KeyEvent.VK_X); /*88,x58*/ + KEYCHAR_MAP.put((char) 0x19, KeyEvent.VK_Y); /*89,x59*/ + KEYCHAR_MAP.put((char) 0x1a, KeyEvent.VK_Z); /*90,x5a*/ - keycharHash.put( (char)0x7b , KeyEvent.VK_BRACELEFT ); /*123,x7b*/ /*'{' la (Latin American)*/ - //keycharHash.put( (char)0x1c , KeyEvent.VK_| ); /*124,x7c*/ /* no VK, cannot test*/ - keycharHash.put( (char)0x7d , KeyEvent.VK_BRACERIGHT ); /*125,x7d*/ /*'}' la */ - //keycharHash.put( (char)0x1e , KeyEvent.VK_~ ); /*126,x7e*/ /* no VK, cannot test*/ + KEYCHAR_MAP.put((char) 0x1b, KeyEvent.VK_OPEN_BRACKET); /*91,x5b*/ /*'['*/ + KEYCHAR_MAP.put((char) 0x1c, KeyEvent.VK_BACK_SLASH); /*92,x5c*/ /*'\'*/ + KEYCHAR_MAP.put((char) 0x1d, KeyEvent.VK_CLOSE_BRACKET); /*93,x5d*/ /*']'*/ + KEYCHAR_MAP.put((char) 0x5e, KeyEvent.VK_CIRCUMFLEX); /*94,x5e*/ /*'^' ?? nodead fr, de??*/ + KEYCHAR_MAP.put((char) 0x1f, KeyEvent.VK_UNDERSCORE); /*95,x5f*/ /*'_' fr*/ + KEYCHAR_MAP.put((char) 0x60, KeyEvent.VK_BACK_QUOTE); /*96,x60*/ + /********* Same as uppercase*/ + //keycharHash.put((char)0x1, KeyEvent.VK_a); /*97,x61*/ + //keycharHash.put((char)0x2, KeyEvent.VK_b); /*98,x62*/ + //keycharHash.put((char)0x3, KeyEvent.VK_c); /*99,x63*/ + //keycharHash.put((char)0x4, KeyEvent.VK_d); /*100,x64*/ + //keycharHash.put((char)0x5, KeyEvent.VK_e); /*101,x65*/ + //keycharHash.put((char)0x6, KeyEvent.VK_f); /*102,x66*/ + //keycharHash.put((char)0x7, KeyEvent.VK_g); /*103,x67*/ + //keycharHash.put((char)0x8, KeyEvent.VK_h); /*104,x68*/ + //keycharHash.put((char)0x9, KeyEvent.VK_i); /*105,x69*/ + //keycharHash.put((char)0xa, KeyEvent.VK_j); /*106,x6a*/ + //keycharHash.put((char)0xb, KeyEvent.VK_k); /*107,x6b*/ + //keycharHash.put((char)0xc, KeyEvent.VK_l); /*108,x6c*/ + //keycharHash.put((char)0xd, KeyEvent.VK_m); /*109,x6d*/ + //keycharHash.put((char)0xe, KeyEvent.VK_n); /*110,x6e*/ + //keycharHash.put((char)0xf, KeyEvent.VK_o); /*111,x6f*/ + //keycharHash.put((char)0x10, KeyEvent.VK_p); /*112,x70*/ + //keycharHash.put((char)0x11, KeyEvent.VK_q); /*113,x71*/ + //keycharHash.put((char)0x12, KeyEvent.VK_r); /*114,x72*/ + //keycharHash.put((char)0x13, KeyEvent.VK_s); /*115,x73*/ + //keycharHash.put((char)0x14, KeyEvent.VK_t); /*116,x74*/ + //keycharHash.put((char)0x15, KeyEvent.VK_u); /*117,x75*/ + //keycharHash.put((char)0x16, KeyEvent.VK_v); /*118,x76*/ + //keycharHash.put((char)0x17, KeyEvent.VK_w); /*119,x77*/ + //keycharHash.put((char)0x18, KeyEvent.VK_x); /*120,x78*/ + //keycharHash.put((char)0x19, KeyEvent.VK_y); /*121,x79*/ + //keycharHash.put((char)0x1a, KeyEvent.VK_z); /*122,x7a*/ + KEYCHAR_MAP.put((char) 0x7b, KeyEvent.VK_BRACELEFT); /*123,x7b*/ /*'{' la (Latin American)*/ + //keycharHash.put(char) 0x1c, KeyEvent.VK_|); /*124,x7c*/ /* no VK, cannot test*/ + KEYCHAR_MAP.put((char) 0x7d, KeyEvent.VK_BRACERIGHT); /*125,x7d*/ /*'}' la */ + //keycharHash.put((char) 0x1e, KeyEvent.VK_~); /*126,x7e*/ /* no VK, cannot test*/ } - public static void main(String[] args) { + + public static void main(String[] args) throws AWTException { CtrlASCII test = new CtrlASCII(); test.init(); test.start(); } - public void init() - { - fillHash( false ); - this.setLayout (new BorderLayout ()); + public void init() throws AWTException { + fillHash(); - }//End init() + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(100); - public void start () - { - setSize(400,300); + setLayout(new BorderLayout()); + + setSize(400, 300); setLocationRelativeTo(null); setVisible(true); @@ -181,87 +187,83 @@ public void start () tf.addKeyListener(this); validate(); - try { - robot = new Robot(); - robot.setAutoWaitForIdle(true); - robot.setAutoDelay(100); + robot.waitForIdle(); + robot.delay(1000); - robot.waitForIdle(); + this.requestFocus(); + tf.requestFocusInWindow(); - // wait for focus, etc. (Hack.) - robot.delay(2000); - this.requestFocus(); - tf.requestFocusInWindow(); + robot.waitForIdle(); + }//End init() + public void start() { + try { Point pt = getLocationOnScreen(); - robot.mouseMove( pt.x+100, pt.y+100 ); - robot.delay(2000); - robot.mousePress( InputEvent.BUTTON1_MASK ); - robot.mouseRelease( InputEvent.BUTTON1_MASK ); - Enumeration enuElem = keycharHash.elements(); + robot.mouseMove(pt.x + 100, pt.y + 100); + robot.delay(1000); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + KEYCHAR_MAP.forEach((k, v) -> punchCtrlKey(v)); - int kc; - while( enuElem.hasMoreElements()) { - kc = enuElem.nextElement(); - punchCtrlKey( robot, kc ); - } robot.delay(500); } catch (Exception e) { throw new RuntimeException("The test was not completed.\n\n" + e); + } finally { + dispose(); } - if( testFailed ) { + if (testFailed) { throw new RuntimeException("The test failed.\n\n"); } System.out.println("Success\n"); }// start() - public void punchCtrlKey( Robot ro, int keyCode ) { - ro.keyPress(KeyEvent.VK_CONTROL); + + public void punchCtrlKey(int keyCode) { try { - ro.keyPress(keyCode); - ro.keyRelease(keyCode); - }catch(IllegalArgumentException iae) { - System.err.println("skip probably invalid keyCode "+keyCode); + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(keyCode); + } catch (IllegalArgumentException iae) { + System.err.println("skip probably invalid keyCode " + keyCode); + } finally { + try { + robot.keyRelease(keyCode); + } catch (IllegalArgumentException iae) { + System.err.println("skip probably invalid keyCode " + keyCode); + } + robot.keyRelease(KeyEvent.VK_CONTROL); } - ro.keyRelease(KeyEvent.VK_CONTROL); - ro.delay(200); + robot.delay(200); } - public void keyPressed(KeyEvent evt) - { + + public void keyPressed(KeyEvent evt) { //printKey(evt); } - public void keyTyped(KeyEvent evt) - { + public void keyTyped(KeyEvent evt) { printKey(evt); char keych = evt.getKeyChar(); - if( !keycharHash.containsKey( keych ) ) { - System.out.println("Unexpected keychar: "+keych); - System.out.println("Unexpected keychar: "+keych); + if (!KEYCHAR_MAP.containsKey(keych)) { + System.out.println("Unexpected keychar: " + keych); testFailed = true; } } - public void keyReleased(KeyEvent evt) - { + public void keyReleased(KeyEvent evt) { //printKey(evt); } - protected void printKey(KeyEvent evt) - { - switch(evt.getID()) - { - case KeyEvent.KEY_TYPED: - case KeyEvent.KEY_PRESSED: - case KeyEvent.KEY_RELEASED: - break; - default: - System.out.println("Other Event "); - System.out.println("Other Event "); - return; + protected void printKey(KeyEvent evt) { + switch (evt.getID()) { + case KeyEvent.KEY_TYPED: + case KeyEvent.KEY_PRESSED: + case KeyEvent.KEY_RELEASED: + break; + default: + System.out.println("Other Event "); + return; } - System.out.print(" 0x"+ Integer.toHexString(evt.getKeyChar())); - System.out.println (" 0x"+ Integer.toHexString(evt.getKeyChar())); + System.out.println(" 0x" + Integer.toHexString(evt.getKeyChar())); } }// class CtrlASCII From efc3f4aa44fcaf7788bd5028d257068814e408c6 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:23:34 +0000 Subject: [PATCH 063/177] 8041447: Test javax/swing/dnd/7171812/bug7171812.java fails with java.lang.RuntimeException: Test failed, scroll on drag doesn't work Backport-of: 2c52cf07469970f730aa7397f9f6b98534af3a44 --- test/jdk/ProblemList.txt | 1 - .../javax/swing/dnd/7171812/bug7171812.java | 43 +++++++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index e09fc957ba5..a21b95b6fd0 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -128,7 +128,6 @@ java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java 8171510 macosx-all -javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all diff --git a/test/jdk/javax/swing/dnd/7171812/bug7171812.java b/test/jdk/javax/swing/dnd/7171812/bug7171812.java index ff985b1a426..405ef6c5a46 100644 --- a/test/jdk/javax/swing/dnd/7171812/bug7171812.java +++ b/test/jdk/javax/swing/dnd/7171812/bug7171812.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 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 @@ -26,26 +26,40 @@ * @key headful * @bug 7171812 * @summary [macosx] Views keep scrolling back to the drag position after DnD - * @author Alexander Zuev * @run main bug7171812 */ -import java.awt.*; -import java.awt.dnd.*; +import java.awt.BorderLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.dnd.DnDConstants; +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 javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; public class bug7171812 { static JFrame mainFrame; static String listData[]; static JListWithScroll list; static JScrollPane scrollPane; + static volatile Point pt; + static volatile int height; /** * @param args the command line arguments */ public static void main(String[] args) throws Exception{ + Robot robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { @@ -53,18 +67,21 @@ public void run() { } }); - Robot robot = new Robot(); - robot.setAutoDelay(10); robot.waitForIdle(); - robot.mouseMove(scrollPane.getLocationOnScreen().x + 5, scrollPane.getLocationOnScreen().y + 5); - robot.mousePress(InputEvent.BUTTON1_MASK); - for(int offset = 5; offset < scrollPane.getHeight()-20; offset++) { - robot.mouseMove(scrollPane.getLocationOnScreen().x+5, scrollPane.getLocationOnScreen().y+offset); + robot.delay(1000); + SwingUtilities.invokeAndWait(() -> { + pt = scrollPane.getLocationOnScreen(); + height = scrollPane.getHeight(); + }); + robot.mouseMove(pt.x + 5, pt.y + 5); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + for(int offset = 5; offset < height - 20; offset++) { + robot.mouseMove(pt.x + 5, pt.y + offset); } for(int offset = 5; offset < 195; offset++) { - robot.mouseMove(scrollPane.getLocationOnScreen().x+offset, scrollPane.getLocationOnScreen().y+scrollPane.getHeight()-20); + robot.mouseMove(pt.x + offset, pt.y + height - 20); } - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); try { SwingUtilities.invokeAndWait(new Runnable() { @Override From 84bc2528c152f7dc0e6fe05a8cadf6a0f8d3c65e Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 11 Oct 2023 09:24:09 +0000 Subject: [PATCH 064/177] 8289547: Update javax/swing/Popup/TaskbarPositionTest.java Backport-of: d73fc70ea272be6bf4f1c82608c73ff0a8f6032d --- .../swing/Popup/TaskbarPositionTest.java | 306 +++++++++++------- 1 file changed, 192 insertions(+), 114 deletions(-) diff --git a/test/jdk/javax/swing/Popup/TaskbarPositionTest.java b/test/jdk/javax/swing/Popup/TaskbarPositionTest.java index a088cb07a9a..6a6b93a1080 100644 --- a/test/jdk/javax/swing/Popup/TaskbarPositionTest.java +++ b/test/jdk/javax/swing/Popup/TaskbarPositionTest.java @@ -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 @@ -24,6 +24,8 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; import java.awt.Insets; import java.awt.Point; import java.awt.Rectangle; @@ -33,8 +35,9 @@ import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.AbstractAction; import javax.swing.JComboBox; import javax.swing.JFrame; @@ -47,54 +50,61 @@ import javax.swing.JTextField; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; -import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +import jtreg.SkippedException; -/** +/* * @test * @bug 4245587 4474813 4425878 4767478 8015599 * @key headful * @summary Tests the location of the heavy weight popup portion of JComboBox, * JMenu and JPopupMenu. + * The test uses Ctrl+Down Arrow (↓) which is a system shortcut on macOS, + * disable it in system settings, otherwise the test will fail * @library ../regtesthelpers + * @library /test/lib * @build Util + * @build jtreg.SkippedException * @run main TaskbarPositionTest */ public class TaskbarPositionTest implements ActionListener { - private boolean done; - private Throwable error; - private static TaskbarPositionTest test; private static JFrame frame; private static JPopupMenu popupMenu; private static JPanel panel; + private static JComboBox combo1; private static JComboBox combo2; - private static JMenuBar menubar; + private static JMenu menu1; private static JMenu menu2; + private static JMenu submenu; + private static Rectangle fullScreenBounds; // The usable desktop space: screen size - screen insets. private static Rectangle screenBounds; - private static String[] numData = { + + private static final String[] numData = { "One", "Two", "Three", "Four", "Five", "Six", "Seven" }; - private static String[] dayData = { + private static final String[] dayData = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }; - private static char[] mnDayData = { + private static final char[] mnDayData = { 'M', 'T', 'W', 'R', 'F', 'S', 'U' }; public TaskbarPositionTest() { frame = new JFrame("Use CTRL-down to show a JPopupMenu"); frame.setContentPane(panel = createContentPane()); - frame.setJMenuBar(createMenuBar("1 - First Menu", true)); + frame.setJMenuBar(createMenuBar()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // CTRL-down will show the popup. panel.getInputMap().put(KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); + KeyEvent.VK_DOWN, InputEvent.CTRL_DOWN_MASK), "OPEN_POPUP"); panel.getActionMap().put("OPEN_POPUP", new PopupHandler()); frame.pack(); @@ -103,7 +113,6 @@ public TaskbarPositionTest() { fullScreenBounds = new Rectangle(new Point(), toolkit.getScreenSize()); screenBounds = new Rectangle(new Point(), toolkit.getScreenSize()); - // Reduce the screen bounds by the insets. GraphicsConfiguration gc = frame.getGraphicsConfiguration(); if (gc != null) { @@ -116,37 +125,56 @@ public TaskbarPositionTest() { } // Place the frame near the bottom. - frame.setLocation(0, screenBounds.y + screenBounds.height - frame.getHeight()); + frame.setLocation(screenBounds.x, + screenBounds.y + screenBounds.height - frame.getHeight()); frame.setVisible(true); } - public static class ComboPopupCheckListener implements PopupMenuListener { + private static class ComboPopupCheckListener implements PopupMenuListener { + @Override public void popupMenuCanceled(PopupMenuEvent ev) { } + @Override public void popupMenuWillBecomeVisible(PopupMenuEvent ev) { } + @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent ev) { - Point cpos = combo1.getLocation(); - SwingUtilities.convertPointToScreen(cpos, panel); - - JPopupMenu pm = (JPopupMenu) combo1.getUI().getAccessibleChild(combo1, 0); - - if (pm != null) { - Point p = pm.getLocation(); - SwingUtilities.convertPointToScreen(p, pm); - if (p.y+1 < cpos.y) { - System.out.println("p.y " + p.y + " cpos.y " + cpos.y); - throw new RuntimeException("ComboBox popup is wrongly aligned"); - } // check that popup was opened down + JComboBox combo = (JComboBox) ev.getSource(); + Point comboLoc = combo.getLocationOnScreen(); + + JPopupMenu popupMenu = (JPopupMenu) combo.getUI().getAccessibleChild(combo, 0); + + Point popupMenuLoc = popupMenu.getLocationOnScreen(); + Dimension popupSize = popupMenu.getSize(); + + isPopupOnScreen(popupMenu, fullScreenBounds); + + if (comboLoc.x > 0) { + // The frame is located at the bottom of the screen, + // the combo popups should open upwards + if (popupMenuLoc.y + popupSize.height < comboLoc.y) { + System.err.println("popup " + popupMenuLoc + + " combo " + comboLoc); + throw new RuntimeException("ComboBox popup should open upwards"); + } + } else { + // The frame has been moved to negative position away from + // the bottom of the screen, the combo popup should + // open downwards in this case + if (popupMenuLoc.y + 1 < comboLoc.y) { + System.err.println("popup " + popupMenuLoc + + " combo " + comboLoc); + throw new RuntimeException("ComboBox popup should open downwards"); + } } } } - private class PopupHandler extends AbstractAction { - + private static class PopupHandler extends AbstractAction { + @Override public void actionPerformed(ActionEvent e) { if (!popupMenu.isVisible()) { popupMenu.show((Component) e.getSource(), 40, 40); @@ -155,18 +183,20 @@ public void actionPerformed(ActionEvent e) { } } - class PopupListener extends MouseAdapter { + private static class PopupListener extends MouseAdapter { - private JPopupMenu popup; + private final JPopupMenu popup; public PopupListener(JPopupMenu popup) { this.popup = popup; } + @Override public void mousePressed(MouseEvent e) { maybeShowPopup(e); } + @Override public void mouseReleased(MouseEvent e) { maybeShowPopup(e); } @@ -182,121 +212,137 @@ private void maybeShowPopup(MouseEvent e) { /** * Tests if the popup is on the screen. */ - public static void isPopupOnScreen(JPopupMenu popup, Rectangle checkBounds) { + private static void isPopupOnScreen(JPopupMenu popup, Rectangle checkBounds) { + if (!popup.isVisible()) { + throw new RuntimeException("Popup not visible"); + } Dimension dim = popup.getSize(); - Point pt = new Point(); - SwingUtilities.convertPointToScreen(pt, popup); + Point pt = popup.getLocationOnScreen(); Rectangle bounds = new Rectangle(pt, dim); if (!SwingUtilities.isRectangleContainingRectangle(checkBounds, bounds)) { - throw new RuntimeException("We do not match! " + checkBounds + " / " + bounds); + throw new RuntimeException("Popup is outside of screen bounds " + + checkBounds + " / " + bounds); } + } + private static void isComboPopupOnScreen(JComboBox comboBox) { + if (!comboBox.isPopupVisible()) { + throw new RuntimeException("ComboBox popup not visible"); + } + JPopupMenu popupMenu = (JPopupMenu) comboBox.getUI().getAccessibleChild(comboBox, 0); + isPopupOnScreen(popupMenu, screenBounds); } - private JPanel createContentPane() { - JPanel panel = new JPanel(); + private JPanel createContentPane() { combo1 = new JComboBox<>(numData); - panel.add(combo1); + combo1.addPopupMenuListener(new ComboPopupCheckListener()); + combo2 = new JComboBox<>(dayData); combo2.setEditable(true); - panel.add(combo2); - panel.setSize(300, 200); + combo2.addPopupMenuListener(new ComboPopupCheckListener()); popupMenu = new JPopupMenu(); - JMenuItem item; for (int i = 0; i < dayData.length; i++) { - item = popupMenu.add(new JMenuItem(dayData[i], mnDayData[i])); + JMenuItem item = popupMenu.add(new JMenuItem(dayData[i], mnDayData[i])); item.addActionListener(this); } - panel.addMouseListener(new PopupListener(popupMenu)); JTextField field = new JTextField("CTRL+down for Popup"); // CTRL-down will show the popup. field.getInputMap().put(KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); + KeyEvent.VK_DOWN, InputEvent.CTRL_DOWN_MASK), "OPEN_POPUP"); field.getActionMap().put("OPEN_POPUP", new PopupHandler()); + JPanel panel = new JPanel(); + panel.add(combo1); + panel.add(combo2); + panel.setSize(300, 200); + panel.addMouseListener(new PopupListener(popupMenu)); panel.add(field); return panel; } - /** - * @param str name of Menu - * @param bFlag set mnemonics on menu items - */ - private JMenuBar createMenuBar(String str, boolean bFlag) { - menubar = new JMenuBar(); - - menu1 = new JMenu(str); - menu1.setMnemonic(str.charAt(0)); - menu1.addActionListener(this); + private JMenuBar createMenuBar() { + JMenuBar menubar = new JMenuBar(); + menu1 = new JMenu("1 - First Menu"); + menu1.setMnemonic('1'); + createSubMenu(menu1, "1 JMenuItem", 8, null); menubar.add(menu1); - for (int i = 0; i < 8; i++) { - JMenuItem menuitem = new JMenuItem("1 JMenuItem" + i); - menuitem.addActionListener(this); - if (bFlag) { - menuitem.setMnemonic('0' + i); - } - menu1.add(menuitem); - } - // second menu menu2 = new JMenu("2 - Second Menu"); - menu2.addActionListener(this); menu2.setMnemonic('2'); - + createSubMenu(menu2, "2 JMenuItem", 4, null); + menu2.add(new JSeparator()); menubar.add(menu2); - for (int i = 0; i < 5; i++) { - JMenuItem menuitem = new JMenuItem("2 JMenuItem" + i); - menuitem.addActionListener(this); - if (bFlag) { - menuitem.setMnemonic('0' + i); - } - menu2.add(menuitem); - } - JMenu submenu = new JMenu("Sub Menu"); + submenu = new JMenu("Sub Menu"); submenu.setMnemonic('S'); - submenu.addActionListener(this); - for (int i = 0; i < 5; i++) { - JMenuItem menuitem = new JMenuItem("S JMenuItem" + i); - menuitem.addActionListener(this); - if (bFlag) { - menuitem.setMnemonic('0' + i); - } - submenu.add(menuitem); - } - menu2.add(new JSeparator()); + createSubMenu(submenu, "S JMenuItem", 4, this); menu2.add(submenu); return menubar; } + private static void createSubMenu(JMenu menu, String prefix, int count, ActionListener action) { + for (int i = 0; i < count; ++i) { + JMenuItem menuitem = new JMenuItem(prefix + i); + menu.add(menuitem); + if (action != null) { + menuitem.addActionListener(action); + } + } + } + + public void actionPerformed(ActionEvent evt) { Object obj = evt.getSource(); if (obj instanceof JMenuItem) { - // put the focus on the noneditable combo. + // put the focus on the non-editable combo. combo1.requestFocus(); } } + private static void hidePopup(Robot robot) { + robot.keyPress(KeyEvent.VK_ESCAPE); + robot.keyRelease(KeyEvent.VK_ESCAPE); + } + public static void main(String[] args) throws Throwable { + GraphicsDevice mainScreen = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice(); + Rectangle mainScreenBounds = mainScreen.getDefaultConfiguration() + .getBounds(); + GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getScreenDevices(); + for (GraphicsDevice screen : screens) { + if (screen == mainScreen) { + continue; + } + + Rectangle bounds = screen.getDefaultConfiguration() + .getBounds(); + if (bounds.x < 0) { + // The test may fail if a screen have negative origin + throw new SkippedException("Configurations with negative screen" + + " origin are not supported"); + } + if (bounds.y >= mainScreenBounds.height) { + // The test may fail if there's a screen to bottom of the main monitor + throw new SkippedException("Configurations with a screen beneath" + + " the main one are not supported"); + } + } try { // Use Robot to automate the test - Robot robot; - robot = new Robot(); + Robot robot = new Robot(); robot.setAutoDelay(50); - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - test = new TaskbarPositionTest(); - } - }); + SwingUtilities.invokeAndWait(TaskbarPositionTest::new); robot.waitForIdle(); robot.delay(1000); @@ -310,58 +356,90 @@ public void run() { // 2 menu with sub menu robot.keyPress(KeyEvent.VK_RIGHT); robot.keyRelease(KeyEvent.VK_RIGHT); - Util.hitMnemonics(robot, KeyEvent.VK_S); + // Open the submenu + robot.keyPress(KeyEvent.VK_S); + robot.keyRelease(KeyEvent.VK_S); robot.waitForIdle(); SwingUtilities.invokeAndWait(() -> isPopupOnScreen(menu2.getPopupMenu(), screenBounds)); + SwingUtilities.invokeAndWait(() -> isPopupOnScreen(submenu.getPopupMenu(), screenBounds)); + // Hit Enter to perform the action of + // a selected menu item in the submenu + // which requests focus on combo1, non-editable combo box robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); - // Focus should go to non editable combo box robot.waitForIdle(); - robot.delay(500); + // Focus should go to combo1 + // Open combo1 popup robot.keyPress(KeyEvent.VK_DOWN); + robot.keyRelease(KeyEvent.VK_DOWN); - // How do we check combo boxes? + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> isComboPopupOnScreen(combo1)); + hidePopup(robot); - // Editable combo box + // Move focus to combo2, editable combo box robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); + + robot.waitForIdle(); + + // Open combo2 popup robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); - // combo1.getUI(); + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> isComboPopupOnScreen(combo2)); + hidePopup(robot); - // Popup from Text field + // Move focus to the text field robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); + + robot.waitForIdle(); + + // Open its popup robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_CONTROL); - // Popup from a mouse click. - Point pt = new Point(2, 2); - SwingUtilities.convertPointToScreen(pt, panel); - robot.mouseMove(pt.x, pt.y); - robot.mousePress(InputEvent.BUTTON3_MASK); - robot.mouseRelease(InputEvent.BUTTON3_MASK); + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> isPopupOnScreen(popupMenu, fullScreenBounds)); + hidePopup(robot); + + // Popup from a mouse click + SwingUtilities.invokeAndWait(() -> { + Point pt = panel.getLocationOnScreen(); + pt.translate(4, 4); + robot.mouseMove(pt.x, pt.y); + }); + robot.mousePress(InputEvent.BUTTON3_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); + // Ensure popupMenu is shown within screen bounds robot.waitForIdle(); - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - frame.setLocation(-30, 100); - combo1.addPopupMenuListener(new ComboPopupCheckListener()); - combo1.requestFocus(); - } + SwingUtilities.invokeAndWait(() -> isPopupOnScreen(popupMenu, fullScreenBounds)); + hidePopup(robot); + + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> { + frame.setLocation(-30, 100); + combo1.requestFocus(); }); + robot.waitForIdle(); + + // Open combo1 popup again robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); - robot.keyPress(KeyEvent.VK_ESCAPE); - robot.keyRelease(KeyEvent.VK_ESCAPE); + + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> isComboPopupOnScreen(combo1)); + hidePopup(robot); robot.waitForIdle(); } finally { From 363855d9dc913119e8177516ba8f09493ccefbff Mon Sep 17 00:00:00 2001 From: Amos Date: Thu, 12 Oct 2023 19:55:03 +0000 Subject: [PATCH 065/177] 8233000: Mark vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize test as stress test Reviewed-by: clanger Backport-of: db24eb1e6a0b777dc44f44ae3a1d75ad8d23d6d0 --- .../vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java b/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java index bd2fb7957a1..56e2b590570 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java @@ -24,6 +24,7 @@ /* * @test + * @key stress * * @summary converted from VM Testbase vm/mlvm/meth/stress/compiler/deoptimize. * VM Testbase keywords: [feature_mlvm, nonconcurrent, quarantine] From 94d3648be11ac80621f1c829618f3e49cc55a3b5 Mon Sep 17 00:00:00 2001 From: Mat Carter Date: Thu, 12 Oct 2023 22:04:58 +0000 Subject: [PATCH 066/177] 8303607: SunMSCAPI provider leaks memory and keys Backport-of: a393f2581740f854518a3ef7caccd6d3c2d8e4a0 --- .../windows/native/libsunmscapi/security.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp index 9059b9160c0..684588cac26 100644 --- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp +++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp @@ -502,7 +502,11 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC else { if (bCallerFreeProv == TRUE) { - ::CryptReleaseContext(hCryptProv, NULL); // deprecated + if ((dwKeySpec & CERT_NCRYPT_KEY_SPEC) == CERT_NCRYPT_KEY_SPEC) { + NCryptFreeObject(hCryptProv); + } else { + ::CryptReleaseContext(hCryptProv, NULL); // deprecated + } bCallerFreeProv = FALSE; } From c780db754e14ff77995dc090396d1958cea1ada1 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Sun, 15 Oct 2023 10:16:24 +0000 Subject: [PATCH 067/177] 8259266: com/sun/jdi/JdbOptions.java failed with "RuntimeException: 'prop[boo] = >foo 2<' missing from stdout/stderr" 8260431: com/sun/jdi/JdbOptions.java failed with "RuntimeException: 'prop[boo] = >foo<' missing from stdout/stderr" Reviewed-by: goetz Backport-of: d63388c00c48e0a08609ae63217f51e474c236ea --- .../tools/example/debug/tty/VMConnection.java | 7 +- test/jdk/com/sun/jdi/JdbOptions.java | 71 +++++++++++++------ 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java index de355ba5d82..8ff830eecf9 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -474,11 +474,10 @@ private void dumpStream(InputStream stream) throws IOException { // printDirect() } } catch (IOException ex) { - String s = ex.getMessage(); - if (!s.startsWith("Bad file number")) { + if (!ex.getMessage().equalsIgnoreCase("stream closed")) { throw ex; } - // else we got a Bad file number IOException which just means + // else we got a "Stream closed" IOException which just means // that the debuggee has gone away. We'll just treat it the // same as if we got an EOF. } diff --git a/test/jdk/com/sun/jdi/JdbOptions.java b/test/jdk/com/sun/jdi/JdbOptions.java index b6fb965e319..114aa3ddd50 100644 --- a/test/jdk/com/sun/jdi/JdbOptions.java +++ b/test/jdk/com/sun/jdi/JdbOptions.java @@ -34,9 +34,17 @@ import lib.jdb.JdbCommand; import jdk.test.lib.process.OutputAnalyzer; +import java.io.IOException; +import java.io.PrintStream; import java.lang.management.ManagementFactory; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Arrays; import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; class JbdOptionsTarg { static final String OK_MSG = "JbdOptionsTarg: OK"; @@ -49,47 +57,62 @@ static String propString(String name, String value) { return "prop[" + name + "] = >" + value + "<"; } - public static void main(String[] args) { - System.out.println(OK_MSG); - // print all args - List vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments(); - for (String s: vmArgs) { - System.out.println(argString(s)); - } - // print requested sys.props - for (String p: args) { - System.out.println(propString(p, System.getProperty(p))); + /** + * 1st argument is a filename to redirect application output, + * the rest are names of the properties to dump. + */ + public static void main(String[] args) throws IOException { + String outFile = args[0]; + try (PrintStream out = new PrintStream(outFile, StandardCharsets.UTF_8)) { + out.println(OK_MSG); + // print all args + List vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments(); + for (String s : vmArgs) { + out.println(argString(s)); + } + // print requested sys.props (skip 1st arg which is output filename) + for (int i=1; i < args.length; i++) { + String p = args[i]; + out.println(propString(p, System.getProperty(p))); + } } } } public class JdbOptions { + private static final String outFilename = UUID.randomUUID().toString() + ".out"; + private static final Path outPath = Paths.get(outFilename); private static final String targ = JbdOptionsTarg.class.getName(); public static void main(String[] args) throws Exception { // the simplest case test("-connect", - "com.sun.jdi.CommandLineLaunch:vmexec=java,options=-client -XX:+PrintVMOptions,main=" + targ) + "com.sun.jdi.CommandLineLaunch:vmexec=java,options=-client -XX:+PrintVMOptions" + + ",main=" + targ + " " + outFilename) .expectedArg("-XX:+PrintVMOptions"); // pass property through 'options' test("-connect", - "com.sun.jdi.CommandLineLaunch:vmexec=java,options='-Dboo=foo',main=" + targ + " boo") + "com.sun.jdi.CommandLineLaunch:vmexec=java,options='-Dboo=foo'" + + ",main=" + targ + " " + outFilename + " boo") .expectedProp("boo", "foo"); // property with spaces test("-connect", - "com.sun.jdi.CommandLineLaunch:vmexec=java,options=\"-Dboo=foo 2\",main=" + targ + " boo") + "com.sun.jdi.CommandLineLaunch:vmexec=java,options=\"-Dboo=foo 2\"" + + ",main=" + targ + " " + outFilename + " boo") .expectedProp("boo", "foo 2"); // property with spaces (with single quotes) test("-connect", - "com.sun.jdi.CommandLineLaunch:vmexec=java,options='-Dboo=foo 2',main=" + targ + " boo") + "com.sun.jdi.CommandLineLaunch:vmexec=java,options='-Dboo=foo 2'" + + ",main=" + targ + " " + outFilename + " boo") .expectedProp("boo", "foo 2"); // properties with spaces (with single quotes) test("-connect", - "com.sun.jdi.CommandLineLaunch:vmexec=java,options=-Dboo=foo '-Dboo2=foo 2',main=" + targ + " boo boo2") + "com.sun.jdi.CommandLineLaunch:vmexec=java,options=-Dboo=foo '-Dboo2=foo 2'" + + ",main=" + targ + " " + outFilename + " boo boo2") .expectedProp("boo", "foo") .expectedProp("boo2", "foo 2"); @@ -98,7 +121,7 @@ public static void main(String[] args) throws Exception { "com.sun.jdi.CommandLineLaunch:vmexec=java,options=\"-client\" \"-XX:+PrintVMOptions\"" + " -XX:+IgnoreUnrecognizedVMOptions" + " \"-XX:StartFlightRecording=dumponexit=true,maxsize=500M\" \"-XX:FlightRecorderOptions=repository=jfrrep\"" - + ",main=" + targ) + + ",main=" + targ + " " + outFilename) .expectedArg("-XX:StartFlightRecording=dumponexit=true,maxsize=500M") .expectedArg("-XX:FlightRecorderOptions=repository=jfrrep"); @@ -107,7 +130,7 @@ public static void main(String[] args) throws Exception { "com.sun.jdi.CommandLineLaunch:vmexec=java,options='-client' '-XX:+PrintVMOptions'" + " -XX:+IgnoreUnrecognizedVMOptions" + " '-XX:StartFlightRecording=dumponexit=true,maxsize=500M' '-XX:FlightRecorderOptions=repository=jfrrep'" - + ",main=" + targ) + + ",main=" + targ + " " + outFilename) .expectedArg("-XX:StartFlightRecording=dumponexit=true,maxsize=500M") .expectedArg("-XX:FlightRecorderOptions=repository=jfrrep"); @@ -120,7 +143,7 @@ public static void main(String[] args) throws Exception { + " -XX:+IgnoreUnrecognizedVMOptions" + " \"-XX:StartFlightRecording=dumponexit=true,maxsize=500M\"" + " '-XX:FlightRecorderOptions=repository=jfrrep'" - + ",main=" + targ + " prop1 prop2 prop3 prop4") + + ",main=" + targ + " " + outFilename + " prop1 prop2 prop3 prop4") .expectedProp("prop1", "val1") .expectedProp("prop2", "val 2") .expectedProp("prop3", "val3") @@ -154,12 +177,18 @@ private static TestResult test(String... args) throws Exception { .map(s -> s.replace("\"", "\\\"")) .toArray(String[]::new); } + try (Jdb jdb = new Jdb(args)) { jdb.waitForSimplePrompt(1024, true); // 1024 lines should be enough jdb.command(JdbCommand.run().allowExit()); - OutputAnalyzer out = new OutputAnalyzer(jdb.getJdbOutput()); - out.shouldContain(JbdOptionsTarg.OK_MSG); - return new TestResult(out); } + String output = Files.readAllLines(outPath, StandardCharsets.UTF_8).stream() + .collect(Collectors.joining(System.getProperty("line.separator"))); + Files.deleteIfExists(outPath); + System.out.println("Debuggee output: ["); + System.out.println(output); + System.out.println("]"); + OutputAnalyzer out = new OutputAnalyzer(output); + return new TestResult(out); } } From 855efc413de1c2d2c5b82fac7bfcaeaeaebd809a Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 17 Oct 2023 07:24:28 +0000 Subject: [PATCH 068/177] 8311285: report some fontconfig related environment variables in hs_err file Backport-of: 0ef03f122866f010ebf50683097e9b92e41cdaad --- src/hotspot/share/utilities/vmError.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 350498181d2..6d14cec2add 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -83,6 +83,8 @@ const char *env_list[] = { "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", "JAVA_COMPILER", "PATH", "USERNAME", + "XDG_CACHE_HOME", "XDG_CONFIG_HOME", "FC_LANG", "FONTCONFIG_USE_MMAP", + // Env variables that are defined on Solaris/Linux/BSD "LD_LIBRARY_PATH", "LD_PRELOAD", "SHELL", "DISPLAY", "HOSTTYPE", "OSTYPE", "ARCH", "MACHTYPE", From 3ba3e88b9113b8c661352c95a07b25f466baca4f Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 17 Oct 2023 07:28:05 +0000 Subject: [PATCH 069/177] 8310549: avoid potential leaks in KeystoreImpl.m related to JNU_CHECK_EXCEPTION early returns Backport-of: 7da3f1999fc5d1b9162443d97dfae7fe7b04dfc5 --- src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m b/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m index b4e19a27995..b4f13a80d96 100644 --- a/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m +++ b/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m @@ -363,7 +363,9 @@ static void addIdentitiesToKeystore(JNIEnv *env, jobject keyStore) // Call back to the Java object to create Java objects corresponding to this security object. jlong nativeKeyRef = ptr_to_jlong(privateKeyRef); (*env)->CallVoidMethod(env, keyStore, jm_createKeyEntry, alias, creationDate, nativeKeyRef, certRefArray, javaCertArray); - JNU_CHECK_EXCEPTION(env); + if ((*env)->ExceptionCheck(env)) { + goto errOut; + } } } while (searchResult == noErr); @@ -505,7 +507,9 @@ static void addCertificatesToKeystore(JNIEnv *env, jobject keyStore) // Call back to the Java object to create Java objects corresponding to this security object. jlong nativeRef = ptr_to_jlong(certRef); (*env)->CallVoidMethod(env, keyStore, jm_createTrustedCertEntry, alias, inputTrust, nativeRef, creationDate, certData); - JNU_CHECK_EXCEPTION(env); + if ((*env)->ExceptionCheck(env)) { + goto errOut; + } } } while (searchResult == noErr); From 7be6fc22f3321204a895208278da115a985c7fb3 Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 17 Oct 2023 07:35:20 +0000 Subject: [PATCH 070/177] 8296275: Write a test to verify setAccelerator method of JMenuItem Backport-of: b005013a0015656b7f6ccc26f8a13c44d61f77b9 --- .../JMenuItemSetAcceleratorTest.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java diff --git a/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java b/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java new file mode 100644 index 00000000000..ff96c2b3aec --- /dev/null +++ b/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016, 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.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; + +/* + * @test + * @key headful + * @bug 8296275 + * @summary To verify the setAccelerator method of JMenuItem. + * @requires (os.family=="mac") + * @run main JMenuItemSetAcceleratorTest + */ + +public class JMenuItemSetAcceleratorTest { + private static JFrame frame; + private static final CountDownLatch actionLatch = new CountDownLatch(1); + private volatile static Point frameAt; + private volatile static Dimension frameSize; + + private static void createAndShow() { + frame = new JFrame("JMenuItem.setAccelerator"); + frame.setLayout(new FlowLayout()); + + JMenuBar bar = new JMenuBar(); + JMenu menu = new JMenu("File"); + JMenuItem menuItem = new JMenuItem("Menu Item"); + + menuItem.setAccelerator( + KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.META_DOWN_MASK)); + menuItem.addActionListener(e -> { + System.out.println("menu item action."); + actionLatch.countDown(); + }); + + menu.add(menuItem); + bar.add(menu); + + frame.setJMenuBar(bar); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + SwingUtilities.invokeAndWait(JMenuItemSetAcceleratorTest::createAndShow); + + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + + EventQueue.invokeAndWait(() -> { + frameAt = frame.getLocationOnScreen(); + frameSize = frame.getSize(); + }); + + robot.mouseMove(frameAt.x + frameSize.width / 2, + frameAt.y + frameSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + robot.keyPress(KeyEvent.VK_META); + robot.keyPress(KeyEvent.VK_M); + robot.keyRelease(KeyEvent.VK_M); + robot.keyRelease(KeyEvent.VK_META); + + if (!actionLatch.await(5, TimeUnit.SECONDS)) { + throw new RuntimeException( + "Hasn't received the JMenuItem action event by pressing " + + "accelerator keys, test fails."); + } + System.out.println("Test passed, received action event on menu item."); + } finally { + SwingUtilities.invokeAndWait(JMenuItemSetAcceleratorTest::disposeFrame); + } + } + + public static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } +} From 9752bedf01d5cecdfd7515d4f165f8c5a06fb298 Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 17 Oct 2023 07:46:26 +0000 Subject: [PATCH 071/177] 8300272: Improve readability of the test JarWithOneNonDisabledDigestAlg Backport-of: cf46004f276293ce8b092fe17ae579cbe45914a2 --- .../JarWithOneNonDisabledDigestAlg.java | 133 +++++++++++------- 1 file changed, 83 insertions(+), 50 deletions(-) diff --git a/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java b/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java index 899500672ad..f0c25dc85bb 100644 --- a/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java +++ b/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java @@ -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 @@ -27,6 +27,7 @@ * @summary Check that jar entry with at least one non-disabled digest * algorithm in manifest is treated as signed * @modules java.base/sun.security.tools.keytool + * @modules java.base/sun.security.util * @library /test/lib * @build jdk.test.lib.util.JarUtils * jdk.test.lib.security.SecurityUtils @@ -34,61 +35,94 @@ */ import java.io.InputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; +import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.security.CodeSigner; import java.security.KeyStore; +import java.security.cert.CertPathValidatorException; +import java.util.Collections; +import java.util.Date; import java.util.Enumeration; -import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.zip.ZipFile; import jdk.security.jarsigner.JarSigner; import jdk.test.lib.util.JarUtils; -import jdk.test.lib.security.SecurityUtils; +import sun.security.util.ConstraintsParameters; +import sun.security.util.DisabledAlgorithmConstraints; +import sun.security.util.JarConstraintsParameters; public class JarWithOneNonDisabledDigestAlg { private static final String PASS = "changeit"; - private static final String TESTFILE1 = "testfile1"; - private static final String TESTFILE2 = "testfile2"; + private static final Path TESTFILE1 = Path.of("testfile1"); + private static final Path TESTFILE2 = Path.of("testfile2"); + private static final Path UNSIGNED_JAR = Path.of("unsigned.jar"); + private static final Path SIGNED_JAR = Path.of("signed.jar"); + private static final Path SIGNED_TWICE_JAR = Path.of("signed2.jar"); + private static final Path MULTI_SIGNED_JAR = Path.of("multi-signed.jar"); + private static final Path CURRENT_DIR = Path.of("."); public static void main(String[] args) throws Exception { - SecurityUtils.removeFromDisabledAlgs("jdk.jar.disabledAlgorithms", - List.of("SHA1")); - Files.write(Path.of(TESTFILE1), TESTFILE1.getBytes()); - JarUtils.createJarFile(Path.of("unsigned.jar"), Path.of("."), - Path.of(TESTFILE1)); + // Sanity check: Assert that MD5 is disabled, SHA-256 enabled + checkDigestAlgorithmPermits(); - genkeypair("-alias SHA1 -sigalg SHA1withRSA"); - genkeypair("-alias SHA256 -sigalg SHA256withRSA"); + // Create an unsigned JAR with a single file + Files.write(TESTFILE1, TESTFILE1.toString().getBytes()); + JarUtils.createJarFile(UNSIGNED_JAR, CURRENT_DIR, TESTFILE1); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - try (FileInputStream fis = new FileInputStream("keystore")) { - ks.load(fis, PASS.toCharArray()); - } + // Generate a keystore with two different signers + genkeypair("-alias SIGNER1"); + genkeypair("-alias SIGNER2"); + KeyStore ks = loadKeyStore(); // Sign JAR twice with same signer but different digest algorithms // so that each entry in manifest file contains two digest values. - signJarFile(ks, "SHA1", "MD5", "unsigned.jar", "signed.jar"); - signJarFile(ks, "SHA1", "SHA1", "signed.jar", "signed2.jar"); - checkThatJarIsSigned("signed2.jar", false); + // Note that MD5 is a disabled digest algorithm, while SHA-256 is not + signJarFile(ks, "SIGNER1", "MD5", UNSIGNED_JAR, SIGNED_JAR); + signJarFile(ks, "SIGNER1", "SHA256", SIGNED_JAR, SIGNED_TWICE_JAR); + checkThatJarIsSigned(SIGNED_TWICE_JAR, Map.of(TESTFILE1.toString(), 1)); // add another file to the JAR - Files.write(Path.of(TESTFILE2), "testFile2".getBytes()); - JarUtils.updateJarFile(Path.of("signed2.jar"), Path.of("."), - Path.of(TESTFILE2)); + Files.write(TESTFILE2, TESTFILE2.toString().getBytes()); + JarUtils.updateJarFile(SIGNED_TWICE_JAR, CURRENT_DIR, TESTFILE2); + + // Sign the updated JAR, now with a different signer and with an enabled digest alg + signJarFile(ks, "SIGNER2", "SHA256", SIGNED_TWICE_JAR, MULTI_SIGNED_JAR); - // Sign again with different signer (SHA256) and SHA-1 digestalg. - // TESTFILE1 should have two signers and TESTFILE2 should have one - // signer. - signJarFile(ks, "SHA256", "SHA1", "signed2.jar", "multi-signed.jar"); + // TESTFILE1 should have two signers and TESTFILE2 should have one signer. + checkThatJarIsSigned(MULTI_SIGNED_JAR, + Map.of(TESTFILE1.toString(), 2, + TESTFILE2.toString(), 1) + ); + } - checkThatJarIsSigned("multi-signed.jar", true); + private static void checkDigestAlgorithmPermits() throws Exception { + ConstraintsParameters cp = new JarConstraintsParameters(Collections.emptyList(), new Date()); + DisabledAlgorithmConstraints jarConstraints = DisabledAlgorithmConstraints.jarConstraints(); + try { + jarConstraints.permits("MD5", cp, false); + throw new Exception("This test assumes that MD5 is disabled"); + } catch (CertPathValidatorException e) { + // Ignore + } + try { + jarConstraints.permits("SHA256", cp, false); + } catch (CertPathValidatorException e) { + throw new Exception("This test assumes that SHA256 is enabled"); + } + } + + private static KeyStore loadKeyStore() throws Exception { + KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); + try (InputStream fis = Files.newInputStream(Path.of("keystore"))) { + ks.load(fis, PASS.toCharArray()); + } + return ks; } private static KeyStore.PrivateKeyEntry getEntry(KeyStore ks, String alias) @@ -101,12 +135,13 @@ private static KeyStore.PrivateKeyEntry getEntry(KeyStore ks, String alias) private static void genkeypair(String cmd) throws Exception { cmd = "-genkeypair -keystore keystore -storepass " + PASS + - " -keypass " + PASS + " -keyalg rsa -dname CN=Duke " + cmd; + " -keypass " + PASS + " -keyalg rsa -sigalg SHA256withRSA " + + "-dname CN=Duke " + cmd; sun.security.tools.keytool.Main.main(cmd.split(" ")); } private static void signJarFile(KeyStore ks, String alias, - String digestAlg, String inputFile, String outputFile) + String digestAlg, Path inputFile, Path outputFile) throws Exception { JarSigner signer = new JarSigner.Builder(getEntry(ks, alias)) @@ -114,38 +149,36 @@ private static void signJarFile(KeyStore ks, String alias, .signerName(alias) .build(); - try (ZipFile in = new ZipFile(inputFile); - FileOutputStream out = new FileOutputStream(outputFile)) { + try (ZipFile in = new ZipFile(inputFile.toFile()); + OutputStream out = Files.newOutputStream(outputFile)) { signer.sign(in, out); } } - private static void checkThatJarIsSigned(String jarFile, boolean multi) + private static void checkThatJarIsSigned(Path jarFile, Map expected) throws Exception { - try (JarFile jf = new JarFile(jarFile, true)) { + try (JarFile jf = new JarFile(jarFile.toFile(), true)) { Enumeration entries = jf.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); if (entry.isDirectory() || isSigningRelated(entry.getName())) { continue; } - InputStream is = jf.getInputStream(entry); - while (is.read() != -1); + try (InputStream is = jf.getInputStream(entry)) { + is.transferTo(OutputStream.nullOutputStream()); + } CodeSigner[] signers = entry.getCodeSigners(); - if (signers == null) { - throw new Exception("JarEntry " + entry.getName() + - " is not signed"); - } else if (multi) { - if (entry.getName().equals(TESTFILE1) && - signers.length != 2) { - throw new Exception("Unexpected number of signers " + - "for " + entry.getName() + ": " + signers.length); - } else if (entry.getName().equals(TESTFILE2) && - signers.length != 1) { - throw new Exception("Unexpected number of signers " + - "for " + entry.getName() + ": " + signers.length); - } + if (!expected.containsKey(entry.getName())) { + throw new Exception("Unexpected entry " + entry.getName()); + } + int expectedSigners = expected.get(entry.getName()); + int actualSigners = signers == null ? 0 : signers.length; + + if (expectedSigners != actualSigners) { + throw new Exception("Unexpected number of signers " + + "for " + entry.getName() + ": " + actualSigners + + ", expected " + expectedSigners); } } } From 701f3e225f392261b2832985aeffbb99918f8901 Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 17 Oct 2023 07:49:12 +0000 Subject: [PATCH 072/177] 8301570: Test runtime/jni/nativeStack/ needs to detach the native thread Backport-of: d269ebbad2286b57802a075091b0cc32110dfcc7 --- .../jtreg/runtime/jni/nativeStack/libnativeStack.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c b/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c index c8b9c9a999e..4087e874c93 100644 --- a/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c +++ b/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c @@ -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 @@ -85,6 +85,13 @@ static void * thread_start(void* unused) { (*env)->ExceptionDescribe(env); exit(1); } + + res = (*jvm)->DetachCurrentThread(jvm); + if (res != JNI_OK) { + fprintf(stderr, "Test ERROR. Can't detach current thread: %d\n", res); + exit(1); + } + printf("Native thread terminating\n"); return NULL; From 5247b7208d990161847567b3a50b6c101b36c430 Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 17 Oct 2023 07:51:49 +0000 Subject: [PATCH 073/177] 8300259: Add test coverage for processing of pending block files in signed JARs Backport-of: c129ce4660e6c9b5365c8bf89fb916e2a7c28e98 --- .../jar/JarFile/SignedJarPendingBlock.java | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java diff --git a/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java b/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java new file mode 100644 index 00000000000..a6f9955a507 --- /dev/null +++ b/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java @@ -0,0 +1,173 @@ +/* + * 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 + * @modules java.base/sun.security.tools.keytool + * @summary JARs with pending block files (where .RSA comes before .SF) should verify correctly + */ + +import jdk.security.jarsigner.JarSigner; + +import java.io.File; +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.security.KeyStore; +import java.util.Collections; +import java.util.jar.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +public class SignedJarPendingBlock { + + public static void main(String[] args) throws Exception { + Path jar = createJarFile(); + Path signed = signJarFile(jar); + Path pendingBlocks = moveBlockFirst(signed); + Path invalid = invalidate(pendingBlocks); + + // 1: Regular signed JAR with no pending blocks should verify + checkSigned(signed); + + // 2: Signed jar with pending blocks should verify + checkSigned(pendingBlocks); + + // 3: Invalid signed jar with pending blocks should throw SecurityException + try { + checkSigned(invalid); + throw new Exception("Expected invalid digest to be detected"); + } catch (SecurityException se) { + // Ignore + } + } + + private static void checkSigned(Path b) throws Exception { + try (JarFile jf = new JarFile(b.toFile(), true)) { + + JarEntry je = jf.getJarEntry("a.txt"); + try (InputStream in = jf.getInputStream(je)) { + in.transferTo(OutputStream.nullOutputStream()); + } + } + } + + /** + * Invalidate signed file by modifying the contents of "a.txt" + */ + private static Path invalidate(Path s) throws Exception{ + Path invalid = Path.of("pending-block-file-invalidated.jar"); + + try (ZipFile zip = new ZipFile(s.toFile()); + ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(invalid))) { + + for (ZipEntry ze : Collections.list(zip.entries())) { + String name = ze.getName(); + out.putNextEntry(new ZipEntry(name)); + + if (name.equals("a.txt")) { + // Change the contents of a.txt to trigger SignatureException + out.write("b".getBytes(StandardCharsets.UTF_8)); + } else { + try (InputStream in = zip.getInputStream(ze)) { + in.transferTo(out); + } + } + } + } + return invalid; + } + + private static Path moveBlockFirst(Path s) throws Exception { + Path b = Path.of("pending-block-file-blockfirst.jar"); + try (ZipFile in = new ZipFile(s.toFile()); + ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(b))) { + + copy("META-INF/MANIFEST.MF", in, out); + + // Switch the order of the RSA and SF files + copy("META-INF/SIGNER.RSA", in, out); + copy("META-INF/SIGNER.SF", in, out); + + copy("a.txt", in, out); + } + return b; + } + + /** + * Copy an entry from a ZipFile to a ZipOutputStream + */ + private static void copy(String name, ZipFile in, ZipOutputStream out) throws Exception { + out.putNextEntry(new ZipEntry(name)); + try (InputStream is = in.getInputStream(in.getEntry(name))) { + is.transferTo(out); + } + } + + private static Path signJarFile(Path j) throws Exception { + Path s = Path.of("pending-block-file-signed.jar"); + + Files.deleteIfExists(Path.of("ks")); + + sun.security.tools.keytool.Main.main( + ("-keystore ks -storepass changeit -keypass changeit -dname" + + " CN=SIGNER" +" -alias r -genkeypair -keyalg rsa").split(" ")); + + char[] pass = "changeit".toCharArray(); + + KeyStore ks = KeyStore.getInstance(new File("ks"), pass); + + KeyStore.PrivateKeyEntry pke = (KeyStore.PrivateKeyEntry) + ks.getEntry("r", new KeyStore.PasswordProtection(pass)); + + JarSigner signer = new JarSigner.Builder(pke) + .digestAlgorithm("SHA-256") + .signatureAlgorithm("SHA256withRSA") + .signerName("SIGNER") + .build(); + + try (ZipFile in = new ZipFile(j.toFile()); + OutputStream out = Files.newOutputStream(s)) { + signer.sign(in, out); + } + + return s; + } + + /** + * Create a jar file with single entry "a.txt" containing "a" + */ + private static Path createJarFile() throws Exception { + Path jar = Path.of("pending-block-file.jar"); + Manifest manifest = new Manifest(); + manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); + try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(jar),manifest)) { + out.putNextEntry(new JarEntry("a.txt")); + out.write("a".getBytes(StandardCharsets.UTF_8)); + } + return jar; + } +} From fbc8bed3f82ea1d0f8dfbd54ea161c6bebbdc01a Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 17 Oct 2023 07:54:26 +0000 Subject: [PATCH 074/177] 8302525: Write a test to check various components send Events while mouse and key are used simultaneously Backport-of: c7517b3decdc55edb7f0ce6e6aa09a6b653c747d --- .../MouseAndKeyEventStressTest.java | 556 ++++++++++++++++++ 1 file changed, 556 insertions(+) create mode 100644 test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java diff --git a/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java b/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java new file mode 100644 index 00000000000..2d9563ab2f1 --- /dev/null +++ b/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java @@ -0,0 +1,556 @@ +/* + * 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 + * 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.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +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.List; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @key headful + * @bug 8302525 + * @summary Test performs various mouse and key operations to check events are getting triggered properly. + * @run main MouseAndKeyEventStressTest + */ +public class MouseAndKeyEventStressTest { + + private volatile static int mouseButtonTypes[] = + { InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, + InputEvent.BUTTON3_DOWN_MASK }; + private volatile static String mouseButtonNames[] = + { "BUTTON1", "BUTTON2", "BUTTON3" }; + + private static Frame frame; + private volatile static Canvas canvas; + private volatile static Button button; + private volatile static List list; + private volatile static Choice choice; + private volatile static Checkbox checkbox; + private volatile static Component[] components; + + private volatile static boolean keyPressed; + private volatile static boolean keyReleased; + private volatile static boolean mousePressed; + private volatile static boolean mouseReleased; + private volatile static boolean actionPerformed; + private volatile static boolean itemEventPerformed; + + private volatile static Robot robot; + private volatile static Point compAt; + private volatile static Dimension compSize; + + private static void initializeGUI() { + frame = new Frame("Test Frame"); + frame.setLayout(new FlowLayout()); + canvas = new Canvas(); + canvas.setSize(50, 50); + canvas.setBackground(Color.red); + button = new Button("Button"); + list = new List(); + list.add("One"); + list.add("Two"); + list.add("Three"); + choice = new Choice(); + for (int i = 0; i < 8; i++) { + choice.add("Choice " + i); + } + choice.select(3); + checkbox = new Checkbox("Checkbox"); + + components = new Component[] { canvas, button, list, choice, checkbox }; + + button.addActionListener((actionEvent) -> { + actionPerformed = true; + System.out.println("button Got an actionEvent: " + actionEvent); + }); + checkbox.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("checkbox Got a ItemEvent: " + itemEvent); + }); + list.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("List Got a ItemEvent: " + itemEvent); + }); + choice.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("Choice Got a ItemEvent: " + itemEvent); + }); + for (int i = 0; i < components.length; i++) { + components[i].addKeyListener(new KeyAdapter() { + + public void keyPressed(KeyEvent ke) { + System.out.println("Got a keyPressedSource: " + ke); + keyPressed = true; + } + + public void keyReleased(KeyEvent ke) { + System.out.println("Got a keyReleasedSource: " + ke); + keyReleased = true; + } + }); + components[i].addMouseListener(new MouseAdapter() { + + public void mousePressed(MouseEvent me) { + mousePressed = true; + System.out.println("Got a mousePressSource: " + me); + } + + public void mouseReleased(MouseEvent me) { + mouseReleased = true; + System.out.println("Got a mouseReleaseSource: " + me); + } + + }); + frame.add(components[i]); + } + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + EventQueue.invokeAndWait(MouseAndKeyEventStressTest::initializeGUI); + doTest(); + } finally { + EventQueue.invokeAndWait(MouseAndKeyEventStressTest::disposeFrame); + } + } + + private static void doTest() throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + robot.waitForIdle(); + + canvasMouseKeyTest(); + buttonMouseKeyTest(); + listMouseKeyTest(); + choiceMouseKeyTest(); + checkboxMouseKeyTest(); + + System.out.println("Test passed!"); + } + + private static void canvasMouseKeyTest() throws Exception { + Component component = canvas; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void buttonMouseKeyTest() throws Exception { + Component component = button; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + + if (!actionPerformed) { + throw new RuntimeException( + "FAIL: action event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void listMouseKeyTest() throws Exception { + Component component = list; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void choiceMouseKeyTest() throws Exception { + Component component = choice; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + if (component instanceof Choice) { + keyType(KeyEvent.VK_ESCAPE); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + boolean isMac = + System.getProperty("os.name").toLowerCase().contains("os x"); + if (isMac) { + // Choice's pop-up menu is drawn in front of choice. So + // choice can not get mouse events generated by robot, + // that's why test is made to dispath event. + MouseEvent me = + new MouseEvent(choice, MouseEvent.MOUSE_RELEASED, + System.currentTimeMillis(), mouseButtonTypes[i], + compSize.width, compSize.height, 1, false); + choice.dispatchEvent(me); + } else { + robot.mouseRelease(mouseButtonTypes[i]); + } + robot.waitForIdle(); + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height + 30); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void checkboxMouseKeyTest() throws Exception { + Component component = checkbox; + robot.waitForIdle(); + for (int i = 0; i < mouseButtonTypes.length; i++) { + + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void resetValues() { + keyPressed = false; + keyReleased = false; + mousePressed = false; + mouseReleased = false; + } + + private static void keyType(int key) throws Exception { + robot.keyPress(key); + robot.keyRelease(key); + } + + public static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } + +} From 92a47bc70293f85f7020b0dccf18ab29a956d384 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 17 Oct 2023 08:32:20 +0000 Subject: [PATCH 075/177] 8315062: [GHA] get-bootjdk action should return the abolute path Backport-of: 99ea8bf2b962011e57d02a93217d65d7259e8f80 --- .github/actions/get-bootjdk/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/get-bootjdk/action.yml b/.github/actions/get-bootjdk/action.yml index 19c3a0128f4..1e569dd47c5 100644 --- a/.github/actions/get-bootjdk/action.yml +++ b/.github/actions/get-bootjdk/action.yml @@ -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 @@ -104,6 +104,6 @@ runs: - name: 'Export path to where BootJDK is installed' id: path-name run: | - # Export the path - echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT + # Export the absolute path + echo "path=`pwd`/bootjdk/jdk" >> $GITHUB_OUTPUT shell: bash From 21536b0fff173f901418cccc01b61ec605cfbc9f Mon Sep 17 00:00:00 2001 From: Amos Date: Thu, 19 Oct 2023 09:15:30 +0000 Subject: [PATCH 076/177] 8278456: Define jtreg jdk_desktop test group time-based sub-tasks for use by headful testing. Reviewed-by: goetz Backport-of: 81c56c700a47c7f1b7855052de17eb88fac84674 --- test/jdk/TEST.groups | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 4073eec2012..c5327e56195 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -376,6 +376,8 @@ jdk_sound = \ jdk_imageio = \ javax/imageio +jdk_accessibility = + jfc_demo = \ demo/jfc @@ -383,14 +385,33 @@ jdk_editpad = \ jdk/editpad jdk_desktop = \ - :jdk_awt \ - :jdk_2d \ - :jdk_beans \ + :jdk_desktop_part1 \ + :jdk_desktop_part2 \ + :jdk_desktop_part3 + +jdk_desktop_part1 = \ + :jdk_client_sanity \ :jdk_swing \ + :jdk_2d \ :jdk_sound \ :jdk_imageio \ + :jdk_editpad \ :jfc_demo \ - :jdk_editpad + :jdk_accessibility \ + :jdk_beans + +jdk_desktop_part2 = \ + :jdk_awt \ + -java/awt/Component \ + -java/awt/Modal \ + -java/awt/datatransfer \ + -java/awt/Window + +jdk_desktop_part3 = \ + java/awt/Component \ + java/awt/Modal \ + java/awt/datatransfer \ + java/awt/Window # SwingSet3 tests. jdk_client_sanity = \ From 0b60ec791abf446d2782c31ab8360eeb9d6ac1c8 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 19 Oct 2023 09:17:33 +0000 Subject: [PATCH 077/177] 8297640: Increase buffer size for buf (insert_features_names) in Abstract_VM_Version::insert_features_names Backport-of: 2f83b5c487f112c175d081ca5882f5032518937a --- src/hotspot/cpu/x86/vm_version_x86.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 6284bb34560..eb96bd5e876 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -745,7 +745,7 @@ void VM_Version::get_processor_features() { } } - char buf[512]; + char buf[1024]; jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d microcode 0x%x" "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", From d439c4a3f6de36eba2bbf8dacac5bee1ed66235d Mon Sep 17 00:00:00 2001 From: amosshi Date: Thu, 19 Oct 2023 09:22:19 +0000 Subject: [PATCH 078/177] 8297296: java/awt/Mouse/EnterExitEvents/DragWindowTest.java fails with "No MouseReleased event on label!" Reviewed-by: goetz Backport-of: 0ed6d0b456e58e4122b97c3d12faabada0d8c530 --- test/jdk/ProblemList.txt | 1 - .../Mouse/EnterExitEvents/DragWindowTest.java | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 21d0dcaef7e..d1b7174e86f 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -370,7 +370,6 @@ java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java 8198665 macosx-all 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/DragWindowTest.java 8023562 macosx-all java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all diff --git a/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java b/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java index 4067bcea32e..4f789668c4a 100644 --- a/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java +++ b/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java @@ -34,11 +34,23 @@ * @run main DragWindowTest */ -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import java.util.concurrent.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +import java.util.concurrent.Callable; import test.java.awt.regtesthelpers.Util; @@ -55,7 +67,7 @@ public class DragWindowTest { public static void main(String[] args) throws Exception { Robot robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); SwingUtilities.invokeAndWait(new Runnable() { @@ -65,6 +77,7 @@ public void run() { } }); + robot.delay(250); robot.waitForIdle(); Point pointToClick = Util.invokeOnEDT(new Callable() { @@ -134,6 +147,7 @@ private static void createAndShowGUI() { panel.add(button, BorderLayout.CENTER); frame.getContentPane().add(panel); + frame.setLocationRelativeTo(null); frame.setVisible(true); } From abeacbfa205e4bfdf314f16e90726ba10f63c286 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 19 Oct 2023 09:27:39 +0000 Subject: [PATCH 079/177] 8299255: Unexpected round errors in FreetypeFontScaler Backport-of: 26868c1ac471c3b305b1d15e3075de0baa9319d2 --- .../native/libfontmanager/freetypeScaler.c | 8 +-- .../awt/FontClass/FontScalerRoundTest.java | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 test/jdk/java/awt/FontClass/FontScalerRoundTest.java diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c index 20ccde96693..83a2182ca03 100644 --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -443,10 +443,10 @@ Java_sun_font_FreetypeFontScaler_createScalerContextNative( ptsz = 1.0; } context->ptsz = (int)(ptsz * 64); - context->transform.xx = FloatToFTFixed((float)dmat[0]/ptsz); - context->transform.yx = -FloatToFTFixed((float)dmat[1]/ptsz); - context->transform.xy = -FloatToFTFixed((float)dmat[2]/ptsz); - context->transform.yy = FloatToFTFixed((float)dmat[3]/ptsz); + context->transform.xx = FloatToFTFixed((float)(dmat[0]/ptsz)); + context->transform.yx = -FloatToFTFixed((float)(dmat[1]/ptsz)); + context->transform.xy = -FloatToFTFixed((float)(dmat[2]/ptsz)); + context->transform.yy = FloatToFTFixed((float)(dmat[3]/ptsz)); context->aaType = aa; context->fmType = fm; diff --git a/test/jdk/java/awt/FontClass/FontScalerRoundTest.java b/test/jdk/java/awt/FontClass/FontScalerRoundTest.java new file mode 100644 index 00000000000..49901683522 --- /dev/null +++ b/test/jdk/java/awt/FontClass/FontScalerRoundTest.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8299255 + * @summary Verify no round error in Font scaling + */ + +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; +import java.awt.font.LineMetrics; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; + +public class FontScalerRoundTest { + public static void main(String[] args) { + final double SCALE = 4096.0; + final double STEP = 0.0001; + final double LIMIT = STEP * 100.0; + + BufferedImage img = new BufferedImage(100, 100, + BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = img.createGraphics(); + FontRenderContext frc = g2d.getFontRenderContext(); + + Font font = new Font(Font.DIALOG, Font.PLAIN, 1); + float h1 = getScaledHeight(font, frc, SCALE); + float h2 = getScaledHeight(font, frc, SCALE + STEP); + float diff = Math.abs(h1 - h2); + + if (diff > LIMIT) { + throw new RuntimeException("Font metrix had round error " + + h1 + "," + h2); + } + } + + private static float getScaledHeight(Font font, + FontRenderContext frc, + double scale) { + AffineTransform at = new AffineTransform(scale, 0.0, 0.0, scale, + 0.0, 0.0); + Font transFont = font.deriveFont(at); + LineMetrics m = transFont.getLineMetrics("0", frc); + return m.getHeight(); + } +} + From 639afbe61ac91ce7f926f01a0f8e63dd694723f5 Mon Sep 17 00:00:00 2001 From: amosshi Date: Thu, 19 Oct 2023 09:32:32 +0000 Subject: [PATCH 080/177] 8255548: Missing coverage for javax.xml.crypto.dom.DOMCryptoContext Reviewed-by: goetz Backport-of: 76cda9f44a80b1979e6e1b7a21431ef631f80782 --- .../xml/crypto/dsig/GenerationTests.java | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/test/jdk/javax/xml/crypto/dsig/GenerationTests.java b/test/jdk/javax/xml/crypto/dsig/GenerationTests.java index f1f5751ab14..0c1b784ecd3 100644 --- a/test/jdk/javax/xml/crypto/dsig/GenerationTests.java +++ b/test/jdk/javax/xml/crypto/dsig/GenerationTests.java @@ -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 @@ -30,6 +30,8 @@ * java.base/sun.security.x509 * java.xml.crypto/org.jcp.xml.dsig.internal.dom * jdk.httpserver/com.sun.net.httpserver + * @library /test/lib + * @build jdk.test.lib.Asserts * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java GenerationTests.java * @run main/othervm/timeout=300 -Dsun.net.httpserver.nodelay=true GenerationTests @@ -92,6 +94,8 @@ import javax.xml.transform.stream.StreamResult; import org.w3c.dom.*; +import jdk.test.lib.Asserts; + /** * Test that recreates merlin-xmldsig-twenty-three test vectors (and more) * but with different keys and X.509 data. @@ -286,6 +290,7 @@ private static enum KeyInfoType { public static void main(String args[]) throws Exception { setup(); + test_context_iterator(); test_create_signature_enveloped_dsa(1024); test_create_signature_enveloped_dsa(2048); test_create_signature_enveloping_b64_dsa(); @@ -1863,6 +1868,48 @@ static boolean test_create_detached_signature0(String canonicalizationMethod, return true; } + static boolean test_context_iterator() throws Exception { + System.out.println("Testing context iterator() method."); + + Reference ref = fac.newReference("#object", + fac.newDigestMethod(DigestMethod.SHA512, null)); + SignedInfo si = fac.newSignedInfo(withoutComments, rsaSha512, + Collections.singletonList(ref)); + + Document doc = db.newDocument(); + XMLObject obj = fac.newXMLObject(Collections.singletonList( + new DOMStructure(doc.createTextNode("test text"))), "object", + null, null); + + DOMSignContext dsc = new DOMSignContext(signingKey, doc); + Asserts.assertNotNull(dsc.iterator()); + Asserts.assertFalse(dsc.iterator().hasNext()); + + String namespaceURI = "https://example.com/ns"; + String idAttrValue = "id1"; + String elementQualifiedName = "test:data"; + + Element elm = doc.createElementNS(namespaceURI, elementQualifiedName); + elm.setAttributeNS(namespaceURI, "test:id", idAttrValue); + dsc.setIdAttributeNS(elm, namespaceURI, "id"); + + Iterator> iter = dsc.iterator(); + Asserts.assertTrue(dsc.iterator().hasNext()); + + Map.Entry element = iter.next(); + Asserts.assertEquals(element.getKey(), idAttrValue); + Asserts.assertEquals(element.getValue().getNodeName(), elementQualifiedName); + + try { + iter.remove(); + throw new RuntimeException( + "The expected UnsupportedOperationException was not thrown."); + } catch (UnsupportedOperationException exc) { + // this is expected + } + return true; + } + private static Key[] getCachedKeys(String signatureMethod) { return cachedKeys.computeIfAbsent(signatureMethod, sm -> { try { From fb8676a9b5c9e42608397a24e82c5e8545fdd8b8 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 24 Oct 2023 07:30:46 +0000 Subject: [PATCH 081/177] 8223788: [macos] JSpinner buttons in JColorChooser dialog may capture focus using TAB Key. Backport-of: 861e1addda4a547c319c7b369f042c7aab8bf36f --- .../classes/com/apple/laf/AquaSpinnerUI.java | 1 + .../8223788/JSpinnerButtonFocusTest.java | 109 ++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 test/jdk/javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java index 8aea5e0dd92..ef9c5243704 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java @@ -556,6 +556,7 @@ public SpinPainter(final AbstractButton top, final AbstractButton bottom) { if (bottom != null) { fBottomModel = bottom.getModel(); } + setFocusable(false); } @Override diff --git a/test/jdk/javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java b/test/jdk/javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java new file mode 100644 index 00000000000..842a62558cf --- /dev/null +++ b/test/jdk/javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @key headful + * @bug 8223788 + * @summary JSpinner buttons in JColorChooser dialog may capture focus + * using TAB Key + * @run main JSpinnerButtonFocusTest + */ + +import java.awt.Robot; +import java.awt.BorderLayout; +import java.awt.ContainerOrderFocusTraversalPolicy; +import java.awt.event.KeyEvent; +import javax.swing.JFrame; +import javax.swing.JSpinner; +import javax.swing.JSpinner.DefaultEditor; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +public class JSpinnerButtonFocusTest { + static JFrame frame; + static Robot robot; + static JSpinner spinner1, spinner2; + static DefaultEditor editor2; + static boolean jTextFieldFocusStatus; + + public static void main(String args[]) throws Exception { + + for (UIManager.LookAndFeelInfo LF : UIManager.getInstalledLookAndFeels()) { + try { + UIManager.setLookAndFeel(LF.getClassName()); + robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame(); + spinner1 = new JSpinner(); + spinner2 = new JSpinner(); + + frame.setLayout(new BorderLayout()); + frame.getContentPane().add(spinner1, BorderLayout.NORTH); + frame.getContentPane().add(spinner2, BorderLayout.SOUTH); + + ((DefaultEditor)spinner1.getEditor()).setFocusable(false); + spinner1.setFocusable(false); + + editor2 = (DefaultEditor) spinner2.getEditor(); + editor2.setFocusable(false); + spinner2.setFocusable(false); + + frame.setFocusTraversalPolicy( + new ContainerOrderFocusTraversalPolicy()); + frame.setFocusTraversalPolicyProvider(true); + + frame.pack(); + frame.setVisible(true); + }); + + robot.waitForIdle(); + pressTab(5); + robot.waitForIdle(); + + SwingUtilities.invokeAndWait(() -> { + jTextFieldFocusStatus = editor2.getTextField().isFocusOwner(); + }); + + if (!jTextFieldFocusStatus) { + throw new RuntimeException( + "Spinner's Text Field doesn't have focus "); + } + } finally { + if(frame != null){ + SwingUtilities.invokeAndWait(frame::dispose); + } + } + } + } + + public static void pressTab(int n) { + for (int i = 0; i < n; i++) { + robot.keyPress(KeyEvent.VK_TAB); + robot.keyRelease(KeyEvent.VK_TAB); + } + } +} From c12421376a1d4945b48ab4c6d8dc2e83246d1889 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 24 Oct 2023 07:32:47 +0000 Subject: [PATCH 082/177] 8153090: TAB key cannot change input focus after the radio button in the Color Selection dialog Backport-of: b5e162200b684897e0ec2547dc2b3f854c0da8e4 --- .../share/classes/javax/swing/colorchooser/ColorPanel.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/java.desktop/share/classes/javax/swing/colorchooser/ColorPanel.java b/src/java.desktop/share/classes/javax/swing/colorchooser/ColorPanel.java index 07616ac2c0a..ffe0fc43c04 100644 --- a/src/java.desktop/share/classes/javax/swing/colorchooser/ColorPanel.java +++ b/src/java.desktop/share/classes/javax/swing/colorchooser/ColorPanel.java @@ -99,8 +99,6 @@ final class ColorPanel extends JPanel implements ActionListener { add(spinner.getSpinner(), gbc); gbc.insets.top = 5; } - setFocusTraversalPolicy(new ContainerOrderFocusTraversalPolicy()); - setFocusTraversalPolicyProvider(true); setFocusable(false); this.model = model; From 129e8567625471643706ebfdc30f89bd20a1eadd Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 25 Oct 2023 07:58:35 +0000 Subject: [PATCH 083/177] 8266249: javax/swing/JPopupMenu/7156657/bug7156657.java fails on macOS Backport-of: 9b769550242e8bf6f9e783bf0d6f4a87d0c6376d --- .../swing/JPopupMenu/7156657/bug7156657.java | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java b/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java index a018ad0455d..b6f4a4c3aff 100644 --- a/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java +++ b/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java @@ -25,12 +25,18 @@ import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Window; import java.awt.image.BufferedImage; +import java.io.File; import java.util.concurrent.Callable; +import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JMenuItem; import javax.swing.JPanel; @@ -103,24 +109,56 @@ public void run() { Rectangle popupRectangle = Util.invokeOnEDT(new Callable() { @Override public Rectangle call() throws Exception { - return popupMenu.getBounds(); + return new Rectangle(popupMenu.getLocationOnScreen(), + popupMenu.getSize()); } }); BufferedImage redBackgroundCapture = robot.createScreenCapture(popupRectangle); + BufferedImage redFrame = robot.createScreenCapture(frame.getBounds()); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { lowerFrame.getContentPane().setBackground(Color.GREEN); + lowerFrame.invalidate(); } }); robot.waitForIdle(); + robot.delay(1000); // Give frame time to repaint BufferedImage greenBackgroundCapture = robot.createScreenCapture(popupRectangle); + BufferedImage greenFrame = robot.createScreenCapture(frame.getBounds()); if (Util.compareBufferedImages(redBackgroundCapture, greenBackgroundCapture)) { + try { + GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); + for (int i = 0; i < devices.length; i++) { + GraphicsConfiguration[] screens = devices[i].getConfigurations(); + for (int j = 0; j < screens.length; j++) { + BufferedImage fullScreen = robot.createScreenCapture(screens[j].getBounds()); + if (screens[j].getBounds().intersects(popupRectangle)) { + Graphics g = fullScreen.getGraphics(); + g.setColor(Color.CYAN); + g.drawRect(popupRectangle.x - 1, popupRectangle.y - 1, + popupRectangle.width + 2, popupRectangle.height + 2); + g.dispose(); + } + ImageIO.write(fullScreen, "png", new File("dev" + i + "scr" + j + ".png")); + } + } + ImageIO.write(redFrame, "png", new File("redframe.png")); + ImageIO.write(redBackgroundCapture, "png", new File("redbg.png")); + ImageIO.write(greenFrame, "png", new File("greenframe.png")); + ImageIO.write(greenBackgroundCapture, "png", new File("greenbg.png")); + } finally { + SwingUtilities.invokeAndWait(() -> { + frame.dispose(); + lowerFrame.dispose(); + }); + } + robot.waitForIdle(); throw new RuntimeException("The test failed"); } @@ -148,8 +186,8 @@ public static void setOpaque(Window window, boolean opaque) { private static JFrame createFrame() { JFrame result = new JFrame(); - result.setLocation(0, 0); result.setSize(400, 300); + result.setLocationRelativeTo(null); result.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); result.setUndecorated(true); From 2835c6a1a6db5398bd11c5a71d3e186bf5aa61a4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 25 Oct 2023 08:00:28 +0000 Subject: [PATCH 084/177] 8254711: Add java.security.Provider.getService JFR Event 8294673: JFR: Add SecurityProviderService#threshold to TestActiveSettingEvent.java Reviewed-by: mbaesken Backport-of: bc2af47e1e4e6e96020e03a60ce098ddd17f63ba --- .../share/classes/java/security/Provider.java | 29 +++- .../event/SecurityProviderServiceEvent.java | 45 +++++ .../events/SecurityProviderServiceEvent.java | 48 ++++++ .../jfr/internal/instrument/JDKEvents.java | 3 + src/jdk.jfr/share/conf/jfr/default.jfc | 5 + src/jdk.jfr/share/conf/jfr/profile.jfc | 5 + .../metadata/TestDefaultConfigurations.java | 1 + .../event/runtime/TestActiveSettingEvent.java | 1 + .../TestSecurityProviderServiceEvent.java | 157 ++++++++++++++++++ test/lib/jdk/test/lib/jfr/EventNames.java | 1 + 10 files changed, 286 insertions(+), 9 deletions(-) create mode 100644 src/java.base/share/classes/jdk/internal/event/SecurityProviderServiceEvent.java create mode 100644 src/jdk.jfr/share/classes/jdk/jfr/events/SecurityProviderServiceEvent.java create mode 100644 test/jdk/jdk/jfr/event/security/TestSecurityProviderServiceEvent.java diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java index 1f0bbfd766a..713087aeb3e 100644 --- a/src/java.base/share/classes/java/security/Provider.java +++ b/src/java.base/share/classes/java/security/Provider.java @@ -25,6 +25,8 @@ package java.security; +import jdk.internal.event.SecurityProviderServiceEvent; + import java.io.*; import java.util.*; import static java.util.Locale.ENGLISH; @@ -1278,19 +1280,28 @@ public Service getService(String type, String algorithm) { key = new ServiceKey(type, algorithm, false); previousKey = key; } + Service s = null; if (!serviceMap.isEmpty()) { - Service s = serviceMap.get(key); - if (s != null) { - return s; - } + s = serviceMap.get(key); } - synchronized (this) { - ensureLegacyParsed(); - if (legacyMap != null && !legacyMap.isEmpty()) { - return legacyMap.get(key); + if (s == null) { + synchronized (this) { + ensureLegacyParsed(); + if (legacyMap != null && !legacyMap.isEmpty()) { + s = legacyMap.get(key); + } } } - return null; + + if (s != null && SecurityProviderServiceEvent.isTurnedOn()) { + var e = new SecurityProviderServiceEvent(); + e.provider = getName(); + e.type = type; + e.algorithm = algorithm; + e.commit(); + } + + return s; } // ServiceKey from previous getService() call diff --git a/src/java.base/share/classes/jdk/internal/event/SecurityProviderServiceEvent.java b/src/java.base/share/classes/jdk/internal/event/SecurityProviderServiceEvent.java new file mode 100644 index 00000000000..2c2c487849b --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/event/SecurityProviderServiceEvent.java @@ -0,0 +1,45 @@ +/* + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.event; + +/** + * Event recording details of Provider.getService(String type, String algorithm) calls + */ + +public final class SecurityProviderServiceEvent extends Event { + private final static SecurityProviderServiceEvent EVENT = new SecurityProviderServiceEvent(); + + /** + * Returns {@code true} if event is enabled, {@code false} otherwise. + */ + public static boolean isTurnedOn() { + return EVENT.isEnabled(); + } + + public String type; + public String algorithm; + public String provider; +} diff --git a/src/jdk.jfr/share/classes/jdk/jfr/events/SecurityProviderServiceEvent.java b/src/jdk.jfr/share/classes/jdk/jfr/events/SecurityProviderServiceEvent.java new file mode 100644 index 00000000000..97a5150561c --- /dev/null +++ b/src/jdk.jfr/share/classes/jdk/jfr/events/SecurityProviderServiceEvent.java @@ -0,0 +1,48 @@ +/* + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.jfr.events; + +import jdk.jfr.Category; +import jdk.jfr.Description; +import jdk.jfr.Label; +import jdk.jfr.Name; +import jdk.jfr.internal.MirrorEvent; + +@Category({"Java Development Kit", "Security"}) +@Label("Security Provider Instance Request") +@Name("jdk.SecurityProviderService") +@Description("Details of Provider.getInstance(String type, String algorithm) calls") +@MirrorEvent(className = "jdk.internal.event.SecurityProviderServiceEvent") +public final class SecurityProviderServiceEvent extends AbstractJDKEvent { + @Label("Type of Service") + public String type; + + @Label("Algorithm Name") + public String algorithm; + + @Label("Security Provider") + public String provider; +} diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java index c8c9af10888..cf64f554e13 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java @@ -39,6 +39,7 @@ import jdk.jfr.events.FileWriteEvent; import jdk.jfr.events.DeserializationEvent; import jdk.jfr.events.SecurityPropertyModificationEvent; +import jdk.jfr.events.SecurityProviderServiceEvent; import jdk.jfr.events.SocketReadEvent; import jdk.jfr.events.SocketWriteEvent; import jdk.jfr.events.TLSHandshakeEvent; @@ -57,6 +58,7 @@ public final class JDKEvents { private static final Class[] mirrorEventClasses = { DeserializationEvent.class, SecurityPropertyModificationEvent.class, + SecurityProviderServiceEvent.class, TLSHandshakeEvent.class, X509CertificateEvent.class, X509ValidationEvent.class @@ -75,6 +77,7 @@ public final class JDKEvents { ActiveRecordingEvent.class, jdk.internal.event.DeserializationEvent.class, jdk.internal.event.SecurityPropertyModificationEvent.class, + jdk.internal.event.SecurityProviderServiceEvent.class, jdk.internal.event.TLSHandshakeEvent.class, jdk.internal.event.X509CertificateEvent.class, jdk.internal.event.X509ValidationEvent.class diff --git a/src/jdk.jfr/share/conf/jfr/default.jfc b/src/jdk.jfr/share/conf/jfr/default.jfc index 0a2838d90de..ed63b678777 100644 --- a/src/jdk.jfr/share/conf/jfr/default.jfc +++ b/src/jdk.jfr/share/conf/jfr/default.jfc @@ -613,6 +613,11 @@ true + + false + true + + false true diff --git a/src/jdk.jfr/share/conf/jfr/profile.jfc b/src/jdk.jfr/share/conf/jfr/profile.jfc index 140aeda7040..b8dc6506846 100644 --- a/src/jdk.jfr/share/conf/jfr/profile.jfc +++ b/src/jdk.jfr/share/conf/jfr/profile.jfc @@ -613,6 +613,11 @@ true + + false + true + + false true diff --git a/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java b/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java index 1dbcceb216b..d0e252a16a6 100644 --- a/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java +++ b/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java @@ -174,6 +174,7 @@ private static Document createDocument(String content) throws ParserConfiguratio insertSetting(doc, EventNames.JavaExceptionThrow, "threshold", "0 ns"); insertSetting(doc, EventNames.JavaErrorThrow, "threshold", "0 ns"); insertSetting(doc, EventNames.SecurityProperty, "threshold", "0 ns"); + insertSetting(doc, EventNames.SecurityProviderService, "threshold", "0 ns"); insertSetting(doc, EventNames.TLSHandshake, "threshold", "0 ns"); insertSetting(doc, EventNames.X509Certificate, "threshold", "0 ns"); insertSetting(doc, EventNames.X509Validation, "threshold", "0 ns"); diff --git a/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java b/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java index 8d3864c2164..ddd5ebdeb24 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java @@ -206,6 +206,7 @@ private static void testSettingConfiguration(String configurationName) throws Ex settingValues.put(EventNames.X509Certificate + "#threshold", "0 ns"); settingValues.put(EventNames.X509Validation + "#threshold", "0 ns"); settingValues.put(EventNames.Deserialization + "#threshold", "0 ns"); + settingValues.put(EventNames.SecurityProviderService + "#threshold", "0 ns"); try (Recording recording = new Recording(c)) { Map eventTypes = new HashMap<>(); diff --git a/test/jdk/jdk/jfr/event/security/TestSecurityProviderServiceEvent.java b/test/jdk/jdk/jfr/event/security/TestSecurityProviderServiceEvent.java new file mode 100644 index 00000000000..a886a7e3b20 --- /dev/null +++ b/test/jdk/jdk/jfr/event/security/TestSecurityProviderServiceEvent.java @@ -0,0 +1,157 @@ +/* + * 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.event.security; + +import java.security.*; +import java.security.cert.CertPathBuilder; +import java.util.Collections; +import java.util.List; +import java.util.function.*; + +import jdk.jfr.Recording; +import jdk.jfr.consumer.RecordedEvent; +import jdk.test.lib.Asserts; +import jdk.test.lib.jfr.Events; +import jdk.test.lib.jfr.EventNames; + +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; + +/* + * @test + * @bug 8254711 + * @summary Add JFR events for security crypto algorithms + * @key jfr + * @requires vm.hasJFR + * @library /test/lib + * @modules jdk.jfr/jdk.jfr.events + * @run main/othervm jdk.jfr.event.security.TestSecurityProviderServiceEvent + */ +public class TestSecurityProviderServiceEvent { + + public static void main(String[] args) throws Exception { + testAlg(cipherFunc, "AES", "SunJCE", + "SunEC", "Cipher", 1, Collections.emptyList()); + testAlg(signatureFunc, "SHA256withRSA", "SunRsaSign", + "SunEC", "Signature", 2, List.of("MessageDigest")); + testAlg(messageDigestFunc, "SHA-512", "SUN", + "SunEC", "MessageDigest", 1, Collections.emptyList()); + testAlg(keystoreFunc, "PKCS12", "SUN", + "SunEC", "KeyStore", 1, Collections.emptyList()); + testAlg(certPathBuilderFunc, "PKIX", "SUN", + "SunEC", "CertPathBuilder", 2, List.of("CertificateFactory")); + } + + private static void testAlg(BiFunction bif, String alg, + String workingProv, String brokenProv, String algType, + int expected, List other) throws Exception { + // bootstrap security Provider services + Provider p = bif.apply(alg, workingProv); + + try (Recording recording = new Recording()) { + recording.enable(EventNames.SecurityProviderService); + recording.start(); + p = bif.apply(alg, workingProv); + bif.apply(alg, brokenProv); + recording.stop(); + List events = Events.fromRecording(recording); + Asserts.assertEquals(events.size(), expected, "Incorrect number of events"); + assertEvent(events, algType, alg, p.getName(), other); + } + } + + private static BiFunction cipherFunc = (s1, p1 ) -> { + Cipher c; + try { + c = Cipher.getInstance(s1, p1); + return c.getProvider(); + } catch (NoSuchAlgorithmException | NoSuchPaddingException | NoSuchProviderException e) { + // expected + } + return null; + }; + + private static BiFunction signatureFunc = (s1, p1 ) -> { + Signature s; + try { + s = Signature.getInstance(s1, p1); + return s.getProvider(); + } catch (NoSuchAlgorithmException | NoSuchProviderException e) { + // expected + } + return null; + }; + + private static BiFunction messageDigestFunc = (s1, p1 ) -> { + MessageDigest md; + try { + md = MessageDigest.getInstance(s1, p1); + return md.getProvider(); + } catch (NoSuchAlgorithmException | NoSuchProviderException e) { + // expected + } + return null; + }; + + private static BiFunction keystoreFunc = (s1, p1 ) -> { + KeyStore ks; + try { + ks = KeyStore.getInstance(s1, p1); + return ks.getProvider(); + } catch (NoSuchProviderException | KeyStoreException e) { + // expected + } + return null; + }; + + private static BiFunction certPathBuilderFunc = (s1, p1 ) -> { + CertPathBuilder cps; + try { + cps = CertPathBuilder.getInstance(s1, p1); + return cps.getProvider(); + } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + // expected + } + return null; + }; + + private static void assertEvent(List events, String type, + String alg, String workingProv, List other) { + boolean secondaryEventOK = other.isEmpty() ? true : false; + for (RecordedEvent e : events) { + if (other.contains(e.getValue("type"))) { + // secondary operation in service stack while constructing this request + secondaryEventOK = true; + continue; + } + Events.assertField(e, "provider").equal(workingProv); + Events.assertField(e, "type").equal(type); + Events.assertField(e, "algorithm").equal(alg); + } + if (!secondaryEventOK) { + throw new RuntimeException("Secondary events missing"); + } + + } +} diff --git a/test/lib/jdk/test/lib/jfr/EventNames.java b/test/lib/jdk/test/lib/jfr/EventNames.java index ffdc88d26b3..df834c7fd31 100644 --- a/test/lib/jdk/test/lib/jfr/EventNames.java +++ b/test/lib/jdk/test/lib/jfr/EventNames.java @@ -175,6 +175,7 @@ public class EventNames { public final static String X509Certificate = PREFIX + "X509Certificate"; public final static String X509Validation = PREFIX + "X509Validation"; public final static String SecurityProperty = PREFIX + "SecurityPropertyModification"; + public final static String SecurityProviderService = PREFIX + "SecurityProviderService"; public final static String Deserialization = PREFIX + "Deserialization"; // Flight Recorder From ce38b3ee6021464f6cb710dbf4801e2447fa50a8 Mon Sep 17 00:00:00 2001 From: Kangcheng Xu Date: Wed, 25 Oct 2023 08:03:23 +0000 Subject: [PATCH 085/177] 8273804: Platform.isTieredSupported should handle the no-compiler case Backport-of: 46af82e5b0d176e340f46125f8a3bb17e56bd7b3 --- test/lib/jdk/test/lib/Platform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index f4ee0546c70..5b3f1889cb7 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -82,7 +82,7 @@ public static boolean isEmulatedClient() { } public static boolean isTieredSupported() { - return compiler.contains("Tiered Compilers"); + return (compiler != null) && compiler.contains("Tiered Compilers"); } public static boolean isInt() { From a28f66b45658e3b88b7761058d1acf22d53bc846 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 25 Oct 2023 08:09:42 +0000 Subject: [PATCH 086/177] 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines Backport-of: a2f67660f088559ce49f73da7401801fb826028b --- .../java/awt/PopupMenu/PopupMenuLocation.java | 81 +++++++++++++------ 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/test/jdk/java/awt/PopupMenu/PopupMenuLocation.java b/test/jdk/java/awt/PopupMenu/PopupMenuLocation.java index 713eb1d706a..197fa8a6927 100644 --- a/test/jdk/java/awt/PopupMenu/PopupMenuLocation.java +++ b/test/jdk/java/awt/PopupMenu/PopupMenuLocation.java @@ -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 @@ -33,10 +33,13 @@ import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.*; +import java.io.File; +import java.util.stream.IntStream; +import javax.imageio.ImageIO; -/** +/* * @test * @key headful * @bug 8160270 @@ -47,43 +50,59 @@ public final class PopupMenuLocation { private static final int SIZE = 350; public static final String TEXT = "Long-long-long-long-long-long-long text in the item-"; + public static final int OFFSET = 50; private static volatile boolean action = false; + private static Robot robot; + private static Frame frame; + private static Rectangle screenBounds; + public static void main(final String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(200); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] sds = ge.getScreenDevices(); for (GraphicsDevice sd : sds) { GraphicsConfiguration gc = sd.getDefaultConfiguration(); - Rectangle bounds = gc.getBounds(); - Point point = new Point(bounds.x, bounds.y); + screenBounds = gc.getBounds(); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc); - while (point.y < bounds.y + bounds.height - insets.bottom - SIZE) { - while (point.x - < bounds.x + bounds.width - insets.right - SIZE) { + Point point = new Point(screenBounds.x + insets.left, + screenBounds.y + insets.top); + final int yBound = screenBounds.y + screenBounds.height + - insets.bottom - SIZE; + final int xBound = screenBounds.x + screenBounds.width + - insets.right - SIZE; + while (point.y < yBound) { + while (point.x < xBound) { test(point); - point.translate(bounds.width / 5, 0); + point.translate(screenBounds.width / 5, 0); } - point.setLocation(bounds.x, point.y + bounds.height / 5); + point.setLocation(screenBounds.x, + point.y + screenBounds.height / 5); } } } - private static void test(final Point tmp) throws Exception { + private static void test(final Point loc) { + frame = new Frame(); PopupMenu pm = new PopupMenu(); - for (int i = 1; i < 7; i++) { - pm.add(TEXT + i); - } - pm.addActionListener(e -> action = true); - Frame frame = new Frame(); + IntStream.rangeClosed(1, 6).forEach(i -> pm.add(TEXT + i)); + pm.addActionListener(e -> { + action = true; + System.out.println(" Got action event " + e); + }); + try { + frame.setUndecorated(true); frame.setAlwaysOnTop(true); frame.setLayout(new FlowLayout()); frame.add(pm); frame.pack(); frame.setSize(SIZE, SIZE); + frame.setLocation(loc); frame.setVisible(true); - frame.setLocation(tmp.x, tmp.y); + frame.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { show(e); @@ -105,23 +124,37 @@ private void show(MouseEvent e) { } } - private static void openPopup(final Frame frame) throws Exception { - Robot robot = new Robot(); - robot.setAutoDelay(200); + private static void openPopup(final Frame frame) { robot.waitForIdle(); Point pt = frame.getLocationOnScreen(); - robot.mouseMove(pt.x + frame.getWidth() / 2, pt.y + 50); + int x = pt.x + frame.getWidth() / 2; + int y = pt.y + OFFSET; + robot.mouseMove(x, y); robot.mousePress(InputEvent.BUTTON3_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); - int x = pt.x + frame.getWidth() / 2; - int y = pt.y + 130; + robot.delay(200); + y += OFFSET; robot.mouseMove(x, y); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); if (!action) { - throw new RuntimeException(); + captureScreen(); + throw new RuntimeException( + "Failed, didn't receive the PopupMenu ActionEvent on " + + "frame= " + frame + ", isFocused = " + frame.isFocused()); } action = false; } + + private static void captureScreen() { + try { + ImageIO.write(robot.createScreenCapture(screenBounds), + "png", + new File("screen.png")); + } catch (Exception e) { + e.printStackTrace(); + } + } + } From c922821cfc98de7a9a9dbfb4978c0449495915b1 Mon Sep 17 00:00:00 2001 From: amosshi Date: Wed, 25 Oct 2023 08:12:27 +0000 Subject: [PATCH 087/177] 8301167: Update VerifySignedJar to actually exercise and test verification Reviewed-by: phh Backport-of: 05ea083b0563ddacf3e38dc329ba00dc4bac9b29 --- .../util/jar/JarFile/VerifySignedJar.java | 125 ++++++++++++++---- test/jdk/java/util/jar/JarFile/thawjar.jar | Bin 2441 -> 0 bytes 2 files changed, 99 insertions(+), 26 deletions(-) diff --git a/test/jdk/java/util/jar/JarFile/VerifySignedJar.java b/test/jdk/java/util/jar/JarFile/VerifySignedJar.java index 1f4db736e8f..e6bec92215c 100644 --- a/test/jdk/java/util/jar/JarFile/VerifySignedJar.java +++ b/test/jdk/java/util/jar/JarFile/VerifySignedJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,48 +23,121 @@ /** * @test + * @library /test/lib + * @modules java.base/sun.security.x509 + * @modules java.base/sun.security.tools.keytool * @bug 4419266 4842702 * @summary Make sure verifying signed Jar doesn't throw SecurityException */ -import java.io.File; -import java.util.jar.JarFile; +import jdk.security.jarsigner.JarSigner; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; + +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.KeyStore; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.Collections; +import java.util.Objects; +import java.util.concurrent.TimeUnit; import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; -import java.util.Enumeration; +import java.util.zip.ZipFile; + +import static jdk.test.lib.Utils.runAndCheckException; + public class VerifySignedJar { - 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 { - File f = new File(System.getProperty("test.src", "."), "thawjar.jar"); - JarFile jf = new JarFile(f); - try { - // Read entries via Enumeration - for (Enumeration e = jf.entries(); e.hasMoreElements();) - jf.getInputStream((ZipEntry) e.nextElement()); - // Read entry by name - ZipEntry ze = jf.getEntry("getprop.class"); - JarEntry je = jf.getJarEntry("getprop.class"); + Path j = createJar(); + Path s = signJar(j, keyEntry("cn=duke")); + + try (JarFile jf = new JarFile(s.toFile())) { - // Make sure we throw NPE on null objects - try { Unreached (jf.getEntry(null)); } - catch (NullPointerException e) {} + for (JarEntry e: Collections.list(jf.entries())) { + // Reading entry to trigger verification + jf.getInputStream(e).transferTo(OutputStream.nullOutputStream()); + // Check that all regular files are signed by duke + if (!e.getName().startsWith("META-INF/")) { + checkSignedBy(e, "cn=duke"); + } + } - try { Unreached (jf.getJarEntry(null)); } - catch (NullPointerException e) {} + // Read ZIP and JAR entries by name + Objects.requireNonNull(jf.getEntry("getprop.class")); + Objects.requireNonNull(jf.getJarEntry("getprop.class")); - try { Unreached (jf.getInputStream(null)); } - catch (NullPointerException e) {} + // Make sure we throw NPE on null parameters + runAndCheckException(() -> jf.getEntry(null), NullPointerException.class); + runAndCheckException(() -> jf.getJarEntry(null), NullPointerException.class); + runAndCheckException(() -> jf.getInputStream(null), NullPointerException.class); } catch (SecurityException se) { throw new Exception("Got SecurityException when verifying signed " + "jar:" + se); } } + + // Check that a JAR entry is signed by an expected DN + private static void checkSignedBy(JarEntry e, String expectedDn) throws Exception { + Certificate[] certs = e.getCertificates(); + if (certs == null || certs.length == 0) { + throw new Exception("JarEntry has no certificates: " + e.getName()); + } + + if (certs[0] instanceof X509Certificate) { + X509Certificate x = (X509Certificate)certs[0]; + String name = x.getSubjectX500Principal().getName(); + if (!name.equalsIgnoreCase(expectedDn)) { + throw new Exception(String.format("Expected entry signed by %s, was %s", name, expectedDn)); + } + } else { + throw new Exception("Expected JarEntry.getCertificate to return X509Certificate"); + } + } + + private static Path createJar() throws Exception { + Path j = Path.of("unsigned.jar"); + try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(j))){ + out.putNextEntry(new JarEntry("getprop.class")); + out.write(new byte[] {(byte) 0XCA, (byte) 0XFE, (byte) 0XBA, (byte) 0XBE}); + } + return j; + } + + private static Path signJar(Path j, KeyStore.PrivateKeyEntry entry) throws Exception { + Path s = Path.of("signed.jar"); + + JarSigner signer = new JarSigner.Builder(entry) + .signerName("zigbert") + .digestAlgorithm("SHA-256") + .signatureAlgorithm("SHA256withRSA") + .build(); + + try (ZipFile zip = new ZipFile(j.toFile()); + OutputStream out = Files.newOutputStream(s)) { + signer.sign(zip, out); + } + + return s; + } + + private static KeyStore.PrivateKeyEntry keyEntry(String dname) throws Exception { + + CertAndKeyGen gen = new CertAndKeyGen("RSA", "SHA256withRSA"); + + gen.generate(1048); // Small key size makes test run faster + + var oneDay = TimeUnit.DAYS.toSeconds(1); + Certificate cert = gen.getSelfCertificate(new X500Name(dname), oneDay); + + return new KeyStore.PrivateKeyEntry(gen.getPrivateKey(), + new Certificate[] {cert}); + } } diff --git a/test/jdk/java/util/jar/JarFile/thawjar.jar b/test/jdk/java/util/jar/JarFile/thawjar.jar index 49d247cb40d9a5dc2e4d9c65be47b5cccd709a02..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 2441 zcmZuz2{;s58y+TRlC4I}DA`?VVwjToiIHn-46-E4RSd%nW1Hl(gbYH;l5j0! zkFxw2V}vM@$S!5f}{P&#aJI`~L?>*1?&iB0EYmNaP0B{-@fTqqU=0(b$ z7vKf}C_n%}fV1l6dfms*+eaDa=|m>SS=xH{qlI^?QJ*!uGV;Z8Qo9b{Q^(eZ+dVm8 zt(#&OmdqE`Q9}2PJ@T$%FsxxI;CD7A8a)A8dMr#g7C)H|f-kUM29a;h4lXY0BsK|V z%?}Ou+H^n!?8R@Ku{t|&W@K;)-Kqyvni80!*|;>L#bbE+;V{NE+mBwfG9SxCe~5l@ zS}jEYA}?Z+Tuz)&<>Nn;x3X-w8#OpQLMHmd>a*w_RK=7rBs?Voy2u>Ppn^^h#&3w2 z!+#4%hZd|{jVPVKTZXwj*XVq(a@wp{QbI{?XJp->uBXhe30ELrVl?DC$IOz~ekViy zb8*3rzZ3XE8j4T&&8#6#(@jQe+Ku!I>aQb6S{}A;A)c=$9oFxzeb2UyS1Hjr;`Dk_ zA}2IAP#9dQYZ^xlptw>$fCDd>j^u!CkBo-jlDhB~*K5RQ0Jo@eZxQGQ;zogJW%GZiOL5t<@%UIl?e35ZIAmh-@vD2=_*tA zrJiS-1?jO}wm@q_n}vsHDcbp4v@TfPx;Fl~GcK%LT3s_jAhZXRI9TXKN-i?O+-bfP zb59&hhj`S?C!3j%7exGJ(Y9dYK0e>l${m#~$-RhjDc>lL1=?fG$XcT}@)F^AZK zL6p`S0w_3H``5)+fg}*O>WRnUNh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-TSHm`%D8HAze6yzr Date: Wed, 25 Oct 2023 08:17:04 +0000 Subject: [PATCH 088/177] 8307165: java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java timed out Backport-of: 14df5c130e5bf5139e3e2ef6d7b9d64883d94d18 --- .../java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java b/test/jdk/java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java index fe0346d95ec..7bc50cbb142 100644 --- a/test/jdk/java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java +++ b/test/jdk/java/awt/dnd/NoFormatsDropTest/NoFormatsDropTest.java @@ -65,8 +65,8 @@ public class NoFormatsDropTest implements AWTEventListener { Frame frame; - DragSourcePanel dragSourcePanel; - DropTargetPanel dropTargetPanel; + volatile DragSourcePanel dragSourcePanel; + volatile DropTargetPanel dropTargetPanel; static final int FRAME_ACTIVATION_TIMEOUT = 1000; static final int DROP_COMPLETION_TIMEOUT = 1000; @@ -103,7 +103,6 @@ public void start() throws InterruptedException, AWTException, InvocationTargetException { try { Robot robot = new Robot(); - robot.setAutoWaitForIdle(true); robot.delay(FRAME_ACTIVATION_TIMEOUT); final Point srcPoint = dragSourcePanel.getLocationOnScreen(); @@ -134,6 +133,7 @@ public void start() throws InterruptedException, AWTException, robot.mouseMove(curPoint.x, curPoint.y); robot.delay(100); } + robot.waitForIdle(); robot.keyRelease(KeyEvent.VK_CONTROL); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); @@ -244,7 +244,7 @@ public Object getTransferData(DataFlavor df) class DropTargetPanel extends Panel implements DropTargetListener { final Dimension preferredDimension = new Dimension(200, 100); - boolean passed = false; + volatile boolean passed = false; public DropTargetPanel() { setDropTarget(new DropTarget(this, this)); From 365daccf2408e137266d6a52a02098d7b55eb68c Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 25 Oct 2023 08:20:28 +0000 Subject: [PATCH 089/177] 8309095: Remove UTF-8 character from TaskbarPositionTest.java Backport-of: 07f2070411b3bff5608166ceae0e0bdbf155e7c2 --- test/jdk/javax/swing/Popup/TaskbarPositionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/javax/swing/Popup/TaskbarPositionTest.java b/test/jdk/javax/swing/Popup/TaskbarPositionTest.java index 6a6b93a1080..5378f61c96f 100644 --- a/test/jdk/javax/swing/Popup/TaskbarPositionTest.java +++ b/test/jdk/javax/swing/Popup/TaskbarPositionTest.java @@ -61,7 +61,7 @@ * @key headful * @summary Tests the location of the heavy weight popup portion of JComboBox, * JMenu and JPopupMenu. - * The test uses Ctrl+Down Arrow (↓) which is a system shortcut on macOS, + * The test uses Ctrl+Down Arrow which is a system shortcut on macOS, * disable it in system settings, otherwise the test will fail * @library ../regtesthelpers * @library /test/lib From a6ee5aa738d9312b28cf8940786fd7d1da381cef Mon Sep 17 00:00:00 2001 From: Kangcheng Xu Date: Wed, 25 Oct 2023 15:19:58 +0000 Subject: [PATCH 090/177] 8240235: jdk.test.lib.util.JarUtils updates jar files incorrectly Backport-of: 2a791467919c9df9869e6fe1e57df0a5caa90d8f --- test/lib/jdk/test/lib/util/JarUtils.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/lib/jdk/test/lib/util/JarUtils.java b/test/lib/jdk/test/lib/util/JarUtils.java index cf4d1d515fa..b1cc74f5294 100644 --- a/test/lib/jdk/test/lib/util/JarUtils.java +++ b/test/lib/jdk/test/lib/util/JarUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -157,7 +157,7 @@ public static void updateJarFile(Path jarfile, Path dir, Path... files) while (jentries.hasMoreElements()) { JarEntry jentry = jentries.nextElement(); if (!names.contains(jentry.getName())) { - jos.putNextEntry(jentry); + jos.putNextEntry(copyEntry(jentry)); jf.getInputStream(jentry).transferTo(jos); } } @@ -289,7 +289,7 @@ public static void updateJar(String src, String dest, changes.remove(name); } else { System.out.println(String.format("- Copy %s", name)); - jos.putNextEntry(entry); + jos.putNextEntry(copyEntry(entry)); srcJarFile.getInputStream(entry).transferTo(jos); } } @@ -359,4 +359,17 @@ private static List findAllRegularFiles(Path dir, Path[] files) throws IOE } return entries; } + + private static JarEntry copyEntry(JarEntry e1) { + JarEntry e2 = new JarEntry(e1.getName()); + e2.setMethod(e1.getMethod()); + e2.setTime(e1.getTime()); + e2.setComment(e1.getComment()); + e2.setExtra(e1.getExtra()); + if (e1.getMethod() == JarEntry.STORED) { + e2.setSize(e1.getSize()); + e2.setCrc(e1.getCrc()); + } + return e2; + } } From a4080b94a87f88a57eaa5e96ac5982148f3df63f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 26 Oct 2023 18:21:13 +0000 Subject: [PATCH 091/177] 8217329: JTREG: Clean up, remove unused imports in gc folder Reviewed-by: lucy Backport-of: 2aa7590846aa6a8cba5fc4e67300bbb676961ade --- test/hotspot/jtreg/gc/TestAgeOutput.java | 3 --- test/hotspot/jtreg/gc/TestCardTablePageCommits.java | 1 - test/hotspot/jtreg/gc/TestGenerationPerfCounter.java | 1 - test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java | 1 - test/hotspot/jtreg/gc/TestNumWorkerOutput.java | 3 --- test/hotspot/jtreg/gc/TestObjectAlignment.java | 3 --- test/hotspot/jtreg/gc/TestPolicyNamePerfCounter.java | 1 - test/hotspot/jtreg/gc/arguments/AllocationHelper.java | 1 - test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java | 3 --- test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java | 1 - .../gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java | 2 -- .../jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java | 2 -- .../jtreg/gc/concurrent_phase_control/CheckControl.java | 1 - test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java | 2 -- test/hotspot/jtreg/gc/epsilon/TestEpsilonEnabled.java | 1 - test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java | 1 - .../jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java | 4 ---- test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java | 3 --- test/hotspot/jtreg/gc/g1/TestPLABOutput.java | 1 - test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java | 3 --- test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java | 2 -- test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java | 2 -- test/hotspot/jtreg/gc/g1/TestVerifyGCType.java | 1 - .../jtreg/gc/g1/mixedgc/TestOldGenCollectionUsage.java | 2 -- test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java | 2 -- test/hotspot/jtreg/gc/logging/TestPrintReferences.java | 2 -- test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java | 2 -- .../jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java | 1 - test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java | 1 - test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java | 1 - test/hotspot/jtreg/gc/whitebox/TestConcMarkCycleWB.java | 1 - 31 files changed, 55 deletions(-) diff --git a/test/hotspot/jtreg/gc/TestAgeOutput.java b/test/hotspot/jtreg/gc/TestAgeOutput.java index 6de4ec02b51..5189a5c5c79 100644 --- a/test/hotspot/jtreg/gc/TestAgeOutput.java +++ b/test/hotspot/jtreg/gc/TestAgeOutput.java @@ -66,12 +66,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import static jdk.test.lib.Asserts.*; - public class TestAgeOutput { public static void checkPattern(String pattern, String what) throws Exception { diff --git a/test/hotspot/jtreg/gc/TestCardTablePageCommits.java b/test/hotspot/jtreg/gc/TestCardTablePageCommits.java index f67daa8cce7..cf9769067ba 100644 --- a/test/hotspot/jtreg/gc/TestCardTablePageCommits.java +++ b/test/hotspot/jtreg/gc/TestCardTablePageCommits.java @@ -23,7 +23,6 @@ package gc; -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; diff --git a/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java b/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java index ea646401bb9..33b32983f8b 100644 --- a/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java +++ b/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java @@ -24,7 +24,6 @@ package gc; import static jdk.test.lib.Asserts.*; -import gc.testlibrary.PerfCounter; import gc.testlibrary.PerfCounters; diff --git a/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java b/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java index 45a0546d6b0..61f8b32ddff 100644 --- a/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java +++ b/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java @@ -24,7 +24,6 @@ package gc; import java.util.List; -import java.util.ArrayList; import java.lang.management.*; import static jdk.test.lib.Asserts.*; import java.util.stream.*; diff --git a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java index 7889319f6db..9842aad6dd6 100644 --- a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java +++ b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java @@ -54,12 +54,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import static jdk.test.lib.Asserts.*; - public class TestNumWorkerOutput { public static void checkPatternOnce(String pattern, String what) throws Exception { diff --git a/test/hotspot/jtreg/gc/TestObjectAlignment.java b/test/hotspot/jtreg/gc/TestObjectAlignment.java index f795236ef97..4760d0c9afa 100644 --- a/test/hotspot/jtreg/gc/TestObjectAlignment.java +++ b/test/hotspot/jtreg/gc/TestObjectAlignment.java @@ -44,9 +44,6 @@ * @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256 */ -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - public class TestObjectAlignment { public static byte[] garbage; diff --git a/test/hotspot/jtreg/gc/TestPolicyNamePerfCounter.java b/test/hotspot/jtreg/gc/TestPolicyNamePerfCounter.java index 8dae167cd9b..1d2a602d672 100644 --- a/test/hotspot/jtreg/gc/TestPolicyNamePerfCounter.java +++ b/test/hotspot/jtreg/gc/TestPolicyNamePerfCounter.java @@ -24,7 +24,6 @@ package gc; import static jdk.test.lib.Asserts.*; -import gc.testlibrary.PerfCounter; import gc.testlibrary.PerfCounters; diff --git a/test/hotspot/jtreg/gc/arguments/AllocationHelper.java b/test/hotspot/jtreg/gc/arguments/AllocationHelper.java index 3a8f2360d5d..2ba79d017de 100644 --- a/test/hotspot/jtreg/gc/arguments/AllocationHelper.java +++ b/test/hotspot/jtreg/gc/arguments/AllocationHelper.java @@ -23,7 +23,6 @@ package gc.arguments; -import java.util.LinkedList; import java.util.concurrent.Callable; /** diff --git a/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java b/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java index 226b938a3ce..4f0ec1cda3c 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java +++ b/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java @@ -36,12 +36,9 @@ * @run driver gc.arguments.TestSelectDefaultGC */ -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import java.util.regex.*; - public class TestSelectDefaultGC { public static void assertVMOption(OutputAnalyzer output, String option, boolean value) { output.shouldMatch(" " + option + " .*=.* " + value + " "); diff --git a/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java b/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java index ce97139c407..1727bf688ce 100644 --- a/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java +++ b/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java @@ -37,7 +37,6 @@ import java.util.LinkedList; import java.util.Arrays; -import java.util.Collections; import jdk.test.lib.Utils; public class TestShrinkHeapInSteps { diff --git a/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java b/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java index d4ca56aa53d..8c58871d5d2 100644 --- a/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java +++ b/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java @@ -42,8 +42,6 @@ import jdk.test.lib.process.ProcessTools; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; -import java.util.ArrayList; -import java.util.Arrays; import sun.hotspot.WhiteBox; public class TestCMSClassUnloadingEnabledHWM { diff --git a/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java b/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java index b0f7a4bb204..4d96f45a39f 100644 --- a/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java +++ b/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java @@ -40,8 +40,6 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import java.util.ArrayList; -import java.util.Arrays; import sun.hotspot.WhiteBox; public class TestG1ClassUnloadingHWM { diff --git a/test/hotspot/jtreg/gc/concurrent_phase_control/CheckControl.java b/test/hotspot/jtreg/gc/concurrent_phase_control/CheckControl.java index 002f42405d7..51cc6ac792e 100644 --- a/test/hotspot/jtreg/gc/concurrent_phase_control/CheckControl.java +++ b/test/hotspot/jtreg/gc/concurrent_phase_control/CheckControl.java @@ -51,7 +51,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; diff --git a/test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java b/test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java index e6223a3312e..a641fa13580 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java +++ b/test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java @@ -51,8 +51,6 @@ * gc.epsilon.TestArraycopyCheckcast */ -import java.util.Random; - public class TestArraycopyCheckcast { static int COUNT = Integer.getInteger("count", 1000); diff --git a/test/hotspot/jtreg/gc/epsilon/TestEpsilonEnabled.java b/test/hotspot/jtreg/gc/epsilon/TestEpsilonEnabled.java index eaeb98c7dac..a3c3af64cf6 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestEpsilonEnabled.java +++ b/test/hotspot/jtreg/gc/epsilon/TestEpsilonEnabled.java @@ -35,7 +35,6 @@ * gc.epsilon.TestEpsilonEnabled */ -import jdk.test.lib.Platform; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; diff --git a/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java b/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java index 541d0fcee52..13bae9f4fd2 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java +++ b/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java @@ -49,7 +49,6 @@ */ import java.lang.management.*; -import java.util.*; public class TestMemoryMXBeans { diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java index 98eeebc4495..0bd0bf4d5bb 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java @@ -39,12 +39,8 @@ import sun.hotspot.WhiteBox; import java.util.Arrays; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import jdk.test.lib.Asserts; -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; diff --git a/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java b/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java index b9dd97715f0..8c56a29175f 100644 --- a/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java +++ b/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java @@ -38,9 +38,6 @@ */ import java.lang.Math; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/gc/g1/TestPLABOutput.java b/test/hotspot/jtreg/gc/g1/TestPLABOutput.java index f6fd29fba96..48858a1865a 100644 --- a/test/hotspot/jtreg/gc/g1/TestPLABOutput.java +++ b/test/hotspot/jtreg/gc/g1/TestPLABOutput.java @@ -41,7 +41,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; diff --git a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java index 80680ddc9d0..14b378444dd 100644 --- a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java +++ b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java @@ -27,13 +27,10 @@ * Common helpers for TestRemsetLogging* tests */ -import com.sun.management.HotSpotDiagnosticMXBean; -import com.sun.management.VMOption; import sun.hotspot.WhiteBox; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.Arrays; diff --git a/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java b/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java index c52cd0a4f62..ac9db0afaa2 100644 --- a/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java +++ b/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java @@ -28,7 +28,6 @@ import jdk.test.lib.Utils; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.Utils; import jtreg.SkippedException; import java.io.IOException; @@ -37,7 +36,6 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.List; diff --git a/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java b/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java index 79a21e49d88..81b143ce3f7 100644 --- a/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java +++ b/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java @@ -27,9 +27,7 @@ * Common code for string deduplication tests */ -import java.lang.management.*; import java.lang.reflect.*; -import java.security.*; import java.util.*; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; diff --git a/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java b/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java index 04aab62169c..ca00d63ce5f 100644 --- a/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java +++ b/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java @@ -38,7 +38,6 @@ import java.util.Collections; import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; diff --git a/test/hotspot/jtreg/gc/g1/mixedgc/TestOldGenCollectionUsage.java b/test/hotspot/jtreg/gc/g1/mixedgc/TestOldGenCollectionUsage.java index de691a4c5c2..40b041d9a9c 100644 --- a/test/hotspot/jtreg/gc/g1/mixedgc/TestOldGenCollectionUsage.java +++ b/test/hotspot/jtreg/gc/g1/mixedgc/TestOldGenCollectionUsage.java @@ -42,8 +42,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.Collections; - import java.lang.management.*; // 8195115 says that for the "G1 Old Gen" MemoryPool, CollectionUsage.used diff --git a/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java b/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java index 3237c67635f..0c8588c895a 100644 --- a/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java +++ b/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java @@ -36,10 +36,8 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.List; import java.util.stream.Collectors; public class TestDeprecatedPrintFlags { diff --git a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java index 06b449cd1af..c47c589e87a 100644 --- a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java +++ b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java @@ -37,8 +37,6 @@ import java.lang.ref.SoftReference; import java.math.BigDecimal; -import java.util.ArrayList; - import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import java.util.regex.Pattern; diff --git a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java index 026f79af52c..2caf4f77a71 100644 --- a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java +++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java @@ -26,8 +26,6 @@ import java.util.List; import java.lang.management.*; import jdk.test.lib.Platform; -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; import static jdk.test.lib.Asserts.*; /* @test TestMetaspaceMemoryPool diff --git a/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java b/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java index d3d17c81701..1dd929afebd 100644 --- a/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java +++ b/test/hotspot/jtreg/gc/metaspace/TestPerfCountersAndMemoryPools.java @@ -28,7 +28,6 @@ import jdk.test.lib.Platform; import static jdk.test.lib.Asserts.*; -import gc.testlibrary.PerfCounter; import gc.testlibrary.PerfCounters; /* @test TestPerfCountersAndMemoryPools diff --git a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java index 60aeb71cfe8..5d1b7315074 100644 --- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java +++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java @@ -30,7 +30,6 @@ import java.lang.management.MemoryPoolMXBean; import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; -import java.nio.ByteBuffer; import java.util.ArrayDeque; import java.util.HashMap; import java.util.List; diff --git a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java index 9244b0f2482..8b89efb7940 100644 --- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java +++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java @@ -26,7 +26,6 @@ // A test that stresses a full GC by allocating objects of different lifetimes // and concurrently calling System.gc(). -import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; diff --git a/test/hotspot/jtreg/gc/whitebox/TestConcMarkCycleWB.java b/test/hotspot/jtreg/gc/whitebox/TestConcMarkCycleWB.java index d4b44784765..65ce2da9278 100644 --- a/test/hotspot/jtreg/gc/whitebox/TestConcMarkCycleWB.java +++ b/test/hotspot/jtreg/gc/whitebox/TestConcMarkCycleWB.java @@ -38,7 +38,6 @@ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC gc.whitebox.TestConcMarkCycleWB * @summary Verifies that ConcurrentMarking-related WB works properly */ -import static jdk.test.lib.Asserts.assertFalse; import static jdk.test.lib.Asserts.assertTrue; import sun.hotspot.WhiteBox; From 35000fb1c290e971663969471ddc536e766c0d5e Mon Sep 17 00:00:00 2001 From: sunguoyun Date: Fri, 27 Oct 2023 06:50:07 +0000 Subject: [PATCH 092/177] 8213898: CDS dumping of springboot asserts in G1ArchiveAllocator::alloc_new_region HeapRegionManager::find_highest_free needs to check if the region obtained from the HeapRegionManager::_regions is available. Backport-of: 14b7467279e15fa6fbbfce2d864edbce94a998bc --- src/hotspot/share/gc/g1/heapRegionManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/heapRegionManager.cpp b/src/hotspot/share/gc/g1/heapRegionManager.cpp index ffe2f04ecc7..8fa5baf37a4 100644 --- a/src/hotspot/share/gc/g1/heapRegionManager.cpp +++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp @@ -286,7 +286,7 @@ uint HeapRegionManager::find_highest_free(bool* expanded) { uint curr = max_length() - 1; while (true) { HeapRegion *hr = _regions.get_by_index(curr); - if (hr == NULL) { + if (hr == NULL || !is_available(curr)) { uint res = expand_at(curr, 1, NULL); if (res == 1) { *expanded = true; From 9be4d3fcebed6b1ecb5fe2231bdbdf270a78e9e0 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Sat, 28 Oct 2023 14:19:41 +0000 Subject: [PATCH 093/177] 8289917: Metadata for regionsRefilled of G1EvacuationStatistics event is wrong Backport-of: 728157fa03913991088f6bb257a8bc16706792a9 --- src/hotspot/share/jfr/metadata/metadata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml index d364934b293..744bda092eb 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xml +++ b/src/hotspot/share/jfr/metadata/metadata.xml @@ -325,7 +325,7 @@ - + From b9936cdf6bb9806f76034cb44adea5c5808eaf55 Mon Sep 17 00:00:00 2001 From: "t.ogata" Date: Mon, 30 Oct 2023 00:06:18 +0000 Subject: [PATCH 094/177] 8221396: Clean up serviceability/sa/TestUniverse.java Reviewed-by: phh Backport-of: 229d923b27a6c01616291aea6c8d4c86930bf7d2 --- .../jtreg/serviceability/sa/TestUniverse.java | 108 ++++++++++-------- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java index d925cdcbce5..ab98866c0a5 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java +++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java @@ -29,99 +29,107 @@ import java.util.HashMap; import jdk.test.lib.apps.LingeredApp; import jtreg.SkippedException; +import sun.hotspot.gc.GC; /** * @test * @summary Test the 'universe' command of jhsdb clhsdb. - * @requires vm.hasSA & vm.gc != "Z" + * @requires vm.hasSA * @bug 8190307 * @library /test/lib * @build jdk.test.lib.apps.* * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse withoutZ - */ - -/** - * @test - * @summary Test the 'universe' command of jhsdb clhsdb. - * @requires vm.hasSA & vm.gc == "Z" - * @bug 8190307 - * @library /test/lib - * @build jdk.test.lib.apps.* - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse withZ + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse */ public class TestUniverse { - private static void testClhsdbForUniverse(long lingeredAppPid, - String gc) throws Exception { - + private static void testClhsdbForUniverse(long lingeredAppPid, GC gc) throws Exception { ClhsdbLauncher launcher = new ClhsdbLauncher(); List cmds = List.of("universe"); Map> expStrMap = new HashMap<>(); List expStrings = new ArrayList(); expStrings.add("Heap Parameters"); - if (gc.contains("UseZGC")) { - expStrings.add("ZHeap"); - } - if (gc.contains("G1GC")) { - expStrings.add("garbage-first heap"); - expStrings.add("region size"); - expStrings.add("G1 Young Generation:"); - expStrings.add("regions ="); - } - if (gc.contains("UseConcMarkSweepGC")) { - expStrings.add("Gen 1: concurrent mark-sweep generation"); - } - if (gc.contains("UseSerialGC")) { + switch (gc) { + case Serial: expStrings.add("Gen 1: old"); - } - if (gc.contains("UseParallelGC")) { + break; + + case Parallel: expStrings.add("ParallelScavengeHeap"); expStrings.add("PSYoungGen"); expStrings.add("eden"); - } - if (gc.contains("UseEpsilonGC")) { + break; + + case ConcMarkSweep: + expStrings.add("Gen 1: concurrent mark-sweep generation"); + break; + + case G1: + expStrings.add("garbage-first heap"); + expStrings.add("region size"); + expStrings.add("G1 Young Generation:"); + expStrings.add("regions ="); + break; + + case Epsilon: expStrings.add("Epsilon heap"); expStrings.add("reserved"); expStrings.add("committed"); expStrings.add("used"); + break; + + case Z: + expStrings.add("ZHeap"); + break; + + case Shenandoah: + expStrings.add("Shenandoah Heap"); + break; } + expStrMap.put("universe", expStrings); launcher.run(lingeredAppPid, cmds, expStrMap, null); } - public static void test(String gc) throws Exception { + private static void test(GC gc) throws Exception { LingeredApp app = null; try { - List vmArgs = new ArrayList(); - vmArgs.add("-XX:+UnlockExperimentalVMOptions"); // unlock experimental GCs - vmArgs.add(gc); - app = LingeredApp.startApp(vmArgs); - System.out.println ("Started LingeredApp with the GC option " + gc + - " and pid " + app.getPid()); + app = LingeredApp.startApp(List.of("-XX:+UnlockExperimentalVMOptions", "-XX:+Use" + gc + "GC")); + System.out.println ("Started LingeredApp with " + gc + "GC and pid " + app.getPid()); testClhsdbForUniverse(app.getPid(), gc); } finally { LingeredApp.stopApp(app); } } + private static boolean isSelectedAndSupported(GC gc) { + if (!gc.isSelected()) { + // Not selected + return false; + } + + if (Compiler.isGraalEnabled()) { + if (gc == GC.ConcMarkSweep || gc == GC.Epsilon || gc == GC.Z || gc == GC.Shenandoah) { + // Not supported + System.out.println ("Skipped testing of " + gc + "GC, not supported by Graal"); + return false; + } + } + + // Selected and supported + return true; + } + public static void main (String... args) throws Exception { - System.out.println("Starting TestUniverse test"); + System.out.println("Starting TestUniverse"); try { - test("-XX:+UseG1GC"); - test("-XX:+UseParallelGC"); - test("-XX:+UseSerialGC"); - if (!Compiler.isGraalEnabled()) { // Graal does not support all GCs - test("-XX:+UseConcMarkSweepGC"); - if (args[0].equals("withZ")) { - test("-XX:+UseZGC"); + for (GC gc: GC.values()) { + if (isSelectedAndSupported(gc)) { + test(gc); } - test("-XX:+UseEpsilonGC"); } } catch (SkippedException se) { throw se; From cf13e82c56ca18ec162b9bcdd046aeef86b8dc3f Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 30 Oct 2023 08:14:34 +0000 Subject: [PATCH 095/177] 8313691: use close after failing os::fdopen in vmError and ciEnv Backport-of: 96304f37f8344b0c0e271ff9cda84961519d5109 --- src/hotspot/share/ci/ciEnv.cpp | 2 ++ src/hotspot/share/utilities/vmError.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 60b86193013..e7e3dc18787 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1265,6 +1265,7 @@ void ciEnv::dump_replay_data(int compile_id) { tty->print_cr("# Compiler replay data is saved as: %s", buffer); } else { tty->print_cr("# Can't open file to dump replay data."); + close(fd); } } } @@ -1288,6 +1289,7 @@ void ciEnv::dump_inline_data(int compile_id) { tty->print_cr("%s", buffer); } else { tty->print_cr("# Can't open file to dump inline data."); + close(fd); } } } diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 6d14cec2add..37cc0aa38d3 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1570,6 +1570,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt int e = errno; out.print_raw("#\n# Can't open file to dump replay data. Error: "); out.print_raw_cr(os::strerror(e)); + close(fd); } } } From dd1994ee519d1174ce8e24e415970c4729ab58d1 Mon Sep 17 00:00:00 2001 From: "t.ogata" Date: Mon, 30 Oct 2023 10:04:32 +0000 Subject: [PATCH 096/177] 8231931: [TESTBUG] serviceability/sa/TestUniverse.java looks for wrong string with Shenandoah Backport-of: f412bfc34eb2a3f94ba4381af365127b56e77537 --- test/hotspot/jtreg/serviceability/sa/TestUniverse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java index ab98866c0a5..5bb818be6df 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java +++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java @@ -86,7 +86,7 @@ private static void testClhsdbForUniverse(long lingeredAppPid, GC gc) throws Exc break; case Shenandoah: - expStrings.add("Shenandoah Heap"); + expStrings.add("Shenandoah heap"); break; } From 53acd95dc37e489e457bce74fbca3d78b5252da2 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 30 Oct 2023 10:06:32 +0000 Subject: [PATCH 097/177] 8251177: [macosx] The text "big" is truncated in JTabbedPane Backport-of: 16ebe40a1bcd1fe43126fe1dca27bb64cb12de16 --- test/jdk/ProblemList.txt | 1 - .../swing/JTabbedPane/4209065/bug4209065.html | 35 -------- .../swing/JTabbedPane/4209065/bug4209065.java | 80 ++++++++++++------- 3 files changed, 53 insertions(+), 63 deletions(-) delete mode 100644 test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index d1b7174e86f..3eca974b9a7 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -820,7 +820,6 @@ javax/swing/SwingUtilities/TestTextPosInPrint.java 8227025 windows-all java/awt/print/PrinterJob/ScaledText/ScaledText.java 8231226 macosx-all java/awt/print/bug8023392/bug8023392.html 8231231 generic-all java/awt/font/TextLayout/TestJustification.html 8250791 macosx-all -javax/swing/JTabbedPane/4209065/bug4209065.java 8251177 macosx-all java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all java/awt/FileDialog/RegexpFilterTest/RegexpFilterTest.html 7187728 macosx-all,linux-all diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html deleted file mode 100644 index 5737912f130..00000000000 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java index c2e2c14d7d8..4f78e73b911 100644 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java +++ b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,37 +21,63 @@ * questions. */ -import java.awt.EventQueue; +/* + * @test + * @bug 4209065 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary To test if the style of the text on the tab matches the description. + * @run main/manual bug4209065 + */ + import java.lang.reflect.InvocationTargetException; -import javax.swing.JApplet; +import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; -/** - * @test - * @bug 4209065 - * @author Georges Saab - * @run applet/manual=yesno bug4209065.html - */ -public final class bug4209065 extends JApplet { - - @Override - public void init() { - try { - EventQueue.invokeAndWait(this::createTabbedPane); - } catch (InterruptedException | InvocationTargetException e) { - throw new RuntimeException(e); - } + +public final class bug4209065 { + + private static JFrame frame; + private static final String text = + "If the style of the text on the tabs matches the descriptions," + + "\npress PASS.\n\nNOTE: where a large font is used, the" + + " text may be larger\nthan the tab height but this is OK" + + " and NOT a failure."; + + public static void createAndShowGUI() throws InterruptedException, + InvocationTargetException { + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame("JTabbedPane"); + + JTabbedPane tp = new JTabbedPane(); + + tp.addTab("
big
", + new JLabel()); + tp.addTab("
red
", + new JLabel()); + tp.addTab("
Bold Italic!
", + new JLabel()); + + frame.getContentPane().add(tp); + frame.setSize(400, 400); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + + + PassFailJFrame.addTestFrame(frame); + PassFailJFrame.positionTestFrame(frame, + PassFailJFrame.Position.HORIZONTAL); + }); } - private void createTabbedPane() { - JTabbedPane tp = new JTabbedPane(); - getContentPane().add(tp); - String text = "
If the style of the text on the tabs matches" - + "
the descriptions, press PASS
"; - tp.addTab("
big
", new JLabel(text)); - tp.addTab("
red
", new JLabel(text)); - tp.addTab("
Bold Italic!
", new JLabel(text)); + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame passFailJFrame = new PassFailJFrame("JTabbedPane " + + "Test Instructions", text, 5, 19, 35); + createAndShowGUI(); + passFailJFrame.awaitAndCheck(); } -} +} \ No newline at end of file From 9f74d2622e619864cc201dd1dc3e9eb21e78010d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 30 Oct 2023 10:09:02 +0000 Subject: [PATCH 098/177] 8286707: JFR: Don't commit JFR internal jdk.JavaMonitorWait events Reviewed-by: mbaesken Backport-of: fc889577eaf3f564d896818c1d9b1eb6fa5a8758 --- .../jfr/recorder/repository/jfrChunkRotation.cpp | 2 +- src/hotspot/share/jfr/support/jfrIntrinsics.hpp | 3 ++- src/hotspot/share/runtime/objectMonitor.cpp | 12 +++++++++++- src/hotspot/share/utilities/macros.hpp | 4 ++++ src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java | 12 +++++++++--- .../classes/jdk/jfr/internal/PlatformRecorder.java | 4 ++-- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp index 29bcbfaa8ec..013ba206ca7 100644 --- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp +++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp @@ -36,7 +36,7 @@ static jobject install_chunk_monitor(Thread* thread) { // read static field HandleMark hm(thread); static const char klass[] = "jdk/jfr/internal/JVM"; - static const char field[] = "FILE_DELTA_CHANGE"; + static const char field[] = "CHUNK_ROTATION_MONITOR"; static const char signature[] = "Ljava/lang/Object;"; JavaValue result(T_OBJECT); JfrJavaArguments field_args(&result, klass, field, signature, thread); diff --git a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp index e49eb44e9bc..d47a5bc291f 100644 --- a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp +++ b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp @@ -34,7 +34,8 @@ #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp" #define JFR_TEMPLATES(template) \ - template(jdk_jfr_internal_JVM, "jdk/jfr/internal/JVM") + template(jdk_jfr_internal_JVM, "jdk/jfr/internal/JVM") \ + template(jfr_chunk_rotation_monitor, "jdk/jfr/internal/JVM$ChunkRotationMonitor") \ #define JFR_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias) \ do_intrinsic(_counterTime, jdk_jfr_internal_JVM, counterTime_name, void_long_signature, F_SN) \ diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index a9690c2d742..ce23aafa8f3 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -1393,6 +1393,12 @@ static int Adjust(volatile int * adr, int dx) { return v; } +static inline bool is_excluded(const Klass* monitor_klass) { + assert(monitor_klass != NULL, "invariant"); + NOT_JFR_RETURN_(false); + JFR_ONLY(return vmSymbols::jfr_chunk_rotation_monitor() == monitor_klass->name()); +} + static void post_monitor_wait_event(EventJavaMonitorWait* event, ObjectMonitor* monitor, jlong notifier_tid, @@ -1400,7 +1406,11 @@ static void post_monitor_wait_event(EventJavaMonitorWait* event, bool timedout) { assert(event != NULL, "invariant"); assert(monitor != NULL, "invariant"); - event->set_monitorClass(((oop)monitor->object())->klass()); + const Klass* monitor_klass = ((oop)monitor->object())->klass(); + if (is_excluded(monitor_klass)) { + return; + } + event->set_monitorClass(monitor_klass); event->set_timeout(timeout); event->set_address((uintptr_t)monitor->object_addr()); event->set_notifier(notifier_tid); diff --git a/src/hotspot/share/utilities/macros.hpp b/src/hotspot/share/utilities/macros.hpp index cf802538689..6605ab367c7 100644 --- a/src/hotspot/share/utilities/macros.hpp +++ b/src/hotspot/share/utilities/macros.hpp @@ -279,8 +279,12 @@ #if INCLUDE_JFR #define JFR_ONLY(code) code +#define NOT_JFR_RETURN() /* next token must be ; */ +#define NOT_JFR_RETURN_(code) /* next token must be ; */ #else #define JFR_ONLY(code) +#define NOT_JFR_RETURN() {} +#define NOT_JFR_RETURN_(code) { return code; } #endif #ifndef INCLUDE_JVMCI diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java index d2536efa571..7db639b33fc 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java @@ -38,11 +38,17 @@ public final class JVM { private static final JVM jvm = new JVM(); - // JVM signals file changes by doing Object#notifu on this object - static final Object FILE_DELTA_CHANGE = new Object(); - static final long RESERVED_CLASS_ID_LIMIT = 400; + private static class ChunkRotationMonitor {} + + /* + * The JVM uses the chunk rotation monitor to notify Java that a rotation is warranted. + * The monitor type is used to exclude jdk.JavaMonitorWait events from being generated + * when Object.wait() is called on this monitor. + */ + static final Object CHUNK_ROTATION_MONITOR = new ChunkRotationMonitor(); + private volatile boolean recording; private volatile boolean nativeOK; diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java index 5ec29d1015b..079005910a6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java @@ -444,8 +444,8 @@ private void periodicTask() { private void takeNap(long duration) { try { - synchronized (JVM.FILE_DELTA_CHANGE) { - JVM.FILE_DELTA_CHANGE.wait(duration < 10 ? 10 : duration); + synchronized (JVM.CHUNK_ROTATION_MONITOR) { + JVM.CHUNK_ROTATION_MONITOR.wait(duration < 10 ? 10 : duration); } } catch (InterruptedException e) { e.printStackTrace(); From 46ce8cb44add8850f7fa8f43669922d35907a14b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 30 Oct 2023 10:11:30 +0000 Subject: [PATCH 099/177] 8306765: Some client related jtreg problem list entries are malformed Backport-of: f02d01934c87414eb610b67bdab55c25b3033878 --- test/jdk/ProblemList.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 3eca974b9a7..1e2f04a2baa 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -462,7 +462,7 @@ java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676 linux-all java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,solaris-all,windows-all,macosx-all java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.java 8148041 linux-all java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all -java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 +java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 linux-all java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all,solaris-all @@ -482,7 +482,7 @@ java/awt/TrayIcon/RightClickWhenBalloonDisplayed/RightClickWhenBalloonDisplayed. java/awt/PopupMenu/PopupMenuLocation.java 8238720 windows-all java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8238720 windows-all java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720 windows-all -java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java +java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java 8238720 windows-all # Several tests which fail sometimes on macos11 java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 8266243 macosx-aarch64 From 910e2c463e5ff1cb264200c551404d36d47eff07 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 30 Oct 2023 10:38:17 +0000 Subject: [PATCH 100/177] 8308910: Allow executeAndLog to accept running process Backport-of: fc288568f2c589975463d30f8c6d0e2484f0bf14 --- test/lib/jdk/test/lib/cds/CDSTestUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 6a75f7f229a..db6abb97899 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -558,8 +558,12 @@ public static File getSourceFile(String name) { // ============================= Logging public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { + return executeAndLog(pb.start(), logName); + } + + public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception { long started = System.currentTimeMillis(); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = new OutputAnalyzer(process); writeFile(getOutputFile(logName + ".stdout"), output.getStdout()); writeFile(getOutputFile(logName + ".stderr"), output.getStderr()); From 2fbb4b92bdcbc3a478c06cc6c904391c1d2e326e Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 30 Oct 2023 10:45:53 +0000 Subject: [PATCH 101/177] 8318705: [macos] ProblemList java/rmi/registry/multipleRegistries/MultipleRegistries.java Backport-of: 37c40a11a78f8b1f290cb04ce5b087904651907e --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 1e2f04a2baa..c6c5fe24606 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -588,6 +588,7 @@ java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGr java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java 8170562 generic-all java/rmi/registry/readTest/CodebaseTest.java 8173324 windows-all +java/rmi/registry/multipleRegistries/MultipleRegistries.java 8268182 macosx-all java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64 From 32e63eb87f063e796e92cb0e1a8cbc0594800949 Mon Sep 17 00:00:00 2001 From: "yibo.yl" Date: Tue, 31 Oct 2023 15:16:39 +0000 Subject: [PATCH 102/177] 8312065: Socket.connect does not timeout when profiling Reviewed-by: phh Backport-of: 1ce12c4f33d3d6905703d95df2574f4037dfd57d --- src/java.base/aix/native/libnet/aix_close.c | 48 +++++----- .../linux/native/libnet/linux_close.c | 50 +++++------ .../macosx/native/libnet/bsd_close.c | 50 +++++------ test/jdk/java/net/Socket/B8312065.java | 88 +++++++++++++++++++ 4 files changed, 162 insertions(+), 74 deletions(-) create mode 100644 test/jdk/java/net/Socket/B8312065.java diff --git a/src/java.base/aix/native/libnet/aix_close.c b/src/java.base/aix/native/libnet/aix_close.c index 687d649b3cb..dfd3beab69f 100644 --- a/src/java.base/aix/native/libnet/aix_close.c +++ b/src/java.base/aix/native/libnet/aix_close.c @@ -388,50 +388,50 @@ int NET_SocketClose(int fd) { /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK)); + BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK), JNI_TRUE ); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { @@ -489,7 +489,7 @@ int NET_Connect(int s, struct sockaddr *addr, int addrlen) { } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff --git a/src/java.base/linux/native/libnet/linux_close.c b/src/java.base/linux/native/libnet/linux_close.c index 0d4e81e0731..aabdaad4e92 100644 --- a/src/java.base/linux/native/libnet/linux_close.c +++ b/src/java.base/linux/native/libnet/linux_close.c @@ -345,58 +345,58 @@ int NET_SocketClose(int fd) { /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE ); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { - BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff --git a/src/java.base/macosx/native/libnet/bsd_close.c b/src/java.base/macosx/native/libnet/bsd_close.c index 4a348b212f8..43b6b491be4 100644 --- a/src/java.base/macosx/native/libnet/bsd_close.c +++ b/src/java.base/macosx/native/libnet/bsd_close.c @@ -349,58 +349,58 @@ int NET_SocketClose(int fd) { /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT)); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE ); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { - BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff --git a/test/jdk/java/net/Socket/B8312065.java b/test/jdk/java/net/Socket/B8312065.java new file mode 100644 index 00000000000..272e53c8c11 --- /dev/null +++ b/test/jdk/java/net/Socket/B8312065.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding 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 + * @bug 8312065 + * @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal) + * @requires (os.family != "windows") + * @compile NativeThread.java + * @run main/othervm/native/timeout=120 B8312065 + */ + +import sun.misc.Signal; + +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.util.concurrent.TimeUnit; + +public class B8312065 { + public static void main(String[] args) throws Exception { + System.loadLibrary("NativeThread"); + + // Setup SIGPIPE handler + Signal.handle(new Signal("PIPE"), System.out::println); + + long osThreadId = NativeThread.getID(); + + int timeoutMillis = 2000; + int n = 10; + Thread t = new Thread(() -> { + // Send SIGPIPE to the thread every second + for (int i = 0; i < n; i++) { + if (NativeThread.signal(osThreadId, NativeThread.SIGPIPE) != 0) { + System.out.println("Test FAILED: failed to send signal"); + System.exit(1); + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + System.out.println("Test FAILED: unexpected interrupt"); + System.exit(1); + } + } + System.out.println("Test FAILED: Socket.connect blocked " + n + " seconds, " + + "expected around " + timeoutMillis / 1000 + " seconds"); + System.exit(1); + }); + t.setDaemon(true); + t.start(); + + long startTime = System.nanoTime(); + + try { + Socket socket = new Socket(); + // There is no good way to mock SocketTimeoutException, just assume 192.168.255.255 is not in use + socket.connect(new InetSocketAddress("192.168.255.255", 8080), timeoutMillis); + } catch (SocketTimeoutException e) { + long duration = TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS); + if (duration >= timeoutMillis) { + System.out.println("Test passed"); + } else { + System.out.println("Test FAILED: duration " + duration + " ms, expected >= " + timeoutMillis + " ms"); + System.exit(1); + } + } + } +} From de9ae1eac41876c2995e99256225085297171048 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 1 Nov 2023 16:39:59 +0000 Subject: [PATCH 103/177] 8293811: Provide a reason for PassFailJFrame.forceFail Reviewed-by: phh Backport-of: 64b96e5cf57023a5d55b4392074e3922ac7c0534 --- .../awt/regtesthelpers/PassFailJFrame.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 83e8896b37f..ad66fb4187c 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -51,6 +51,11 @@ public class PassFailJFrame { private static final int ROWS = 10; private static final int COLUMNS = 40; + /** + * Prefix for the user-provided failure reason. + */ + private static final String FAILURE_REASON = "Failure Reason:\n"; + private static final List frameList = new ArrayList<>(); private static final Timer timer = new Timer(0, null); private static final CountDownLatch latch = new CountDownLatch(1); @@ -130,8 +135,8 @@ private static void createUI(String title, String instructions, long leftTime = tTimeout - (System.currentTimeMillis() - startTime); if ((leftTime < 0) || failed) { timer.stop(); - testFailedReason = "Failure Reason:\n" - + "Timeout User did not perform testing."; + testFailedReason = FAILURE_REASON + + "Timeout User did not perform testing."; timeout = true; latch.countDown(); } @@ -161,8 +166,8 @@ private static void createUI(String title, String instructions, @Override public void windowClosing(WindowEvent e) { super.windowClosing(e); - testFailedReason = "Failure Reason:\n" - + "User closed the instruction Frame"; + testFailedReason = FAILURE_REASON + + "User closed the instruction Frame"; failed = true; latch.countDown(); } @@ -236,7 +241,7 @@ private static void getFailureReason() { JButton okButton = new JButton("OK"); okButton.addActionListener((ae) -> { - testFailedReason = "Failure Reason:\n" + jTextArea.getText(); + testFailedReason = FAILURE_REASON + jTextArea.getText(); dialog.setVisible(false); }); @@ -314,7 +319,17 @@ public static void forcePass() { * Forcibly fail the test. */ public static void forceFail() { + forceFail("forceFail called"); + } + + /** + * Forcibly fail the test and provide a reason. + * + * @param reason the reason why the test is failed + */ + public static void forceFail(String reason) { failed = true; + testFailedReason = FAILURE_REASON + reason; latch.countDown(); } } From d0045daa83d0771f1ba5d7bf5da6bdffa41968da Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:28:59 +0000 Subject: [PATCH 104/177] 8220083: Remove hard-coded 127.0.0.1 loopback address in JDK networking tests Tests that hardcode "127.0.0.1" fail in an environment where only IPv6 is available and IPv4 is not. Reviewed-by: mbaesken Backport-of: ef9ce3be1e33f1a45a6d8fbcbe3d4ceffcf7c4ce --- test/jdk/com/sun/net/httpserver/TestLogging.java | 4 ++-- test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6361557.java | 4 ++-- .../sun/net/httpserver/bugs/TruncatedRequestBody.java | 7 ++++--- .../com/sun/nio/sctp/SctpMultiChannel/SendFailed.java | 5 +++-- test/jdk/java/net/Authenticator/B6870935.java | 4 ++-- .../net/DatagramSocket/SendDatagramToBadAddress.java | 5 ++--- .../SetAuthenticator/HTTPTestServer.java | 8 +++++--- test/jdk/java/net/Socket/UrgentDataTest.java | 4 ++-- test/jdk/java/net/SocketOption/OptionsTest.java | 4 ++-- .../jdk/java/net/httpclient/UnknownBodyLengthTest.java | 3 ++- test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java | 4 ++-- .../AsynchronousChannelGroup/bootlib/Attack.java | 5 +++-- test/jdk/java/nio/channels/Selector/LotsOfCancels.java | 5 +++-- .../nio/channels/SocketChannel/AsyncCloseChannel.java | 8 ++++---- .../channels/SocketChannel/CloseRegisteredChannel.java | 2 +- .../channels/SocketChannel/CloseTimeoutChannel.java | 4 ++-- .../nio/channels/SocketChannel/SocketInheritance.java | 4 ++-- .../nio/channels/etc/AdaptorCloseAndInterrupt.java | 10 +++++----- test/jdk/java/nio/channels/etc/Shadow.java | 4 ++-- test/jdk/java/nio/charset/coders/StreamTimeout.java | 5 +++-- .../rmi/transport/readTimeout/ReadTimeoutTest.java | 6 +++--- test/jdk/jdk/net/Sockets/QuickAckTest.java | 7 +++---- test/jdk/jdk/net/Sockets/Test.java | 8 ++++---- .../sun/net/www/protocol/http/TunnelThroughProxy.java | 2 +- 25 files changed, 65 insertions(+), 59 deletions(-) diff --git a/test/jdk/com/sun/net/httpserver/TestLogging.java b/test/jdk/com/sun/net/httpserver/TestLogging.java index dc629b696b7..95399844087 100644 --- a/test/jdk/com/sun/net/httpserver/TestLogging.java +++ b/test/jdk/com/sun/net/httpserver/TestLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -93,7 +93,7 @@ public static void main (String[] args) throws Exception { System.out.println ("caught expected exception"); } - Socket s = new Socket ("127.0.0.1", p1); + Socket s = new Socket (InetAddress.getLoopbackAddress(), p1); OutputStream os = s.getOutputStream(); //os.write ("GET xxx HTTP/1.1\r\n".getBytes()); os.write ("HELLO WORLD\r\n".getBytes()); diff --git a/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java b/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java index 875b3fc7dfe..202ec7488e8 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java +++ b/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java @@ -105,7 +105,7 @@ public static void main (String[] args) throws Exception { static void test1() throws IOException { failed = false; - Socket s = new Socket ("127.0.0.1", port); + Socket s = new Socket (InetAddress.getLoopbackAddress(), port); InputStream is = s.getInputStream(); // server should close connection after 2 seconds. We wait up to 10 s.setSoTimeout (10000); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java index d854c772503..a1306f3895e 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -78,7 +78,7 @@ public static void main (String[] args) throws Exception { server.start (); InetSocketAddress destaddr = new InetSocketAddress ( - "127.0.0.1", server.getAddress().getPort() + InetAddress.getLoopbackAddress(), server.getAddress().getPort() ); System.out.println ("destaddr " + destaddr); diff --git a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java index 84fbf1fd4e2..f72c828e437 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java +++ b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.nio.charset.StandardCharsets; @@ -100,7 +101,7 @@ public static void main(String[] args) throws IOException, InterruptedException // Test 1: fixed length - Socket sock = new Socket("127.0.0.1", port); + Socket sock = new Socket(InetAddress.getLoopbackAddress(), port); String s1 = "POST /foo HTTP/1.1\r\nContent-length: 200000\r\n" + "\r\nfoo bar99"; @@ -114,7 +115,7 @@ public static void main(String[] args) throws IOException, InterruptedException String s2 = "POST /foo HTTP/1.1\r\nTransfer-encoding: chunked\r\n\r\n" + "100\r\nFoo bar"; - sock = new Socket("127.0.0.1", port); + sock = new Socket(InetAddress.getLoopbackAddress(), port); os = sock.getOutputStream(); os.write(s2.getBytes(StandardCharsets.ISO_8859_1)); Thread.sleep(500); diff --git a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java index 50741af3565..09a215c132f 100644 --- a/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java +++ b/test/jdk/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import com.sun.nio.sctp.*; import java.io.IOException; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; @@ -36,7 +37,7 @@ public class SendFailed { - static final SocketAddress remoteAddress = new InetSocketAddress("127.0.0.1", 3000); + static final SocketAddress remoteAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(), 3000); static final int[] bufferSizes = { 20, 49, 50, 51, 100, 101, 1024, 1025, 4095, 4096, 4097, 8191, 8192, 8193}; diff --git a/test/jdk/java/net/Authenticator/B6870935.java b/test/jdk/java/net/Authenticator/B6870935.java index 4985e7df752..279ef63a865 100644 --- a/test/jdk/java/net/Authenticator/B6870935.java +++ b/test/jdk/java/net/Authenticator/B6870935.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -240,7 +240,7 @@ public static void main(String[] args) throws Exception { try { Authenticator.setDefault (new MyAuthenticator ()); - SocketAddress addr = new InetSocketAddress ("127.0.0.1", port); + SocketAddress addr = new InetSocketAddress (InetAddress.getLoopbackAddress(), port); Proxy proxy = new Proxy (Proxy.Type.HTTP, addr); String s = "http://www.ibm.com"; URL url = new URL(s); diff --git a/test/jdk/java/net/DatagramSocket/SendDatagramToBadAddress.java b/test/jdk/java/net/DatagramSocket/SendDatagramToBadAddress.java index b0cb10a6e92..f859ff4ee03 100644 --- a/test/jdk/java/net/DatagramSocket/SendDatagramToBadAddress.java +++ b/test/jdk/java/net/DatagramSocket/SendDatagramToBadAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,8 +114,7 @@ public void run() throws Exception { if (OSsupportsFeature()) { print ("running on OS that supports ICMP port unreachable"); } - String host = "127.0.0.1"; - InetAddress addr = InetAddress.getByName(host); + InetAddress addr = InetAddress.getLoopbackAddress(); DatagramSocket sock = new DatagramSocket(); DatagramSocket serversock = new DatagramSocket(0); DatagramPacket p; diff --git a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java index 505e0e159da..a896142b513 100644 --- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java +++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -218,7 +218,8 @@ static ServerSocket create() throws IOException { @Override protected ServerSocket createBindable() throws IOException { - return new ServerSocket(0, 0, InetAddress.getByName("127.0.0.1")); + InetAddress address = InetAddress.getLoopbackAddress(); + return new ServerSocket(0, 0, address); } @Override @@ -240,7 +241,8 @@ private static abstract class WebServerFactory @Override protected S createBindable() throws IOException { S server = newHttpServer(); - server.bind(new InetSocketAddress("127.0.0.1", 0), 0); + InetAddress address = InetAddress.getLoopbackAddress(); + server.bind(new InetSocketAddress(address, 0), 0); return server; } diff --git a/test/jdk/java/net/Socket/UrgentDataTest.java b/test/jdk/java/net/Socket/UrgentDataTest.java index ed1ba15450b..a0db6924fc8 100644 --- a/test/jdk/java/net/Socket/UrgentDataTest.java +++ b/test/jdk/java/net/Socket/UrgentDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -57,7 +57,7 @@ public static void main (String args[]) { test.listener = new ServerSocket (0); test.isClient = true; test.isServer = true; - test.clHost = "127.0.0.1"; + test.clHost = InetAddress.getLoopbackAddress().getHostAddress(); test.clPort = test.listener.getLocalPort(); test.run(); } else if (args[0].equals ("-server")) { diff --git a/test/jdk/java/net/SocketOption/OptionsTest.java b/test/jdk/java/net/SocketOption/OptionsTest.java index 214c2d920f1..f0a24427f51 100644 --- a/test/jdk/java/net/SocketOption/OptionsTest.java +++ b/test/jdk/java/net/SocketOption/OptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,7 +100,7 @@ static NetworkInterface getNetworkInterface() { static void doSocketTests() throws Exception { try ( ServerSocket srv = new ServerSocket(0); - Socket c = new Socket("127.0.0.1", srv.getLocalPort()); + Socket c = new Socket(InetAddress.getLoopbackAddress(), srv.getLocalPort()); Socket s = srv.accept(); ) { Set> options = c.supportedOptions(); diff --git a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java index cd2ebe8f3d4..e211237164f 100644 --- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java +++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java @@ -22,6 +22,7 @@ */ import java.io.InputStream; import java.io.OutputStream; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; @@ -72,7 +73,7 @@ public class UnknownBodyLengthTest { : ServerSocketFactory.getDefault(); ss = factory.createServerSocket(); ss.setReuseAddress(true); - ss.bind(new InetSocketAddress("127.0.0.1", 0)); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); System.out.println("ServerSocket = " + ss.getClass() + " " + ss); port = ss.getLocalPort(); clientURL = (useSSL ? "https" : "http") + "://localhost:" diff --git a/test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java b/test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java index cbb28aa2ba8..31f87137838 100644 --- a/test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java +++ b/test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -182,7 +182,7 @@ InterruptibleChannel create() throws IOException { = new ChannelFactory("DatagramChannel") { InterruptibleChannel create() throws IOException { DatagramChannel dc = DatagramChannel.open(); - InetAddress lb = InetAddress.getByName("127.0.0.1"); + InetAddress lb = InetAddress.getLoopbackAddress(); dc.bind(new InetSocketAddress(lb, 0)); dc.connect(new InetSocketAddress(lb, 80)); return dc; diff --git a/test/jdk/java/nio/channels/AsynchronousChannelGroup/bootlib/Attack.java b/test/jdk/java/nio/channels/AsynchronousChannelGroup/bootlib/Attack.java index c0317632443..ae0bf64d037 100644 --- a/test/jdk/java/nio/channels/AsynchronousChannelGroup/bootlib/Attack.java +++ b/test/jdk/java/nio/channels/AsynchronousChannelGroup/bootlib/Attack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -22,6 +22,7 @@ */ import java.io.IOException; +import java.net.InetAddress; import java.net.Socket; import java.util.concurrent.CountDownLatch; @@ -42,7 +43,7 @@ public void Attack() { @Override public void run() { try { - new Socket("127.0.0.1", 9999).close(); + new Socket(InetAddress.getLoopbackAddress(), 9999).close(); throw new RuntimeException("Connected (not expected)"); } catch (IOException e) { throw new RuntimeException("IOException (not expected)"); diff --git a/test/jdk/java/nio/channels/Selector/LotsOfCancels.java b/test/jdk/java/nio/channels/Selector/LotsOfCancels.java index 79df4b83625..8c22d3dfdcc 100644 --- a/test/jdk/java/nio/channels/Selector/LotsOfCancels.java +++ b/test/jdk/java/nio/channels/Selector/LotsOfCancels.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 Google Inc. All Rights Reserved. + * Copyright 2009, 2019, Google 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 @@ -21,6 +21,7 @@ * questions. */ +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.channels.SelectionKey; @@ -87,7 +88,7 @@ static void runTest(int initCount, int massCount, int maxSelectTime) throws Exception { testStartTime = System.nanoTime(); - InetSocketAddress address = new InetSocketAddress("127.0.0.1", 7359); + InetSocketAddress address = new InetSocketAddress(InetAddress.getLoopbackAddress(), 7359); // Create server channel, add it to selector and run epoll_ctl. log("Setting up server"); diff --git a/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java b/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java index eb33b840e0d..2561c5b9b06 100644 --- a/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java +++ b/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ */ import java.io.IOException; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; @@ -39,7 +40,6 @@ public class AsyncCloseChannel { static volatile boolean keepGoing = true; static int maxAcceptCount = 100; static volatile int acceptCount = 0; - static String host = "127.0.0.1"; static int sensorPort; static int targetPort; @@ -149,7 +149,7 @@ public void run() { } wake = false; } - s.connect(new InetSocketAddress(host, sensorPort)); + s.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), sensorPort)); try { Thread.sleep(10); } catch (InterruptedException ex) { } @@ -183,7 +183,7 @@ public void run() { while(keepGoing) { try { final SocketChannel s = SocketChannel.open( - new InetSocketAddress(host, targetPort)); + new InetSocketAddress(InetAddress.getLoopbackAddress(), targetPort)); s.finishConnect(); s.socket().setSoLinger(false, 0); ready = false; diff --git a/test/jdk/java/nio/channels/SocketChannel/CloseRegisteredChannel.java b/test/jdk/java/nio/channels/SocketChannel/CloseRegisteredChannel.java index dfba9db2e9e..a5e5f22d0a4 100644 --- a/test/jdk/java/nio/channels/SocketChannel/CloseRegisteredChannel.java +++ b/test/jdk/java/nio/channels/SocketChannel/CloseRegisteredChannel.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception { //System.out.println ("listening on port " + port); SocketChannel client = SocketChannel.open (); - client.connect (new InetSocketAddress ("127.0.0.1", port)); + client.connect (new InetSocketAddress (InetAddress.getLoopbackAddress(), port)); SocketChannel peer = server.accept (); peer.configureBlocking (true); diff --git a/test/jdk/java/nio/channels/SocketChannel/CloseTimeoutChannel.java b/test/jdk/java/nio/channels/SocketChannel/CloseTimeoutChannel.java index a09c4bef452..10fdcaaaea6 100644 --- a/test/jdk/java/nio/channels/SocketChannel/CloseTimeoutChannel.java +++ b/test/jdk/java/nio/channels/SocketChannel/CloseTimeoutChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public static void main(String args[]) throws Exception { try { System.out.println("Establishing connection"); Socket socket=SocketChannel.open( - new InetSocketAddress("127.0.0.1", port)).socket(); + new InetSocketAddress(InetAddress.getLoopbackAddress(), port)).socket(); OutputStream out=socket.getOutputStream(); InputStream in=socket.getInputStream(); diff --git a/test/jdk/java/nio/channels/SocketChannel/SocketInheritance.java b/test/jdk/java/nio/channels/SocketChannel/SocketInheritance.java index 1df065d2724..18e26b38c55 100644 --- a/test/jdk/java/nio/channels/SocketChannel/SocketInheritance.java +++ b/test/jdk/java/nio/channels/SocketChannel/SocketInheritance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ public void run() { // connect to the given port static SocketChannel connect(int port) throws IOException { - InetAddress lh = InetAddress.getByName("127.0.0.1"); + InetAddress lh = InetAddress.getLoopbackAddress(); InetSocketAddress isa = new InetSocketAddress(lh, port); return SocketChannel.open(isa); } diff --git a/test/jdk/java/nio/channels/etc/AdaptorCloseAndInterrupt.java b/test/jdk/java/nio/channels/etc/AdaptorCloseAndInterrupt.java index 368437a3803..5da7ed90db5 100644 --- a/test/jdk/java/nio/channels/etc/AdaptorCloseAndInterrupt.java +++ b/test/jdk/java/nio/channels/etc/AdaptorCloseAndInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,7 +93,7 @@ public static void main(String args[]) throws Exception { void scReadAsyncClose() throws IOException { try { SocketChannel sc = SocketChannel.open(new InetSocketAddress( - "127.0.0.1", port)); + InetAddress.getLoopbackAddress(), port)); sc.socket().setSoTimeout(30*1000); doAsyncClose(sc); @@ -115,7 +115,7 @@ void scReadAsyncClose() throws IOException { void scReadAsyncInterrupt() throws IOException { try { final SocketChannel sc = SocketChannel.open(new InetSocketAddress( - "127.0.0.1", port)); + InetAddress.getLoopbackAddress(), port)); sc.socket().setSoTimeout(30*1000); doAsyncInterrupt(); @@ -141,7 +141,7 @@ void scReadAsyncInterrupt() throws IOException { void dcReceiveAsyncClose() throws IOException { DatagramChannel dc = DatagramChannel.open(); dc.connect(new InetSocketAddress( - "127.0.0.1", port)); + InetAddress.getLoopbackAddress(), port)); dc.socket().setSoTimeout(30*1000); doAsyncClose(dc); @@ -159,7 +159,7 @@ void dcReceiveAsyncClose() throws IOException { void dcReceiveAsyncInterrupt() throws IOException { DatagramChannel dc = DatagramChannel.open(); dc.connect(new InetSocketAddress( - "127.0.0.1", port)); + InetAddress.getLoopbackAddress(), port)); dc.socket().setSoTimeout(30*1000); doAsyncInterrupt(); diff --git a/test/jdk/java/nio/channels/etc/Shadow.java b/test/jdk/java/nio/channels/etc/Shadow.java index fe75d9953dc..5ee3ebdb86e 100644 --- a/test/jdk/java/nio/channels/etc/Shadow.java +++ b/test/jdk/java/nio/channels/etc/Shadow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -107,7 +107,7 @@ public static void main(String[] args) throws Exception { // connect client socket to port SocketAddress connectAddr = - new InetSocketAddress("127.0.0.1", + new InetSocketAddress(InetAddress.getLoopbackAddress(), serverSocket.getLocalPort()); socket.connect(connectAddr); log.println("connected Socket: " + socket); diff --git a/test/jdk/java/nio/charset/coders/StreamTimeout.java b/test/jdk/java/nio/charset/coders/StreamTimeout.java index 1d8f1175c32..7f570cb5a2f 100644 --- a/test/jdk/java/nio/charset/coders/StreamTimeout.java +++ b/test/jdk/java/nio/charset/coders/StreamTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import java.io.PrintStream; import java.io.Reader; import java.io.Writer; +import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; @@ -47,7 +48,7 @@ private static class Client extends Thread implements Closeable { private final Socket so; Client(int port) throws IOException { - so = new Socket("127.0.0.1", port); + so = new Socket(InetAddress.getLoopbackAddress(), port); } @Override diff --git a/test/jdk/java/rmi/transport/readTimeout/ReadTimeoutTest.java b/test/jdk/java/rmi/transport/readTimeout/ReadTimeoutTest.java index 702b8796e7c..d10ca072f10 100644 --- a/test/jdk/java/rmi/transport/readTimeout/ReadTimeoutTest.java +++ b/test/jdk/java/rmi/transport/readTimeout/ReadTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,9 +82,9 @@ public static void main(String[] args) // Now, connect to that port //Thread.sleep(2000); - System.err.println("(connecting to listening port on 127.0.0.1:" + + System.err.println("(connecting to listening port on localhost:" + port + ")"); - DoS = new Socket("127.0.0.1", port); + DoS = new Socket(InetAddress.getLoopbackAddress(), port); InputStream stream = DoS.getInputStream(); // Read on the socket in the background diff --git a/test/jdk/jdk/net/Sockets/QuickAckTest.java b/test/jdk/jdk/net/Sockets/QuickAckTest.java index 612d1c05a0e..11a11721241 100644 --- a/test/jdk/jdk/net/Sockets/QuickAckTest.java +++ b/test/jdk/jdk/net/Sockets/QuickAckTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ */ import java.io.IOException; import java.net.DatagramSocket; +import java.net.InetAddress; import java.net.MulticastSocket; import java.net.ServerSocket; import java.net.Socket; @@ -38,12 +39,10 @@ public class QuickAckTest { - private static final String LOCAL_HOST = "127.0.0.1"; - public static void main(String args[]) throws IOException { try (ServerSocket ss = new ServerSocket(0); - Socket s = new Socket(LOCAL_HOST, ss.getLocalPort()); + Socket s = new Socket(InetAddress.getLoopbackAddress(), ss.getLocalPort()); DatagramSocket ds = new DatagramSocket(0); MulticastSocket mc = new MulticastSocket(0)) { diff --git a/test/jdk/jdk/net/Sockets/Test.java b/test/jdk/jdk/net/Sockets/Test.java index 639a7a1bcc3..bc1b92333cb 100644 --- a/test/jdk/jdk/net/Sockets/Test.java +++ b/test/jdk/jdk/net/Sockets/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,14 +79,14 @@ public static void main(String[] args) throws Exception { DatagramSocket dg = new DatagramSocket(0)) { int tcp_port = ss.getLocalPort(); - final InetAddress loop = InetAddress.getByName("127.0.0.1"); + final InetAddress loop = InetAddress.getLoopbackAddress(); final InetSocketAddress loopad = new InetSocketAddress(loop, tcp_port); final int udp_port = dg.getLocalPort(); - final Socket s = new Socket("127.0.0.1", tcp_port); + final Socket s = new Socket(loop, tcp_port); final SocketChannel sc = SocketChannel.open(); - sc.connect(new InetSocketAddress("127.0.0.1", tcp_port)); + sc.connect(new InetSocketAddress(loop, tcp_port)); doTest("Sockets.setOption Socket", () -> { out.println(flowIn); diff --git a/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java b/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java index ba729f84fe5..c291e2b469d 100644 --- a/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java +++ b/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From 4ebccd61a40f89ca64e04f35a846ea44e5c7e1e7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:33:21 +0000 Subject: [PATCH 105/177] 8223145: Replace wildcard address with loopback or local host in tests - part 1 Replaces binding to wildacard with alternative less susceptible to intermittent failure in some intermittently failing tests. Reviewed-by: mbaesken, phh Backport-of: 7d4520c109f408a7dbcdcc424dfef121e3eeaaa7 --- .../com/sun/net/httpserver/bugs/B6361557.java | 16 ++++++++++++---- test/jdk/java/net/Authenticator/B4722333.java | 15 ++++++++------- .../HttpURLConnection/UnmodifiableMaps.java | 16 ++++++++++++---- .../net/ResponseCache/ResponseCacheTest.java | 19 ++++++++++++++----- test/jdk/java/net/Socket/GetLocalAddress.java | 5 +++-- .../java/net/Socket/SetReceiveBufferSize.java | 10 +++++++--- test/jdk/java/net/Socket/SoTimeout.java | 5 +++-- test/jdk/java/net/Socket/TestAfterClose.java | 7 ++++--- test/jdk/java/net/Socket/UrgentDataTest.java | 6 ++++-- .../java/net/SocketOption/OptionsTest.java | 2 +- test/jdk/java/net/URL/GetContent.java | 14 +++++++++----- test/jdk/java/net/URLConnection/B5052093.java | 7 ++++--- .../net/URLPermission/nstest/LookupTest.java | 10 +++++++--- .../ftp/TestFtpClientNameListWithNull.java | 8 ++++++-- .../net/www/http/HttpClient/ProxyTest.java | 9 ++++++--- .../HttpURLConnection/NTLMAuthWithSM.java | 18 ++++++++++++++---- .../http/HttpURLConnection/PostOnDelete.java | 7 ++++--- .../KeepAliveStream/KeepAliveStreamClose.java | 13 ++++++++++--- .../sun/net/www/protocol/http/B8012625.java | 5 +++-- .../sun/net/www/protocol/http/Finalizer.java | 11 +++++++++-- .../protocol/http/ResponseCacheStream.java | 5 +++-- .../HttpsURLConnection/CookieHandlerTest.java | 15 +++++++++++---- 22 files changed, 154 insertions(+), 69 deletions(-) diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java index a1306f3895e..0b5ef9488f8 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java @@ -69,7 +69,8 @@ public void handle (HttpExchange t) public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); @@ -78,7 +79,7 @@ public static void main (String[] args) throws Exception { server.start (); InetSocketAddress destaddr = new InetSocketAddress ( - InetAddress.getLoopbackAddress(), server.getAddress().getPort() + loopback, server.getAddress().getPort() ); System.out.println ("destaddr " + destaddr); @@ -86,7 +87,10 @@ public static void main (String[] args) throws Exception { int requests = 0; int responses = 0; while (true) { - int selres = selector.select (1); + // we need to read responses from time to time: slightly + // increase the timeout with the amount of pending responses + // to give a chance to the server to reply. + int selres = selector.select (requests - responses + 1); Set selkeys = selector.selectedKeys(); for (SelectionKey key : selkeys) { if (key.isReadable()) { @@ -95,14 +99,18 @@ public static void main (String[] args) throws Exception { try { int x = chan.read(buf); if (x == -1 || responseComplete(buf)) { + System.out.print("_"); key.attach(null); chan.close(); responses++; } - } catch (IOException e) {} + } catch (IOException e) { + System.out.println(e); + } } } if (requests < NUM) { + System.out.print("."); SocketChannel schan = SocketChannel.open(destaddr); requestBuf.rewind(); int c = 0; diff --git a/test/jdk/java/net/Authenticator/B4722333.java b/test/jdk/java/net/Authenticator/B4722333.java index efc016f91a6..a8b317ee6d2 100644 --- a/test/jdk/java/net/Authenticator/B4722333.java +++ b/test/jdk/java/net/Authenticator/B4722333.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,13 +121,14 @@ public static void main (String[] args) throws Exception { MyAuthenticator auth = new MyAuthenticator (); Authenticator.setDefault (auth); try { - server = new TestHttpServer (new B4722333(), 1, 10, 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + server = new TestHttpServer (new B4722333(), 1, 10, loopback, 0); System.out.println ("Server started: listening on port: " + server.getLocalPort()); - client ("http://localhost:"+server.getLocalPort()+"/d1/d2/d3/foo.html"); - client ("http://localhost:"+server.getLocalPort()+"/ASD/d3/x.html"); - client ("http://localhost:"+server.getLocalPort()+"/biz/d3/x.html"); - client ("http://localhost:"+server.getLocalPort()+"/bar/d3/x.html"); - client ("http://localhost:"+server.getLocalPort()+"/fuzz/d3/x.html"); + client ("http://" + server.getAuthority() + "/d1/d2/d3/foo.html"); + client ("http://" + server.getAuthority() + "/ASD/d3/x.html"); + client ("http://" + server.getAuthority() + "/biz/d3/x.html"); + client ("http://" + server.getAuthority() + "/bar/d3/x.html"); + client ("http://" + server.getAuthority() + "/fuzz/d3/x.html"); } catch (Exception e) { if (server != null) { server.terminate(); diff --git a/test/jdk/java/net/HttpURLConnection/UnmodifiableMaps.java b/test/jdk/java/net/HttpURLConnection/UnmodifiableMaps.java index c8c6e1b54f6..2d7a078fa36 100644 --- a/test/jdk/java/net/HttpURLConnection/UnmodifiableMaps.java +++ b/test/jdk/java/net/HttpURLConnection/UnmodifiableMaps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,11 +24,13 @@ /** * @test * @bug 7128648 + * @library /test/lib * @modules jdk.httpserver * @summary HttpURLConnection.getHeaderFields should return an unmodifiable Map */ import java.io.IOException; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.URI; import java.net.HttpURLConnection; @@ -41,6 +43,7 @@ import com.sun.net.httpserver.HttpServer; import com.sun.net.httpserver.Headers; import static java.net.Proxy.NO_PROXY; +import jdk.test.lib.net.URIBuilder; public class UnmodifiableMaps { @@ -48,7 +51,12 @@ void test(String[] args) throws Exception { HttpServer server = startHttpServer(); try { InetSocketAddress address = server.getAddress(); - URI uri = new URI("http://localhost:" + address.getPort() + "/foo"); + URI uri = URIBuilder.newBuilder() + .scheme("http") + .host(address.getAddress()) + .port(address.getPort()) + .path("/foo") + .build(); doClient(uri); } finally { server.stop(0); @@ -78,7 +86,8 @@ void doClient(URI uri) throws Exception { // HTTP Server HttpServer startHttpServer() throws IOException { - HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + HttpServer httpServer = HttpServer.create(new InetSocketAddress(loopback, 0), 0); httpServer.createContext("/foo", new SimpleHandler()); httpServer.start(); return httpServer; @@ -146,4 +155,3 @@ public void instanceMain(String[] args) throws Throwable { System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} } - diff --git a/test/jdk/java/net/ResponseCache/ResponseCacheTest.java b/test/jdk/java/net/ResponseCache/ResponseCacheTest.java index ff252e04e02..b28fcd28073 100644 --- a/test/jdk/java/net/ResponseCache/ResponseCacheTest.java +++ b/test/jdk/java/net/ResponseCache/ResponseCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* @test * @summary Unit test for java.net.ResponseCache * @bug 4837267 + * @library /test/lib * @author Yingxian Wang */ @@ -31,6 +32,7 @@ import java.util.*; import java.io.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Request should get serviced by the cache handler. Response get @@ -90,14 +92,17 @@ public void run() { try { fis.close(); } catch (IOException unused) {} } } -static class NameVerifier implements HostnameVerifier { + static class NameVerifier implements HostnameVerifier { public boolean verify(String hostname, SSLSession session) { return true; } } ResponseCacheTest() throws Exception { /* start the server */ - ss = new ServerSocket(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(loopback, 0)); + (new Thread(this)).start(); /* establish http connection to server */ url1 = new URL("http://localhost/file1.cache"); @@ -126,8 +131,12 @@ public boolean verify(String hostname, SSLSession session) { http.disconnect(); // testing ResponseCacheHandler.put() - url2 = new URL("http://localhost:" + - Integer.toString(ss.getLocalPort())+"/file2.1"); + url2 = URIBuilder.newBuilder() + .scheme("http") + .host(ss.getInetAddress()) + .port(ss.getLocalPort()) + .path("/file2.1") + .toURL(); http = (HttpURLConnection)url2.openConnection(); System.out.println("responsecode2 is :"+http.getResponseCode()); Map> headers2 = http.getHeaderFields(); diff --git a/test/jdk/java/net/Socket/GetLocalAddress.java b/test/jdk/java/net/Socket/GetLocalAddress.java index 3e98bc9f294..7cada86a0c3 100644 --- a/test/jdk/java/net/Socket/GetLocalAddress.java +++ b/test/jdk/java/net/Socket/GetLocalAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,8 @@ public static void main(String args[]) throws Exception { int linger = 65546; int value = 0; addr = InetAddress.getLocalHost(); - ss = new ServerSocket(0); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(addr, 0)); port = ss.getLocalPort(); Thread t = new Thread(new GetLocalAddress()); diff --git a/test/jdk/java/net/Socket/SetReceiveBufferSize.java b/test/jdk/java/net/Socket/SetReceiveBufferSize.java index 3f848f1fee5..00a5d396bd6 100644 --- a/test/jdk/java/net/Socket/SetReceiveBufferSize.java +++ b/test/jdk/java/net/Socket/SetReceiveBufferSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,8 @@ * */ +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; import java.net.ServerSocket; @@ -37,8 +39,10 @@ public static void main(String[] args) throws Exception { } public SetReceiveBufferSize() throws Exception { - ServerSocket ss = new ServerSocket(0); - Socket s = new Socket("localhost", ss.getLocalPort()); + ServerSocket ss = new ServerSocket(); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ss.bind(new InetSocketAddress(loopback, 0)); + Socket s = new Socket(loopback, ss.getLocalPort()); Socket accepted = ss.accept(); try { s.setReceiveBufferSize(0); diff --git a/test/jdk/java/net/Socket/SoTimeout.java b/test/jdk/java/net/Socket/SoTimeout.java index 9c2204746dc..5432c392bfc 100644 --- a/test/jdk/java/net/Socket/SoTimeout.java +++ b/test/jdk/java/net/Socket/SoTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,8 @@ public class SoTimeout implements Runnable { public static void main(String[] args) throws Exception { addr = InetAddress.getLocalHost(); - serverSocket = new ServerSocket(0); + serverSocket = new ServerSocket(); + serverSocket.bind(new InetSocketAddress(addr, 0)); port = serverSocket.getLocalPort(); byte[] b = new byte[12]; diff --git a/test/jdk/java/net/Socket/TestAfterClose.java b/test/jdk/java/net/Socket/TestAfterClose.java index a8189c20eaf..16e7d6fbed9 100644 --- a/test/jdk/java/net/Socket/TestAfterClose.java +++ b/test/jdk/java/net/Socket/TestAfterClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,8 +39,9 @@ public class TestAfterClose public static void main(String[] args) { try { - ServerSocket ss = new ServerSocket(0, 0, null); - Socket socket = new Socket("localhost", ss.getLocalPort()); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ServerSocket ss = new ServerSocket(0, 0, loopback); + Socket socket = new Socket(loopback, ss.getLocalPort()); ss.accept(); ss.close(); test(socket); diff --git a/test/jdk/java/net/Socket/UrgentDataTest.java b/test/jdk/java/net/Socket/UrgentDataTest.java index a0db6924fc8..1f5ca282cbf 100644 --- a/test/jdk/java/net/Socket/UrgentDataTest.java +++ b/test/jdk/java/net/Socket/UrgentDataTest.java @@ -54,10 +54,12 @@ public static void main (String args[]) { try { UrgentDataTest test = new UrgentDataTest (); if (args.length == 0) { - test.listener = new ServerSocket (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + test.listener = new ServerSocket (); + test.listener.bind(new InetSocketAddress(loopback, 0)); test.isClient = true; test.isServer = true; - test.clHost = InetAddress.getLoopbackAddress().getHostAddress(); + test.clHost = loopback.getHostAddress(); test.clPort = test.listener.getLocalPort(); test.run(); } else if (args[0].equals ("-server")) { diff --git a/test/jdk/java/net/SocketOption/OptionsTest.java b/test/jdk/java/net/SocketOption/OptionsTest.java index f0a24427f51..f4d5fc72122 100644 --- a/test/jdk/java/net/SocketOption/OptionsTest.java +++ b/test/jdk/java/net/SocketOption/OptionsTest.java @@ -99,7 +99,7 @@ static NetworkInterface getNetworkInterface() { static void doSocketTests() throws Exception { try ( - ServerSocket srv = new ServerSocket(0); + ServerSocket srv = new ServerSocket(0, 50, InetAddress.getLoopbackAddress()); Socket c = new Socket(InetAddress.getLoopbackAddress(), srv.getLocalPort()); Socket s = srv.accept(); ) { diff --git a/test/jdk/java/net/URL/GetContent.java b/test/jdk/java/net/URL/GetContent.java index 70dbf219bd5..f39ce318c69 100644 --- a/test/jdk/java/net/URL/GetContent.java +++ b/test/jdk/java/net/URL/GetContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,11 +24,13 @@ /** * @test * @bug 4145315 + * @library /test/lib * @summary Test a read from nonexistant URL */ import java.net.*; import java.io.*; +import jdk.test.lib.net.URIBuilder; public class GetContent implements Runnable { @@ -71,10 +73,12 @@ public void run() { boolean error = true; try { - String name = "http://localhost:" + ss.getLocalPort() + - "/no-such-name"; - java.net.URL url = null; - url = new java.net.URL(name); + java.net.URL url = URIBuilder.newBuilder() + .scheme("http") + .host(ss.getInetAddress()) + .port(ss.getLocalPort()) + .path("/no-such-name") + .toURL(); Object obj = url.getContent(); InputStream in = (InputStream) obj; byte buff[] = new byte[200]; diff --git a/test/jdk/java/net/URLConnection/B5052093.java b/test/jdk/java/net/URLConnection/B5052093.java index 878a6427724..8ee347fccd9 100644 --- a/test/jdk/java/net/URLConnection/B5052093.java +++ b/test/jdk/java/net/URLConnection/B5052093.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,9 +64,10 @@ public void request(HttpTransaction req) { } public static void main(String[] args) throws Exception { - server = new TestHttpServer(new B5052093(), 1, 10, 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + server = new TestHttpServer(new B5052093(), 1, 10, loopback, 0); try { - URL url = new URL("http://localhost:"+server.getLocalPort()+"/foo"); + URL url = new URL("http://" + server.getAuthority() + "/foo"); URLConnection conn = url.openConnection(); int i = conn.getContentLength(); long l = conn.getContentLengthLong(); diff --git a/test/jdk/java/net/URLPermission/nstest/LookupTest.java b/test/jdk/java/net/URLPermission/nstest/LookupTest.java index 93c4e816148..10b764e0d56 100644 --- a/test/jdk/java/net/URLPermission/nstest/LookupTest.java +++ b/test/jdk/java/net/URLPermission/nstest/LookupTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.NetPermission; import java.net.ProxySelector; import java.net.ServerSocket; @@ -104,7 +106,7 @@ public static void main(String args[]) throws Exception { String hostsFileName = CWD + "/LookupTestHosts"; System.setProperty("jdk.net.hosts.file", hostsFileName); addMappingToHostsFile("allowedAndFound.com", - "127.0.0.1", + InetAddress.getLoopbackAddress().getHostAddress(), hostsFileName, false); addMappingToHostsFile("notAllowedButFound.com", @@ -131,7 +133,9 @@ static class Server extends Thread { private volatile boolean done; public Server() throws IOException { - serverSocket = new ServerSocket(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + serverSocket = new ServerSocket(); + serverSocket.bind(new InetSocketAddress(loopback, 0)); port = serverSocket.getLocalPort(); } diff --git a/test/jdk/sun/net/ftp/TestFtpClientNameListWithNull.java b/test/jdk/sun/net/ftp/TestFtpClientNameListWithNull.java index 7a142f628cb..e89439cd578 100644 --- a/test/jdk/sun/net/ftp/TestFtpClientNameListWithNull.java +++ b/test/jdk/sun/net/ftp/TestFtpClientNameListWithNull.java @@ -37,6 +37,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; @@ -52,7 +53,8 @@ public static void main(String[] args) throws Exception { FtpClient client = FtpClient.create()) { (new Thread(server)).start(); int port = server.getPort(); - client.connect(new InetSocketAddress("localhost", port)); + InetAddress loopback = InetAddress.getLoopbackAddress(); + client.connect(new InetSocketAddress(loopback, port)); client.nameList(null); } finally { if (commandHasArgs) { @@ -66,7 +68,9 @@ private static class FtpServer implements AutoCloseable, Runnable { private final ServerSocket serverSocket; FtpServer() throws IOException { - serverSocket = new ServerSocket(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + serverSocket = new ServerSocket(); + serverSocket.bind(new InetSocketAddress(loopback, 0)); } public void handleClient(Socket client) throws IOException { diff --git a/test/jdk/sun/net/www/http/HttpClient/ProxyTest.java b/test/jdk/sun/net/www/http/HttpClient/ProxyTest.java index 5bbd5781467..71b8660e4ec 100644 --- a/test/jdk/sun/net/www/http/HttpClient/ProxyTest.java +++ b/test/jdk/sun/net/www/http/HttpClient/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,9 @@ public void run() { } public HttpProxyServer() throws IOException { - server = new ServerSocket(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + server = new ServerSocket(); + server.bind(new InetSocketAddress(loopback, 0)); } public int getPort() { @@ -183,7 +185,8 @@ public ProxyTest() throws Exception { server.start(); int port = server.getPort(); - Proxy ftpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", port)); + InetAddress loopback = InetAddress.getLoopbackAddress(); + Proxy ftpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(loopback, port)); URL url = new URL(testURL); InputStream ins = (url.openConnection(ftpProxy)).getInputStream(); in = new BufferedReader(new InputStreamReader(ins)); diff --git a/test/jdk/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java b/test/jdk/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java index 6423de7e409..856ff506620 100644 --- a/test/jdk/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java +++ b/test/jdk/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.Authenticator; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.URL; @@ -62,8 +63,8 @@ public static void main(String[] args) throws Exception { // set authenticator Authenticator.setDefault(new AuthenticatorImpl()); - String url = String.format("http://localhost:%d/test/", - server.getPort()); + String url = String.format("http://%s/test/", + server.getAuthority()); // load a document which is protected with NTML authentication System.out.println("load() called: " + url); @@ -107,8 +108,9 @@ private LocalHttpServer(HttpServer server) { } static LocalHttpServer startServer() throws IOException { + InetAddress loopback = InetAddress.getLoopbackAddress(); HttpServer httpServer = HttpServer.create( - new InetSocketAddress(0), 0); + new InetSocketAddress(loopback, 0), 0); LocalHttpServer localHttpServer = new LocalHttpServer(httpServer); localHttpServer.start(); @@ -126,6 +128,14 @@ void stop() { System.out.println("HttpServer: stopped"); } + String getAuthority() { + InetAddress address = server.getAddress().getAddress(); + String hostaddr = address.isAnyLocalAddress() + ? "localhost" : address.getHostAddress(); + if (hostaddr.indexOf(':') > -1) hostaddr = "[" + hostaddr + "]"; + return hostaddr + ":" + getPort(); + } + int getPort() { return server.getAddress().getPort(); } diff --git a/test/jdk/sun/net/www/http/HttpURLConnection/PostOnDelete.java b/test/jdk/sun/net/www/http/HttpURLConnection/PostOnDelete.java index e785c426156..b1c13f8d92b 100644 --- a/test/jdk/sun/net/www/http/HttpURLConnection/PostOnDelete.java +++ b/test/jdk/sun/net/www/http/HttpURLConnection/PostOnDelete.java @@ -83,9 +83,10 @@ public void startServer() { } public String getAuthority() { - String address = server.getAddress().getHostString(); - address = (address.indexOf(':') >= 0) ? ("[" + address + "]") : address; - return address + ":" + getPort(); + InetAddress address = server.getAddress().getAddress(); + String hostaddr = address.isAnyLocalAddress() ? "localhost" : address.getHostAddress(); + hostaddr = (hostaddr.indexOf(':') >= 0) ? ("[" + hostaddr + "]") : hostaddr; + return hostaddr + ":" + getPort(); } public int getPort() { diff --git a/test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java b/test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java index d2f5490e9e8..29d6789df37 100644 --- a/test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java +++ b/test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,13 @@ * @test * @bug 4392195 * @summary Infinite loop in sun.net.www.http.KeepAliveStream [due to skip()] + * @library /test/lib * @run main/othervm/timeout=30 KeepAliveStreamClose */ import java.net.*; import java.io.*; +import jdk.test.lib.net.URIBuilder; public class KeepAliveStreamClose { static class XServer extends Thread { @@ -78,11 +80,16 @@ public void run() { public static void main (String[] args) { try { - ServerSocket serversocket = new ServerSocket (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ServerSocket serversocket = new ServerSocket (0, 50, loopback); int port = serversocket.getLocalPort (); XServer server = new XServer (serversocket); server.start (); - URL url = new URL ("http://localhost:"+port); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .toURL(); URLConnection urlc = url.openConnection (); InputStream is = urlc.getInputStream (); int i=0, c; diff --git a/test/jdk/sun/net/www/protocol/http/B8012625.java b/test/jdk/sun/net/www/protocol/http/B8012625.java index c99ab1c1aab..e92ffd57908 100644 --- a/test/jdk/sun/net/www/protocol/http/B8012625.java +++ b/test/jdk/sun/net/www/protocol/http/B8012625.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,8 @@ public void run() throws Exception { ExecutorService ex; public B8012625 () throws Exception { - server = HttpServer.create(new InetSocketAddress(0), 10); + InetAddress loopback = InetAddress.getLoopbackAddress(); + server = HttpServer.create(new InetSocketAddress(loopback, 0), 10); HttpContext ctx = server.createContext("/", this); ex = Executors.newFixedThreadPool(5); server.setExecutor(ex); diff --git a/test/jdk/sun/net/www/protocol/http/Finalizer.java b/test/jdk/sun/net/www/protocol/http/Finalizer.java index 6d6b33bc95b..2808bab9395 100644 --- a/test/jdk/sun/net/www/protocol/http/Finalizer.java +++ b/test/jdk/sun/net/www/protocol/http/Finalizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,8 +80,11 @@ public void run() { public class Finalizer { public static void main (String args[]) { + ServerSocket serversocket = null; try { - ServerSocket serversocket = new ServerSocket (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + serversocket = new ServerSocket(); + serversocket.bind(new InetSocketAddress(loopback, 0)); int port = serversocket.getLocalPort (); XServer server = new XServer (serversocket); server.start (); @@ -107,6 +110,10 @@ public static void main (String args[]) { } catch (IOException e) { throw new RuntimeException("finalize method failure."+e); } catch (InterruptedException ie) { + } finally { + if (serversocket != null) { + try {serversocket.close();} catch (IOException io) {} + } } } diff --git a/test/jdk/sun/net/www/protocol/http/ResponseCacheStream.java b/test/jdk/sun/net/www/protocol/http/ResponseCacheStream.java index 491299384da..89a7f8afc4a 100644 --- a/test/jdk/sun/net/www/protocol/http/ResponseCacheStream.java +++ b/test/jdk/sun/net/www/protocol/http/ResponseCacheStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,8 +99,9 @@ public byte[] getBuffer() { public static void main(String[] args) throws Exception { MyResponseCache cache = new MyResponseCache(); try { + InetAddress loopback = InetAddress.getLoopbackAddress(); ResponseCache.setDefault(cache); - server = new TestHttpServer (new ResponseCacheStream()); + server = new TestHttpServer (new ResponseCacheStream(), loopback, 0); System.out.println ("Server: listening on port: " + server.getLocalPort()); URL url = URIBuilder.newBuilder() .scheme("http") diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java index 565138c143d..4d17e87c6d7 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* @test * @bug 4696506 4942650 * @summary Unit test for java.net.CookieHandler + * @library /test/lib * @run main/othervm CookieHandlerTest * * SunJSSE does not support dynamic system properties, no way to re-use @@ -35,6 +36,7 @@ import java.util.*; import java.io.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class CookieHandlerTest { static Map cookies; @@ -78,10 +80,12 @@ public class CookieHandlerTest { * to avoid infinite hangs. */ void doServerSide() throws Exception { + InetAddress loopback = InetAddress.getLoopbackAddress(); SSLServerSocketFactory sslssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(new InetSocketAddress(loopback, serverPort)); serverPort = sslServerSocket.getLocalPort(); /* @@ -151,8 +155,11 @@ void doClientSide() throws Exception { } HttpsURLConnection http = null; /* establish http connection to server */ - String uri = "https://localhost:" + +serverPort ; - URL url = new URL(uri); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .toURL(); HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier()); http = (HttpsURLConnection)url.openConnection(); From ef475f76546b1a1e9ca1f5f3fbb6fa68d02f2c99 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:38:19 +0000 Subject: [PATCH 106/177] 8224204: Replace wildcard address with loopback or local host in tests - part 10 Fixed intermittently failing tests Backport-of: a974268f17f5059021680fec7af9dc83409a6daa --- .../nameservice/simple/DefaultCaching.java | 86 ++++++++------ .../KeepAliveCache/KeepAliveTimerThread.java | 10 +- .../http/KeepAliveStream/InfiniteLoop.java | 18 ++- .../sun/net/www/protocol/http/B6369510.java | 10 +- .../protocol/http/BasicLongCredentials.java | 21 +++- .../sun/net/www/protocol/http/NTLMTest.java | 110 +++++++++++------- .../https/HttpsURLConnection/HttpsPost.java | 20 +++- .../HttpsURLConnection/PostThruProxy.java | 59 ++++++---- .../PostThruProxyWithAuth.java | 53 +++++++-- .../HttpsURLConnection/ProxyTunnelServer.java | 37 +++++- .../https/HttpsURLConnection/RetryHttps.java | 30 ++++- 11 files changed, 312 insertions(+), 142 deletions(-) diff --git a/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java b/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java index df3aef6e232..d3c31ceac9b 100644 --- a/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java +++ b/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,98 +33,112 @@ import java.io.FileWriter; import java.io.PrintWriter; import java.io.BufferedWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; public class DefaultCaching { public static void main(String args[]) throws Exception { - String hostsFileName = System.getProperty("test.src", ".") + "/DefaultCachingHosts"; + String hostsFileNameSrc = System.getProperty("test.src", ".") + "/DefaultCachingHosts"; + String hostsFileName = System.getProperty("user.dir", ".") + "/DefaultCachingHosts"; + if (!hostsFileNameSrc.equals(hostsFileName)) { + Files.copy(Path.of(hostsFileNameSrc), Path.of(hostsFileName), REPLACE_EXISTING); + System.out.println("Host file created: " + hostsFileName); + } System.setProperty("jdk.net.hosts.file", hostsFileName); // initial mapping // name service needs to resolve this. addMappingToHostsFile("theclub", "129.156.220.219", hostsFileName, false); - test ("theclub", "129.156.220.219", true); // lk: 1 - test ("luster", "1.16.20.2", false); // lk: 2 + test("theclub", "129.156.220.219", true); // lk: 1 + test("luster", "1.16.20.2", false); // lk: 2 // name service now needs to know about luster addMappingToHostsFile("luster", "10.5.18.21", hostsFileName, true); - test ("luster", "1.16.20.2", false); // lk: 2 - sleep (10+1); + test("luster", "1.16.20.2", false); // lk: 2 + sleep(10+1); test("luster", "10.5.18.21", true, 3); // lk: 3 - sleep (5); + sleep(5); // new mapping for theclub and rewrite existing foo and luster mappings addMappingToHostsFile("theclub", "129.156.220.1", hostsFileName, false); addMappingToHostsFile("foo", "10.5.18.22", hostsFileName, true); addMappingToHostsFile("luster", "10.5.18.21", hostsFileName, true); - test ("theclub", "129.156.220.219", true, 3); - test ("luster", "10.5.18.21", true, 3); - test ("bar", "10.5.18.22", false, 4); - test ("foo", "10.5.18.22", true, 5); + test("theclub", "129.156.220.219", true, 3); + test("luster", "10.5.18.21", true, 3); + test("bar", "10.5.18.22", false, 4); + test("foo", "10.5.18.22", true, 5); // now delay to see if theclub has expired - sleep (5); + sleep(5); - test ("foo", "10.5.18.22", true, 5); - test ("theclub", "129.156.220.1", true, 6); + test("foo", "10.5.18.22", true, 5); + test("theclub", "129.156.220.1", true, 6); - sleep (11); + sleep(11); // now see if luster has expired - test ("luster", "10.5.18.21", true, 7); - test ("theclub", "129.156.220.1", true, 7); + test("luster", "10.5.18.21", true, 7); + test("theclub", "129.156.220.1", true, 7); // now delay to see if 3rd has expired - sleep (10+6); + sleep(10+6); - test ("theclub", "129.156.220.1", true, 8); - test ("luster", "10.5.18.21", true, 8); - test ("foo", "10.5.18.22", true, 9); + test("theclub", "129.156.220.1", true, 8); + test("luster", "10.5.18.21", true, 8); + test("foo", "10.5.18.22", true, 9); } /* throws RuntimeException if it fails */ - static void test (String host, String address, - boolean shouldSucceed, int count) { - test (host, address, shouldSucceed); + static void test(String host, String address, + boolean shouldSucceed, int count) { + test(host, address, shouldSucceed); } - static void sleep (int seconds) { + static void sleep(int seconds) { try { - Thread.sleep (seconds * 1000); + Thread.sleep(seconds * 1000); } catch (InterruptedException e) {} } - static void test (String host, String address, boolean shouldSucceed) { + static void test(String host, String address, boolean shouldSucceed) { InetAddress addr = null; try { - addr = InetAddress.getByName (host); + addr = InetAddress.getByName(host); if (!shouldSucceed) { - throw new RuntimeException (host+":"+address+": should fail"); - + throw new RuntimeException(host+":"+address+": should fail (got " + + addr + ")"); } if (!address.equals(addr.getHostAddress())) { - throw new RuntimeException(host+":"+address+": compare failed"); + throw new RuntimeException(host+":"+address+": compare failed (found " + + addr + ")"); } + System.out.println("test: " + host + "/" + address + + " succeeded - got " + addr); } catch (UnknownHostException e) { if (shouldSucceed) { throw new RuntimeException(host+":"+address+": should succeed"); + } else { + System.out.println("test: " + host + "/" + address + + " succeeded - got expected " + e); } } } - private static void addMappingToHostsFile (String host, - String addr, - String hostsFileName, - boolean append) + private static void addMappingToHostsFile(String host, + String addr, + String hostsFileName, + boolean append) throws Exception { String mapping = addr + " " + host; try (PrintWriter hfPWriter = new PrintWriter(new BufferedWriter( new FileWriter(hostsFileName, append)))) { hfPWriter.println(mapping); -} + } } } diff --git a/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java b/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java index 9a6b3dc905f..d29d705cc01 100644 --- a/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java +++ b/test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ * @library /test/lib * @bug 4701299 * @summary Keep-Alive-Timer thread management in KeepAliveCache causes memory leak + * @run main KeepAliveTimerThread + * @run main/othervm -Djava.net.preferIPv6Addresses=true KeepAliveTimerThread */ import java.net.*; @@ -103,8 +105,10 @@ public void run() { public static void main(String args[]) throws Exception { - ServerSocket ss = new ServerSocket(0); - Server s = new Server (ss); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ServerSocket ss = new ServerSocket(); + ss.bind(new InetSocketAddress(loopback, 0)); + Server s = new Server(ss); s.start(); URL url = URIBuilder.newBuilder() diff --git a/test/jdk/sun/net/www/http/KeepAliveStream/InfiniteLoop.java b/test/jdk/sun/net/www/http/KeepAliveStream/InfiniteLoop.java index b3f0ced39dc..106d4ffffa4 100644 --- a/test/jdk/sun/net/www/http/KeepAliveStream/InfiniteLoop.java +++ b/test/jdk/sun/net/www/http/KeepAliveStream/InfiniteLoop.java @@ -26,6 +26,9 @@ * @bug 8004863 * @modules jdk.httpserver * @summary Checks for proper close code in KeepAliveStream + * @library /test/lib + * @run main InfiniteLoop + * @run main/othervm -Djava.net.preferIPv6Addresses=true InfiniteLoop */ import com.sun.net.httpserver.HttpExchange; @@ -35,10 +38,14 @@ import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; +import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.Proxy; import java.net.URL; import java.util.concurrent.Phaser; +import jdk.test.lib.net.URIBuilder; + // Racey test, will not always fail, but if it does then we have a problem. public class InfiniteLoop { @@ -49,11 +56,16 @@ public static void main(String[] args) throws Exception { server.start(); try { InetSocketAddress address = server.getAddress(); - URL url = new URL("http://localhost:" + address.getPort() - + "/test/InfiniteLoop"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(server.getAddress().getAddress()) + .port(server.getAddress().getPort()) + .path("/test/InfiniteLoop") + .toURL(); final Phaser phaser = new Phaser(2); for (int i=0; i<10; i++) { - HttpURLConnection uc = (HttpURLConnection)url.openConnection(); + HttpURLConnection uc = (HttpURLConnection) + url.openConnection(Proxy.NO_PROXY); final InputStream is = uc.getInputStream(); final Thread thread = new Thread() { public void run() { diff --git a/test/jdk/sun/net/www/protocol/http/B6369510.java b/test/jdk/sun/net/www/protocol/http/B6369510.java index 2068b04b5b2..d03a138c17b 100644 --- a/test/jdk/sun/net/www/protocol/http/B6369510.java +++ b/test/jdk/sun/net/www/protocol/http/B6369510.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,11 +59,12 @@ public B6369510() void doClient() { try { InetSocketAddress address = httpServer.getAddress(); - String urlString = "http://" + InetAddress.getLocalHost().getHostName() + ":" + address.getPort() + "/test/"; + String urlString = "http://" + InetAddress.getLocalHost().getHostName() + + ":" + address.getPort() + "/test/"; System.out.println("URL == " + urlString); // GET Request - URL url = new URL("http://" + InetAddress.getLocalHost().getHostName() + ":" + address.getPort() + "/test/"); + URL url = new URL(urlString); HttpURLConnection uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); int resp = uc.getResponseCode(); if (resp != 200) @@ -95,7 +96,8 @@ void doClient() { * Http Server */ public void startHttpServer() throws IOException { - httpServer = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(0), 0); + InetAddress localhost = InetAddress.getLocalHost(); + httpServer = HttpServer.create(new InetSocketAddress(localhost, 0), 0); // create HttpServer context HttpContext ctx = httpServer.createContext("/test/", new MyHandler()); diff --git a/test/jdk/sun/net/www/protocol/http/BasicLongCredentials.java b/test/jdk/sun/net/www/protocol/http/BasicLongCredentials.java index 02e54b1529d..28ab3456851 100644 --- a/test/jdk/sun/net/www/protocol/http/BasicLongCredentials.java +++ b/test/jdk/sun/net/www/protocol/http/BasicLongCredentials.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,9 @@ * @bug 6947917 * @modules jdk.httpserver * @summary Error in basic authentication when user name and password are long + * @library /test/lib + * @run main BasicLongCredentials + * @run main/othervm -Djava.net.preferIPv6Addresses=true BasicLongCredentials */ import com.sun.net.httpserver.BasicAuthenticator; @@ -37,11 +40,15 @@ import java.io.InputStream; import java.io.IOException; import java.net.Authenticator; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; +import java.net.Proxy; import java.net.HttpURLConnection; import java.net.URL; +import jdk.test.lib.net.URIBuilder; + public class BasicLongCredentials { static final String USERNAME = "ThisIsMyReallyReallyReallyReallyReallyReally" + @@ -51,7 +58,8 @@ public class BasicLongCredentials { static final String REALM = "foobar@test.realm"; public static void main (String[] args) throws Exception { - HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + HttpServer server = HttpServer.create(new InetSocketAddress(loopback, 0), 0); try { Handler handler = new Handler(); HttpContext ctx = server.createContext("/test", handler); @@ -66,8 +74,13 @@ public boolean checkCredentials (String username, String pw) { Authenticator.setDefault(new MyAuthenticator()); - URL url = new URL("http://localhost:"+server.getAddress().getPort()+"/test/"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(server.getAddress().getAddress()) + .port(server.getAddress().getPort()) + .path("/test/") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); InputStream is = urlc.getInputStream(); int c = 0; while (is.read()!= -1) { c ++; } diff --git a/test/jdk/sun/net/www/protocol/http/NTLMTest.java b/test/jdk/sun/net/www/protocol/http/NTLMTest.java index d9db4fdacfb..73d0cb98603 100644 --- a/test/jdk/sun/net/www/protocol/http/NTLMTest.java +++ b/test/jdk/sun/net/www/protocol/http/NTLMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 6520665 6357133 * @modules java.base/sun.net.www + * @library /test/lib * @run main/othervm NTLMTest * @summary 6520665 & 6357133: NTLM authentication issues. */ @@ -32,35 +33,41 @@ import java.net.*; import java.io.*; import sun.net.www.MessageHeader; +import jdk.test.lib.net.URIBuilder; public class NTLMTest { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { Authenticator.setDefault(new NullAuthenticator()); try { - // Test with direct connection. - ServerSocket serverSS = new ServerSocket(0); - startServer(serverSS, false); - runClient(Proxy.NO_PROXY, serverSS.getLocalPort()); + InetAddress loopback = InetAddress.getLoopbackAddress(); + // Test with direct connection. + try (NTLMServer server = startServer(new ServerSocket(0, 0, loopback), false)) { + runClient(Proxy.NO_PROXY, server.getLocalPort()); + } // Test with proxy. - serverSS = new ServerSocket(0); - startServer(serverSS, true /*proxy*/); - SocketAddress proxyAddr = new InetSocketAddress("localhost", serverSS.getLocalPort()); - runClient(new Proxy(java.net.Proxy.Type.HTTP, proxyAddr), 8888); - + try (NTLMServer server = + startServer(new ServerSocket(0, 0, loopback), true /*proxy*/)) { + SocketAddress proxyAddr = new InetSocketAddress(loopback, server.getLocalPort()); + runClient(new Proxy(java.net.Proxy.Type.HTTP, proxyAddr), 8888); + } } catch (IOException e) { - e.printStackTrace(); + throw e; } } static void runClient(Proxy proxy, int serverPort) { try { - String urlStr = "http://localhost:" + serverPort + "/"; - URL url = new URL(urlStr); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(serverPort) + .path("/") + .toURLUnchecked(); HttpURLConnection uc = (HttpURLConnection) url.openConnection(proxy); - uc.getInputStream(); + uc.getInputStream().readAllBytes(); } catch (ProtocolException e) { /* java.net.ProtocolException: Server redirected too many times (20) */ @@ -70,6 +77,7 @@ static void runClient(Proxy proxy, int serverPort) { * returned HTTP response code: 401 for URL: ..." */ //ioe.printStackTrace(); + System.out.println("Got expected " + ioe); } catch (NullPointerException npe) { throw new RuntimeException("Failed: NPE thrown ", npe); } @@ -93,34 +101,56 @@ static void runClient(Proxy proxy, int serverPort) { "Content-Length: 0\r\n" + "Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==\r\n\r\n"}; - static void startServer(ServerSocket serverSS, boolean proxy) { - final ServerSocket ss = serverSS; - final boolean isProxy = proxy; - - Thread thread = new Thread(new Runnable() { - public void run() { - boolean doing2ndStageNTLM = false; - while (true) { - try { - Socket s = ss.accept(); - if (!doing2ndStageNTLM) { - handleConnection(s, isProxy ? proxyResp : serverResp, 0, 1); - doing2ndStageNTLM = true; - } else { - handleConnection(s, isProxy ? proxyResp : serverResp, 1, 2); - doing2ndStageNTLM = false; - } - connectionCount++; - //System.out.println("connectionCount = " + connectionCount); - - } catch (IOException ioe) { - ioe.printStackTrace(); + static class NTLMServer extends Thread implements AutoCloseable { + final ServerSocket ss; + final boolean isProxy; + volatile boolean closed; + + NTLMServer(ServerSocket serverSS, boolean proxy) { + super(); + setDaemon(true); + ss = serverSS; + isProxy = proxy; + } + + public int getLocalPort() { return ss.getLocalPort(); } + + @Override + public void run() { + boolean doing2ndStageNTLM = false; + while (!closed) { + try { + Socket s = ss.accept(); + if (!doing2ndStageNTLM) { + handleConnection(s, isProxy ? proxyResp : serverResp, 0, 1); + doing2ndStageNTLM = true; + } else { + handleConnection(s, isProxy ? proxyResp : serverResp, 1, 2); + doing2ndStageNTLM = false; } + connectionCount++; + //System.out.println("connectionCount = " + connectionCount); + } catch (IOException ioe) { + if (!closed) ioe.printStackTrace(); } - } }); - thread.setDaemon(true); - thread.start(); + } + } + + @Override + public void close() { + if (closed) return; + synchronized(this) { + if (closed) return; + closed = true; + } + try { ss.close(); } catch (IOException x) { }; + } + } + public static NTLMServer startServer(ServerSocket serverSS, boolean proxy) { + NTLMServer server = new NTLMServer(serverSS, proxy); + server.start(); + return server; } static int connectionCount = 0; diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java index 7964234dbfd..a819139f5a5 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,9 @@ * @bug 4423074 * @summary Need to rebase all the duplicated classes from Merlin. * This test will check out http POST + * @library /test/lib * @run main/othervm HttpsPost + * @run main/othervm -Djava.net.preferIPv6Addresses=true HttpsPost * * SunJSSE does not support dynamic system properties, no way to re-use * system properties in samevm/agentvm mode. @@ -35,6 +37,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class HttpsPost { @@ -95,12 +98,16 @@ public class HttpsPost { * to avoid infinite hangs. */ void doServerSide() throws Exception { + InetAddress loopback = InetAddress.getLoopbackAddress(); SSLServerSocketFactory sslssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(serverPort, 0, loopback); serverPort = sslServerSocket.getLocalPort(); + System.out.println("Starting server at: " + + sslServerSocket.getInetAddress() + + ":" + serverPort); /* * Signal Client, we're ready for his connect. */ @@ -155,10 +162,15 @@ void doClientSide() throws Exception { } // Send HTTP POST request to server - URL url = new URL("https://localhost:"+serverPort); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .toURL(); + System.out.println("Client connecting to: " + url); HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier()); - HttpsURLConnection http = (HttpsURLConnection)url.openConnection(); + HttpsURLConnection http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); http.setDoOutput(true); http.setRequestMethod("POST"); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java index eeb1150464e..4efc7df483f 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,7 @@ import javax.net.*; import javax.net.ssl.*; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.net.URIBuilder; /* * @test @@ -39,12 +38,6 @@ * that serves http POST method requests in secure channel, and a client * that makes https POST request through a proxy. * @library /test/lib - * @build jdk.test.lib.Utils - * jdk.test.lib.Asserts - * jdk.test.lib.JDKToolFinder - * jdk.test.lib.JDKToolLauncher - * jdk.test.lib.Platform - * jdk.test.lib.process.* * @compile OriginServer.java ProxyTunnelServer.java * @run main/othervm PostThruProxy */ @@ -62,6 +55,9 @@ public class PostThruProxy { static String passwd = "passphrase"; private static int serverPort = 0; + private static ProxyTunnelServer pserver; + private static TestServer server; + static final String RESPONSE_MSG = "Https POST thru proxy is successful"; /* * The TestServer implements a OriginServer that @@ -79,8 +75,7 @@ public TestServer(ServerSocket ss) throws Exception { * @return bytes for the data in the response */ public byte[] getBytes() { - return "Https POST thru proxy is successful". - getBytes(); + return RESPONSE_MSG.getBytes(); } } @@ -88,6 +83,7 @@ public byte[] getBytes() { * Main method to create the server and client */ public static void main(String args[]) throws Exception { + String keyFilename = TEST_SRC + "/" + pathToStores + "/" + keyStoreFile; String trustFilename = TEST_SRC + "/" + pathToStores + "/" + trustStoreFile; @@ -97,16 +93,18 @@ public static void main(String args[]) throws Exception { System.setProperty("javax.net.ssl.trustStore", trustFilename); System.setProperty("javax.net.ssl.trustStorePassword", passwd); + InetAddress loopback = InetAddress.getLoopbackAddress(); boolean useSSL = true; /* * setup the server */ try { ServerSocketFactory ssf = getServerSocketFactory(useSSL); - ServerSocket ss = ssf.createServerSocket(serverPort); + ServerSocket ss = ssf.createServerSocket(serverPort, 0, loopback); ss.setSoTimeout(TIMEOUT); // 30 seconds serverPort = ss.getLocalPort(); - new TestServer(ss); + server = new TestServer(ss); + System.out.println("Server started at: " + ss); } catch (Exception e) { System.out.println("Server side failed:" + e.getMessage()); @@ -120,6 +118,12 @@ public static void main(String args[]) throws Exception { e.getMessage()); throw e; } + long connectCount = pserver.getConnectCount(); + if (connectCount == 0) { + throw new AssertionError("Proxy was not used!"); + } else { + System.out.println("Proxy CONNECT count: " + connectCount); + } } private static ServerSocketFactory getServerSocketFactory @@ -162,9 +166,15 @@ static void doClientSide() throws Exception { */ HttpsURLConnection.setDefaultHostnameVerifier( new NameVerifier()); - URL url = new URL("https://" + getHostname() +":" + serverPort); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .toURL(); Proxy p = new Proxy(Proxy.Type.HTTP, pAddr); + System.out.println("Client connecting to: " + url); + System.out.println("Through proxy: " + pAddr); HttpsURLConnection https = (HttpsURLConnection)url.openConnection(p); https.setConnectTimeout(TIMEOUT); https.setReadTimeout(TIMEOUT); @@ -185,9 +195,15 @@ static void doClientSide() throws Exception { new InputStreamReader( https.getInputStream())); String inputLine; - while ((inputLine = in.readLine()) != null) + boolean msgFound = false; + while ((inputLine = in.readLine()) != null) { System.out.println("Client received: " + inputLine); + if (inputLine.contains(RESPONSE_MSG)) msgFound = true; + } in.close(); + if (!msgFound) { + throw new RuntimeException("POST message not found."); + } } catch (SSLException e) { if (ps != null) ps.close(); @@ -208,20 +224,13 @@ public boolean verify(String hostname, SSLSession session) { } static SocketAddress setupProxy() throws IOException { - ProxyTunnelServer pserver = new ProxyTunnelServer(); + InetAddress loopback = InetAddress.getLoopbackAddress(); + pserver = new ProxyTunnelServer(loopback); // disable proxy authentication pserver.needUserAuth(false); pserver.start(); - return new InetSocketAddress("localhost", pserver.getPort()); + return new InetSocketAddress(loopback, pserver.getPort()); } - private static String getHostname() { - try { - OutputAnalyzer oa = ProcessTools.executeCommand("hostname"); - return oa.getOutput().trim(); - } catch (Throwable e) { - throw new RuntimeException("Get hostname failed.", e); - } - } } diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java index 0c6c06facaf..c1e5b3d4413 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -29,6 +29,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.net.URIBuilder; /* * @test @@ -47,6 +48,8 @@ * jdk.test.lib.process.* * @compile OriginServer.java ProxyTunnelServer.java * @run main/othervm -Djdk.http.auth.tunneling.disabledSchemes= PostThruProxyWithAuth + * @run main/othervm -Djava.net.preferIPv6Addresses=true + -Djdk.http.auth.tunneling.disabledSchemes= PostThruProxyWithAuth */ public class PostThruProxyWithAuth { @@ -62,6 +65,11 @@ public class PostThruProxyWithAuth { static String passwd = "passphrase"; volatile private static int serverPort = 0; + private static ProxyTunnelServer pserver; + private static TestServer server; + + static final String RESPONSE_MSG = + "Https POST thru proxy is successful with proxy authentication"; /* * The TestServer implements a OriginServer that @@ -79,9 +87,7 @@ public TestServer(ServerSocket ss) throws Exception { * @return bytes for the data in the response */ public byte[] getBytes() { - return - "Https POST thru proxy is successful with proxy authentication". - getBytes(); + return RESPONSE_MSG.getBytes(); } } @@ -103,11 +109,13 @@ public static void main(String args[]) throws Exception { * setup the server */ try { + InetAddress localhost = InetAddress.getLocalHost(); ServerSocketFactory ssf = getServerSocketFactory(useSSL); - ServerSocket ss = ssf.createServerSocket(serverPort); + ServerSocket ss = ssf.createServerSocket(serverPort, 0, localhost); ss.setSoTimeout(TIMEOUT); // 30 seconds serverPort = ss.getLocalPort(); - new TestServer(ss); + server = new TestServer(ss); + System.out.println("Server started at: " + ss); } catch (Exception e) { System.out.println("Server side failed:" + e.getMessage()); @@ -120,7 +128,13 @@ public static void main(String args[]) throws Exception { System.out.println("Client side failed: " + e.getMessage()); throw e; - } + } + long connectCount = pserver.getConnectCount(); + if (connectCount == 0) { + throw new AssertionError("Proxy was not used!"); + } else { + System.out.println("Proxy CONNECT count: " + connectCount); + } } private static ServerSocketFactory getServerSocketFactory @@ -160,9 +174,16 @@ static void doClientSide() throws Exception { */ HttpsURLConnection.setDefaultHostnameVerifier( new NameVerifier()); - URL url = new URL("https://" + getHostname() + ":" + serverPort); + + URL url = URIBuilder.newBuilder() + .scheme("https") + .host(getHostname()) + .port(serverPort) + .toURL(); Proxy p = new Proxy(Proxy.Type.HTTP, pAddr); + System.out.println("Client connecting to: " + url); + System.out.println("Through proxy: " + pAddr); HttpsURLConnection https = (HttpsURLConnection)url.openConnection(p); https.setConnectTimeout(TIMEOUT); https.setReadTimeout(TIMEOUT); @@ -182,9 +203,15 @@ static void doClientSide() throws Exception { new InputStreamReader( https.getInputStream())); String inputLine; - while ((inputLine = in.readLine()) != null) - System.out.println("Client received: " + inputLine); + boolean msgFound = false; + while ((inputLine = in.readLine()) != null) { + System.out.println("Client received: " + inputLine); + if (inputLine.contains(RESPONSE_MSG)) msgFound = true; + } in.close(); + if (!msgFound) { + throw new RuntimeException("POST message not found."); + } } catch (SSLException e) { if (ps != null) ps.close(); @@ -202,7 +229,9 @@ public boolean verify(String hostname, SSLSession session) { } static SocketAddress setupProxy() throws IOException { - ProxyTunnelServer pserver = new ProxyTunnelServer(); + + InetAddress localhost = InetAddress.getLocalHost(); + pserver = new ProxyTunnelServer(localhost); /* * register a system wide authenticator and setup the proxy for @@ -216,7 +245,7 @@ static SocketAddress setupProxy() throws IOException { pserver.start(); - return new InetSocketAddress("localhost", pserver.getPort()); + return new InetSocketAddress(localhost, pserver.getPort()); } public static class TestAuthenticator extends Authenticator { diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ProxyTunnelServer.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ProxyTunnelServer.java index 02a7af75317..dc6dcfeff67 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ProxyTunnelServer.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ProxyTunnelServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -63,11 +63,23 @@ public class ProxyTunnelServer extends Thread { */ static boolean needAuth = false; + volatile long connectCount; + public ProxyTunnelServer() throws IOException { if (ss == null) { ss = (ServerSocket) ServerSocketFactory.getDefault() .createServerSocket(0); ss.setSoTimeout(TIMEOUT); + System.out.println("Proxy server created: " + ss); + } + } + + public ProxyTunnelServer(InetAddress address) throws IOException { + if (ss == null) { + ss = (ServerSocket) ServerSocketFactory.getDefault() + .createServerSocket(0, 0, address); + ss.setSoTimeout(TIMEOUT); + System.out.println("Proxy server created: " + ss); } } @@ -86,7 +98,9 @@ public void setUserAuth(String uname, String passwd) { public void run() { try { + System.out.println("Proxy server listening at: " + ss); clientSocket = ss.accept(); + System.out.println("Proxy server accepted connection: " + clientSocket); processRequests(); } catch (SocketTimeoutException e) { System.out.println( @@ -101,7 +115,9 @@ public void run() { System.out.println("ProxyServer close error: " + excep); excep.printStackTrace(); } - } + } finally { + System.out.println("Proxy server: request served"); + } } /* @@ -118,6 +134,7 @@ private void processRequests() throws Exception { String statusLine = mheader.getValue(0); if (statusLine.startsWith("CONNECT")) { + synchronized(this) { connectCount++; } // retrieve the host and port info from the status-line retrieveConnectInfo(statusLine); if (needAuth) { @@ -154,6 +171,10 @@ private void processRequests() throws Exception { } } + public long getConnectCount() { + return connectCount; + } + private void respondForConnect(boolean needAuth) throws Exception { OutputStream out = clientSocket.getOutputStream(); @@ -273,13 +294,19 @@ private void retrieveConnectInfo(String connectStr) throws Exception { endi = connectStr.lastIndexOf(' '); connectInfo = connectStr.substring(starti+1, endi).trim(); // retrieve server name and port - endi = connectInfo.indexOf(':'); - serverName = connectInfo.substring(0, endi); + if (connectInfo.charAt(0) == '[') { + endi = connectInfo.indexOf(']'); + serverName = connectInfo.substring(1, endi++); + assert connectInfo.charAt(endi) == ':' : "Expected [IPv6]:port"; + } else { + endi = connectInfo.indexOf(':'); + serverName = connectInfo.substring(0, endi); + } serverPort = Integer.parseInt(connectInfo.substring(endi+1)); } catch (Exception e) { throw new IOException("Proxy recieved a request: " + connectStr, e); - } + } serverInetAddr = InetAddress.getByName(serverName); } diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java index ae5da4078e0..5c5cceb106b 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,9 @@ /* @test * @bug 4799427 * @summary Https can not retry request + * @library /test/lib * @run main/othervm RetryHttps + * @run main/othervm -Djava.net.preferIPv6Addresses=true RetryHttps * * SunJSSE does not support dynamic system properties, no way to re-use * system properties in samevm/agentvm mode. @@ -35,6 +37,7 @@ import java.util.*; import java.io.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class RetryHttps { static Map cookies; @@ -80,12 +83,17 @@ public class RetryHttps { * to avoid infinite hangs. */ void doServerSide() throws Exception { + InetAddress loopback = InetAddress.getLoopbackAddress(); SSLServerSocketFactory sslssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(serverPort, 0, loopback); serverPort = sslServerSocket.getLocalPort(); + System.out.println("Starting server at: " + + sslServerSocket.getInetAddress() + + ":" + serverPort); + /* * Signal Client, we're ready for his connect. */ @@ -145,11 +153,16 @@ void doClientSide() throws Exception { try { HttpsURLConnection http = null; /* establish http connection to server */ - URL url = new URL("https://localhost:" + serverPort+"/file1"); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .path("/file1") + .toURL(); System.out.println("url is "+url.toString()); HttpsURLConnection.setDefaultHostnameVerifier( new NameVerifier()); - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); int cl = http.getContentLength(); InputStream is = http.getInputStream (); @@ -157,8 +170,13 @@ void doClientSide() throws Exception { while (is.read() != -1 && count++ < cl); System.out.println("respCode1 = "+respCode); Thread.sleep(2000); - url = new URL("https://localhost:" + serverPort+"/file2"); - http = (HttpsURLConnection)url.openConnection(); + url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .path("/file2") + .toURL(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); respCode = http.getResponseCode(); System.out.println("respCode2 = "+respCode); } catch (IOException ioex) { From 569ecf4e7f2cb4f4ecf4c0bba093ecaa61f64e05 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:40:40 +0000 Subject: [PATCH 107/177] 8226825: Replace wildcard address with loopback or local host in tests - part 19 Replace use of wildcard by the loopback address, or possibly the local host address, wherever possible, to improve test stability. Backport-of: c45f932cc5953d5aa45084c101d975758535ebd0 --- test/jdk/java/net/Socket/SetSoLinger.java | 8 +- .../www/protocol/http/AsyncDisconnect.java | 42 +++++---- .../sun/net/www/protocol/http/B6641309.java | 89 ++++++++++--------- .../sun/net/www/protocol/http/B6660405.java | 86 ++++++++++-------- .../sun/net/www/protocol/http/B6890349.java | 14 ++- .../sun/net/www/protocol/http/Modified.java | 23 +++-- 6 files changed, 155 insertions(+), 107 deletions(-) diff --git a/test/jdk/java/net/Socket/SetSoLinger.java b/test/jdk/java/net/Socket/SetSoLinger.java index f05190ac8e2..343f307256b 100644 --- a/test/jdk/java/net/Socket/SetSoLinger.java +++ b/test/jdk/java/net/Socket/SetSoLinger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Test Socket.setSoLinger * @run main SetSoLinger * @run main/othervm -Djava.net.preferIPv4Stack=true SetSoLinger + * @run main/othervm -Djava.net.preferIPv6Addresses=true SetSoLinger */ import java.net.*; @@ -37,7 +38,10 @@ public class SetSoLinger { public static void main(String args[]) throws Exception { int value; InetAddress addr = InetAddress.getLocalHost(); - ServerSocket ss = new ServerSocket(0); + ServerSocket ss = new ServerSocket(); + + InetSocketAddress socketAddress = new InetSocketAddress(addr, 0); + ss.bind(socketAddress); int port = ss.getLocalPort(); Socket s = new Socket(addr, port); diff --git a/test/jdk/sun/net/www/protocol/http/AsyncDisconnect.java b/test/jdk/sun/net/www/protocol/http/AsyncDisconnect.java index 250557e9c55..75df6d28617 100644 --- a/test/jdk/sun/net/www/protocol/http/AsyncDisconnect.java +++ b/test/jdk/sun/net/www/protocol/http/AsyncDisconnect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,18 +24,21 @@ /* * @test * @bug 6358532 + * @library /test/lib * @modules jdk.httpserver * @run main/othervm AsyncDisconnect + * @run main/othervm -Djava.net.preferIPv6Addresses=true AsyncDisconnect * @summary HttpURLConnection.disconnect doesn't really do the job */ import java.net.*; -import java.util.*; import java.io.*; import com.sun.net.httpserver.*; import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; +import jdk.test.lib.net.URIBuilder; + public class AsyncDisconnect implements Runnable { com.sun.net.httpserver.HttpServer httpServer; @@ -43,27 +46,30 @@ public class AsyncDisconnect implements Runnable ExecutorService executorService; HttpURLConnection uc; - public static void main(String[] args) { + public static void main(String[] args) throws Exception { new AsyncDisconnect(); } - public AsyncDisconnect() { - try { - startHttpServer(); - doClient(); - } catch (IOException ioe) { - System.err.println(ioe); - } + public AsyncDisconnect() throws Exception { + startHttpServer(); + doClient(); } - void doClient() { + void doClient() throws Exception { + Thread t = new Thread(this); + try { InetSocketAddress address = httpServer.getAddress(); - URL url = new URL("http://" + address.getHostName() + ":" + address.getPort() + "/test/"); - uc = (HttpURLConnection)url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(address.getAddress()) + .port(address.getPort()) + .path("/test/") + .toURL(); + uc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); // create a thread that will disconnect the connection - (new Thread(this)).start(); + t.start(); uc.getInputStream(); @@ -73,11 +79,11 @@ void doClient() { } catch (SocketException se) { // this is what we expect to happen and is OK. //System.out.println(se); - } catch (IOException e) { - e.printStackTrace(); } finally { httpServer.stop(1); + t.join(); executorService.shutdown(); + } } @@ -93,7 +99,9 @@ public void run() { * Http Server */ public void startHttpServer() throws IOException { - httpServer = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, 0); + httpServer = com.sun.net.httpserver.HttpServer.create(address, 0); httpHandler = new MyHandler(); HttpContext ctx = httpServer.createContext("/test/", httpHandler); diff --git a/test/jdk/sun/net/www/protocol/http/B6641309.java b/test/jdk/sun/net/www/protocol/http/B6641309.java index 25952c65cd7..58de97404a1 100644 --- a/test/jdk/sun/net/www/protocol/http/B6641309.java +++ b/test/jdk/sun/net/www/protocol/http/B6641309.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,10 @@ * @test * @bug 6641309 * @modules jdk.httpserver - * @summary Wrong Cookie separator used in HttpURLConnection + * @library /test/lib + * @run main/othervm B6641309 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6641309 + * @summary Wrong Cookie separator used in HttpURLConnection B6641309 */ import java.net.*; @@ -35,65 +38,65 @@ import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; +import jdk.test.lib.net.URIBuilder; + public class B6641309 { com.sun.net.httpserver.HttpServer httpServer; ExecutorService executorService; - public static void main(String[] args) - { + public static void main(String[] args) throws Exception { new B6641309(); } - public B6641309() - { - try { - startHttpServer(); - doClient(); - } catch (IOException ioe) { - System.err.println(ioe); - } + public B6641309() throws Exception { + startHttpServer(); + doClient(); } - void doClient() { + void doClient() throws Exception { CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); - try { - InetSocketAddress address = httpServer.getAddress(); - - // GET Request - URL url = new URL("http://localhost:" + address.getPort() + "/test/"); - CookieHandler ch = CookieHandler.getDefault(); - Map> header = new HashMap>(); - List values = new LinkedList(); - values.add("Test1Cookie=TEST1; path=/test/"); - values.add("Test2Cookie=TEST2; path=/test/"); - header.put("Set-Cookie", values); - - // preload the CookieHandler with a cookie for our URL - // so that it will be sent during the first request - ch.put(url.toURI(), header); - HttpURLConnection uc = (HttpURLConnection)url.openConnection(); - int resp = uc.getResponseCode(); - if (resp != 200) - throw new RuntimeException("Failed: Response code from GET is not 200"); - - System.out.println("Response code from GET = 200 OK"); - - } catch (IOException e) { - e.printStackTrace(); - } catch (URISyntaxException e) { - e.printStackTrace(); - } finally { - httpServer.stop(1); - executorService.shutdown(); + ProxySelector.setDefault(ProxySelector.of(null)); + + InetSocketAddress address = httpServer.getAddress(); + + // GET Request + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(address.getAddress()) + .port(address.getPort()) + .path("/test/") + .toURL(); + + CookieHandler ch = CookieHandler.getDefault(); + Map> header = new HashMap>(); + List values = new LinkedList(); + values.add("Test1Cookie=TEST1; path=/test/"); + values.add("Test2Cookie=TEST2; path=/test/"); + header.put("Set-Cookie", values); + + // preload the CookieHandler with a cookie for our URL + // so that it will be sent during the first request + ch.put(url.toURI(), header); + HttpURLConnection uc = (HttpURLConnection)url.openConnection(); + int resp = uc.getResponseCode(); + if (resp != 200) { + throw new RuntimeException("Failed: Response code from GET is not 200: " + + resp); } + System.out.println("Response code from GET = 200 OK"); + + httpServer.stop(1); + executorService.shutdown(); } /** * Http Server */ public void startHttpServer() throws IOException { - httpServer = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, 0); + httpServer = com.sun.net.httpserver.HttpServer.create(address, 0); // create HttpServer context HttpContext ctx = httpServer.createContext("/test/", new MyHandler()); diff --git a/test/jdk/sun/net/www/protocol/http/B6660405.java b/test/jdk/sun/net/www/protocol/http/B6660405.java index 50b5838e2c5..b8bee2e3c5d 100644 --- a/test/jdk/sun/net/www/protocol/http/B6660405.java +++ b/test/jdk/sun/net/www/protocol/http/B6660405.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,10 @@ * @test * @bug 6660405 * @modules jdk.httpserver - * @summary HttpURLConnection returns the wrong InputStream + * @library /test/lib + * @run main/othervm B6660405 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6660405 + * @summary HttpURLConnection returns the wrong InputStream B6660405 */ import java.net.*; @@ -34,6 +37,8 @@ import com.sun.net.httpserver.*; import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; +import jdk.test.lib.net.URIBuilder; + public class B6660405 { @@ -72,7 +77,8 @@ public MyResponseCache() { } @Override - public CacheResponse get(URI uri, String rqstMethod, Map> rqstHeaders) throws IOException + public CacheResponse get(URI uri, String rqstMethod, Map> rqstHeaders) + throws IOException { if (uri.getPath().equals("/redirect/index.html")) { return new MyCacheResponse(); @@ -88,53 +94,61 @@ public CacheRequest put(URI uri, URLConnection conn) throws IOException } - public static void main(String[] args) + public static void main(String[] args) throws Exception { new B6660405(); } - public B6660405() - { - try { - startHttpServer(); - doClient(); - } catch (IOException ioe) { - System.err.println(ioe); - } + public B6660405() throws Exception { + startHttpServer(); + doClient(); } - void doClient() { + void doClient() throws Exception { ResponseCache.setDefault(new MyResponseCache()); - try { - InetSocketAddress address = httpServer.getAddress(); - - // GET Request - URL url = new URL("http://localhost:" + address.getPort() + "/test/index.html"); - HttpURLConnection uc = (HttpURLConnection)url.openConnection(); - int code = uc.getResponseCode(); - System.err.println("response code = " + code); - int l = uc.getContentLength(); - System.err.println("content-length = " + l); - InputStream in = uc.getInputStream(); - int i = 0; - // Read till end of stream - do { - i = in.read(); - } while (i != -1); - in.close(); - } catch (IOException e) { - throw new RuntimeException("Got the wrong InputStream after checking headers"); - } finally { - httpServer.stop(1); - executorService.shutdown(); + InetSocketAddress address = httpServer.getAddress(); + + // GET Request + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(address.getAddress()) + .port(address.getPort()) + .path("/test/index.html") + .toURL(); + + HttpURLConnection uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); + int code = uc.getResponseCode(); + System.err.println("response code = " + code); + int l = uc.getContentLength(); + System.err.println("content-length = " + l); + if (l != 1024) { + throw new AssertionError("Bad content length: " + l); } + + InputStream in = uc.getInputStream(); + int i = 0; + // Read till end of stream + do { + l--; + i = in.read(); + } while (i != -1); + in.close(); + if (l != -1) { + throw new AssertionError("Only " + (1024 - (l + 1)) + + " bytes read from stream."); + } + + httpServer.stop(1); + executorService.shutdown(); } /** * Http Server */ public void startHttpServer() throws IOException { - httpServer = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback,0); + httpServer = com.sun.net.httpserver.HttpServer.create(address, 0); // create HttpServer context HttpContext ctx = httpServer.createContext("/test/", new MyHandler()); diff --git a/test/jdk/sun/net/www/protocol/http/B6890349.java b/test/jdk/sun/net/www/protocol/http/B6890349.java index 51f1ccca08c..086856b4b65 100644 --- a/test/jdk/sun/net/www/protocol/http/B6890349.java +++ b/test/jdk/sun/net/www/protocol/http/B6890349.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,9 @@ /** * @test * @bug 6890349 + * @library /test/lib * @run main/othervm B6890349 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6890349 * @summary Light weight HTTP server */ @@ -34,7 +36,11 @@ public class B6890349 extends Thread { public static final void main(String[] args) throws Exception { try { - ServerSocket server = new ServerSocket (0); + ServerSocket server = new ServerSocket(); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, 0); + server.bind(address); + int port = server.getLocalPort(); System.out.println ("listening on " + port); B6890349 t = new B6890349 (server); @@ -44,11 +50,11 @@ public static final void main(String[] args) throws Exception { port, "/foo\nbar"); System.out.println("URL: " + u); - HttpURLConnection urlc = (HttpURLConnection)u.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)u.openConnection(Proxy.NO_PROXY); InputStream is = urlc.getInputStream(); throw new RuntimeException ("Test failed"); } catch (IOException e) { - System.out.println ("OK"); + System.out.println ("Caught expected exception: " + e); } } diff --git a/test/jdk/sun/net/www/protocol/http/Modified.java b/test/jdk/sun/net/www/protocol/http/Modified.java index 6a34f7ca7cb..7f2313db538 100644 --- a/test/jdk/sun/net/www/protocol/http/Modified.java +++ b/test/jdk/sun/net/www/protocol/http/Modified.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,12 +24,16 @@ /* * @test * @bug 4092605 + * @library /test/lib + * @run main/othervm Modified + * @run main/othervm -Djava.net.preferIPv6Addresses=true Modified * @summary Test HttpURLConnection setIfModifiedSince * */ import java.net.*; import java.io.*; +import jdk.test.lib.net.URIBuilder; public class Modified implements Runnable { @@ -78,13 +82,22 @@ public void run() { Modified() throws Exception { - ss = new ServerSocket(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, 0); + ss = new ServerSocket(); + ss.bind(address); + int port = ss.getLocalPort(); + Thread thr = new Thread(this); thr.start(); - URL testURL = new URL("http://localhost:" + ss.getLocalPort() + - "/index.html"); - URLConnection URLConn = testURL.openConnection(); + URL testURL = URIBuilder.newBuilder() + .scheme("http") + .host(loopback) + .port(port) + .path("/index.html") + .toURL(); + URLConnection URLConn = testURL.openConnection(Proxy.NO_PROXY); HttpURLConnection httpConn; if (URLConn instanceof HttpURLConnection) { From c73323bae6f12a3a94a3d9f6415e4ddca6cf8c99 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:42:31 +0000 Subject: [PATCH 108/177] 8240604: Rewrite sun/management/jmxremote/bootstrap/CustomLauncherTest.java test to make binaries from source file Reviewed-by: mdoerr Backport-of: cd7d17500171ff20a2d919a4e9d5de0399304d4d --- make/test/JtregNativeJdk.gmk | 5 +- .../bootstrap/CustomLauncherTest.java | 174 +++--------------- .../management/jmxremote/bootstrap/Makefile | 80 -------- .../bootstrap/{launcher.c => exelauncher.c} | 6 +- .../jmxremote/bootstrap/linux-amd64/launcher | Bin 8926 -> 0 bytes .../jmxremote/bootstrap/linux-i586/launcher | Bin 14569 -> 0 bytes .../bootstrap/solaris-amd64/launcher | Bin 12056 -> 0 bytes .../bootstrap/solaris-sparcv9/launcher | Bin 11656 -> 0 bytes 8 files changed, 29 insertions(+), 236 deletions(-) delete mode 100644 test/jdk/sun/management/jmxremote/bootstrap/Makefile rename test/jdk/sun/management/jmxremote/bootstrap/{launcher.c => exelauncher.c} (95%) delete mode 100644 test/jdk/sun/management/jmxremote/bootstrap/linux-amd64/launcher delete mode 100644 test/jdk/sun/management/jmxremote/bootstrap/linux-i586/launcher delete mode 100644 test/jdk/sun/management/jmxremote/bootstrap/solaris-amd64/launcher delete mode 100644 test/jdk/sun/management/jmxremote/bootstrap/solaris-sparcv9/launcher diff --git a/make/test/JtregNativeJdk.gmk b/make/test/JtregNativeJdk.gmk index bb544026f00..34da81aa9f9 100644 --- a/make/test/JtregNativeJdk.gmk +++ b/make/test/JtregNativeJdk.gmk @@ -56,7 +56,7 @@ BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \ # Platform specific setup ifeq ($(call isTargetOs, windows), true) - BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c + BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c exelauncher.c WIN_LIB_JAVA := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA) @@ -66,8 +66,10 @@ else BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava ifeq ($(call isTargetOs, linux), true) + BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava else ifeq ($(call isTargetOs, solaris), true) + BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -lthread -ldl BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava endif UNIX_LDFLAGS_JLI := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli @@ -76,6 +78,7 @@ else endif ifeq ($(call isTargetOs, macosx), true) + BUILD_JDK_JTREG_EXCLUDE += exelauncher.c BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := \ -framework Cocoa BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestDynamicStore := \ diff --git a/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java index 880edd756b0..5108549b96f 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,22 +21,16 @@ * questions. */ -import java.io.File; -import java.io.IOException; -import java.nio.file.FileSystem; -import java.nio.file.FileSystems; +import jdk.test.lib.Utils; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; + import java.nio.file.Files; -import java.nio.file.LinkOption; import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.PosixFilePermission; -import java.util.HashSet; -import java.util.Set; +import java.nio.file.Paths; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import jdk.test.lib.process.ProcessTools; - /** * @test * @bug 6434402 8004926 @@ -47,80 +41,35 @@ * jdk.attach * jdk.management.agent/jdk.internal.agent * + * @requires (os.family == "linux" | os.family == "solaris") * @build TestManager TestApplication CustomLauncherTest - * @run main/othervm CustomLauncherTest + * @run main/othervm/native CustomLauncherTest */ public class CustomLauncherTest { - private static final String TEST_CLASSPATH = System.getProperty("test.class.path"); - private static final String TEST_JDK = System.getProperty("test.jdk"); - private static final String WORK_DIR = System.getProperty("user.dir"); - private static final String TEST_SRC = System.getProperty("test.src"); - private static final String OSNAME = System.getProperty("os.name"); - private static final String ARCH; - static { - // magic with os.arch - String osarch = System.getProperty("os.arch"); - switch (osarch) { - case "i386": - case "i486": - case "i586": - case "i686": - case "i786": - case "i886": - case "i986": { - ARCH = "i586"; - break; - } - case "x86_64": - case "amd64": { - ARCH = "amd64"; - break; - } - case "sparc": - ARCH = "sparcv9"; - break; - default: { - ARCH = osarch; - } - } - } + public static final String TEST_NATIVE_PATH = System.getProperty("test.nativepath"); public static void main(String[] args) throws Exception { - if (TEST_CLASSPATH == null || TEST_CLASSPATH.isEmpty()) { + if (".".equals(Utils.TEST_CLASS_PATH)) { System.out.println("Test is designed to be run from jtreg only"); return; } - if (getPlatform() == null) { - System.out.println("Test not designed to run on this operating " + - "system (" + OSNAME + "), skipping..."); - return; - } - - final FileSystem FS = FileSystems.getDefault(); - - Path libjvmPath = findLibjvm(FS); - if (libjvmPath == null) { - throw new Error("Unable to locate 'libjvm.so' in " + TEST_JDK); - } - + Path libjvm = Platform.jvmLibDir().resolve("libjvm.so"); Process serverPrc = null, clientPrc = null; try { - String[] launcher = getLauncher(); - - if (launcher == null) return; // launcher not available for the tested platform; skip + String launcher = getLauncher(); System.out.println("Starting custom launcher:"); System.out.println("========================="); - System.out.println(" launcher : " + launcher[0]); - System.out.println(" libjvm : " + libjvmPath.toString()); - System.out.println(" classpath : " + TEST_CLASSPATH); + System.out.println(" launcher : " + launcher); + System.out.println(" libjvm : " + libjvm); + System.out.println(" classpath : " + Utils.TEST_CLASS_PATH); ProcessBuilder server = new ProcessBuilder( - launcher[1], - libjvmPath.toString(), - TEST_CLASSPATH, + launcher, + libjvm.toString(), + Utils.TEST_CLASS_PATH, "TestApplication" ); @@ -148,7 +97,7 @@ public static void main(String[] args) throws Exception { ProcessBuilder client = ProcessTools.createJavaProcessBuilder( "-cp", - TEST_CLASSPATH, + Utils.TEST_CLASS_PATH, "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", "TestManager", String.valueOf(serverPrc.pid()), @@ -182,87 +131,8 @@ public static void main(String[] args) throws Exception { } } - private static Path findLibjvm(FileSystem FS) { - Path libjvmPath = findLibjvm(FS.getPath(TEST_JDK, "lib")); - return libjvmPath; - } - - private static Path findLibjvm(Path libPath) { - // libjvm.so -> server/libjvm.so -> client/libjvm.so - Path libjvmPath = libPath.resolve("libjvm.so"); - if (isFileOk(libjvmPath)) { - return libjvmPath; - } - libjvmPath = libPath.resolve("server/libjvm.so"); - if (isFileOk(libjvmPath)) { - return libjvmPath; - } - libjvmPath = libPath.resolve("client/libjvm.so"); - if (isFileOk(libPath)) { - return libjvmPath; - } - - return null; - } - - private static boolean isFileOk(Path path) { - return Files.isRegularFile(path) && Files.isReadable(path); - } - - private static String getPlatform() { - String platform = null; - switch (OSNAME.toLowerCase()) { - case "linux": { - platform = "linux"; - break; - } - case "sunos": { - platform = "solaris"; - break; - } - default: { - platform = null; - } - } - - return platform; - } - - private static String[] getLauncher() throws IOException { - String platform = getPlatform(); - if (platform == null) { - return null; - } - - String launcher = TEST_SRC + File.separator + platform + "-" + ARCH + - File.separator + "launcher"; - - final FileSystem FS = FileSystems.getDefault(); - Path launcherPath = FS.getPath(launcher); - - final boolean hasLauncher = Files.isRegularFile(launcherPath, LinkOption.NOFOLLOW_LINKS)&& - Files.isReadable(launcherPath); - if (!hasLauncher) { - System.out.println("Launcher [" + launcher + "] does not exist. Skipping the test."); - return null; - } - - // It is impossible to store an executable file in the source control - // We need to copy the launcher to the working directory - // and set the executable flag - Path localLauncherPath = FS.getPath(WORK_DIR, "launcher"); - Files.copy(launcherPath, localLauncherPath, - StandardCopyOption.REPLACE_EXISTING); - if (!Files.isExecutable(localLauncherPath)) { - Set perms = new HashSet<>( - Files.getPosixFilePermissions( - localLauncherPath, - LinkOption.NOFOLLOW_LINKS - ) - ); - perms.add(PosixFilePermission.OWNER_EXECUTE); - Files.setPosixFilePermissions(localLauncherPath, perms); - } - return new String[] {launcher, localLauncherPath.toAbsolutePath().toString()}; + private static String getLauncher() { + Path launcherPath = Paths.get(TEST_NATIVE_PATH, "launcher"); + return launcherPath.toAbsolutePath().toString(); } } diff --git a/test/jdk/sun/management/jmxremote/bootstrap/Makefile b/test/jdk/sun/management/jmxremote/bootstrap/Makefile deleted file mode 100644 index 9e1fc922db6..00000000000 --- a/test/jdk/sun/management/jmxremote/bootstrap/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2006, 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. - -# -# This Makefile is used to generate versions of the launcher program for -# use by the CustomLauncherTest. The binaries are checked into SCCS -# so this Makefile is not used as part of test run. It is provided to -# make rebuilding the launcher binaries a relatively painless activity. -# - -# -# Edit the following to reflect the current build environment. -# -# Architecture being built (initially one of: solaris-sparc, solaris-i586, -# linux-i586. -# -PLATFORM=solaris -ARCH=sparc -OUTPUT_DIR =$(PLATFORM)-$(ARCH) - -# -# Path to C compiler -# -# As of 6/1/06: -# Solaris CC=/java/devtools/$(ARCH)/SUNWspro/SS11/bin/cc -# Linux CC=/usr/bin/gcc -# -CC=/java/devtools/$(ARCH)/SUNWspro/SS11/bin/cc - -# -# Include directory in JRE or JDK install -# -JINCLUDE=/java/re/jdk/1.6.0/latest/binaries/$(OUTPUT_DIR)/include - -# -# PLATFORM dependent flags -# -# On pre-Solaris 10, -lthread is required. -# -ifeq ($(PLATFORM), solaris) - PLATFORM_LIBS= -lthread -else - PLATFORM_LIBS= -endif - -# -# Targets -# -all: install - -$(PLATFORM): - mkdir $(OUTPUT_DIR) $(OUTPUT_DIR)/SCCS - -install: $(PLATFORM) - $(CC) -I$(JINCLUDE) -I$(JINCLUDE)/$(PLATFORM) \ - -o $(OUTPUT_DIR)/launcher launcher.c $(PLATFORM_LIBS) -ldl - -clean: - - -clobber: clean - rm $(OUTPUT_DIR)/launcher diff --git a/test/jdk/sun/management/jmxremote/bootstrap/launcher.c b/test/jdk/sun/management/jmxremote/bootstrap/exelauncher.c similarity index 95% rename from test/jdk/sun/management/jmxremote/bootstrap/launcher.c rename to test/jdk/sun/management/jmxremote/bootstrap/exelauncher.c index e11fea33584..46f30d9e157 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/launcher.c +++ b/test/jdk/sun/management/jmxremote/bootstrap/exelauncher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,11 +22,11 @@ */ /* - * A minature launcher for use by CustomLauncherTest.sh. It sets + * A miniature launcher for use by CustomLauncherTest.java test. It sets * up the absolute minimal execution environment. */ #include -#include +#include #include #include "jni.h" diff --git a/test/jdk/sun/management/jmxremote/bootstrap/linux-amd64/launcher b/test/jdk/sun/management/jmxremote/bootstrap/linux-amd64/launcher deleted file mode 100644 index 6df223c91c716644ceeed126c2971c48969fa295..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8926 zcmd5>eQZm)wa_9F=f-#@kgssO{-F*(a<2EQ`NzyQM9d9R<$SrIdZXX4LxnyN9MRH2zys4yPz8Ti+^EuhY=$qMruEm$z;9ulYa3Z$v3#RukEB6A^p z5+Fb7tC%N6@K&p$c#rBwpW^ICBKcJ-ziMUAd`xwWIbR=L8~vMAyk@rsiDZqKSTD;0 zCtIQ|ADCh3H^-8j=V-FR{9X$d%-Qb&_{r;2`v1hZpIcRX)8$2QJ``7%E0)KiZL3!; zkA-Vv(RjMIwzqC|?dnzjRKkC|ylyW#K(-qQIvgx~%5EDsGxQ;E{&n+l5oU<*p%N2bAtroop1 z_u=oP#{iUypPdH33%Cz|C+!1JD$aA$;NJx9!{12}0HxwQ1H4Ks5B8ed;J$`q z)_pV@o12VqBpK<9rp!pPxv3$Rh)0@3ZLx?jjLz;v+(?l%#P{kQw?lvm`&(52zxk)^#(YM1;8LF3eie|m9r7TF#{orv^F zaMBZ5dUswwIloony#7f61?Q92C>p0s)hf^B0OTN63ZD(9`M|WyhVvXJ-3l9SUkB@K zxP2YaY&f;eq}y;@c%HV{@X9B< z6Z+{BW0k~C`ztgt{vZrL?ii&05AQ}ITJ&1F&wBslJU#QlZugGSVZ@UO_;|-_q{@xW zzqyaFVUpPX#H0uIdggWg#HIUm*I7MtN6!iG zdNweAoU*QGPLKcm^IT5P1Sa+V{gWbHE+bv8g309ZgOm-JoP^06qcXyGuMEO3^Xq*G zs%L&hS?!mC=kZ!Sdw^s;>&2k(qMOHutN=3R_?Ho782a4AcHCh$?jM1*Y~|h0;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q6W?I=XHyo2#I*z;`Z5}uYUkGc7I+6<(n6D7bpmb{Aq7+`acbf zazgnf;(bF?0PhEu)@qCE#A$D}`?r>91dCSXKP06>!SC(Ne*l%;UzBT>v0BJYx;PuL zA4AWhV)y5L&Qu!>ulH>42q%V=Kj*(s?UQ}V|M%>uIOmVyBMyK59@wll;(OUpacBFl zIQ$3ka8ER-{6Cgbp>Vc80@XbH^ZTaSxB0uF)7~k+3E%lPf8O^iC@9Ej@04kLQU1Ao zdc!61enJ0tU`s=V{dwQx@490Y9K_?3+vjm`5juPO{QYN=E(*lypnndw)cy)`vJv~+pUFv0 zwnWV7_<-A%3ROI>+OJ?kg*!wUhv$ynf0=sFyr6E}O;Fb2&)3iE7tPO7?F%0ipm!a? zo$XszrArTbSLfEIDCx^%b4lDI%#!$w{PV6om`oqmw*{Wx zHibu23!b+&80{9m!x!VuUD29PGsNF$Iu;QvcHz2KIFh3 zl<^mdUUgkOKRP5nHJ^u6oDoMHI=^t0xG%%NOI;VWQwkrIajHb$Tn)7XokO)$9>}6p z9NHJ?goO7aDWdo*{;m@D{h!ic>bR;zM_ncEyASvR@Vxq4>6S zhWAI&o-|Wtx}(G2jx)VY4O@+1w;L|)CWEkOu(HTp$gdCSK-&(t*g3FVaY%VPDW z%`L`;Xgpl>Nf=oyw4e?`i`|^3vPL+SFuFqVFrC;o-jB|Oqj4jhiiFkatJ6Jyv6LQl z0_(7e#F0mpG6P>KR9$`)E_Dp7PIZf;Sf{zgm|-BBd>85HnMYf3lIiT&;V3(6of8*p F{tZumU3&lk diff --git a/test/jdk/sun/management/jmxremote/bootstrap/linux-i586/launcher b/test/jdk/sun/management/jmxremote/bootstrap/linux-i586/launcher deleted file mode 100644 index 072d8048f82fa42d9c082e667c23abbde687bdc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14569 zcmb_j4RBmnb-uEcLEwX##(8A^iPT{d95hOl96PSkiwg%-M89JR=b;h zZ)GdsVPo-UWDkL%os@uxQ#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+FqvOR5R0zZ;pGhlXwAPFGiPVHaO+5S0*TvcC3pCVBcXll$nK+KTxC=a4y|^Df+KyS-RKrH zE$A6^d`=9$k?q{{PN`pUL`P0X^ysq=zM^`vS9rrP@U)zB_jc70$x*4(#`2Bi-iH&^1;f_xHkQxAsx(zS<5XO8pIdbC z1jDCj^F%e5&sB4-XT~7s&rI`RuK1Wak)|^&( zd)lqGrb`9adUO)AuvE!eUM1sMlciD>1Jfxp(<+s#7Ak!N4@%3c&R|3&hi8(OH&awx zJZY6lI+-h4nT#1bU{wocD_6|qXR>aHwd8}|j1_ilGh_K|-i&2TQ>)NPXV=k(|JMoI zh5A2+@8`QJ&Y4}A>@GIGXP>=q;xN*IIW2NP=O80&ub+{Ju=I|sWCjYQYUzyVO9igJ zhAr#rTXlEWm&dyx|U zRb2XcK^(-1m-AH?=f4nuQ+)i7^N;>&-k@3~OjG~OzNA2vX{d;jJ`#rd(_)mhOD9UbuA$#>3 zHdTMJr?yc$sL1`Im37WBMLWq}FQ&#|S3hj8_Jb7V>p9KDZ$DwD+Su1gAlHrjg0sO% z)t`__9IE~@f9iK|iu(Cc9#p=Ff3%JLOG44#k9tS&{#lRzSb+3Wm9)m!OG;xd;F|K@rl|Mq z6A0u9%)bwONz27Oa@-oyk1tg533wWZ?$1{WsuMY_fpn?sKOf>X)%(JBN~Y|Ie&?g@ z=_jErMYn%tar>cj(&}i7bx?ou^Y=^Ge^1(l_c8VO{{o#w`funRY5#AMDx&P!{{Z(L B5zqht From 33771273d39578a52e87706ac8bca8eda447c215 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:44:23 +0000 Subject: [PATCH 109/177] 8183374: Refactor java/lang/Runtime shell tests to java Reviewed-by: mdoerr Backport-of: ec383abc1d2e609cc6af94a526e11c407d7e91ff --- .../java/lang/RuntimeTests/exec/SetCwd.java | 93 ++++++++++++++++++ .../RuntimeTests/shutdown/ShutdownHooks.java | 97 +++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 test/jdk/java/lang/RuntimeTests/exec/SetCwd.java create mode 100644 test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java diff --git a/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java b/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java new file mode 100644 index 00000000000..347c4d0eae3 --- /dev/null +++ b/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999, 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 4156278 + * @summary Basic functional test for + * Runtime.exec(String[] command, String[] env, File path) and + * Runtime.exec(String command, String[] env, File path). + * + * @library /test/lib + * @run testng/othervm SetCwd + */ +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.*; + +import static jdk.test.lib.Asserts.assertTrue; + +public class SetCwd { + + private static final String TEST_CLASSES = System.getProperty( + "test.classes", "."); + + private static final String[] CMD_ARRAY = new String[2]; + + @BeforeTest + public static void setUp() throws Exception { + CMD_ARRAY[0] = System.getProperty("java.home") + File.separator + + "bin" + File.separator + "java"; + CMD_ARRAY[1] = SimpleProcess.class.getName(); + } + + @Test + public void testRuntimeExecWithArray() throws Exception { + Process process = Runtime.getRuntime().exec(CMD_ARRAY, null, + new File(TEST_CLASSES)); + verifyProcessOutput(process); + } + + @Test + public void testRuntimeExecWithString() throws Exception { + String cmd = String.join(" ", CMD_ARRAY); + Process process = Runtime.getRuntime().exec(cmd, null, + new File(TEST_CLASSES)); + verifyProcessOutput(process); + } + + // Verify the process has executed by comparing its output with the expected + private void verifyProcessOutput(Process process) throws Exception { + process.waitFor(); + assertTrue(process.exitValue() == 0); + + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(process.getInputStream()))) { + String line = reader.readLine(); + if (!line.startsWith(TEST_CLASSES)) { + String error = String.format("Expected process output first line: " + + "'%s' Actual: '%s'", TEST_CLASSES, line); + throw new Exception(error); + } + } + } + + // This class main will be the entry point for test subprocesses + static class SimpleProcess { + public static void main (String[] args) throws Exception { + File dir = new File("."); + System.out.println(dir.getCanonicalPath()); + } + } +} diff --git a/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java new file mode 100644 index 00000000000..6b2dc7b4dbf --- /dev/null +++ b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2009, 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 6829503 + * @summary 1) Test Console and DeleteOnExitHook can be initialized + * while shutdown is in progress + * 2) Test if files that are added by the application shutdown + * hook are deleted on exit during shutdown + * @library /test/lib + * @run testng/othervm ShutdownHooks + */ + +import jdk.test.lib.process.ProcessTools; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.*; +import java.nio.file.Files; + +import static jdk.test.lib.Asserts.assertFalse; + +public class ShutdownHooks { + + private static final String TEST_FILE_NAME = "fileToBeDeleted"; + + private static final File TEST_FILE = new File(TEST_FILE_NAME); + + private static final String TEST_CLASSES = System.getProperty( + "test.classes", "."); + + @BeforeTest + public static void setUp() throws Exception { + // Make sure file does not exist before test + Files.deleteIfExists(TEST_FILE.toPath()); + } + + @Test + public void testShutdownHooks() throws Exception { + // Run in a new process in order to evaluate shutdown hook results + String[] testCommand = new String[] {"-classpath", TEST_CLASSES, + ShutdownHooksProcess.class.getName()}; + ProcessTools.executeTestJvm(testCommand).shouldHaveExitValue(0); + + String errorMsg = "File exists despite shutdown hook has been run"; + assertFalse(Files.exists(TEST_FILE.toPath()), errorMsg); + } + + // This class main will be the entry point for test subprocesses + static class ShutdownHooksProcess { + public static void main(String[] args) throws Exception { + Runtime.getRuntime().addShutdownHook(new Cleaner()); + + System.out.println("Writing to "+ TEST_FILE); + try (PrintWriter pw = new PrintWriter(TEST_FILE)) { + pw.println("Shutdown begins"); + } + } + + static class Cleaner extends Thread { + public void run() { + // register the Console's shutdown hook while the application + // shutdown hook is running + Console cons = System.console(); + // register the DeleteOnExitHook while the application + // shutdown hook is running + TEST_FILE.deleteOnExit(); + try (PrintWriter pw = new PrintWriter(TEST_FILE)) { + pw.println("File is being deleted"); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } + } + } + } +} From d90b9ac9d057cf354c1a3403eb309b9b9142e3e7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 07:46:25 +0000 Subject: [PATCH 110/177] 8285612: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java Reviewed-by: mbaesken Backport-of: 0c551b6c01bed302a2fbd1271773c3e231920ddd --- .../ImagePrinting/ClippedImages.java | 224 +++++++++--------- 1 file changed, 118 insertions(+), 106 deletions(-) diff --git a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java index ab999844884..519bc02d0ff 100644 --- a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java +++ b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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,105 +21,120 @@ * questions. */ -/** +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Color; +import java.awt.Component; +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.image.BufferedImage; +import java.awt.print.PageFormat; +import java.awt.print.Pageable; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; +import java.lang.reflect.InvocationTargetException; +import java.util.Objects; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.PrintRequestAttributeSet; + +import static java.awt.EventQueue.invokeAndWait; + +/* * @test * @bug 6531728 + * @key printer + * @library ../../../regtesthelpers + * @build PassFailJFrame * @summary Test printing of images which need to have src area clipped - * @run main/manual=yesno/timeout=900 ClippedImages + * @run main/manual ClippedImages */ -import java.io.*; -import java.awt.*; -import java.awt.geom.*; -import java.awt.event.*; -import java.awt.print.*; -import java.awt.image.BufferedImage; -import javax.print.*; -import javax.print.attribute.*; - -public class ClippedImages extends Frame implements ActionListener { - - private ClippedImageCanvas c; - - public static void main(String args[]) { +public class ClippedImages { + + private static ClippedImageCanvas c; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + + if (PrinterJob.lookupPrintServices().length > 0) { + + String instruction = + "This is a manual test as it requires that you compare the\n" + + "on-screen rendering with the printed output.\n" + + "\n" + + "Select the 'Print All' button to print out the test. It will\n" + + "generate 4 sides of content: as it will print each of 2 sets\n" + + "of transformed images in portrait, and landscape orientations.\n" + + "\n" + + "The sets of images are in turn made up of two similar sets of\n" + + " pages: one is 'random' images, the other is 16 squares. Use the\n" + + "'Toggle Contents' button to view the screen rendering. For each\n" + + "page compare the printed content to the same on-screen one\n" + + "taking careful note of\n" + + "a) the positions of the red/blue circles on the corners\n" + + "b) that numerical text on the image is displayed similarly\n" + + "e) that the green quadrilaterals match on-screen\n" + + "f) that the rendering is clipped at the default (typically 1 inch)\n" + + "margins of the page.\n" + + "\n" + + "The test PASSES if the onscreen and printed rendering match" + ; + + PassFailJFrame passFailJFrame = new PassFailJFrame("Test " + + "Instruction", instruction, 15); + invokeAndWait(ClippedImages::createTestUI); + passFailJFrame.awaitAndCheck(); - ClippedImages f = new ClippedImages(); - f.setVisible(true); + } else { + System.out.println("Printer not configured or available." + + " Test cannot continue."); + PassFailJFrame.forcePass(); + } } - public ClippedImages() { - super("Clipped Src Area Image Printing Test"); + public static void createTestUI() { + Frame frame = new Frame("Clipped Src Area Image Printing Test"); c = new ClippedImageCanvas(); - add("Center", c); + frame.add(c, BorderLayout.CENTER); Button paintButton = new Button("Toggle Contents"); - paintButton.addActionListener(this); + paintButton.addActionListener((ae) -> { + c.toggleContents(); + c.repaint(); + }); Button printThisButton = new Button("Print This"); - printThisButton.addActionListener(this); + printThisButton.addActionListener((ae) -> printOne()); Button printAllButton = new Button("Print All"); - printAllButton.addActionListener(this); + printAllButton.addActionListener((ae) -> printAll()); Panel p = new Panel(); p.add(paintButton); p.add(printThisButton); p.add(printAllButton); - add("South", p); - add("North", getInstructions()); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - - pack(); - } + frame.add(p, BorderLayout.SOUTH); + frame.setLocationRelativeTo(null); + frame.pack(); + frame.setVisible(true); - private TextArea getInstructions() { - TextArea ta = new TextArea(18, 60); - ta.setFont(new Font("Dialog", Font.PLAIN, 11)); - ta.setText - ("This is a manual test as it requires that you compare "+ - "the on-screen rendering with the printed output.\n"+ - "Select the 'Print All' button to print out the test\n"+ - "It will generate 4 sides of content: as it will print "+ - "each of 2 sets of transformed images in portrait, \n"+ - "and landscape orientations. \n"+ - "The sets of images are in turn made up\n"+ - "of two similar sets of pages: one is 'random' images,\n "+ - " the other is 16 squares.\n"+ - "Use the 'Toggle Contents' button to view the screen rendering\n"+ - "For each page compare the printed content to the same\n"+ - "on-screen one taking careful note of\n"+ - "a) the positions of the red/blue circles on the corners\n"+ - "b) that numerical text on the image is displayed similarly\n"+ - "e) that the green quadrilaterals match on-screen\n"+ - "f) that the rendering is clipped at the default (typically 1 inch) "+ - "margins of the page.\n"+ - "The test PASSES if the onscreen and printed rendering match"); - return ta; + PassFailJFrame.addTestFrame(frame); + PassFailJFrame.positionTestFrame(frame, PassFailJFrame.Position.HORIZONTAL); } - public void actionPerformed(ActionEvent e) { - - if (e.getActionCommand().equals("Print This")) { - printOne(); - } else if (e.getActionCommand().equals("Print All")) { - printAll(); - } else if (e.getActionCommand().equals("Toggle Contents")) { - c.toggleContents(); - c.repaint(); - } - } - - private void printOne() { + private static void printOne() { PrinterJob pj = PrinterJob.getPrinterJob(); - PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet(); - if (pj != null && (false||pj.printDialog(attrs))) { - c.setPrinterJob(pj, false); - pj.setPrintable(c); + c.setPrinterJob(pj, false); + pj.setPrintable(c); + if (pj.printDialog(attrs)) { try { pj.print(attrs); } catch (PrinterException pe) { @@ -128,15 +143,18 @@ private void printOne() { } finally { System.out.println("PRINT RETURNED OK."); } + } else { + throw new RuntimeException("Test failed : " + + "User selected 'Cancel' button on the print dialog"); } } - private void printAll() { + private static void printAll() { PrinterJob pj = PrinterJob.getPrinterJob(); PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet(); - if (pj != null && (false||pj.printDialog(attrs))) { - c.setPrinterJob(pj, true); - pj.setPageable(c); + c.setPrinterJob(pj, true); + pj.setPageable(c); + if (pj.printDialog(attrs)) { try { pj.print(attrs); } catch (PrinterException pe) { @@ -145,6 +163,9 @@ private void printAll() { } finally { System.out.println("PRINT RETURNED OK."); } + } else { + throw new RuntimeException("Test failed : " + + "User selected 'Cancel' button on the print dialog"); } } } @@ -167,7 +188,7 @@ class ClippedImageCanvas extends Component implements Printable, Pageable { for (int y=12;y= getNumberOfPages()) { - throw new IndexOutOfBoundsException(); - } + throws IndexOutOfBoundsException { + Objects.checkIndex(pageIndex, getNumberOfPages()); PageFormat pf = myPrinterJob.defaultPage(); switch (pageIndex % 2) { + case 0 : + pf.setOrientation(PageFormat.PORTRAIT); + break; - case 0 : - pf.setOrientation(PageFormat.PORTRAIT); - break; - - case 1: - pf.setOrientation(PageFormat.LANDSCAPE); - break; + case 1: + pf.setOrientation(PageFormat.LANDSCAPE); + break; } return pf; } @@ -224,11 +241,9 @@ String getOrientStr(PageFormat pf) { } public Printable getPrintable(int pageIndex) - throws IndexOutOfBoundsException { + throws IndexOutOfBoundsException { + Objects.checkIndex(pageIndex, getNumberOfPages()); - if (pageIndex < 0 || pageIndex >= getNumberOfPages()) { - throw new IndexOutOfBoundsException(); - } if (pageIndex < 2) { paintSquares = true; } else { @@ -286,7 +301,7 @@ public void paint(Graphics g) { for (int p=0;p dA + dD - the normal untransformed case */ + /* sA + sD -> dA + dD - the normal untransformed case */ drawImage(g, dxa, dya, dxd, dyd, sxa, sya, sxd, syd); g.translate(incX, 0); @@ -388,7 +403,6 @@ private void paintSquares(Graphics g) { drawImage(g, dxa, dya, dxd, dyd, sxc, syc, sxb, syb); g.translate(-3*incX, incY); - /******/ /* sA + sD -> dD + dA */ drawImage(g, dxd, dyd, dxa, dya, sxa, sya, sxd, syd); @@ -406,7 +420,6 @@ private void paintSquares(Graphics g) { drawImage(g, dxd, dyd, dxa, dya, sxc, syc, sxb, syb); g.translate(-3*incX, incY); - /******/ /* sA + sD -> dB + dC */ drawImage(g, dxb, dyb, dxc, dyc, sxa, sya, sxd, syd); @@ -424,7 +437,6 @@ private void paintSquares(Graphics g) { drawImage(g, dxb, dyb, dxc, dyc, sxc, syc, sxb, syb); g.translate(-3*incX, incY); - /******/ /* sA + sD -> dC + dB */ @@ -445,11 +457,11 @@ private void paintSquares(Graphics g) { - /* Size is chosen to match default imageable width of a NA letter - * page. This means there will be clipping, what is clipped will - * depend on PageFormat orientation. - */ - public Dimension getPreferredSize() { + /* Size is chosen to match default imageable width of a NA letter + * page. This means there will be clipping, what is clipped will + * depend on PageFormat orientation. + */ + public Dimension getPreferredSize() { return new Dimension(468, 468); } From 92c50625786ad84c50223f21df2fbff431469228 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 6 Nov 2023 08:11:28 +0000 Subject: [PATCH 111/177] 8289238: Refactoring changes to PassFailJFrame Test Framework Reviewed-by: phh Backport-of: 8204dfab76d8ae61c2bc68cdf42fcd0fb7a81189 --- .../ImagePrinting/ClippedImages.java | 4 +- .../PrinterJob/PrintGlyphVectorTest.java | 4 +- .../print/PrinterJob/PrintLatinCJKTest.java | 4 +- .../awt/regtesthelpers/PassFailJFrame.java | 51 +++++++++---------- .../javax/swing/JRadioButton/bug4380543.java | 4 +- .../swing/JTabbedPane/4209065/bug4209065.java | 4 +- 6 files changed, 35 insertions(+), 36 deletions(-) diff --git a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java index 519bc02d0ff..fde7f8778a0 100644 --- a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java +++ b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java @@ -125,8 +125,8 @@ public static void createTestUI() { frame.pack(); frame.setVisible(true); - PassFailJFrame.addTestFrame(frame); - PassFailJFrame.positionTestFrame(frame, PassFailJFrame.Position.HORIZONTAL); + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); } private static void printOne() { diff --git a/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java b/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java index 57a01c3f9d0..82e6d0aaf15 100644 --- a/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java @@ -151,10 +151,10 @@ private static void createTestUI() { f.setVisible(true); // add the test frame to dispose - PassFailJFrame.addTestFrame(f); + PassFailJFrame.addTestWindow(f); // Arrange the test instruction frame and test frame side by side - PassFailJFrame.positionTestFrame(f, PassFailJFrame.Position.HORIZONTAL); + PassFailJFrame.positionTestWindow(f, PassFailJFrame.Position.HORIZONTAL); } public static void main(String[] arg) throws Exception { diff --git a/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java b/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java index d120b0dabe5..902d9d1bd95 100644 --- a/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java @@ -77,10 +77,10 @@ public static void showFrame() throws InterruptedException, InvocationTargetExce frame.setVisible(true); // add the test frame to dispose - PassFailJFrame.addTestFrame(frame); + PassFailJFrame.addTestWindow(frame); // Arrange the test instruction frame and test frame side by side - PassFailJFrame.positionTestFrame(frame, + PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); }); } diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index ad66fb4187c..815da722919 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -23,8 +23,8 @@ import java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.Frame; import java.awt.Toolkit; +import java.awt.Window; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.lang.reflect.InvocationTargetException; @@ -56,7 +56,7 @@ public class PassFailJFrame { */ private static final String FAILURE_REASON = "Failure Reason:\n"; - private static final List frameList = new ArrayList<>(); + private static final List windowList = new ArrayList<>(); private static final Timer timer = new Timer(0, null); private static final CountDownLatch latch = new CountDownLatch(1); @@ -177,7 +177,7 @@ public void windowClosing(WindowEvent e) { frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); - frameList.add(frame); + windowList.add(frame); } private static String convertMillisToTimeStr(long millis) { @@ -206,7 +206,7 @@ public void awaitAndCheck() throws InterruptedException, InvocationTargetExcepti throw new IllegalStateException("awaitAndCheck() should not be called on EDT"); } latch.await(); - invokeAndWait(PassFailJFrame::disposeFrames); + invokeAndWait(PassFailJFrame::disposeWindows); if (timeout) { throw new RuntimeException(testFailedReason); @@ -220,12 +220,12 @@ public void awaitAndCheck() throws InterruptedException, InvocationTargetExcepti } /** - * Dispose all the frame(s) i,e both the test instruction frame as - * well as the frame that is added via addTestFrame(Frame frame) + * Dispose all the window(s) i,e both the test instruction frame and + * the window(s) that is added via addTestWindow(Window testWindow) */ - private static synchronized void disposeFrames() { - for (Frame f : frameList) { - f.dispose(); + private static synchronized void disposeWindows() { + for (Window win : windowList) { + win.dispose(); } } @@ -262,42 +262,42 @@ private static void getFailureReason() { } /** - * Position the instruction frame with testFrame ( testcase created - * frame) by the specified position + * Position the instruction frame with testWindow (testcase created + * window) by the specified position. * Note: This method should be invoked from the method that creates - * testFrame + * testWindow. * - * @param testFrame test frame that the test is created + * @param testWindow test window that the test is created * @param position position can be either HORIZONTAL (both test - * instruction frame and test frame as arranged side by - * side or VERTICAL ( both test instruction frame and - * test frame as arranged up and down) + * instruction frame and test window as arranged + * side by side) or VERTICAL (both test instruction + * frame and test window as arranged up and down) */ - public static void positionTestFrame(Frame testFrame, Position position) { + public static void positionTestWindow(Window testWindow, Position position) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if (position.equals(Position.HORIZONTAL)) { int newX = ((screenSize.width / 2) - frame.getWidth()); frame.setLocation(newX, frame.getY()); - testFrame.setLocation((frame.getLocation().x + frame.getWidth() + 5), frame.getY()); + testWindow.setLocation((frame.getLocation().x + frame.getWidth() + 5), frame.getY()); } else if (position.equals(Position.VERTICAL)) { int newY = ((screenSize.height / 2) - frame.getHeight()); frame.setLocation(frame.getX(), newY); - testFrame.setLocation(frame.getX(), + testWindow.setLocation(frame.getX(), (frame.getLocation().y + frame.getHeight() + 5)); } } /** - * Add the testFrame to the frameList so that test instruction frame - * and testFrame and any other frame used in this test is disposed - * via disposeFrames() + * Add the testWindow to the windowList so that test instruction frame + * and testWindow and any other windows used in this test is disposed + * via disposeWindows(). * - * @param testFrame testFrame that needs to be disposed + * @param testWindow testWindow that needs to be disposed */ - public static synchronized void addTestFrame(Frame testFrame) { - frameList.add(testFrame); + public static synchronized void addTestWindow(Window testWindow) { + windowList.add(testWindow); } /** @@ -333,4 +333,3 @@ public static void forceFail(String reason) { latch.countDown(); } } - diff --git a/test/jdk/javax/swing/JRadioButton/bug4380543.java b/test/jdk/javax/swing/JRadioButton/bug4380543.java index 91f11094808..4db6336a6a7 100644 --- a/test/jdk/javax/swing/JRadioButton/bug4380543.java +++ b/test/jdk/javax/swing/JRadioButton/bug4380543.java @@ -68,8 +68,8 @@ public void run() { passFailJFrame = new PassFailJFrame(instructions); testObj = new TestFrame(); //Adding the Test Frame to handle dispose - PassFailJFrame.addTestFrame(testObj); - PassFailJFrame.positionTestFrame(testObj, PassFailJFrame.Position.HORIZONTAL); + PassFailJFrame.addTestWindow(testObj); + PassFailJFrame.positionTestWindow(testObj, PassFailJFrame.Position.HORIZONTAL); } catch (Exception e) { e.printStackTrace(); } diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java index 4f78e73b911..ee01216b643 100644 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java +++ b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java @@ -67,8 +67,8 @@ public static void createAndShowGUI() throws InterruptedException, frame.setVisible(true); - PassFailJFrame.addTestFrame(frame); - PassFailJFrame.positionTestFrame(frame, + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); }); } From f993ef52fbdb0982c6f7ff284feaa5a87c9a7000 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Mon, 6 Nov 2023 08:22:35 +0000 Subject: [PATCH 112/177] 8284331: Add sanity check for signal handler modification warning. Backport-of: 116763cb5d58a7316b7bada689a0fa34a7250ee7 --- test/jdk/sun/tools/jcmd/TestJcmdSanity.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/jdk/sun/tools/jcmd/TestJcmdSanity.java b/test/jdk/sun/tools/jcmd/TestJcmdSanity.java index a04c837a682..43c7cccfb91 100644 --- a/test/jdk/sun/tools/jcmd/TestJcmdSanity.java +++ b/test/jdk/sun/tools/jcmd/TestJcmdSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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,6 +32,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Platform; import jdk.test.lib.Utils; /* @@ -59,6 +60,7 @@ public static void main(String[] args) throws Exception { testJcmdPid_f(); testJcmdPidPerfCounterPrint(); testJcmdPidBigScript(); + testJcmdPidVMinfo(); } /** @@ -166,4 +168,21 @@ private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOExce "The ouput should contain all content of " + path.toAbsolutePath()); } + /** + * Sanity check for VM.info + */ + private static void testJcmdPidVMinfo() throws Exception { + OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS, new String[] {"VM.info"}); + output.shouldHaveExitValue(0); + output.shouldContain(Long.toString(ProcessTools.getProcessId()) + ":"); + + // Should find the signal handler summary (except on Windows): + if (!Platform.isWindows()) { + output.shouldContain("Signal Handlers:"); + // Should not find any of the possible signal handler modification warnings: + output.shouldNotContain(" handler modified!"); // e.g. Warning: SIGILL handler modified! + output.shouldNotContain("*** Handler was modified!"); + output.shouldNotContain("*** Expected: "); // e.g. *** Expected: javaSignalHandler in ... + } + } } From 18d616d6dae6703e4908a603c707c5a4829fd09a Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Mon, 6 Nov 2023 08:24:40 +0000 Subject: [PATCH 113/177] 8306280: Open source several choice AWT tests Backport-of: d03128d0e5158ea967e714341c019b9af00ac4a1 --- test/jdk/java/awt/Choice/EmptyChoiceTest.java | 85 ++++++++++ .../jdk/java/awt/Choice/InsertRemoveTest.java | 92 +++++++++++ .../java/awt/Choice/OpenedChoiceHangs.java | 145 ++++++++++++++++++ .../awt/Choice/PressOutsideOpenedChoice.java | 113 ++++++++++++++ 4 files changed, 435 insertions(+) create mode 100644 test/jdk/java/awt/Choice/EmptyChoiceTest.java create mode 100644 test/jdk/java/awt/Choice/InsertRemoveTest.java create mode 100644 test/jdk/java/awt/Choice/OpenedChoiceHangs.java create mode 100644 test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java diff --git a/test/jdk/java/awt/Choice/EmptyChoiceTest.java b/test/jdk/java/awt/Choice/EmptyChoiceTest.java new file mode 100644 index 00000000000..cf799979acf --- /dev/null +++ b/test/jdk/java/awt/Choice/EmptyChoiceTest.java @@ -0,0 +1,85 @@ +/* + * 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. + */ + +/* + @test + @bug 4908468 + @summary Linux Empty Choice throws NPE + @key headful + @run main EmptyChoiceTest +*/ +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.lang.reflect.InvocationTargetException; + +public class EmptyChoiceTest +{ + Frame frame; + Choice choice = null; + + public static void main(String[] args) throws + InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(() -> { + EmptyChoiceTest emptyChoiceTest = new EmptyChoiceTest(); + emptyChoiceTest.init(); + emptyChoiceTest.test(); + }); + } + + public void init() { + frame = new Frame(); + frame.setLayout(new BorderLayout()); + choice = new Choice(); + frame.add(choice, BorderLayout.NORTH); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.validate(); + } + + public void test () { + try { + int iWidth = choice.getWidth(); + int iHeight = choice.getHeight(); + Image componentImage = + choice.createImage(iWidth, iHeight); + Graphics graphics = + componentImage.getGraphics(); + graphics.setClip(0, 0, iWidth, iHeight); + choice.printAll(graphics); + System.out.println("PrintAll successful!"); + } catch (NullPointerException exp) { + throw new RuntimeException("Test failed. " + + "Empty Choice printAll throws NullPointerException"); + } catch (Exception exc){ + throw new RuntimeException("Test failed.", exc); + } finally { + frame.dispose(); + } + } +} diff --git a/test/jdk/java/awt/Choice/InsertRemoveTest.java b/test/jdk/java/awt/Choice/InsertRemoveTest.java new file mode 100644 index 00000000000..37c2f15f65a --- /dev/null +++ b/test/jdk/java/awt/Choice/InsertRemoveTest.java @@ -0,0 +1,92 @@ +/* + * 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. + */ + +/* + @test + @bug 4115130 + @summary Tests Inserting/Removing items doesn't cause crash. + @key headful + @run main InsertRemoveTest + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class InsertRemoveTest { + Choice choice1; + Choice choice2; + Choice choice3; + Frame f; + int itemCount = 0; + int iterCount = 0; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(() -> new InsertRemoveTest().start()); + } + + public void start() { + f = new Frame("Check Choice"); + f.setLayout(new BorderLayout()); + + choice1 = new Choice(); + choice2 = new Choice(); + choice3 = new Choice(); + + f.add(choice1, BorderLayout.NORTH); + f.add(choice3, BorderLayout.CENTER); + f.add(choice2, BorderLayout.SOUTH); + + f.pack(); + f.setLocationRelativeTo(null); + f.setVisible(true); + + try { + for (int i = 0; i < 50; i++) { + if (choice1 != null && itemCount < 40) { + choice1.insert("I am Choice, yes I am : " + iterCount, + 0); + choice2.add("I am the same, yes I am : " + iterCount); + choice3.insert("I am the same, yes I am : " + iterCount, + 10); + itemCount++; + iterCount++; + } + if (itemCount >= 20 && choice1 != null + && choice1.getItemCount() > 0) { + choice1.remove(0); + choice2.remove(10); + choice3.remove(19); + itemCount--; + } + f.validate(); + } + } finally { + f.dispose(); + } + } + +} diff --git a/test/jdk/java/awt/Choice/OpenedChoiceHangs.java b/test/jdk/java/awt/Choice/OpenedChoiceHangs.java new file mode 100644 index 00000000000..cd053918362 --- /dev/null +++ b/test/jdk/java/awt/Choice/OpenedChoiceHangs.java @@ -0,0 +1,145 @@ +/* + * 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 + * 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 6246503 + @summary Disabling a choice after selection locks keyboard, \ + mouse and makes the system unusable + @key headful + @run main OpenedChoiceHangs +*/ + +import java.awt.AWTException; +import java.awt.Button; +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.event.FocusEvent; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.lang.reflect.InvocationTargetException; + +public class OpenedChoiceHangs implements ItemListener { + static final Object FOCUS_LOCK = new Object(); + + Frame frame; + Choice ch = new Choice(); + Button b = new Button("A button"); + Robot robot; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + OpenedChoiceHangs openedChoiceHangs = new OpenedChoiceHangs(); + EventQueue.invokeAndWait(openedChoiceHangs::init); + openedChoiceHangs.test(); + } + + public void init() { + frame = new Frame(); + + frame.setLayout(new FlowLayout()); + for (int i = 1; i < 10; i++) { + ch.add("item " + i); + } + frame.add(ch); + frame.add(b); + ch.setBackground(new Color(255, 0, 0)); + ch.setForeground(new Color(255, 0, 0)); + ch.addItemListener(this); + + frame.setSize(200, 200); + frame.setVisible(true); + frame.setLocationRelativeTo(null); + frame.validate(); + } + + public void test() { + try { + robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + robot.delay(1000); + robot.mouseMove(ch.getLocationOnScreen().x + ch.getWidth() / 2, + ch.getLocationOnScreen().y + ch.getHeight() / 2); + + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(1000); + if (!ch.isFocusOwner()) { + synchronized (FOCUS_LOCK) { + FOCUS_LOCK.wait(3000); + } + } + if (!ch.isFocusOwner()){ + throw new RuntimeException( + "Test failed. Choice has no focus after mouse press."); + } + robot.keyPress(KeyEvent.VK_DOWN); + robot.keyRelease(KeyEvent.VK_DOWN); + robot.delay(1000); + + robot.keyPress(KeyEvent.VK_UP); + robot.keyRelease(KeyEvent.VK_UP); + robot.delay(1000); + + Color color = robot.getPixelColor( + ch.getLocationOnScreen().x + ch.getWidth() / 2, + ch.getLocationOnScreen().y + ch.getHeight() * 4); + System.out.println("Color is " + color); + if (color.equals(new Color(255, 0,0))){ + throw new RuntimeException( + "Test failed. Choice is disabled and still opened. "); + } + } catch (AWTException e) { + throw new RuntimeException( + "Test interrupted due to AWTException. Robot=" + robot, e); + } catch (InterruptedException e) { + throw new RuntimeException("Test interrupted. Robot=" + robot, e); + } finally { + EventQueue.invokeLater(frame::dispose); + } + + System.out.println("Test passed: Choice became closed after disabling."); + } + + public void itemStateChanged (ItemEvent ie) { + System.out.println("Choice Item has changed: "+ie); + ch.setEnabled(false); + } + public void focusGained(FocusEvent fEvent){ + System.out.println("focusGained"+fEvent); + synchronized(FOCUS_LOCK){ + FOCUS_LOCK.notify(); + } + } + + public void focusLost(FocusEvent fEvent){ + System.out.println("focusLost"+fEvent); + } +} diff --git a/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java b/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java new file mode 100644 index 00000000000..60803e775ad --- /dev/null +++ b/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java @@ -0,0 +1,113 @@ +/* + * 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 + * 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 6259328 + @summary Choice scrolls when dragging the parent frame while drop-down \ + is active + @key headful + @run main PressOutsideOpenedChoice +*/ + + +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.lang.reflect.InvocationTargetException; + +public class PressOutsideOpenedChoice extends Frame { + Robot robot; + Choice choice1 = new Choice(); + Point pt; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + PressOutsideOpenedChoice pressOutsideOpenedChoice = + new PressOutsideOpenedChoice(); + EventQueue.invokeAndWait(pressOutsideOpenedChoice::init); + pressOutsideOpenedChoice.start(); + } + + public void init() { + for (int i = 1; i < 50; i++) { + choice1.add("item-" + i); + } + choice1.setForeground(Color.red); + choice1.setBackground(Color.red); + add(choice1); + setLayout(new FlowLayout()); + setSize (200,200); + setLocationRelativeTo(null); + setVisible(true); + validate(); + } + + public void start() { + try { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + robot.delay(1000); + testPressOutsideOpenedChoice(InputEvent.BUTTON1_DOWN_MASK); + } catch (Throwable e) { + throw new RuntimeException("Test failed. Exception thrown: " + e); + } finally { + EventQueue.invokeLater(this::dispose); + } + } + + public void testPressOutsideOpenedChoice(int button) { + pt = choice1.getLocationOnScreen(); + robot.mouseMove(pt.x + choice1.getWidth() - choice1.getHeight() / 4, + pt.y + choice1.getHeight() / 2); + robot.delay(100); + robot.mousePress(button); + robot.mouseRelease(button); + robot.delay(200); + //move mouse outside of the choice + robot.mouseMove(pt.x - choice1.getWidth() / 2, + pt.y + choice1.getHeight() / 2); + robot.delay(400); + robot.mousePress(button); + robot.mouseRelease(button); + robot.delay(200); + Color color = robot.getPixelColor(pt.x + choice1.getWidth() / 2, + pt.y + 3 * choice1.getHeight()); + System.out.println("color got " + + robot.getPixelColor(pt.x + choice1.getWidth() / 2, + pt.y + 3 * choice1.getHeight())); + if (color.equals(Color.red)) { + throw new RuntimeException("Test failed. Choice didn't close " + + "after mouse press outside of Choice " + button); + } else { + System.out.println("Test passed. " + + "Choice closed with MousePress outside"); + } + } +} From 9abfddecff40a90d4915bf921c8a22f797a65f22 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 6 Nov 2023 08:27:06 +0000 Subject: [PATCH 114/177] 8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection Reviewed-by: mbaesken Backport-of: f2383b3cbd1096f0b38e89a3d876da2217511f11 --- .../classes/com/sun/jndi/ldap/Connection.java | 132 +++++----- .../ldap/LdapSSLHandshakeFailureTest.java | 248 ++++++++++++++++++ test/jdk/com/sun/jndi/ldap/ksWithSAN | Bin 0 -> 2240 bytes 3 files changed, 314 insertions(+), 66 deletions(-) create mode 100644 test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java create mode 100644 test/jdk/com/sun/jndi/ldap/ksWithSAN diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java index f591b3567cc..2461527acc2 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java @@ -279,79 +279,80 @@ private InetSocketAddress createInetSocketAddress(String host, int port) { private Socket createSocket(String host, int port, String socketFactory, int connectTimeout) throws Exception { - Socket socket = null; - - if (socketFactory != null) { + SocketFactory factory = getSocketFactory(socketFactory); + assert factory != null; + Socket socket = createConnectionSocket(host, port, factory, connectTimeout); - // create the factory + // the handshake for SSL connection with server and reset timeout for the socket + if (socket instanceof SSLSocket) { + SSLSocket sslSocket = (SSLSocket)socket; + try { + initialSSLHandshake(sslSocket, connectTimeout); + } catch (Exception e) { + // 8314063 the socket is not closed after the failure of handshake + // close the socket while the error happened + closeOpenedSocket(socket); + throw e; + } + } + return socket; + } + private SocketFactory getSocketFactory(String socketFactoryName) throws Exception { + if (socketFactoryName == null) { + if (debug) { + System.err.println("Connection: using default SocketFactory"); + } + return SocketFactory.getDefault(); + } else { + if (debug) { + System.err.println("Connection: loading supplied SocketFactory: " + socketFactoryName); + } @SuppressWarnings("unchecked") Class socketFactoryClass = - (Class)Obj.helper.loadClass(socketFactory); + (Class) Obj.helper.loadClass(socketFactoryName); Method getDefault = - socketFactoryClass.getMethod("getDefault", new Class[]{}); + socketFactoryClass.getMethod("getDefault"); SocketFactory factory = (SocketFactory) getDefault.invoke(null, new Object[]{}); + return factory; + } + } - // create the socket - - if (connectTimeout > 0) { - - InetSocketAddress endpoint = - createInetSocketAddress(host, port); - - // unconnected socket - socket = factory.createSocket(); - - if (debug) { - System.err.println("Connection: creating socket with " + - "a timeout using supplied socket factory"); - } - - // connected socket - socket.connect(endpoint, connectTimeout); - } - - // continue (but ignore connectTimeout) - if (socket == null) { - if (debug) { - System.err.println("Connection: creating socket using " + - "supplied socket factory"); - } - // connected socket - socket = factory.createSocket(host, port); - } - } else { - - if (connectTimeout > 0) { - - InetSocketAddress endpoint = createInetSocketAddress(host, port); - - socket = new Socket(); + private Socket createConnectionSocket(String host, int port, SocketFactory factory, + int connectTimeout) throws Exception { + Socket socket = null; - if (debug) { - System.err.println("Connection: creating socket with " + - "a timeout"); - } - socket.connect(endpoint, connectTimeout); + if (connectTimeout > 0) { + // create unconnected socket and then connect it if timeout + // is supplied + InetSocketAddress endpoint = + createInetSocketAddress(host, port); + // unconnected socket + socket = factory.createSocket(); + // connect socket with a timeout + socket.connect(endpoint, connectTimeout); + if (debug) { + System.err.println("Connection: creating socket with " + + "a connect timeout"); } - - // continue (but ignore connectTimeout) - - if (socket == null) { - if (debug) { - System.err.println("Connection: creating socket"); - } - // connected socket - socket = new Socket(host, port); + } + if (socket == null) { + // create connected socket + socket = factory.createSocket(host, port); + if (debug) { + System.err.println("Connection: creating connected socket with" + + " no connect timeout"); } } + return socket; + } + + // For LDAP connect timeouts on LDAP over SSL connections must treat + // the SSL handshake following socket connection as part of the timeout. + // So explicitly set a socket read timeout, trigger the SSL handshake, + // then reset the timeout. + private void initialSSLHandshake(SSLSocket sslSocket , int connectTimeout) throws Exception { - // For LDAP connect timeouts on LDAP over SSL connections must treat - // the SSL handshake following socket connection as part of the timeout. - // So explicitly set a socket read timeout, trigger the SSL handshake, - // then reset the timeout. - if (socket instanceof SSLSocket) { - SSLSocket sslSocket = (SSLSocket) socket; if (!IS_HOSTNAME_VERIFICATION_DISABLED) { SSLParameters param = sslSocket.getSSLParameters(); param.setEndpointIdentificationAlgorithm("LDAPS"); @@ -364,8 +365,6 @@ private Socket createSocket(String host, int port, String socketFactory, sslSocket.startHandshake(); sslSocket.setSoTimeout(socketTimeout); } - } - return socket; } //////////////////////////////////////////////////////////////////////////// @@ -641,7 +640,7 @@ void cleanup(Control[] reqCtls, boolean notifyParent) { flushAndCloseOutputStream(); // 8313657 socket is not closed until GC is run - closeOpenedSocket(); + closeOpenedSocket(sock); tryUnpauseReader(); if (!notifyParent) { @@ -694,9 +693,10 @@ private void flushAndCloseOutputStream() { } // close socket - private void closeOpenedSocket() { + private void closeOpenedSocket(Socket socket) { try { - sock.close(); + if (socket != null && !socket.isClosed()) + socket.close(); } catch (IOException ioEx) { if (debug) { System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); diff --git a/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java b/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java new file mode 100644 index 00000000000..766862d2670 --- /dev/null +++ b/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java @@ -0,0 +1,248 @@ +/* + * 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.lib.net.URIBuilder; + +import javax.naming.Context; +import javax.naming.ldap.InitialLdapContext; +import javax.naming.ldap.LdapContext; +import javax.net.SocketFactory; +import javax.net.ssl.SSLServerSocketFactory; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.util.Hashtable; + +/* + * @test + * @bug 8314063 + * @library /test/lib + * @summary For LDAPs connection, if the value of com.sun.jndi.ldap.connect.timeout is + * set too small or not an optimal value for the system, after the socket is created and + * connected to the server, but the handshake between the client and server fails due to + * socket time out, the opened socket is not closed properly. In this test case, the server + * is forced to sleep ten seconds and connection time out for client is one second. This + * will allow the socket opened and connected, and give the chance for the handshake to be + * timed out. Before this fix, the socket is kept opened. Right now the exception will be + * caught and the socket will be closed. + * + * @run main/othervm LdapSSLHandshakeFailureTest LdapSSLHandshakeFailureTest$CustomSocketFactory true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest -1000 true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest -1000 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 2000 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 0 true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 0 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest true + * @run main/othervm LdapSSLHandshakeFailureTest false + */ + +public class LdapSSLHandshakeFailureTest { + private static String SOCKET_CLOSED_MSG = "The socket has been closed."; + + private static int serverSleepingTime = 5000; + + public static void main(String args[]) throws Exception { + + // Set the keystores + setKeyStore(); + boolean serverSlowDown = Boolean.valueOf(args[0]); + if (args.length == 2) { + serverSlowDown = Boolean.valueOf(args[1]); + } + + if (args.length == 3) { + serverSleepingTime = Integer.valueOf(args[2]); + } + + boolean hasCustomSocketFactory = args[0] + .equals("LdapSSLHandshakeFailureTest$CustomSocketFactory"); + // start the test server first. + try (TestServer server = new TestServer(serverSlowDown, serverSleepingTime)) { + server.start(); + Hashtable env = new Hashtable<>(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + env.put("java.naming.ldap.version", "3"); + env.put(Context.PROVIDER_URL, URIBuilder.newBuilder() + .scheme("ldaps") + .loopback() + .port(server.getPortNumber()) + .buildUnchecked().toString()); + + if (hasCustomSocketFactory) { + env.put("java.naming.ldap.factory.socket", args[0]); + env.put("com.sun.jndi.ldap.connect.timeout", "1000"); + } + + if (args.length == 2 && !hasCustomSocketFactory) { + env.put("com.sun.jndi.ldap.connect.timeout", args[0]); + } + + env.put(Context.SECURITY_PROTOCOL, "ssl"); + env.put(Context.SECURITY_AUTHENTICATION, "Simple"); + env.put(Context.SECURITY_PRINCIPAL, "cn=principal"); + env.put(Context.SECURITY_CREDENTIALS, "123456"); + LdapContext ctx = null; + try { + ctx = new InitialLdapContext(env, null); + } catch (Exception e) { + if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0 + && hasCustomSocketFactory + && Boolean.valueOf(args[1])) { + System.out.println(SOCKET_CLOSED_MSG); + } else { + throw e; + } + } finally { + if (ctx != null) + ctx.close(); + } + } + } + + public static class CustomSocketFactory extends SocketFactory { + private static CustomSocket customSocket; + + public static CustomSocketFactory getDefault() { + return new CustomSocketFactory(); + } + + @Override + public Socket createSocket() throws SocketException { + customSocket = new CustomSocket(); + return customSocket; + } + + @Override + public Socket createSocket(String s, int timeout) { + return customSocket; + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, + int localPort) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress host, int port) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress address, int port, + InetAddress localAddress, int localPort) { + return customSocket; + } + } + + private static class CustomSocket extends Socket { + private int closeMethodCalled = 0; + + public CustomSocket() { + closeMethodCalled = 0; + } + + public int closeMethodCalledCount() { + return closeMethodCalled; + } + + @Override + public void close() throws java.io.IOException { + closeMethodCalled++; + super.close(); + } + } + + private static void setKeyStore() { + + String fileName = "ksWithSAN", dir = System.getProperty("test.src", ".") + File.separator; + + System.setProperty("javax.net.ssl.keyStore", dir + fileName); + System.setProperty("javax.net.ssl.keyStorePassword", "welcome1"); + System.setProperty("javax.net.ssl.trustStore", dir + fileName); + System.setProperty("javax.net.ssl.trustStorePassword", "welcome1"); + } + + static class TestServer extends Thread implements AutoCloseable { + private boolean isForceToSleep; + private int sleepingTime; + private final ServerSocket serverSocket; + private final int PORT; + + private TestServer(boolean isForceToSleep, int sleepingTime) { + this.isForceToSleep = isForceToSleep; + this.sleepingTime = sleepingTime; + try { + SSLServerSocketFactory socketFactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + serverSocket = socketFactory.createServerSocket(0, 0, InetAddress.getLoopbackAddress()); + PORT = serverSocket.getLocalPort(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + setDaemon(true); + } + + public int getPortNumber() { + return PORT; + } + + @Override + public void run() { + try (Socket socket = serverSocket.accept(); + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream()) { + if (isForceToSleep) { + Thread.sleep(sleepingTime); + } + byte[] bindResponse = {0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A, + 0x01, 0x00, 0x04, 0x00, 0x04, 0x00}; + // read the bindRequest + while (in.read() != -1) { + in.skip(in.available()); + break; + } + out.write(bindResponse); + out.flush(); + // ignore the further requests + while (in.read() != -1) { + in.skip(in.available()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void close() throws Exception { + if (serverSocket != null) { + serverSocket.close(); + } + } + } +} + diff --git a/test/jdk/com/sun/jndi/ldap/ksWithSAN b/test/jdk/com/sun/jndi/ldap/ksWithSAN new file mode 100644 index 0000000000000000000000000000000000000000..9c028e7cec6522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j6KsIEpqkIq6ATE;7Lq-kYH~@=Y;YCVZ`ZgR)7NfwQUzk}8OVvsko&$2{lOL| zMbCKWksU9+Ph`^D_LO9%DPFfvk8){b+&FKTk7uUM-$))|X{C|N!k#fbZtdr5HM?8B zD+uHeGgp7>?Q1zaOgn5@A@7QoI&@Q0C9l|IA%7?5F>F)|-H)fN1+_oM>)e%T zM6oqLhfNjpv7^mGE3WBl53-yGA*LFGbaRug-eVdB*)zsrF1`AsS7xDZb2a`Jt6#4u z#x8_W-c-_p)tH(n!gKIA|ZE)d|Vj0AY$P+J%r1M&3xFX6#Jyot(!0RJxw zH-^`h=;uN7Aq8Ak<~s;*pdm1D^8lio&t+v4fczyOF|hN*;Q#qRF}yw`H=@r~QXmD8 zz@n510R8}KssvTM!(Wu3to9%Jf60LgKJxd{4?Y8w3g!a=R4@WU1%p9bl1~a%D;J;i zVXXpv8+_VfD|g0X5&QR!)^A{~&WJHULoOE@s-k~hS!A?0t7&@Vs%nlYb?XV`Ti#=o z1gBdKN*g&Q!%K}e$V8Ofl8blY+jt&Pov1rXdDay1^xPH$O(TvbfHrLy+R2%8*SHQk zyO;HG#G$Bv3g^d&yeigm#B|}zvtzccDYU^+zL=O8w%qjKr_gmxTjXa(zoXx`tJ}Z7zEBg1polw!8pYQ zU_1ak8Wwr*UIFo60vaX)6Oy5{I{5ia%<>|&2c`yhGy1T{RsP=9gM~WiDj4Lxd*ju) z?%s&w`hgd=Z=~Ts|dC7QKXh$Q>23@dbR|cXngK4_n5B@>pzDZ zw18q|^&NDhPqS_ka+12UB~nzryHE1O3{DSRm+GIq)`m!lh_4`N(*-RjmMX_H%qo>G PM>3~w?k6Bja+3Z9gk<0b literal 0 HcmV?d00001 From feb051fa69e981f3882823e69df36b63f3100c69 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 6 Nov 2023 08:29:12 +0000 Subject: [PATCH 115/177] 8316906: Clarify TLABWasteTargetPercent flag Reviewed-by: mbaesken Backport-of: 77fac0f4c6692bcc06456d03a4329d9f8ddeeded --- src/hotspot/share/gc/shared/gc_globals.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index a77964e35ce..0fd7b30323e 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -772,10 +772,13 @@ "Allocation averaging weight") \ range(0, 100) \ \ + /* At GC all TLABs are retired, and each thread's active */ \ + /* TLAB is assumed to be half full on average. The */ \ + /* remaining space is waste, proportional to TLAB size. */ \ + product(uintx, TLABWasteTargetPercent, 1, \ + "Percentage of Eden that can be wasted (half-full TLABs at GC)") \ /* Limit the lower bound of this flag to 1 as it is used */ \ /* in a division expression. */ \ - product(uintx, TLABWasteTargetPercent, 1, \ - "Percentage of Eden that can be wasted") \ range(1, 100) \ \ product(uintx, TLABRefillWasteFraction, 64, \ From f6bdbe8966daf555acd0b45ca436d5f2adaa89a7 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Mon, 6 Nov 2023 08:31:41 +0000 Subject: [PATCH 116/177] 8317967: Enhance test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java to handle default cases Backport-of: 9728e21db1b35e487c562690de659aac386aa99d --- .../javax/net/ssl/TLSCommon/SSLEngineTestCase.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java b/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java index 57548ce750d..dce28edadf2 100644 --- a/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java +++ b/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java @@ -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 @@ -134,7 +134,7 @@ public enum HandshakeMode { * e.g. "TLSv1", "TLSv1.1", "TLSv1.2", "DTLSv1.0", "DTLSv1.2". */ public static final String TESTED_SECURITY_PROTOCOL - = System.getProperty("test.security.protocol", "TLS"); + = System.getProperty("test.security.protocol"); /** * Test mode: "norm", "norm_sni" or "krb". * Modes "norm" and "norm_sni" are used to run @@ -738,13 +738,18 @@ public void runTests() { case "TLSv1.1": runTests(Ciphers.SUPPORTED_NON_KRB_NON_SHA_CIPHERS); break; - case "DTLSv1.1": + case "DTLS": + case "DTLSv1.2": + case "TLS": case "TLSv1.2": runTests(Ciphers.SUPPORTED_NON_KRB_CIPHERS); break; case "TLSv1.3": runTests(Ciphers.TLS13_CIPHERS); break; + default: + throw new Error("Test error: Unsupported test " + + "security protocol: " + TESTED_SECURITY_PROTOCOL); } break; case "krb": From 1f67ffb029869a432420af3920cc3311126a4036 Mon Sep 17 00:00:00 2001 From: Frederic Thevenet Date: Mon, 6 Nov 2023 08:34:17 +0000 Subject: [PATCH 117/177] 8318669: Target OS detection in 'test-prebuilt' makefile target is incorrect when running on MSYS2 Backport-of: 202c0137b86cd7bcbe0c1eddf2657f45698ab667 --- make/RunTestsPrebuilt.gmk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make/RunTestsPrebuilt.gmk b/make/RunTestsPrebuilt.gmk index 8cd4ca51bbb..b5e00a70a8f 100644 --- a/make/RunTestsPrebuilt.gmk +++ b/make/RunTestsPrebuilt.gmk @@ -157,6 +157,10 @@ ifeq ($(UNAME_OS), CYGWIN) OPENJDK_TARGET_OS := windows OPENJDK_TARGET_OS_TYPE := windows OPENJDK_TARGET_OS_ENV := windows.cygwin +else ifeq ($(UNAME_OS), MINGW64) + OPENJDK_TARGET_OS := windows + OPENJDK_TARGET_OS_TYPE := windows + OPENJDK_TARGET_OS_ENV := windows.msys2 else OPENJDK_TARGET_OS_TYPE:=unix ifeq ($(UNAME_OS), Linux) @@ -171,6 +175,9 @@ else OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS) endif +# Sanity check env detection +$(info Detected target OS, type and env: [$(OPENJDK_TARGET_OS)] [$(OPENJDK_TARGET_OS_TYPE)] [$(OPENJDK_TARGET_OS_ENV)]) + # Assume little endian unless otherwise specified OPENJDK_TARGET_CPU_ENDIAN := little From 80d3bb46c0804016a17d4cd05eee7eda03268cce Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Mon, 6 Nov 2023 12:35:01 +0000 Subject: [PATCH 118/177] 8289745: JfrStructCopyFailed uses heap words instead of bytes for object sizes Reviewed-by: phh Backport-of: 7f0e9bd632198c7fd34d27b85ca51ea0e2442e4d --- src/hotspot/share/gc/shared/gcTraceSend.cpp | 6 +++--- .../jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java | 4 ++++ .../jfr/event/gc/detailed/TestEvacuationFailedEvent.java | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/shared/gcTraceSend.cpp b/src/hotspot/share/gc/shared/gcTraceSend.cpp index 191d6bf89fe..ae22da347a0 100644 --- a/src/hotspot/share/gc/shared/gcTraceSend.cpp +++ b/src/hotspot/share/gc/shared/gcTraceSend.cpp @@ -161,9 +161,9 @@ void OldGCTracer::send_old_gc_event() const { static JfrStructCopyFailed to_struct(const CopyFailedInfo& cf_info) { JfrStructCopyFailed failed_info; failed_info.set_objectCount(cf_info.failed_count()); - failed_info.set_firstSize(cf_info.first_size()); - failed_info.set_smallestSize(cf_info.smallest_size()); - failed_info.set_totalSize(cf_info.total_size()); + failed_info.set_firstSize(cf_info.first_size() * HeapWordSize); + failed_info.set_smallestSize(cf_info.smallest_size() * HeapWordSize); + failed_info.set_totalSize(cf_info.total_size() * HeapWordSize); return failed_info; } diff --git a/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java b/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java index f075aedc699..6fc9b0ab8f0 100644 --- a/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java +++ b/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java @@ -51,12 +51,16 @@ public static void test(String testName, String[] vmFlags) throws Throwable { // This test can not always trigger the expected event. // Test is ok even if no events found. List events = RecordingFile.readAllEvents(Paths.get(jfr_file)); + int minObjectAlignment = 8; for (RecordedEvent event : events) { System.out.println("Event: " + event); long smallestSize = Events.assertField(event, "promotionFailed.smallestSize").atLeast(1L).getValue(); + Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size."); long firstSize = Events.assertField(event, "promotionFailed.firstSize").atLeast(smallestSize).getValue(); + Asserts.assertTrue((firstSize % minObjectAlignment) == 0, "firstSize " + firstSize + " is not a valid size."); long totalSize = Events.assertField(event, "promotionFailed.totalSize").atLeast(firstSize).getValue(); long objectCount = Events.assertField(event, "promotionFailed.objectCount").atLeast(1L).getValue(); + Asserts.assertTrue((totalSize % minObjectAlignment) == 0, "totalSize " + totalSize + " is not a valid size."); Asserts.assertLessThanOrEqual(smallestSize * objectCount, totalSize, "smallestSize * objectCount <= totalSize"); } } diff --git a/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java b/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java index ee71eb9e1fc..927f074e582 100644 --- a/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java +++ b/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java @@ -62,13 +62,17 @@ public static void main(String[] args) throws Exception { } List events = RecordingFile.readAllEvents(Paths.get(JFR_FILE)); + int minObjectAlignment = 8; Events.hasEvents(events); for (RecordedEvent event : events) { long objectCount = Events.assertField(event, "evacuationFailed.objectCount").atLeast(1L).getValue(); long smallestSize = Events.assertField(event, "evacuationFailed.smallestSize").atLeast(1L).getValue(); + Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size."); long firstSize = Events.assertField(event, "evacuationFailed.firstSize").atLeast(smallestSize).getValue(); + Asserts.assertTrue((firstSize % minObjectAlignment) == 0, "firstSize " + firstSize + " is not a valid size."); long totalSize = Events.assertField(event, "evacuationFailed.totalSize").atLeast(firstSize).getValue(); + Asserts.assertTrue((totalSize % minObjectAlignment) == 0, "totalSize " + totalSize + " is not a valid size."); Asserts.assertLessThanOrEqual(smallestSize * objectCount, totalSize, "smallestSize * objectCount <= totalSize"); } } From b64a1acb212a64629094bf7e992d98500f91d629 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Mon, 6 Nov 2023 12:35:24 +0000 Subject: [PATCH 119/177] 8293166: jdk/jfr/jvm/TestDumpOnCrash.java fails on Linux ppc64le and Linux aarch64 Reviewed-by: aph, stuefe Backport-of: 5551cb66ba58cadce7291a95c5af662ade2cb7b8 --- test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java index b84e94f18f0..22e3cbe0732 100644 --- a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java +++ b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java @@ -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 @@ -95,6 +95,7 @@ private static long runProcess(String crasher, String signal, boolean disk) thro "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateCoredumpOnCrash", + "-XX:-TieredCompilation", // Avoid secondary crashes (see JDK-8293166) "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:StartFlightRecording=" + flightRecordingOptions, crasher, From 48f1f39821dfd29a6a8d1caffbdf8d1481692aa4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 7 Nov 2023 09:06:42 +0000 Subject: [PATCH 120/177] 8230435: Replace wildcard address with loopback or local host in tests - part 22 Fixes tests to use the loopback address whenever possible. It also fixes some safe publishing issues, or add diagnostics in some of the tests. Reviewed-by: lucy Backport-of: f71db3074c44c554b600c506adaa5b145edf4420 --- test/jdk/java/net/Authenticator/B4678055.java | 13 +++- .../net/DatagramSocket/PortUnreachable.java | 68 +++++++++++++++---- .../java/net/URLConnection/RedirectLimit.java | 7 ++ .../jdk/java/net/URLConnection/Responses.java | 11 ++- .../net/ssl/templates/SSLSocketTemplate.java | 22 ++++-- .../nameservice/simple/DefaultCaching.java | 20 +++++- test/jdk/sun/net/www/AuthHeaderTest.java | 2 +- .../net/www/http/HttpClient/RetryPost.java | 8 ++- .../https/HttpsClient/ProxyAuthTest.java | 25 +++++-- .../https/HttpsClient/ProxyTunnelServer.java | 21 ++++-- .../https/HttpsURLConnection/B6226610.java | 23 ++++--- .../HttpsProxyStackOverflow.java | 15 ++-- .../https/HttpsURLConnection/TunnelProxy.java | 23 ++++++- 13 files changed, 203 insertions(+), 55 deletions(-) diff --git a/test/jdk/java/net/Authenticator/B4678055.java b/test/jdk/java/net/Authenticator/B4678055.java index f390d9a07be..3aba8378c3c 100644 --- a/test/jdk/java/net/Authenticator/B4678055.java +++ b/test/jdk/java/net/Authenticator/B4678055.java @@ -36,8 +36,8 @@ public class B4678055 implements HttpCallback { - static int count = 0; - static String authstring; + static volatile int count = 0; + static volatile String authstring; void errorReply (HttpTransaction req, String reply) throws IOException { req.addResponseHeader ("Connection", "close"); @@ -54,6 +54,7 @@ void okReply (HttpTransaction req) throws IOException { public void request (HttpTransaction req) { try { + System.out.println("Server handling case: "+ count); authstring = req.getRequestHeader ("Authorization"); System.out.println (authstring); switch (count) { @@ -93,6 +94,7 @@ public void request (HttpTransaction req) { } count ++; } catch (IOException e) { + System.err.println("Unexpected exception for case " + count + ": " + e); e.printStackTrace(); } } @@ -132,6 +134,8 @@ public static void main (String[] args) throws Exception { client ("http://localhost:"+server.getLocalPort()+"/d2/foo.html"); client ("http://localhost:"+server.getLocalPort()+"/d2/foo.html"); } catch (Exception e) { + System.out.println("Client got exception: " + e); + System.out.println("Terminating server"); if (server != null) { server.terminate(); } @@ -145,10 +149,13 @@ public static void main (String[] args) throws Exception { if (!checkFinalAuth()) { except ("Wrong authorization string received from client"); } + System.out.println("Terminating server"); server.terminate(); } public static void except (String s) { + System.out.println("Check failed: " + s); + System.out.println("Terminating server"); server.terminate(); throw new RuntimeException (s); } @@ -158,7 +165,7 @@ static class MyAuthenticator extends Authenticator { super (); } - int count = 0; + volatile int count = 0; public PasswordAuthentication getPasswordAuthentication () { PasswordAuthentication pw; diff --git a/test/jdk/java/net/DatagramSocket/PortUnreachable.java b/test/jdk/java/net/DatagramSocket/PortUnreachable.java index d692df08bd7..5fc64909a82 100644 --- a/test/jdk/java/net/DatagramSocket/PortUnreachable.java +++ b/test/jdk/java/net/DatagramSocket/PortUnreachable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,14 +24,16 @@ /** * @test * @bug 4361783 + * @key intermittent * @summary Test to see if ICMP Port Unreachable on non-connected * DatagramSocket causes a SocketException "socket closed" * exception on Windows 2000. */ import java.net.BindException; -import java.net.InetAddress; -import java.net.DatagramSocket; import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.InetSocketAddress; public class PortUnreachable { @@ -42,7 +44,7 @@ public class PortUnreachable { public void serverSend() { try { InetAddress addr = InetAddress.getLocalHost(); - Thread.currentThread().sleep(1000); + Thread.sleep(1000); // send a delayed packet which should mean a delayed icmp // port unreachable byte b[] = "A late msg".getBytes(); @@ -63,29 +65,72 @@ public void serverSend() { DatagramSocket recreateServerSocket (int serverPort) throws Exception { DatagramSocket serverSocket = null; int retryCount = 0; + long sleeptime = 0; System.out.println("Attempting to recreate server socket with port: " + serverPort); + // it's possible that this method intermittently fails, if some other + // process running on the machine grabs the port we want before us, + // and doesn't release it before the 5 * 500 ms are elapsed... while (serverSocket == null) { try { - serverSocket = new DatagramSocket(serverPort); + serverSocket = new DatagramSocket(serverPort, InetAddress.getLocalHost()); } catch (BindException bEx) { if (retryCount++ < 5) { - Thread.sleep(500); + sleeptime += sleepAtLeast(500); } else { - System.out.println("Give up after 5 retries"); + System.out.println("Give up after 5 retries and " + sleeptime(sleeptime)); + System.out.println("Has some other process grabbed port " + serverPort + "?"); throw bEx; } } } System.out.println("PortUnreachableTest.recreateServerSocket: returning socket == " - + serverSocket.getLocalAddress() + ":" + serverSocket.getLocalPort()); + + serverSocket.getLocalAddress() + ":" + serverSocket.getLocalPort() + + " obtained at " + attempt(retryCount) + " attempt with " + sleeptime(sleeptime)); return serverSocket; } - PortUnreachable() throws Exception { + long sleepAtLeast(long millis) throws Exception { + long start = System.nanoTime(); + long ms = millis; + while (ms > 0) { + assert ms < Long.MAX_VALUE/1000_000L; + Thread.sleep(ms); + long elapsedms = (System.nanoTime() - start)/1000_000L; + ms = millis - elapsedms; + } + return millis - ms; + } + + String attempt(int retry) { + switch (retry) { + case 0: return "first"; + case 1: return "second"; + case 2: return "third"; + default: return retry + "th"; + } + } + + String sleeptime(long millis) { + if (millis == 0) return "no sleep"; + long sec = millis / 1000L; + long ms = millis % 1000L; + String sleeptime = ""; + if (millis > 0) { + if (sec > 0) { + sleeptime = "" + sec + " s" + + (ms > 0 ? " " : ""); + } + if (ms > 0 ) { + sleeptime += ms + " ms"; + } + } else sleeptime = millis + " ms"; // should not happen + return sleeptime + " of sleep time"; + } - clientSock = new DatagramSocket(); + PortUnreachable() throws Exception { + clientSock = new DatagramSocket(new InetSocketAddress(InetAddress.getLocalHost(), 0)); clientPort = clientSock.getLocalPort(); } @@ -93,7 +138,7 @@ DatagramSocket recreateServerSocket (int serverPort) throws Exception { void execute () throws Exception{ // pick a port for the server - DatagramSocket sock2 = new DatagramSocket(); + DatagramSocket sock2 = new DatagramSocket(new InetSocketAddress(InetAddress.getLocalHost(), 0)); serverPort = sock2.getLocalPort(); // send a burst of packets to the unbound port - we should get back @@ -126,4 +171,3 @@ public static void main(String[] args) throws Exception { } } - diff --git a/test/jdk/java/net/URLConnection/RedirectLimit.java b/test/jdk/java/net/URLConnection/RedirectLimit.java index 5faaeb2870f..0b30c4abb86 100644 --- a/test/jdk/java/net/URLConnection/RedirectLimit.java +++ b/test/jdk/java/net/URLConnection/RedirectLimit.java @@ -73,7 +73,9 @@ class RedirLimitServer extends Thread { // Read until the end of a HTTP request void readOneRequest(InputStream is) throws IOException { int requestEndCount = 0, r; + StringBuilder sb = new StringBuilder(); while ((r = is.read()) != -1) { + sb.append((char)r); if (r == requestEnd[requestEndCount]) { requestEndCount++; if (requestEndCount == 4) { @@ -83,6 +85,7 @@ void readOneRequest(InputStream is) throws IOException { requestEndCount = 0; } } + System.out.println("Server got request: " + sb.toString()); } public void run() { @@ -90,15 +93,19 @@ public void run() { readyToStart.countDown(); for (int i=0; i" + tests[i][0] + "<"); PrintStream out = new PrintStream( new BufferedOutputStream( @@ -117,6 +120,9 @@ public void run() { s.close(); } } catch (Exception e) { + if (!shutdown) { + e.printStackTrace(); + } } } } @@ -170,6 +176,7 @@ public static void main(String args[]) throws Exception { actualPhrase + ", expected: " + expectedPhrase); } } catch (IOException e) { + System.err.println("Test failed for >" + tests[i][0] + "<: " + e); e.printStackTrace(); failures++; } diff --git a/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java b/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java index 32022a731a9..eceefb9506d 100644 --- a/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java +++ b/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java @@ -45,6 +45,7 @@ import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManagerFactory; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketTimeoutException; import java.security.KeyStore; @@ -221,6 +222,11 @@ protected void configureServerSocket(SSLServerSocket socket) { */ protected volatile int serverPort = 0; + /* + * What's the server address? null means binding to the wildcard. + */ + protected volatile InetAddress serverAddress = null; + /* * Define the server side of the test. */ @@ -228,8 +234,13 @@ protected void doServerSide() throws Exception { // kick start the server side service SSLContext context = createServerSSLContext(); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); - SSLServerSocket sslServerSocket = - (SSLServerSocket)sslssf.createServerSocket(serverPort); + InetAddress serverAddress = this.serverAddress; + SSLServerSocket sslServerSocket = serverAddress == null ? + (SSLServerSocket)sslssf.createServerSocket(serverPort) + : (SSLServerSocket)sslssf.createServerSocket(); + if (serverAddress != null) { + sslServerSocket.bind(new InetSocketAddress(serverAddress, serverPort)); + } configureServerSocket(sslServerSocket); serverPort = sslServerSocket.getLocalPort(); @@ -317,8 +328,11 @@ private void doClientSide() throws Exception { try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket()) { try { configureClientSocket(sslSocket); - sslSocket.connect( - new InetSocketAddress("localhost", serverPort), 15000); + InetAddress serverAddress = this.serverAddress; + InetSocketAddress connectAddress = serverAddress == null + ? new InetSocketAddress("localhost", serverPort) + : new InetSocketAddress(serverAddress, serverPort); + sslSocket.connect(connectAddress, 15000); } catch (IOException ioe) { // The server side may be impacted by naughty test cases or // third party routines, and cannot accept connections. diff --git a/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java b/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java index d3c31ceac9b..747b1c69776 100644 --- a/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java +++ b/test/jdk/sun/net/InetAddress/nameservice/simple/DefaultCaching.java @@ -101,8 +101,22 @@ static void test(String host, String address, static void sleep(int seconds) { try { - Thread.sleep(seconds * 1000); - } catch (InterruptedException e) {} + sleepms(seconds * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + static long sleepms(long millis) throws InterruptedException { + long start = System.nanoTime(); + long ms = millis; + while (ms > 0) { + assert ms < Long.MAX_VALUE/1000_000L; + Thread.sleep(ms); + long elapsedms = (System.nanoTime() - start)/1000_000L; + ms = millis - elapsedms; + } + return millis - ms; } static void test(String host, String address, boolean shouldSucceed) { @@ -114,7 +128,7 @@ static void test(String host, String address, boolean shouldSucceed) { + addr + ")"); } if (!address.equals(addr.getHostAddress())) { - throw new RuntimeException(host+":"+address+": compare failed (found " + throw new RuntimeException(host+"/"+address+": compare failed (found " + addr + ")"); } System.out.println("test: " + host + "/" + address diff --git a/test/jdk/sun/net/www/AuthHeaderTest.java b/test/jdk/sun/net/www/AuthHeaderTest.java index 5ce874ef015..53852aab8f1 100644 --- a/test/jdk/sun/net/www/AuthHeaderTest.java +++ b/test/jdk/sun/net/www/AuthHeaderTest.java @@ -85,7 +85,7 @@ static void read (InputStream is) throws IOException { static void client (String u) throws Exception { URL url = new URL (u); System.out.println ("client opening connection to: " + u); - URLConnection urlc = url.openConnection (); + URLConnection urlc = url.openConnection (Proxy.NO_PROXY); InputStream is = urlc.getInputStream (); read (is); is.close(); diff --git a/test/jdk/sun/net/www/http/HttpClient/RetryPost.java b/test/jdk/sun/net/www/http/HttpClient/RetryPost.java index 6b80175135c..276e775255c 100644 --- a/test/jdk/sun/net/www/http/HttpClient/RetryPost.java +++ b/test/jdk/sun/net/www/http/HttpClient/RetryPost.java @@ -84,13 +84,17 @@ void doClient() throws Exception { throw new RuntimeException("Failed: POST request being retried"); } catch (SocketException se) { + System.out.println("Got expected exception: " + se); // this is what we expect to happen and is OK. - if (shouldRetry && httpHandler.getCallCount() != 2) + if (shouldRetry && httpHandler.getCallCount() != 2) { + se.printStackTrace(System.out); throw new RuntimeException("Failed: Handler should have been called twice. " + "It was called "+ httpHandler.getCallCount() + " times"); - else if (!shouldRetry && httpHandler.getCallCount() != 1) + } else if (!shouldRetry && httpHandler.getCallCount() != 1) { + se.printStackTrace(System.out); throw new RuntimeException("Failed: Handler should have only been called once" + "It was called "+ httpHandler.getCallCount() + " times"); + } } finally { httpServer.stop(1); executorService.shutdown(); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java b/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java index 6e3df007628..bbd9536d208 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,6 +59,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.net.Authenticator; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.Proxy; @@ -80,6 +81,10 @@ public class ProxyAuthTest extends SSLSocketTemplate { private static boolean expectSuccess; + ProxyAuthTest() { + serverAddress = InetAddress.getLoopbackAddress(); + } + /* * Run the test case. */ @@ -143,18 +148,25 @@ protected void runClientApplication(int serverPort) throws Exception { */ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier()); - InetSocketAddress paddr = - new InetSocketAddress("localhost", ps.getPort()); + InetSocketAddress paddr = InetSocketAddress + .createUnresolved(ps.getInetAddress().getHostAddress(), + ps.getPort()); Proxy proxy = new Proxy(Proxy.Type.HTTP, paddr); + InetAddress serverAddress = this.serverAddress; + String host = serverAddress == null + ? "localhost" + : serverAddress.getHostAddress(); + if (host.indexOf(':') > -1) host = "[" + host + "]"; URL url = new URL( - "https://" + "localhost:" + serverPort + "/index.html"); + "https://" + host + ":" + serverPort + "/index.html"); + System.out.println("URL: " + url); BufferedReader in = null; HttpsURLConnection uc = (HttpsURLConnection) url.openConnection(proxy); try { in = new BufferedReader(new InputStreamReader(uc.getInputStream())); String inputLine; - System.out.print("Client recieved from the server: "); + System.out.print("Client received from the server: "); while ((inputLine = in.readLine()) != null) { System.out.println(inputLine); } @@ -226,7 +238,8 @@ public boolean verify(String hostname, SSLSession session) { } private static ProxyTunnelServer setupProxy() throws IOException { - ProxyTunnelServer pserver = new ProxyTunnelServer(); + InetAddress loopback = InetAddress.getLoopbackAddress(); + ProxyTunnelServer pserver = new ProxyTunnelServer(loopback); /* * register a system wide authenticator and setup the proxy for diff --git a/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyTunnelServer.java b/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyTunnelServer.java index 90315e8cc84..65dc796a5db 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyTunnelServer.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsClient/ProxyTunnelServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -61,9 +61,14 @@ public class ProxyTunnelServer extends Thread { static boolean needAuth = false; public ProxyTunnelServer() throws IOException { + this(null); // use wildcard + } + + public ProxyTunnelServer(InetAddress proxyAddress) throws IOException { if (ss == null) { - ss = (ServerSocket) ServerSocketFactory.getDefault(). - createServerSocket(0); + ss = (ServerSocket) ServerSocketFactory.getDefault(). + createServerSocket(); + ss.bind(new InetSocketAddress(proxyAddress, 0)); } setDaemon(true); } @@ -274,9 +279,9 @@ private void retrieveConnectInfo(String connectStr) throws Exception { serverName = connectInfo.substring(0, endi); serverPort = Integer.parseInt(connectInfo.substring(endi+1)); } catch (Exception e) { - throw new IOException("Proxy recieved a request: " - + connectStr); - } + throw new IOException("Proxy received a request: " + + connectStr, e); + } serverInetAddr = InetAddress.getByName(serverName); } @@ -284,6 +289,10 @@ public int getPort() { return ss.getLocalPort(); } + public InetAddress getInetAddress() { + return ss.getInetAddress(); + } + /* * do "basic" authentication, authInfo is of the form: * Basic diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java index c04ad1d1560..ec75bcc3e11 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,12 +47,14 @@ public static void main(String[] args) throws Exception proxy = new HeaderCheckerProxyTunnelServer(); proxy.start(); - String hostname = InetAddress.getLocalHost().getHostName(); + InetAddress localHost = InetAddress.getLocalHost(); + String hostname = localHost.getHostName(); + String hostAddress = localHost.getHostAddress(); try { URL u = new URL("https://" + hostname + "/"); System.out.println("Connecting to " + u); - InetSocketAddress proxyAddr = new InetSocketAddress(hostname, proxy.getLocalPort()); + InetSocketAddress proxyAddr = InetSocketAddress.createUnresolved(hostAddress, proxy.getLocalPort()); java.net.URLConnection c = u.openConnection(new Proxy(Proxy.Type.HTTP, proxyAddr)); /* I want this header to go to the destination server only, protected @@ -96,7 +98,8 @@ class HeaderCheckerProxyTunnelServer extends Thread public HeaderCheckerProxyTunnelServer() throws IOException { if (ss == null) { - ss = new ServerSocket(0); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0)); } } @@ -143,16 +146,16 @@ private void processRequests() throws IOException retrieveConnectInfo(statusLine); if (mheader.findValue("X-TestHeader") != null) { - System.out.println("Proxy should not receive user defined headers for tunneled requests"); - failed = true; + System.out.println("Proxy should not receive user defined headers for tunneled requests"); + failed = true; } // 6973030 String value; if ((value = mheader.findValue("Proxy-Connection")) == null || !value.equals("keep-alive")) { - System.out.println("Proxy-Connection:keep-alive not being sent"); - failed = true; + System.out.println("Proxy-Connection:keep-alive not being sent"); + failed = true; } //This will allow the main thread to terminate without trying to perform the SSL handshake. @@ -206,8 +209,8 @@ private void retrieveConnectInfo(String connectStr) throws IOException { serverPort = Integer.parseInt(connectInfo.substring(endi+1)); } catch (Exception e) { throw new IOException("Proxy recieved a request: " - + connectStr); - } + + connectStr, e); + } serverInetAddr = InetAddress.getByName(serverName); } } diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java index d214bd513f7..7e4a3fe130a 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import java.io.InputStream; import java.net.Authenticator; import java.net.Proxy; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.ServerSocket; @@ -51,9 +52,11 @@ public static void main(String[] args) throws IOException { static void doClient(BadAuthProxyServer server) throws IOException { // url doesn't matter since we will never make the connection URL url = new URL("https://anythingwilldo/"); + InetAddress loopback = InetAddress.getLoopbackAddress(); + String loopbackAddress = loopback.getHostAddress(); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection( new Proxy(Proxy.Type.HTTP, - new InetSocketAddress("localhost", server.getPort()))); + InetSocketAddress.createUnresolved(loopbackAddress, server.getPort()))); try (InputStream is = conn.getInputStream()) { } catch(IOException unused) { // no real server, IOException is expected. @@ -70,8 +73,11 @@ protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("xyz", "xyz".toCharArray()); } }); - - BadAuthProxyServer server = new BadAuthProxyServer(new ServerSocket(0)); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, 0); + ServerSocket ss = new ServerSocket(); + ss.bind(address); + BadAuthProxyServer server = new BadAuthProxyServer(ss); Thread serverThread = new Thread(server); serverThread.start(); return server; @@ -113,4 +119,3 @@ void done() { } } } - diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java index a5d5441ee90..5b6deec2512 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java @@ -95,9 +95,30 @@ public TunnelProxy (int threads, int cperthread) */ public TunnelProxy (int threads, int cperthread, int port) + throws IOException { + this(threads, cperthread, null, 0); + } + + /** + * Create a TunnelProxy instance with the specified number + * of threads and maximum number of connections per thread and running on + * the specified port. The specified number of threads are created to + * handle incoming requests, and each thread is allowed + * to handle a number of simultaneous TCP connections. + * @param cb the callback object which is invoked to handle + * each incoming request + * @param threads the number of threads to create to handle + * requests in parallel + * @param cperthread the number of simultaneous TCP connections + * to handle per thread + * @param address the address to bind to. null means all addresses. + * @param port the port number to bind the server to. Zero + * means choose any free port. + */ + public TunnelProxy (int threads, int cperthread, InetAddress address, int port) throws IOException { schan = ServerSocketChannel.open (); - InetSocketAddress addr = new InetSocketAddress (port); + InetSocketAddress addr = new InetSocketAddress (address, port); schan.socket().bind (addr); this.threads = threads; this.cperthread = cperthread; From 2f3fc250505e1684c6e914ab42b51e6d0ed7ec02 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 7 Nov 2023 09:12:44 +0000 Subject: [PATCH 121/177] 8232135: Add diagnostic output to test java/util/ProcessBuilder/Basic.java Backport-of: 3af3b5de618a98580ded4401de6d891a38dde482 --- test/jdk/java/lang/ProcessBuilder/Basic.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/jdk/java/lang/ProcessBuilder/Basic.java b/test/jdk/java/lang/ProcessBuilder/Basic.java index b1f624a29e0..27397b33e8f 100644 --- a/test/jdk/java/lang/ProcessBuilder/Basic.java +++ b/test/jdk/java/lang/ProcessBuilder/Basic.java @@ -2188,6 +2188,19 @@ public void run() { case 2: r = s.read(bytes); break; default: throw new Error(); } + if (r >= 0) { + // The child sent unexpected output; print it to diagnose + System.out.println("Unexpected child output:"); + if ((action & 0x2) == 0) { + System.out.write(r); // Single character + + } else { + System.out.write(bytes, 0, r); + } + for (int c = s.read(); c >= 0; c = s.read()) + System.out.write(c); + System.out.println("\nEND Child output."); + } equal(-1, r); } catch (IOException ioe) { if (!ioe.getMessage().equals("Stream closed")) { From ff19eeb90b2de66fb769680d893122214adbab0d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 7 Nov 2023 09:20:56 +0000 Subject: [PATCH 122/177] 8285687: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PageRangesDlgTest.java Reviewed-by: lucy Backport-of: fc3edf2412461f41ac4dfd8b047257432620ba6d --- .../print/PrinterJob/PageRangesDlgTest.java | 76 +++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java b/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java index f1f1fdea93e..ce12d851565 100644 --- a/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,56 +21,72 @@ * questions. */ -/** +import java.awt.Graphics; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.PrintRequestAttributeSet; +import javax.print.attribute.standard.DialogTypeSelection; +import javax.print.attribute.standard.PageRanges; +import jtreg.SkippedException; + +/* * @test * @bug 8061267 + * @key printer + * @library /java/awt/regtesthelpers + * @library /test/lib + * @build PassFailJFrame + * @build jtreg.SkippedException * @summary The specified page range should be displayed in the dialog - * @run main/manual=yesno PageRangesDlgTest + * @run main/manual PageRangesDlgTest */ -import javax.print.*; -import javax.print.attribute.*; -import javax.print.attribute.standard.*; -import java.awt.*; -import java.awt.print.*; - public class PageRangesDlgTest implements Printable { - static String[] instr = { - "This test is to check that the print dialog displays the specified", - "page ranges. You must have a printer installed for this test.", - "It is valid only on dialogs which support page ranges", - "In each dialog, check that a page range of 2 to 3 is requested", - "Optionally press Print instead of Cancel, and verify that the", - "correct number/set of pages is printed", - }; - - public static void main(String args[]) throws Exception { - for (int i=0;i Date: Tue, 7 Nov 2023 10:23:51 +0000 Subject: [PATCH 124/177] 8290469: Add new positioning options to PassFailJFrame test framework Backport-of: 62140e249cf78d8d4acd1e5ab76bac0cc013a1a5 --- .../awt/TrayIcon/TrayIconScalingTest.java | 4 + .../ImagePrinting/ClippedImages.java | 5 +- .../PrinterJob/PrintGlyphVectorTest.java | 7 +- .../print/PrinterJob/PrintLatinCJKTest.java | 5 +- .../awt/regtesthelpers/PassFailJFrame.java | 123 +++++++++++++++--- .../javax/swing/JRadioButton/bug4380543.java | 40 +++--- .../swing/JTabbedPane/4209065/bug4209065.java | 54 ++++---- 7 files changed, 160 insertions(+), 78 deletions(-) diff --git a/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java b/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java index 962950a7b79..ed72ce115cf 100644 --- a/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java +++ b/test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java @@ -81,6 +81,10 @@ public static void main(String[] args) PassFailJFrame passFailJFrame = new PassFailJFrame("TrayIcon " + "Test Instructions", INSTRUCTIONS, 8, 18, 85); createAndShowGUI(); + // does not have a test window, + // hence only the instruction frame is positioned + PassFailJFrame.positionTestWindow(null, + PassFailJFrame.Position.HORIZONTAL); try { passFailJFrame.awaitAndCheck(); } finally { diff --git a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java index fde7f8778a0..a4f93433f9e 100644 --- a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java +++ b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java @@ -59,6 +59,7 @@ public class ClippedImages { private static ClippedImageCanvas c; + private static Frame frame; public static void main(String[] args) throws InterruptedException, InvocationTargetException { @@ -100,7 +101,7 @@ public static void main(String[] args) throws InterruptedException, } public static void createTestUI() { - Frame frame = new Frame("Clipped Src Area Image Printing Test"); + frame = new Frame("Clipped Src Area Image Printing Test"); c = new ClippedImageCanvas(); frame.add(c, BorderLayout.CENTER); @@ -123,10 +124,10 @@ public static void createTestUI() { frame.add(p, BorderLayout.SOUTH); frame.setLocationRelativeTo(null); frame.pack(); - frame.setVisible(true); PassFailJFrame.addTestWindow(frame); PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); } private static void printOne() { diff --git a/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java b/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java index 82e6d0aaf15..06248dc741d 100644 --- a/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java @@ -34,13 +34,11 @@ import java.awt.Button; import java.awt.Color; import java.awt.Component; -import java.awt.Dialog; import java.awt.Dimension; import java.awt.Font; import java.awt.Frame; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Label; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.Point2D; @@ -51,6 +49,7 @@ import java.awt.print.PrinterJob; public class PrintGlyphVectorTest extends Component implements Printable { + private static Frame f; private static final String INSTRUCTIONS = "Note: You must have a printer installed for this test.\n" + @@ -127,7 +126,7 @@ private static void createTestUI() { PassFailJFrame.forcePass(); } - Frame f = new Frame("Test PrintGlyphVector"); + f = new Frame("Test PrintGlyphVector"); PrintGlyphVectorTest pvt = new PrintGlyphVectorTest(); f.add(pvt, BorderLayout.CENTER); @@ -148,13 +147,13 @@ private static void createTestUI() { f.add(printButton, BorderLayout.SOUTH); f.pack(); - f.setVisible(true); // add the test frame to dispose PassFailJFrame.addTestWindow(f); // Arrange the test instruction frame and test frame side by side PassFailJFrame.positionTestWindow(f, PassFailJFrame.Position.HORIZONTAL); + f.setVisible(true); } public static void main(String[] arg) throws Exception { diff --git a/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java b/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java index 902d9d1bd95..4b3ef8b537d 100644 --- a/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java @@ -73,8 +73,6 @@ public static void showFrame() throws InterruptedException, InvocationTargetExce }); frame.getContentPane().add(b, BorderLayout.SOUTH); frame.pack(); - frame.setLocationRelativeTo(null); - frame.setVisible(true); // add the test frame to dispose PassFailJFrame.addTestWindow(frame); @@ -82,6 +80,7 @@ public static void showFrame() throws InterruptedException, InvocationTargetExce // Arrange the test instruction frame and test frame side by side PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); }); } @@ -99,7 +98,7 @@ public int print(Graphics g, PageFormat pf, int pageIndex) public static void main(String[] args) throws InterruptedException, InvocationTargetException { PassFailJFrame passFailJFrame = new PassFailJFrame("Test Instruction" + - "Frame", info, 10, 40, 5); + "Frame", info, 10, 10, 45); showFrame(); passFailJFrame.awaitAndCheck(); } diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 815da722919..a13d6ee2e08 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -23,6 +23,10 @@ import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Window; import java.awt.event.WindowAdapter; @@ -41,6 +45,7 @@ import javax.swing.JTextArea; import javax.swing.Timer; + import static javax.swing.SwingUtilities.invokeAndWait; import static javax.swing.SwingUtilities.isEventDispatchThread; @@ -65,7 +70,7 @@ public class PassFailJFrame { private static volatile String testFailedReason; private static JFrame frame; - public enum Position {HORIZONTAL, VERTICAL} + public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER} public PassFailJFrame(String instructions) throws InterruptedException, InvocationTargetException { @@ -176,7 +181,6 @@ public void windowClosing(WindowEvent e) { frame.add(buttonsPanel, BorderLayout.SOUTH); frame.pack(); frame.setLocationRelativeTo(null); - frame.setVisible(true); windowList.add(frame); } @@ -262,31 +266,116 @@ private static void getFailureReason() { } /** - * Position the instruction frame with testWindow (testcase created - * window) by the specified position. - * Note: This method should be invoked from the method that creates - * testWindow. + * Approximately positions the instruction frame relative to the test + * window as specified by the {@code position} parameter. If {@code testWindow} + * is {@code null}, only the instruction frame is positioned according to + * {@code position} parameter. + *

This method should be called before making the test window visible + * to avoid flickering.

+ * + * @param testWindow test window that the test created. + * May be {@code null}. + * + * @param position position must be one of: + *
    + *
  • {@code HORIZONTAL} - the test instruction frame is positioned + * such that its right edge aligns with screen's horizontal center + * and the test window (if not {@code null}) is placed to the right + * of the instruction frame.
  • * - * @param testWindow test window that the test is created - * @param position position can be either HORIZONTAL (both test - * instruction frame and test window as arranged - * side by side) or VERTICAL (both test instruction - * frame and test window as arranged up and down) + *
  • {@code VERTICAL} - the test instruction frame is positioned + * such that its bottom edge aligns with the screen's vertical center + * and the test window (if not {@code null}) is placed below the + * instruction frame.
  • + * + *
  • {@code TOP_LEFT_CORNER} - the test instruction frame is positioned + * such that its top left corner is at the top left corner of the screen + * and the test window (if not {@code null}) is placed to the right of + * the instruction frame.
  • + *
*/ public static void positionTestWindow(Window testWindow, Position position) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + // Get the screen insets to position the frame by taking into + // account the location of taskbar/menubars on screen. + GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice().getDefaultConfiguration(); + Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc); + if (position.equals(Position.HORIZONTAL)) { int newX = ((screenSize.width / 2) - frame.getWidth()); - frame.setLocation(newX, frame.getY()); - - testWindow.setLocation((frame.getLocation().x + frame.getWidth() + 5), frame.getY()); + frame.setLocation((newX + screenInsets.left), + (frame.getY() + screenInsets.top)); + syncLocationToWindowManager(); + if (testWindow != null) { + testWindow.setLocation((frame.getX() + frame.getWidth() + 5), + frame.getY()); + } } else if (position.equals(Position.VERTICAL)) { int newY = ((screenSize.height / 2) - frame.getHeight()); - frame.setLocation(frame.getX(), newY); + frame.setLocation((frame.getX() + screenInsets.left), + (newY + screenInsets.top)); + syncLocationToWindowManager(); + if (testWindow != null) { + testWindow.setLocation(frame.getX(), + (frame.getY() + frame.getHeight() + 5)); + } + } else if (position.equals(Position.TOP_LEFT_CORNER)) { + frame.setLocation(screenInsets.left, screenInsets.top); + syncLocationToWindowManager(); + if (testWindow != null) { + testWindow.setLocation((frame.getX() + frame.getWidth() + 5), + frame.getY()); + } + } + // make instruction frame visible after updating + // frame & window positions + frame.setVisible(true); + } + + /** + * Ensures the frame location is updated by the window manager + * if it adjusts the frame location after {@code setLocation}. + * + * @see #positionTestWindow + */ + private static void syncLocationToWindowManager() { + Toolkit.getDefaultToolkit().sync(); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } - testWindow.setLocation(frame.getX(), - (frame.getLocation().y + frame.getHeight() + 5)); + /** + * Returns the current position and size of the test instruction frame. + * This method can be used in scenarios when custom positioning of + * multiple test windows w.r.t test instruction frame is necessary, + * at test-case level and the desired configuration is not available + * as a {@code Position} option. + * + * @return Rectangle bounds of test instruction frame + * @see #positionTestWindow + * + * @throws InterruptedException exception thrown when thread is + * interrupted + * @throws InvocationTargetException if an exception is thrown while + * obtaining frame bounds on EDT + */ + public static Rectangle getInstructionFrameBounds() + throws InterruptedException, InvocationTargetException { + final Rectangle[] bounds = {null}; + + if (isEventDispatchThread()) { + bounds[0] = frame != null ? frame.getBounds() : null; + } else { + invokeAndWait(() -> { + bounds[0] = frame != null ? frame.getBounds() : null; + }); } + return bounds[0]; } /** diff --git a/test/jdk/javax/swing/JRadioButton/bug4380543.java b/test/jdk/javax/swing/JRadioButton/bug4380543.java index 4db6336a6a7..18cc4bb2159 100644 --- a/test/jdk/javax/swing/JRadioButton/bug4380543.java +++ b/test/jdk/javax/swing/JRadioButton/bug4380543.java @@ -20,15 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* @test - * @bug 4380543 - * @key headful - * @library /java/awt/regtesthelpers - * @build PassFailJFrame - * @summary setMargin() does not work for AbstractButton - * @run main/manual bug4380543 -*/ - import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; @@ -45,6 +36,14 @@ import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; +/* @test + * @bug 4380543 + * @key headful + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary setMargin() does not work for AbstractButton + * @run main/manual bug4380543 + */ public class bug4380543 { static TestFrame testObj; static String instructions @@ -62,17 +61,16 @@ public class bug4380543 { public static void main(String[] args) throws Exception { - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - try { - passFailJFrame = new PassFailJFrame(instructions); - testObj = new TestFrame(); - //Adding the Test Frame to handle dispose - PassFailJFrame.addTestWindow(testObj); - PassFailJFrame.positionTestWindow(testObj, PassFailJFrame.Position.HORIZONTAL); - } catch (Exception e) { - e.printStackTrace(); - } + SwingUtilities.invokeAndWait(() -> { + try { + passFailJFrame = new PassFailJFrame(instructions); + testObj = new TestFrame(); + //Adding the Test Frame to handle dispose + PassFailJFrame.addTestWindow(testObj); + PassFailJFrame.positionTestWindow(testObj, PassFailJFrame.Position.HORIZONTAL); + testObj.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); } }); passFailJFrame.awaitAndCheck(); @@ -111,9 +109,7 @@ public void initComponents() { } getContentPane().add(p,BorderLayout.SOUTH); - setSize(500, 300); - setVisible(true); } private static void setLookAndFeel(String laf) { diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java index ee01216b643..3ece69b2f00 100644 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java +++ b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java @@ -21,6 +21,13 @@ * questions. */ +import java.lang.reflect.InvocationTargetException; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; + /* * @test * @bug 4209065 @@ -30,14 +37,6 @@ * @run main/manual bug4209065 */ -import java.lang.reflect.InvocationTargetException; - -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JTabbedPane; -import javax.swing.SwingUtilities; - - public final class bug4209065 { private static JFrame frame; @@ -47,37 +46,32 @@ public final class bug4209065 { " text may be larger\nthan the tab height but this is OK" + " and NOT a failure."; - public static void createAndShowGUI() throws InterruptedException, - InvocationTargetException { - SwingUtilities.invokeAndWait(() -> { - frame = new JFrame("JTabbedPane"); - - JTabbedPane tp = new JTabbedPane(); + public static void createAndShowGUI() { - tp.addTab("
big
", - new JLabel()); - tp.addTab("
red
", - new JLabel()); - tp.addTab("
Bold Italic!
", - new JLabel()); + frame = new JFrame("JTabbedPane"); + JTabbedPane tp = new JTabbedPane(); - frame.getContentPane().add(tp); - frame.setSize(400, 400); - frame.setLocationRelativeTo(null); - frame.setVisible(true); + tp.addTab("
big
", + new JLabel()); + tp.addTab("
red
", + new JLabel()); + tp.addTab("
Bold Italic!
", + new JLabel()); + frame.getContentPane().add(tp); + frame.setSize(400, 400); - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - }); + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, + PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); } public static void main(String[] args) throws InterruptedException, InvocationTargetException { PassFailJFrame passFailJFrame = new PassFailJFrame("JTabbedPane " + "Test Instructions", text, 5, 19, 35); - createAndShowGUI(); + SwingUtilities.invokeAndWait(bug4209065::createAndShowGUI); passFailJFrame.awaitAndCheck(); } -} \ No newline at end of file +} From 68807aa7c7d10938463a9b3a39758deedcd06d58 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 7 Nov 2023 10:26:06 +0000 Subject: [PATCH 125/177] 8314242: Update applications/scimark/Scimark.java to accept VM flags Backport-of: 6bf4a33593bfe0df9b5ba81de5321a04f4dbe0ea --- test/hotspot/jtreg/applications/scimark/Scimark.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/applications/scimark/Scimark.java b/test/hotspot/jtreg/applications/scimark/Scimark.java index 96c5dccabef..8aab97aa2bc 100644 --- a/test/hotspot/jtreg/applications/scimark/Scimark.java +++ b/test/hotspot/jtreg/applications/scimark/Scimark.java @@ -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 @@ -24,7 +24,6 @@ /* * @test * @library /test/lib - * @requires vm.flagless * @run driver Scimark */ @@ -47,7 +46,9 @@ public static void main(String... args) throws Exception { + Scimark.class.getName(), e); } - OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + System.setProperty("test.noclasspath", "true"); + + OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm( "-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(), "jnt.scimark2.commandline", "-large") .start()); From 662f3bde535e60127196b0a560f66203837d07d0 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 7 Nov 2023 10:30:06 +0000 Subject: [PATCH 126/177] 8317920: JDWP-agent sends broken exception event with onthrow option Reviewed-by: phh --- .../share/native/libjdwp/debugInit.c | 44 +++-- test/jdk/com/sun/jdi/JdwpOnThrowTest.java | 158 ++++++++++++++++++ .../jdk/com/sun/jdi/ThrowCaughtException.java | 36 ++++ test/jdk/com/sun/jdi/lib/jdb/Debuggee.java | 37 +++- 4 files changed, 255 insertions(+), 20 deletions(-) create mode 100644 test/jdk/com/sun/jdi/JdwpOnThrowTest.java create mode 100644 test/jdk/com/sun/jdi/ThrowCaughtException.java diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c b/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c index da699715d45..7cef49ea4d2 100644 --- a/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c +++ b/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c @@ -103,7 +103,7 @@ static void JNICALL cbEarlyVMDeath(jvmtiEnv*, JNIEnv *); static void JNICALL cbEarlyException(jvmtiEnv*, JNIEnv *, jthread, jmethodID, jlocation, jobject, jmethodID, jlocation); -static void initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei); +static void initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei, EventInfo *opt_info); static jboolean parseOptions(char *str); /* @@ -439,7 +439,7 @@ cbEarlyVMInit(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread) EXIT_ERROR(AGENT_ERROR_INTERNAL,"VM dead at VM_INIT time"); } if (initOnStartup) - initialize(env, thread, EI_VM_INIT); + initialize(env, thread, EI_VM_INIT, NULL); vmInitialized = JNI_TRUE; LOG_MISC(("END cbEarlyVMInit")); } @@ -492,6 +492,16 @@ cbEarlyException(jvmtiEnv *jvmti_env, JNIEnv *env, LOG_MISC(("VM is not initialized yet")); return; } + EventInfo info; + info.ei = EI_EXCEPTION; + info.thread = thread; + info.clazz = getMethodClass(jvmti_env, method); + info.method = method; + info.location = location; + info.object = exception; + info.u.exception.catch_clazz = getMethodClass(jvmti_env, catch_method); + info.u.exception.catch_method = catch_method; + info.u.exception.catch_location = catch_location; /* * We want to preserve any current exception that might get wiped @@ -506,24 +516,22 @@ cbEarlyException(jvmtiEnv *jvmti_env, JNIEnv *env, if (initOnUncaught && catch_method == NULL) { LOG_MISC(("Initializing on uncaught exception")); - initialize(env, thread, EI_EXCEPTION); + initialize(env, thread, EI_EXCEPTION, &info); } else if (initOnException != NULL) { - jclass clazz; - - /* Get class of exception thrown */ - clazz = JNI_FUNC_PTR(env,GetObjectClass)(env, exception); - if ( clazz != NULL ) { + jclass exception_clazz = JNI_FUNC_PTR(env, GetObjectClass)(env, exception); + /* check class of exception thrown */ + if ( exception_clazz != NULL ) { char *signature = NULL; /* initing on throw, check */ - error = classSignature(clazz, &signature, NULL); + error = classSignature(exception_clazz, &signature, NULL); LOG_MISC(("Checking specific exception: looking for %s, got %s", initOnException, signature)); if ( (error==JVMTI_ERROR_NONE) && (strcmp(signature, initOnException) == 0)) { LOG_MISC(("Initializing on specific exception")); - initialize(env, thread, EI_EXCEPTION); + initialize(env, thread, EI_EXCEPTION, &info); } else { error = AGENT_ERROR_INTERNAL; /* Just to cause restore */ } @@ -664,9 +672,11 @@ jniFatalError(JNIEnv *env, const char *msg, jvmtiError error, int exit_code) /* * Initialize debugger back end modules + * + * @param opt_info optional event info to use, might be null */ static void -initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei) +initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei, EventInfo *opt_info) { jvmtiError error; EnumerateArg arg; @@ -754,13 +764,13 @@ initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei) * can get in the queue (from other not-yet-suspended threads) * before this one does. (Also need to handle allocation error below?) */ - EventInfo info; struct bag *initEventBag; - LOG_MISC(("triggering_ei != EI_VM_INIT")); + LOG_MISC(("triggering_ei == EI_EXCEPTION")); + JDI_ASSERT(triggering_ei == EI_EXCEPTION); + JDI_ASSERT(opt_info != NULL); initEventBag = eventHelper_createEventBag(); - (void)memset(&info,0,sizeof(info)); - info.ei = triggering_ei; - eventHelper_recordEvent(&info, 0, suspendPolicy, initEventBag); + threadControl_onEventHandlerEntry(currentSessionID, opt_info->ei, thread, NULL); + eventHelper_recordEvent(opt_info, 0, suspendPolicy, initEventBag); (void)eventHelper_reportEvents(currentSessionID, initEventBag); bagDestroyBag(initEventBag); } @@ -1395,7 +1405,7 @@ JNIEXPORT char const* JNICALL debugInit_startDebuggingViaCommand(JNIEnv* env, jt if (!startedViaJcmd) { startedViaJcmd = JNI_TRUE; is_first_start = JNI_TRUE; - initialize(env, thread, EI_VM_INIT); + initialize(env, thread, EI_VM_INIT, NULL); } bagEnumerateOver(transports, getFirstTransport, &spec); diff --git a/test/jdk/com/sun/jdi/JdwpOnThrowTest.java b/test/jdk/com/sun/jdi/JdwpOnThrowTest.java new file mode 100644 index 00000000000..27884dd7ff2 --- /dev/null +++ b/test/jdk/com/sun/jdi/JdwpOnThrowTest.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2023 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.jdi.Bootstrap; +import com.sun.jdi.VirtualMachine; +import com.sun.jdi.connect.AttachingConnector; +import com.sun.jdi.connect.Connector; +import com.sun.jdi.connect.IllegalConnectorArgumentsException; +import com.sun.jdi.event.EventIterator; +import com.sun.jdi.event.EventQueue; +import com.sun.jdi.event.EventSet; +import com.sun.jdi.event.Event; +import com.sun.jdi.event.ExceptionEvent; +import lib.jdb.Debuggee; + +import java.io.IOException; +import java.net.ServerSocket; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/* + * @test + * @bug 8317920 + * @summary Tests for JDWP agent to send valid exception event with onthrow option + * @library /test/lib + * + * @build ThrowCaughtException JdwpOnThrowTest + * @run main/othervm JdwpOnThrowTest + */ +public class JdwpOnThrowTest { + + private static long TIMEOUT = 10000; + + private static String ATTACH_CONNECTOR = "com.sun.jdi.SocketAttach"; + // cache socket attaching connector + private static AttachingConnector attachingConnector; + + public static void main(String[] args) throws Exception { + int port = findFreePort(); + try (Debuggee debuggee = Debuggee.launcher("ThrowCaughtException").setAddress("localhost:" + port) + .enableOnThrow("Ex", "Start").setSuspended(true).launch()) { + VirtualMachine vm = null; + try { + vm = attach("localhost", "" + port); + EventQueue queue = vm.eventQueue(); + log("Waiting for exception event"); + long start = System.currentTimeMillis(); + while (start + TIMEOUT > System.currentTimeMillis()) { + EventSet eventSet = queue.remove(TIMEOUT); + EventIterator eventIterator = eventSet.eventIterator(); + while(eventIterator.hasNext() && start + TIMEOUT > System.currentTimeMillis()) { + Event event = eventIterator.next(); + if (event instanceof ExceptionEvent) { + ExceptionEvent ex = (ExceptionEvent)event; + verifyExceptionEvent(ex); + log("Received exception event: " + event); + vm.dispose(); + return; + } + log("Received event: " + event); + } + } + throw new RuntimeException("ERROR: failed to receive exception event"); + } catch (IOException ex) { + throw new RuntimeException("ERROR: failed to attach", ex); + } + } + } + + private static void verifyExceptionEvent(ExceptionEvent ex) throws Exception { + if (ex.exception() == null) { + throw new RuntimeException("Exception is null"); + } + if (ex.exception().type() == null) { + throw new RuntimeException("Exception type is null"); + } + if (ex.exception().referenceType() == null) { + throw new RuntimeException("Exception reference type is null"); + } + if (ex.catchLocation() == null) { + throw new RuntimeException("Exception catch location is null"); + } + if (!ex.location().equals(ex.thread().frame(0).location())) { + throw new RuntimeException( + String.format("Throw location %s and location of first frame %s are not equal", + ex.location(), ex.thread().frame(0).location())); + } + if (!ex.exception().type().name().equals("Ex")) { + throw new RuntimeException("Exception has wrong type: " + ex.exception().type().name()); + } + } + + private static int findFreePort() { + try (ServerSocket socket = new ServerSocket(0)) { + return socket.getLocalPort(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static VirtualMachine attach(String address, String port) throws IOException { + if (attachingConnector == null) { + attachingConnector = (AttachingConnector)getConnector(ATTACH_CONNECTOR); + } + Map args = attachingConnector.defaultArguments(); + setConnectorArg(args, "hostname", address); + setConnectorArg(args, "port", port); + try { + return attachingConnector.attach(args); + } catch (IllegalConnectorArgumentsException e) { + // unexpected.. wrap in RuntimeException + throw new RuntimeException(e); + } + } + + private static Connector getConnector(String name) { + for (Connector connector : Bootstrap.virtualMachineManager().allConnectors()) { + if (connector.name().equalsIgnoreCase(name)) { + return connector; + } + } + throw new IllegalArgumentException("Connector " + name + " not found"); + } + + private static void setConnectorArg(Map args, String name, String value) { + Connector.Argument arg = args.get(name); + if (arg == null) { + throw new IllegalArgumentException("Argument " + name + " is not defined"); + } + arg.setValue(value); + } + + private static void log(Object o) { + System.out.println(String.valueOf(o)); + } + +} diff --git a/test/jdk/com/sun/jdi/ThrowCaughtException.java b/test/jdk/com/sun/jdi/ThrowCaughtException.java new file mode 100644 index 00000000000..38253ad8875 --- /dev/null +++ b/test/jdk/com/sun/jdi/ThrowCaughtException.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 ThrowCaughtException { + public static void main(String args[]) throws Exception { + try { + System.out.println("Start"); + throw new Ex(); + } catch (Exception e) { + System.out.println(e); + } + } +} + +class Ex extends RuntimeException { +} diff --git a/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java b/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java index 76243ce5027..b45a424a68f 100644 --- a/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java +++ b/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java @@ -68,6 +68,9 @@ public static class Launcher { private String transport = "dt_socket"; private String address = null; private boolean suspended = true; + private String onthrow = ""; + private boolean waitForPortPrint = true; + private String expectedOutputBeforeThrow = ""; private Launcher(String mainClass) { this.mainClass = mainClass; @@ -96,18 +99,28 @@ public Launcher setSuspended(boolean value) { return this; } + // required to pass non null port with address and emit string before the throw + public Launcher enableOnThrow(String value, String expectedOutputBeforeThrow) { + this.onthrow = value; + this.waitForPortPrint = false; + this.expectedOutputBeforeThrow = expectedOutputBeforeThrow; + return this; + } + public ProcessBuilder prepare() { List debuggeeArgs = new LinkedList<>(); + String onthrowArgs = onthrow.isEmpty() ? "" : ",onthrow=" + onthrow + ",launch=exit"; debuggeeArgs.add("-agentlib:jdwp=transport=" + transport + (address == null ? "" : ",address=" + address) - + ",server=y,suspend=" + (suspended ? "y" : "n")); + + ",server=y,suspend=" + (suspended ? "y" : "n") + + onthrowArgs); debuggeeArgs.addAll(options); debuggeeArgs.add(mainClass); return ProcessTools.createTestJvm(debuggeeArgs); } public Debuggee launch(String name) { - return new Debuggee(prepare(), name); + return new Debuggee(prepare(), name, waitForPortPrint, expectedOutputBeforeThrow); } public Debuggee launch() { return launch("debuggee"); @@ -115,10 +128,22 @@ public Debuggee launch() { } // starts the process, waits for "Listening for transport" output and detects transport/address - private Debuggee(ProcessBuilder pb, String name) { + private Debuggee(ProcessBuilder pb, String name, boolean waitForPortPrint, String expectedOutputBeforeThrow) { // debuggeeListen[0] - transport, debuggeeListen[1] - address String[] debuggeeListen = new String[2]; Pattern listenRegexp = Pattern.compile("Listening for transport \\b(.+)\\b at address: \\b(.+)\\b"); + if (!waitForPortPrint) { + try { + p = ProcessTools.startProcess(name, pb, s -> {output.add(s);}, s -> { + return s.equals(expectedOutputBeforeThrow); + }, 30, TimeUnit.SECONDS); + } catch (IOException | InterruptedException | TimeoutException ex) { + throw new RuntimeException("failed to launch debuggee", ex); + } + transport = null; + address = null; + return; + } try { p = ProcessTools.startProcess(name, pb, s -> output.add(s), // output consumer @@ -167,10 +192,16 @@ public String getOutput() { } String getTransport() { + if (transport == null) { + throw new IllegalStateException("transport is not available"); + } return transport; } public String getAddress() { + if (address == null) { + throw new IllegalStateException("address is not available"); + } return address; } From 75daf18555e213b4f72e7ce98fea686a08ae1940 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 7 Nov 2023 12:48:01 +0000 Subject: [PATCH 127/177] 8315214: Do not run sun/tools/jhsdb tests concurrently Reviewed-by: clanger Backport-of: 1e7e2bcf3560e1ad39516fb604e4d8bf85bb54e0 --- test/jdk/TEST.ROOT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 76202cd9531..97d8729c532 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -30,7 +30,7 @@ javax/management com/sun/awt sun/awt sun/java2d javax/xml/jaxp/testng/validation exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd \ sun/security/mscapi java/util/stream java/util/Arrays/largeMemory \ java/util/BitSet/stream javax/rmi java/net/httpclient/websocket \ -sanity/client +sanity/client sun/tools/jhsdb # Group definitions groups=TEST.groups From 3592b70aeae3cefdb3d7afcd3216c5bdfc3bc9af Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 7 Nov 2023 17:08:38 +0000 Subject: [PATCH 128/177] 8317373: Add Telia Root CA v2 Reviewed-by: phh Backport-of: d3ebb4a155be8ed93e79b6b58c645e861ec30267 --- make/data/cacerts/teliarootcav2 | 39 +++++++++++++++++++ .../certification/CAInterop.java | 14 +++++++ .../security/lib/cacerts/VerifyCACerts.java | 8 ++-- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 make/data/cacerts/teliarootcav2 diff --git a/make/data/cacerts/teliarootcav2 b/make/data/cacerts/teliarootcav2 new file mode 100644 index 00000000000..24ed624291f --- /dev/null +++ b/make/data/cacerts/teliarootcav2 @@ -0,0 +1,39 @@ +Owner: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Issuer: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Serial number: 1675f27d6fe7ae3e4acbe095b059e +Valid from: Thu Nov 29 11:55:54 GMT 2018 until: Sun Nov 29 11:55:54 GMT 2043 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIPAWdfJ9b+euPkrL4JWwWeMA0GCSqGSIb3DQEBCwUAMEQx +CzAJBgNVBAYTAkZJMRowGAYDVQQKDBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UE +AwwQVGVsaWEgUm9vdCBDQSB2MjAeFw0xODExMjkxMTU1NTRaFw00MzExMjkxMTU1 +NTRaMEQxCzAJBgNVBAYTAkZJMRowGAYDVQQKDBFUZWxpYSBGaW5sYW5kIE95ajEZ +MBcGA1UEAwwQVGVsaWEgUm9vdCBDQSB2MjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALLQPwe84nvQa5n44ndp586dpAO8gm2h/oFlH0wnrI4AuhZ76zBq +AMCzdGh+sq/H1WKzej9Qyow2RCRj0jbpDIX2Q3bVTKFgcmfiKDOlyzG4OiIjNLh9 +vVYiQJ3q9HsDrWj8soFPmNB06o3lfc1jw6P23pLCWBnglrvFxKk9pXSW/q/5iaq9 +lRdU2HhE8Qx3FZLgmEKnpNaqIJLNwaCzlrI6hEKNfdWV5Nbb6WLEWLN5xYzTNTOD +n3WhUidhOPFZPY5Q4L15POdslv5e2QJltI5c0BE0312/UqeBAMN/mUWZFdUXyApT +7GPzmX3MaRKGwhfwAZ6/hLzRUssbkmbOpFPlob/E2wnW5olWK8jjfN7j/4nlNW4o +6GwLI1GpJQXrSPjdscr6bAhR77cYbETKJuFzxokGgeWKrLDiKca5JLNrRBH0pUPC +TEPlcDaMtjNXepUugqD0XBCzYYP2AgWGLnwtbNwDRm41k9V6lS/eINhbfpSQBGq6 +WT0EBXWdN6IOLj3rwaRSg/7Qa9RmjtzG6RJOHSpXqhC8fF6CfaamyfItufUXJ63R +DolUK5X6wK0dmBR4M0KGCqlztft0DbcbMBnEWg4cJ7faGND/isgFuvGqHKI3t+ZI +pEYslOqodmJHixBTB0hXbOKSTbauBcvcwUpej6w9GU7C7WB1K9vBykLVAgMBAAGj +YzBhMB8GA1UdIwQYMBaAFHKs5DN5qkWH9v2sHZ7Wxy+G2CQ5MB0GA1UdDgQWBBRy +rOQzeapFh/b9rB2e1scvhtgkOTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAoDtZpwmUPjaE0n4vOaWWl/oRrfxn83EJ +8rKJhGdEr7nv7ZbsnGTbMjBvZ5qsfl+yqwE2foH65IRe0qw24GtixX1LDoJt0nZi +0f6X+J8wfBj5tFJ3gh1229MdqfDBmgC9bXXYfef6xzijnHDoRnkDry5023X4blMM +A8iZGok1GTzTyVR8qPAs5m4HeW9q4ebqkYJpCh3DflminmtGFZhb069GHWLIzoBS +SRE/yQQSwxN8PzuKlts8oB4KtItUsiRnDe+Cy748fdHif64W1lZYudogsYMVoe+K +TTJvQS8TUoKU1xrBeKJR3Stwbbca+few4GeXVtt8YVMJAygCQMez2P2ccGrGKMOF +6eLtGpOg3kuYooQ+BXcBlj37tCAPnHICehIv1aO6UXivKitEZU61/Qrowc15h2Er +3oBXRb9n8ZuRXqWk7FlIEA04x7D6w0RtBPV4UBySllva9bguulvP5fBqnUsvWHMt +Ty3EHD70sz+rFQ47GUGKpMFXEmZxTPpT41frYpUJnlTd0cI8Vzy9OK2YZLe4A5pT +VmBds9hCG1xLEooc6+t9xnppxyd/pPiL8uSUZodL6ZQHCRJ5irLrdATczvREWeAW +ysUsWNc8e89ihmpQfTU2Zqf7N+cox9jQraVplI/owd8k+BsHMYeB2F326CjYSlKA +rBPuUBQemMc= +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index abc7bbe3272..5ff31ae922d 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -352,6 +352,16 @@ * @run main/othervm -Djava.security.debug=certpath CAInterop certignarootca CRL */ +/* + * @test id=teliarootcav2 + * @bug 8317373 + * @summary Interoperability tests with Telia Root CA V2 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliarootcav2 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop teliarootcav2 CRL + */ + /** * Collection of certificate validation tests for interoperability with external CAs */ @@ -479,6 +489,10 @@ private CATestURLs getTestURLs(String alias) { return new CATestURLs("https://valid.servicesca.dhimyotis.com", "https://revoked.servicesca.dhimyotis.com"); + case "teliarootcav2": + return new CATestURLs("https://juolukka.cover.telia.fi:10600", + "https://juolukka.cover.telia.fi:10601"); + default: throw new RuntimeException("No test setup found for: " + alias); } } diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index 8e22aab9b28..277ead3a972 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 + * 8305975 8304760 8307134 8295894 8314960 8317373 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +47,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 97; + private static final int COUNT = 98; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "88:72:92:56:FF:E5:A3:E4:39:98:6D:18:0B:BA:CC:0B:66:CB:1D:6D:52:CE:D7:C8:AD:63:B7:F1:5F:02:24:52"; + = "63:A7:1F:4F:8E:4B:A1:04:DE:BB:EC:2E:31:35:5B:5A:19:D4:B1:C0:59:62:B1:13:65:C3:AE:C7:DB:78:9A:1E"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") private static final Map FINGERPRINT_MAP = new HashMap<>() { @@ -251,6 +251,8 @@ public class VerifyCACerts { "34:9D:FA:40:58:C5:E2:63:12:3B:39:8A:E7:95:57:3C:4E:13:13:C8:3F:E6:8F:93:55:6C:D5:E8:03:1B:3C:7D"); put("certignarootca [jdk]", "D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68"); + put("teliarootcav2 [jdk]", + "24:2B:69:74:2F:CB:1E:5B:2A:BF:98:89:8B:94:57:21:87:54:4E:5B:4D:99:11:78:65:73:62:1F:6A:74:B8:2C"); } }; From 0bc8b222184df2e72fe5eedc6276d64fd47babf6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 8 Nov 2023 08:10:35 +0000 Subject: [PATCH 129/177] 8230858: Replace wildcard address with loopback or local host in tests - part 23 Add new traces for better diagnosis, refrain binding to the wildcard address when possible. Backport-of: e9eaba3d538fcd2d8b5642f227433d69faef2552 --- .../net/CookieHandler/CookieManagerTest.java | 10 +++++++++- test/jdk/java/net/Socket/HttpProxy.java | 4 ++++ test/jdk/java/net/Socket/NullHost.java | 15 +++++++-------- .../net/www/http/KeepAliveCache/B5045306.java | 15 ++++++++------- .../https/HttpsClient/ServerIdentityTest.java | 11 +++++++++-- .../HttpsURLConnection/DNSIdentities.java | 11 ++++++++--- .../IPAddressDNSIdentities.java | 11 ++++++++--- .../IPAddressIPIdentities.java | 11 ++++++++--- .../https/HttpsURLConnection/IPIdentities.java | 18 +++++++++++++++--- .../https/HttpsURLConnection/Identities.java | 11 ++++++++--- .../https/HttpsURLConnection/ImpactOnSNI.java | 15 ++++++++++++--- .../https/NewImpl/JavaxHostnameVerifier.java | 12 +++++++++--- .../jdk/sun/net/www/protocol/jar/B4957695.java | 11 ++++++++--- 13 files changed, 113 insertions(+), 42 deletions(-) diff --git a/test/jdk/java/net/CookieHandler/CookieManagerTest.java b/test/jdk/java/net/CookieHandler/CookieManagerTest.java index 077a087c123..6affcb98846 100644 --- a/test/jdk/java/net/CookieHandler/CookieManagerTest.java +++ b/test/jdk/java/net/CookieHandler/CookieManagerTest.java @@ -26,13 +26,16 @@ * @summary Unit test for java.net.CookieManager * @bug 6244040 7150552 7051862 * @modules jdk.httpserver - * @run main/othervm -ea CookieManagerTest + * java.logging + * @run main/othervm -ea -esa CookieManagerTest * @author Edward Wang */ import com.sun.net.httpserver.*; import java.io.IOException; import java.net.*; +import java.util.logging.Level; +import java.util.logging.Logger; import static java.net.Proxy.NO_PROXY; public class CookieManagerTest { @@ -59,6 +62,11 @@ static String getAddr() { } public static void main(String[] args) throws Exception { + // logs everything... + Logger root = Logger.getLogger(""); + root.setLevel(Level.ALL); + root.getHandlers()[0].setLevel(Level.ALL); + startHttpServer(); makeHttpCall(); diff --git a/test/jdk/java/net/Socket/HttpProxy.java b/test/jdk/java/net/Socket/HttpProxy.java index 00a2cc2edb4..68c33acd93c 100644 --- a/test/jdk/java/net/Socket/HttpProxy.java +++ b/test/jdk/java/net/Socket/HttpProxy.java @@ -132,6 +132,7 @@ void startSimpleWriter(String threadName, final OutputStream os, final int start public void run() { try { simpleWrite(os, start); } catch (Exception e) {unexpected(e); } + finally { out.println(threadName + ": done"); } }}, threadName)).start(); } @@ -142,6 +143,7 @@ void simpleWrite(OutputStream os, int start) throws Exception { b[1] = (byte) (i % 256); os.write(b); } + out.println("Wrote " + start + " -> " + (start + 100)); } void simpleRead(InputStream is, int start) throws Exception { @@ -156,6 +158,7 @@ void simpleRead(InputStream is, int start) throws Exception { if (r != i) throw new Exception("read " + r + " expected " +i); } + out.println("Read " + start + " -> " + (start + 100)); } int bytes(byte b1, byte b2) { @@ -207,6 +210,7 @@ private void processRequest(Socket clientSocket) throws Exception { // retrieve the host and port info from the status-line InetSocketAddress serverAddr = getConnectInfo(statusLine); + out.println("Proxy serving CONNECT request to " + serverAddr); //open socket to the server try (Socket serverSocket = new Socket(serverAddr.getAddress(), diff --git a/test/jdk/java/net/Socket/NullHost.java b/test/jdk/java/net/Socket/NullHost.java index 17684856ea6..1172d531495 100644 --- a/test/jdk/java/net/Socket/NullHost.java +++ b/test/jdk/java/net/Socket/NullHost.java @@ -46,8 +46,10 @@ public int getPort() { return svr.getLocalPort(); } + volatile boolean done; public void shutdown() { try { + done = true; svr.close(); } catch (IOException e) { } @@ -56,11 +58,12 @@ public void shutdown() { public void run() { Socket s; try { - while (true) { + while (!done) { s = svr.accept(); s.close(); } } catch (IOException e) { + if (!done) e.printStackTrace(); } } } @@ -74,13 +77,9 @@ public NullHost () throws IOException { int port = s.getPort(); s.start(); try { - Socket sock = new Socket((String)null, port); - sock.close(); - sock = new Socket((String)null, port, true); - sock.close(); - sock = new Socket((String)null, port, null, 0); - sock.close(); - + try (var sock = new Socket((String)null, port)) {} + try (var sock = new Socket((String)null, port, true)) {} + try (var sock = new Socket((String)null, port, null, 0)) {} } catch (NullPointerException e) { throw new RuntimeException("Got a NPE"); } finally { diff --git a/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java b/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java index 88526fb1652..5a278202bd7 100644 --- a/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java +++ b/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception { public static void startHttpServer() { try { httpTrans = new SimpleHttpTransaction(); - server = new TestHttpServer(httpTrans, 1, 10, 0); + server = new TestHttpServer(httpTrans, 1, 10, InetAddress.getLocalHost(), 0); } catch (IOException e) { e.printStackTrace(); } @@ -71,13 +71,14 @@ public static void startHttpServer() { public static void clientHttpCalls() { try { System.out.println("http server listen on: " + server.getLocalPort()); - String baseURLStr = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + - server.getLocalPort() + "/"; + String hostAddr = InetAddress.getLocalHost().getHostAddress(); + if (hostAddr.indexOf(':') > -1) hostAddr = "[" + hostAddr + "]"; + String baseURLStr = "http://" + hostAddr + ":" + server.getLocalPort() + "/"; URL bigDataURL = new URL (baseURLStr + "firstCall"); URL smallDataURL = new URL (baseURLStr + "secondCall"); - HttpURLConnection uc = (HttpURLConnection)bigDataURL.openConnection(); + HttpURLConnection uc = (HttpURLConnection)bigDataURL.openConnection(Proxy.NO_PROXY); //Only read 1 byte of response data and close the stream InputStream is = uc.getInputStream(); @@ -88,7 +89,7 @@ public static void clientHttpCalls() { // 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(); + uc = (HttpURLConnection)smallDataURL.openConnection(Proxy.NO_PROXY); uc.getResponseCode(); if (SimpleHttpTransaction.failed) @@ -96,7 +97,7 @@ public static void clientHttpCalls() { // Part 2 URL part2Url = new URL (baseURLStr + "part2"); - uc = (HttpURLConnection)part2Url.openConnection(); + uc = (HttpURLConnection)part2Url.openConnection(Proxy.NO_PROXY); is = uc.getInputStream(); is.close(); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java b/test/jdk/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java index 4672fb6ad67..15224e22e6e 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -42,7 +42,10 @@ import java.io.BufferedWriter; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.Proxy; import java.net.URL; +import java.net.UnknownHostException; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; @@ -64,6 +67,10 @@ public static void main(String[] args) throws Exception { (new ServerIdentityTest()).run(); } + ServerIdentityTest() throws UnknownHostException { + serverAddress = InetAddress.getByName(hostname); + } + @Override protected boolean isCustomizedClientConnection() { return true; @@ -88,7 +95,7 @@ protected void runClientApplication(int serverPort) throws Exception { HttpURLConnection urlc = null; InputStream is = null; try { - urlc = (HttpURLConnection)url.openConnection(); + urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); is = urlc.getInputStream(); } finally { if (is != null) { diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java index e0c46743d4d..0d479d60fd2 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -651,8 +651,13 @@ void doServerSide() throws Exception { serverModulus, serverPrivateExponent, passphrase); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + // doClientSide() connects to "localhost" + InetAddress localHost = InetAddress.getByName("localhost"); + InetSocketAddress address = new InetSocketAddress(localHost, serverPort); + sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); /* @@ -717,7 +722,7 @@ void doClientSide() throws Exception { System.out.println("url is "+url.toString()); try { - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); System.out.println("respCode = "+respCode); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java index 30b8506d37e..dda6dc6078a 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -650,8 +650,13 @@ void doServerSide() throws Exception { serverModulus, serverPrivateExponent, passphrase); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + // doClientSide() connects to the loopback address + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, serverPort); + sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); /* @@ -721,7 +726,7 @@ void doClientSide() throws Exception { System.out.println("url is "+url.toString()); try { - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); System.out.println("respCode = " + respCode); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java index 3662d02332c..bd6c62c603c 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -654,8 +654,13 @@ void doServerSide() throws Exception { serverModulus, serverPrivateExponent, passphrase); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + // doClientSide() connects to the loopback address + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, serverPort); + sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); /* @@ -725,7 +730,7 @@ void doClientSide() throws Exception { System.out.println("url is "+url.toString()); try { - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); System.out.println("respCode = "+respCode); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java index 8cc09a76252..91f0020f7d1 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java @@ -29,6 +29,7 @@ /* @test * @summary X509 certificate hostname checking is broken in JDK1.6.0_10 * @bug 6766775 + * @library /test/lib * @run main/othervm IPIdentities * @author Xuelei Fan */ @@ -45,6 +46,7 @@ import java.security.spec.*; import java.security.interfaces.*; import java.math.BigInteger; +import jdk.test.lib.net.URIBuilder; /* * Certificates and key used in the test. @@ -652,8 +654,13 @@ void doServerSide() throws Exception { serverModulus, serverPrivateExponent, passphrase); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + // doClientSide() connects to the loopback address + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress address = new InetSocketAddress(loopback, serverPort); + sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); /* @@ -713,11 +720,16 @@ void doClientSide() throws Exception { HttpsURLConnection http = null; /* establish http connection to server */ - URL url = new URL("https://localhost:" + serverPort+"/"); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(serverPort) + .path("/") + .toURL(); System.out.println("url is "+url.toString()); try { - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); System.out.println("respCode = "+respCode); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/Identities.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/Identities.java index 28f61c79f1c..3764b3de688 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/Identities.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/Identities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -651,8 +651,13 @@ void doServerSide() throws Exception { serverModulus, serverPrivateExponent, passphrase); SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + // doClientSide() connects to "localhost" + InetAddress localHost = InetAddress.getByName("localhost"); + InetSocketAddress address = new InetSocketAddress(localHost, serverPort); + sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); /* @@ -717,7 +722,7 @@ void doClientSide() throws Exception { System.out.println("url is "+url.toString()); try { - http = (HttpsURLConnection)url.openConnection(); + http = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); int respCode = http.getResponseCode(); System.out.println("respCode = "+respCode); diff --git a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java index d90d9478e2a..16e6d09798e 100644 --- a/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java +++ b/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,6 +95,16 @@ public class ImpactOnSNI { * smart about it.... */ + private SSLServerSocket createServerSocket(SSLServerSocketFactory sslssf) + throws Exception { + SSLServerSocket sslServerSocket = + (SSLServerSocket)sslssf.createServerSocket(); + InetAddress localHost = InetAddress.getLocalHost(); + InetSocketAddress address = new InetSocketAddress(localHost, serverPort); + sslServerSocket.bind(address); + return sslServerSocket; + } + /* * Define the server side of the test. * @@ -104,8 +114,7 @@ public class ImpactOnSNI { private void doServerSide() throws Exception { SSLServerSocketFactory sslssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault(); - try (SSLServerSocket sslServerSocket = - (SSLServerSocket)sslssf.createServerSocket(serverPort)) { + try (SSLServerSocket sslServerSocket = createServerSocket(sslssf)) { serverPort = sslServerSocket.getLocalPort(); diff --git a/test/jdk/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java b/test/jdk/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java index a02d7622c8b..7bea6383787 100644 --- a/test/jdk/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java +++ b/test/jdk/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -135,8 +135,14 @@ void doServerSide() throws Exception { SSLServerSocketFactory sslssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + + // doClientSide() connects to "localhost" + InetAddress localHost = InetAddress.getByName("localhost"); + InetSocketAddress address = new InetSocketAddress(localHost, serverPort); + SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(); + sslServerSocket.bind(address); serverPort = sslServerSocket.getLocalPort(); String ciphers[]= { "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA" }; @@ -205,7 +211,7 @@ void doClientSide() throws Exception { URL url = new URL("https://" + "localhost:" + serverPort + "/etc/hosts"); - URLConnection urlc = url.openConnection(); + URLConnection urlc = url.openConnection(Proxy.NO_PROXY); if (!(urlc instanceof javax.net.ssl.HttpsURLConnection)) { throw new Exception( diff --git a/test/jdk/sun/net/www/protocol/jar/B4957695.java b/test/jdk/sun/net/www/protocol/jar/B4957695.java index 6f9089d4971..bed00811ebd 100644 --- a/test/jdk/sun/net/www/protocol/jar/B4957695.java +++ b/test/jdk/sun/net/www/protocol/jar/B4957695.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,10 @@ static void read (InputStream is) throws IOException { public static void main (String[] args) throws Exception { String tmpdir = System.getProperty("java.io.tmpdir"); String[] list1 = listTmpFiles(tmpdir); - ServerSocket serverSocket = new ServerSocket(0); + InetAddress localHost = InetAddress.getByName("localhost"); + InetSocketAddress address = new InetSocketAddress(localHost, 0); + ServerSocket serverSocket = new ServerSocket(); + serverSocket.bind(address); server = new Server(serverSocket); server.start(); int port = serverSocket.getLocalPort(); @@ -108,7 +111,9 @@ public static void main (String[] args) throws Exception { read (is); is.close(); } catch (IOException e) { - System.out.println ("Received IOException as expected"); + System.out.println ("Received IOException as expected: " + e); + } finally { + try {serverSocket.close();} catch (IOException x) {} } String[] list2 = listTmpFiles(tmpdir); if (!sameList (list1, list2)) { From 799a7c8d4c17b7957f5e6bf514fb3df251be0d7f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 8 Nov 2023 08:14:30 +0000 Subject: [PATCH 130/177] 8292683: Remove BadKeyUsageTest.java from Problem List Backport-of: df5209e70fd92ec6bda4e7356a3ad121732f6c66 --- test/jdk/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index c6c5fe24606..8c83f666a5a 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -612,8 +612,6 @@ sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8161536 generic- sun/security/tools/keytool/ListKeychainStore.sh 8156889 macosx-all -sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java 8026393 generic-all - javax/net/ssl/DTLS/PacketLossRetransmission.java 8169086 macosx-x64 javax/net/ssl/DTLS/RespondToRetransmit.java 8169086 macosx-all javax/net/ssl/DTLS/CipherSuite.java 8202059 macosx-x64 From b773f56744c7600bbe70e2bceb129a8ba08334fb Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 8 Nov 2023 08:16:33 +0000 Subject: [PATCH 131/177] 6445283: ProgressMonitorInputStream not large file aware (>2GB) Backport-of: a17fce7507c7d485d51f98fadd444235ea31058d --- .../swing/ProgressMonitorInputStream.java | 48 ++++++---- .../swing/ProgressMonitor/ProgressTest.java | 90 +++++++++++++++++++ 2 files changed, 122 insertions(+), 16 deletions(-) create mode 100644 test/jdk/javax/swing/ProgressMonitor/ProgressTest.java diff --git a/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java b/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java index 3edb0e1f35b..6fc6f56f4ea 100644 --- a/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java +++ b/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java @@ -67,7 +67,8 @@ public class ProgressMonitorInputStream extends FilterInputStream private ProgressMonitor monitor; private int nread = 0; private int size = 0; - + Component parentComponent; + Object message; /** * Constructs an object to monitor the progress of an input stream. @@ -88,6 +89,8 @@ public ProgressMonitorInputStream(Component parentComponent, catch(IOException ioe) { size = 0; } + this.parentComponent = parentComponent; + this.message = message; monitor = new ProgressMonitor(parentComponent, message, null, 0, size); } @@ -119,6 +122,25 @@ public int read() throws IOException { return c; } + private void setProgress(int nr) throws IOException { + if (nr > 0) { + if (nread + nr > nread) { + monitor.setProgress(nread += nr); + } else { + size = in.available(); + nread = 0; + monitor.close(); + monitor = new ProgressMonitor(this.parentComponent, + this.message, null, 0, size); + } + } + if (monitor.isCanceled()) { + InterruptedIOException exc = + new InterruptedIOException("progress"); + exc.bytesTransferred = nread; + throw exc; + } + } /** * Overrides FilterInputStream.read @@ -126,13 +148,7 @@ public int read() throws IOException { */ public int read(byte b[]) throws IOException { int nr = in.read(b); - if (nr > 0) monitor.setProgress(nread += nr); - if (monitor.isCanceled()) { - InterruptedIOException exc = - new InterruptedIOException("progress"); - exc.bytesTransferred = nread; - throw exc; - } + setProgress(nr); return nr; } @@ -145,13 +161,7 @@ public int read(byte b[], int off, int len) throws IOException { int nr = in.read(b, off, len); - if (nr > 0) monitor.setProgress(nread += nr); - if (monitor.isCanceled()) { - InterruptedIOException exc = - new InterruptedIOException("progress"); - exc.bytesTransferred = nread; - throw exc; - } + setProgress(nr); return nr; } @@ -162,7 +172,13 @@ public int read(byte b[], */ public long skip(long n) throws IOException { long nr = in.skip(n); - if (nr > 0) monitor.setProgress(nread += nr); + if (nr > 0) { + if ((int)(nread + nr) > nread) { + monitor.setProgress(nread += nr); + } else { + monitor.setProgress(monitor.getMaximum()); + } + } return nr; } diff --git a/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java b/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java new file mode 100644 index 00000000000..e79bf7973b1 --- /dev/null +++ b/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java @@ -0,0 +1,90 @@ +/* + * 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. + */ + +/* @test + * @bug 8054572 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests if JComboBox displays correctly when editable/non-editable + * @run main/manual ProgressTest + */ + +import java.io.InputStream; + +import javax.swing.JFrame; +import javax.swing.ProgressMonitorInputStream; +import javax.swing.SwingUtilities; + +public class ProgressTest { + + private static final String instructionsText = + "A ProgressMonitor will be shown." + + " If it shows blank progressbar after 2048MB bytes read,"+ + " press Fail else press Pass"; + + private static JFrame frame; + + public static void main(String[] args) throws Exception { + + PassFailJFrame pfjFrame = new PassFailJFrame("JScrollPane " + + "Test Instructions", instructionsText, 5); + + final long SIZE = (long) (Integer.MAX_VALUE * 1.5); + + InputStream fileIn = new InputStream() { + long read = 0; + + @Override + public int available() { + return (int) Math.min(SIZE - read, Integer.MAX_VALUE); + } + + @Override + public int read() { + return (SIZE - read++ > 0) ? 1 : -1; + } + }; + + ProgressMonitorInputStream pmis = + new ProgressMonitorInputStream(null, "Reading File", fileIn); + + Thread thread = new Thread() { + public void run() { + byte[] buffer = new byte[512]; + int nb = 0; + long total = 0; + while (true) { + try { + nb = pmis.read(buffer); + } catch (Exception e){} + if (nb == 0) break; + total += nb; + + pmis.getProgressMonitor().setNote(total/(1024*1024)+" MB Read"); + } + } + }; + thread.start(); + pfjFrame.awaitAndCheck(); + } +} From 34cc0891f2b407cbeab8bac9a37f8687a498c4d5 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 8 Nov 2023 08:40:04 +0000 Subject: [PATCH 132/177] 8298905: Test "java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java" fails because the frames of instruction does not display Backport-of: d1026720d323d0acd9bd8d85d5caba7185107863 --- .../PrinterJob/ImagePrinting/PrintARGBImage.java | 1 + .../awt/print/PrinterJob/PageRangesDlgTest.java | 1 + .../javax/swing/ProgressMonitor/ProgressTest.java | 14 ++++++-------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java index fa16e90bb24..3ec5a0d6f36 100644 --- a/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java +++ b/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java @@ -53,6 +53,7 @@ public static void main(String[] args) throws InterruptedException, "The test passes if the text shows through the rectangular image.\n"; PassFailJFrame passFailJFrame = new PassFailJFrame(instruction, 10); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL); try { PrinterJob pj = PrinterJob.getPrinterJob(); pj.setPrintable(new PrintARGBImage()); diff --git a/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java b/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java index ce12d851565..88ad153cc3a 100644 --- a/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java +++ b/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java @@ -81,6 +81,7 @@ public static void main(String[] args) throws Exception { ; PassFailJFrame passFailJFrame = new PassFailJFrame(instruction, 10); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL); showPrintDialogs(); passFailJFrame.awaitAndCheck(); } diff --git a/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java b/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java index e79bf7973b1..776cb720ae1 100644 --- a/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java +++ b/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java @@ -22,32 +22,29 @@ */ /* @test - * @bug 8054572 + * @bug 6445283 * @library /java/awt/regtesthelpers * @build PassFailJFrame - * @summary Tests if JComboBox displays correctly when editable/non-editable + * @summary Tests if ProgressMonitorInputStream reports progress accurately * @run main/manual ProgressTest */ import java.io.InputStream; -import javax.swing.JFrame; import javax.swing.ProgressMonitorInputStream; -import javax.swing.SwingUtilities; public class ProgressTest { private static final String instructionsText = - "A ProgressMonitor will be shown." + - " If it shows blank progressbar after 2048MB bytes read,"+ + "A ProgressMonitor will be shown.\n" + + " If it shows blank progressbar after 2048MB bytes read,\n"+ " press Fail else press Pass"; - private static JFrame frame; - public static void main(String[] args) throws Exception { PassFailJFrame pfjFrame = new PassFailJFrame("JScrollPane " + "Test Instructions", instructionsText, 5); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.VERTICAL); final long SIZE = (long) (Integer.MAX_VALUE * 1.5); @@ -85,6 +82,7 @@ public void run() { } }; thread.start(); + pfjFrame.awaitAndCheck(); } } From 416c48e9d30ba4232bc9d592693992eea6819211 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 8 Nov 2023 17:10:12 +0000 Subject: [PATCH 133/177] 8310265: (process) jspawnhelper should not use argv[0] Backport-of: cd6cb730c934d8e16d4bd8e3342e59e806f158f9 --- .../unix/native/jspawnhelper/jspawnhelper.c | 4 ++-- src/java.base/unix/native/libjava/ProcessImpl_md.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/java.base/unix/native/jspawnhelper/jspawnhelper.c b/src/java.base/unix/native/jspawnhelper/jspawnhelper.c index 13882017163..dec17f01598 100644 --- a/src/java.base/unix/native/jspawnhelper/jspawnhelper.c +++ b/src/java.base/unix/native/jspawnhelper/jspawnhelper.c @@ -134,10 +134,10 @@ int main(int argc, char *argv[]) { ChildStuff c; int t; struct stat buf; - /* argv[0] contains the fd number to read all the child info */ + /* argv[1] contains the fd number to read all the child info */ int r, fdin, fdout; - r = sscanf (argv[argc-1], "%d:%d", &fdin, &fdout); + r = sscanf (argv[1], "%d:%d", &fdin, &fdout); if (r == 2 && fcntl(fdin, F_GETFD) != -1) { fstat(fdin, &buf); if (!S_ISFIFO(buf.st_mode)) diff --git a/src/java.base/unix/native/libjava/ProcessImpl_md.c b/src/java.base/unix/native/libjava/ProcessImpl_md.c index df8b62cf89f..1ea633c6b0b 100644 --- a/src/java.base/unix/native/libjava/ProcessImpl_md.c +++ b/src/java.base/unix/native/libjava/ProcessImpl_md.c @@ -394,16 +394,20 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) jboolean isCopy; int i, offset, rval, bufsize, magic; char *buf, buf1[16]; - char *hlpargs[2]; + char *hlpargs[3]; SpawnInfo sp; /* need to tell helper which fd is for receiving the childstuff * and which fd to send response back on */ snprintf(buf1, sizeof(buf1), "%d:%d", c->childenv[0], c->fail[1]); - /* put the fd string as argument to the helper cmd */ - hlpargs[0] = buf1; - hlpargs[1] = 0; + /* NULL-terminated argv array. + * argv[0] contains path to jspawnhelper, to follow conventions. + * argv[1] contains the fd string as argument to jspawnhelper + */ + hlpargs[0] = (char*)helperpath; + hlpargs[1] = buf1; + hlpargs[2] = NULL; /* Following items are sent down the pipe to the helper * after it is spawned. From c54521b2366c80c3afc8d2be11033e5d1ea0460c Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 9 Nov 2023 11:27:55 +0000 Subject: [PATCH 134/177] 8314263: Signed jars triggering Logger finder recursion and StackOverflowError 8315696: SignedLoggerFinderTest.java test failed 8316087: Test SignedLoggerFinderTest.java is still failing Reviewed-by: lucy Backport-of: 7daae1fb4267f92b38f0152611d69b7b89691087 --- .../share/classes/java/lang/System.java | 10 +- .../jdk/internal/logger/BootstrapLogger.java | 53 ++- .../jdk/internal/logger/LazyLoggers.java | 33 +- .../internal/logger/LoggerFinderLoader.java | 60 +++- .../services/java.lang.System$LoggerFinder | 1 + .../PlatformRecursiveLoadingTest.java | 122 +++++++ .../RecursiveLoadingTest.java | 120 +++++++ .../RecursiveLoading/SimpleLoggerFinder.java | 140 ++++++++ .../services/java.lang.System$LoggerFinder | 1 + .../SignedLoggerFinderTest.java | 307 ++++++++++++++++++ .../SimpleLoggerFinder.java | 74 +++++ .../jdk/internal/event/EventHelper.java | 155 +++++++++ .../SignedLoggerFinderTest/logging.properties | 14 + .../BootstrapLoggerAPIsTest.java | 7 +- .../BootstrapLogger/BootstrapLoggerTest.java | 5 +- .../internal/BootstrapLogger/LogStream.java | 4 +- .../BootstrapLoggerUtils.java | 8 +- 17 files changed, 1074 insertions(+), 40 deletions(-) create mode 100644 test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder create mode 100644 test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder create mode 100644 test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java create mode 100644 test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties rename test/jdk/java/lang/System/LoggerFinder/{internal/BootstrapLogger => lib}/BootstrapLoggerUtils.java (89%) diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index 80044096f9d..290f2742474 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -60,6 +60,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; +import jdk.internal.logger.LoggerFinderLoader.TemporaryLoggerFinder; import jdk.internal.util.StaticProperty; import jdk.internal.module.ModuleBootstrap; import jdk.internal.module.ServicesCatalog; @@ -1619,13 +1620,16 @@ static LoggerFinder accessProvider() { // We do not need to synchronize: LoggerFinderLoader will // always return the same instance, so if we don't have it, // just fetch it again. - if (service == null) { + LoggerFinder finder = service; + if (finder == null) { PrivilegedAction pa = () -> LoggerFinderLoader.getLoggerFinder(); - service = AccessController.doPrivileged(pa, null, + finder = AccessController.doPrivileged(pa, null, LOGGERFINDER_PERMISSION); + if (finder instanceof TemporaryLoggerFinder) return finder; + service = finder; } - return service; + return finder; } } diff --git a/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java b/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java index f5702f23572..ad83ea13d86 100644 --- a/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java +++ b/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java @@ -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 @@ -38,7 +38,6 @@ import java.util.function.Supplier; import java.lang.System.LoggerFinder; import java.lang.System.Logger; -import java.lang.System.Logger.Level; import java.lang.ref.WeakReference; import java.util.Objects; import java.util.concurrent.ExecutionException; @@ -228,9 +227,19 @@ static void flush() { // The accessor in which this logger is temporarily set. final LazyLoggerAccessor holder; + // tests whether the logger is invoked by the loading thread before + // the LoggerFinder is loaded; can be null; + final BooleanSupplier isLoadingThread; + + // returns true if the logger is invoked by the loading thread before the + // LoggerFinder service is loaded + boolean isLoadingThread() { + return isLoadingThread != null && isLoadingThread.getAsBoolean(); + } - BootstrapLogger(LazyLoggerAccessor holder) { + BootstrapLogger(LazyLoggerAccessor holder, BooleanSupplier isLoadingThread) { this.holder = holder; + this.isLoadingThread = isLoadingThread; } // Temporary data object storing log events @@ -499,14 +508,15 @@ static LogEvent valueOf(BootstrapLogger bootstrap, PlatformLogger.Level level, static void log(LogEvent log, PlatformLogger.Bridge logger) { final SecurityManager sm = System.getSecurityManager(); if (sm == null || log.acc == null) { - log.log(logger); + BootstrapExecutors.submit(() -> log.log(logger)); } else { // not sure we can actually use lambda here. We may need to create // an anonymous class. Although if we reach here, then it means // the VM is booted. - AccessController.doPrivileged((PrivilegedAction) () -> { - log.log(logger); return null; - }, log.acc); + BootstrapExecutors.submit(() -> + AccessController.doPrivileged((PrivilegedAction) () -> { + log.log(logger); return null; + }, log.acc)); } } @@ -553,8 +563,9 @@ public String getName() { * @return true if the VM is still bootstrapping. */ boolean checkBootstrapping() { - if (isBooted()) { + if (isBooted() && !isLoadingThread()) { BootstrapExecutors.flush(); + holder.getConcreteLogger(this); return false; } return true; @@ -928,10 +939,16 @@ private static boolean useSurrogateLoggers() { // - the logging backend is a custom backend // - the logging backend is JUL, there is no custom config, // and the LogManager has not been initialized yet. - public static synchronized boolean useLazyLoggers() { - return !BootstrapLogger.isBooted() - || DetectBackend.detectedBackend == LoggingBackend.CUSTOM - || useSurrogateLoggers(); + public static boolean useLazyLoggers() { + // Note: avoid triggering the initialization of the DetectBackend class + // while holding the BootstrapLogger class monitor + if (!BootstrapLogger.isBooted() || + DetectBackend.detectedBackend == LoggingBackend.CUSTOM) { + return true; + } + synchronized (BootstrapLogger.class) { + return useSurrogateLoggers(); + } } // Called by LazyLoggerAccessor. This method will determine whether @@ -939,9 +956,9 @@ public static synchronized boolean useLazyLoggers() { // a SurrogateLogger (if JUL is the default backend and there // is no custom JUL configuration and LogManager is not yet initialized), // or a logger returned by the loaded LoggerFinder (all other cases). - static Logger getLogger(LazyLoggerAccessor accessor) { - if (!BootstrapLogger.isBooted()) { - return new BootstrapLogger(accessor); + static Logger getLogger(LazyLoggerAccessor accessor, BooleanSupplier isLoading) { + if (!BootstrapLogger.isBooted() || isLoading != null && isLoading.getAsBoolean()) { + return new BootstrapLogger(accessor, isLoading); } else { if (useSurrogateLoggers()) { // JUL is the default backend, there is no custom configuration, @@ -957,6 +974,12 @@ static Logger getLogger(LazyLoggerAccessor accessor) { } } + // trigger class initialization outside of holding lock + static void ensureBackendDetected() { + assert VM.isBooted() : "VM is not booted"; + // triggers detection of the backend + var backend = DetectBackend.detectedBackend; + } // If the backend is JUL, and there is no custom configuration, and // nobody has attempted to call LogManager.getLogManager() yet, then diff --git a/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java b/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java index c266caac684..8e1bcce0793 100644 --- a/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java +++ b/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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 @@ -32,6 +32,9 @@ import java.lang.System.Logger; import java.lang.ref.WeakReference; import java.util.Objects; +import java.util.function.BooleanSupplier; + +import jdk.internal.logger.LoggerFinderLoader.TemporaryLoggerFinder; import jdk.internal.misc.VM; import sun.util.logging.PlatformLogger; @@ -110,6 +113,9 @@ static final class LazyLoggerAccessor implements LoggerAccessor { // We need to pass the actual caller module when creating the logger. private final WeakReference moduleRef; + // whether this is the loading thread, can be null + private final BooleanSupplier isLoadingThread; + // The name of the logger that will be created lazyly final String name; // The plain logger SPI object - null until it is accessed for the @@ -122,16 +128,24 @@ static final class LazyLoggerAccessor implements LoggerAccessor { private LazyLoggerAccessor(String name, LazyLoggerFactories factories, Module module) { + this(name, factories, module, null); + } + + private LazyLoggerAccessor(String name, + LazyLoggerFactories factories, + Module module, BooleanSupplier isLoading) { + this(Objects.requireNonNull(name), Objects.requireNonNull(factories), - Objects.requireNonNull(module), null); + Objects.requireNonNull(module), isLoading, null); } private LazyLoggerAccessor(String name, LazyLoggerFactories factories, - Module module, Void unused) { + Module module, BooleanSupplier isLoading, Void unused) { this.name = name; this.factories = factories; this.moduleRef = new WeakReference<>(module); + this.isLoadingThread = isLoading; } /** @@ -162,7 +176,7 @@ public Logger wrapped() { // BootstrapLogger has the logic to decide whether to invoke the // SPI or use a temporary (BootstrapLogger or SimpleConsoleLogger) // logger. - wrapped = BootstrapLogger.getLogger(this); + wrapped = BootstrapLogger.getLogger(this, isLoadingThread); synchronized(this) { // if w has already been in between, simply drop 'wrapped'. setWrappedIfNotSet(wrapped); @@ -194,7 +208,7 @@ public PlatformLogger.Bridge platform() { // BootstrapLogger has the logic to decide whether to invoke the // SPI or use a temporary (BootstrapLogger or SimpleConsoleLogger) // logger. - final Logger wrapped = BootstrapLogger.getLogger(this); + final Logger wrapped = BootstrapLogger.getLogger(this, isLoadingThread); synchronized(this) { // if w has already been set, simply drop 'wrapped'. setWrappedIfNotSet(wrapped); @@ -282,10 +296,10 @@ Logger createLogger() { * Creates a new lazy logger accessor for the named logger. The given * factories will be use when it becomes necessary to actually create * the logger. - * @param An interface that extends {@link Logger}. * @param name The logger name. * @param factories The factories that should be used to create the * wrapped logger. + * @param module The module for which the logger is being created * @return A new LazyLoggerAccessor. */ public static LazyLoggerAccessor makeAccessor(String name, @@ -339,6 +353,7 @@ private static LoggerFinder accessLoggerFinder() { prov = sm == null ? LoggerFinder.getLoggerFinder() : AccessController.doPrivileged( (PrivilegedAction)LoggerFinder::getLoggerFinder); + if (prov instanceof TemporaryLoggerFinder) return prov; provider = prov; } return prov; @@ -358,7 +373,6 @@ public Logger apply(String name, Module module) { new LazyLoggerFactories<>(loggerSupplier); - // A concrete implementation of Logger that delegates to a System.Logger, // but only creates the System.Logger instance lazily when it's used for // the first time. @@ -376,6 +390,11 @@ private JdkLazyLogger(LazyLoggerAccessor holder, Void unused) { } } + static Logger makeLazyLogger(String name, Module module, BooleanSupplier isLoading) { + final LazyLoggerAccessor holder = new LazyLoggerAccessor(name, factories, module, isLoading); + return new JdkLazyLogger(holder, null); + } + /** * Gets a logger from the LoggerFinder. Creates the actual concrete * logger. diff --git a/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java b/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java index 1009968046a..ba25e524af2 100644 --- a/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java +++ b/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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,8 @@ package jdk.internal.logger; import java.io.FilePermission; +import java.lang.System.Logger; +import java.lang.System.LoggerFinder; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedAction; @@ -32,6 +34,9 @@ import java.util.Locale; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; +import java.util.function.BooleanSupplier; + +import jdk.internal.vm.annotation.Stable; import sun.security.util.SecurityConstants; import sun.security.action.GetPropertyAction; @@ -64,13 +69,28 @@ private LoggerFinderLoader() { throw new InternalError("LoggerFinderLoader cannot be instantiated"); } - + // record the loadingThread while loading the backend + static volatile Thread loadingThread; // Return the loaded LoggerFinder, or load it if not already loaded. private static System.LoggerFinder service() { if (service != null) return service; + // ensure backend is detected before attempting to load the finder + BootstrapLogger.ensureBackendDetected(); synchronized(lock) { if (service != null) return service; - service = loadLoggerFinder(); + Thread currentThread = Thread.currentThread(); + if (loadingThread == currentThread) { + // recursive attempt to load the backend while loading the backend + // use a temporary logger finder that returns special BootstrapLogger + // which will wait until loading is finished + return TemporaryLoggerFinder.INSTANCE; + } + loadingThread = currentThread; + try { + service = loadLoggerFinder(); + } finally { + loadingThread = null; + } } // Since the LoggerFinder is already loaded - we can stop using // temporary loggers. @@ -78,6 +98,12 @@ private static System.LoggerFinder service() { return service; } + // returns true if called by the thread that loads the LoggerFinder, while + // loading the LoggerFinder. + static boolean isLoadingThread() { + return loadingThread != null && loadingThread == Thread.currentThread(); + } + // Get configuration error policy private static ErrorPolicy configurationErrorPolicy() { String errorPolicy = @@ -115,6 +141,34 @@ private static Iterator findLoggerFinderProviders() { return iterator; } + public static final class TemporaryLoggerFinder extends LoggerFinder { + private TemporaryLoggerFinder() {} + @Stable + private LoggerFinder loadedService; + + private static final BooleanSupplier isLoadingThread = new BooleanSupplier() { + @Override + public boolean getAsBoolean() { + return LoggerFinderLoader.isLoadingThread(); + } + }; + private static final TemporaryLoggerFinder INSTANCE = new TemporaryLoggerFinder(); + + @Override + public Logger getLogger(String name, Module module) { + if (loadedService == null) { + loadedService = service; + if (loadedService == null) { + return LazyLoggers.makeLazyLogger(name, module, isLoadingThread); + } + } + assert loadedService != null; + assert !LoggerFinderLoader.isLoadingThread(); + assert loadedService != this; + return LazyLoggers.getLogger(name, module); + } + } + // Loads the LoggerFinder using ServiceLoader. If no LoggerFinder // is found returns the default (possibly JUL based) implementation private static System.LoggerFinder loadLoggerFinder() { diff --git a/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder new file mode 100644 index 00000000000..2471db0e957 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder @@ -0,0 +1 @@ +loggerfinder.SimpleLoggerFinder diff --git a/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java new file mode 100644 index 00000000000..2165c640c4f --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java @@ -0,0 +1,122 @@ +/* + * 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 8314263 + * @summary Creating a logger while loading the Logger finder + * triggers recursion and StackOverflowError + * @modules java.base/sun.util.logging java.base/jdk.internal.logger:+open + * @library ../lib + * @compile RecursiveLoadingTest.java SimpleLoggerFinder.java + * @run main/othervm PlatformRecursiveLoadingTest + */ + +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.logging.LogRecord; + +import sun.util.logging.PlatformLogger; + +public class PlatformRecursiveLoadingTest { + + /** + * This test triggers recursion by calling `System.getLogger` in the class init and constructor + * of a custom LoggerFinder. Without the fix, this is expected to throw + * java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy + * caused by: java.lang.StackOverflowError + */ + public static void main(String[] args) throws Throwable { + PlatformLogger.getLogger("main").info("in main"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + List logs = loggerfinder.SimpleLoggerFinder.LOGS; + logs.stream().map(SimpleLogRecord::of).forEach(System.out::println); + logs.stream().map(SimpleLogRecord::of).forEach(SimpleLogRecord::check); + assertEquals(String.valueOf(logs.size()), String.valueOf(3)); + } + + static List asList(Object[] params) { + return params == null ? null : Arrays.asList(params); + } + + public static class SimpleLogRecord { + + String message; + Instant instant; + String loggerName; + java.util.logging.Level level; + List params; + String resourceBundleName; + long seqNumber; + String sourceClassName; + String methodName; + Throwable thrown; + + public SimpleLogRecord(String message, Instant instant, String loggerName, java.util.logging.Level level, List params, + String resourceBundleName, long seqNumber, String sourceClassName, String methodName, Throwable thrown) { + this.message = message; + this.instant = instant; + this.loggerName = loggerName; + this.level = level; + this.params = params; + this.resourceBundleName = resourceBundleName; + this.seqNumber = seqNumber; + this.sourceClassName = sourceClassName; + this.methodName = methodName; + this.thrown = thrown; + } + + public SimpleLogRecord(LogRecord record) { + this(record.getMessage(), record.getInstant(), record.getLoggerName(), record.getLevel(), + asList(record.getParameters()), record.getResourceBundleName(), record.getSequenceNumber(), + record.getSourceClassName(), record.getSourceMethodName(), record.getThrown()); + } + static SimpleLogRecord of(Object o) { + if (o instanceof LogRecord) { + LogRecord record = (LogRecord) o; + return new SimpleLogRecord(record); + }else { + return null; + } + } + static SimpleLogRecord check(SimpleLogRecord record) { + if (record.loggerName.equals("dummy")) { + assertEquals(record.sourceClassName, "jdk.internal.logger.BootstrapLogger$LogEvent"); + assertEquals(record.methodName, "log"); + } + if (record.loggerName.equals("main")) { + assertEquals(record.sourceClassName, PlatformRecursiveLoadingTest.class.getName()); + assertEquals(record.methodName, "main"); + } + return record; + } + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff --git a/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java new file mode 100644 index 00000000000..67d19849802 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java @@ -0,0 +1,120 @@ +/* + * 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 8314263 + * @summary Creating a logger while loading the Logger finder + * triggers recursion and StackOverflowError + * @modules java.base/jdk.internal.logger:+open + * @library ../lib + * @compile RecursiveLoadingTest.java SimpleLoggerFinder.java + * @run main/othervm RecursiveLoadingTest + */ + +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.logging.LogRecord; + +public class RecursiveLoadingTest { + + /** + * This test triggers recursion by calling `System.getLogger` in the class init and constructor + * of a custom LoggerFinder. Without the fix, this is expected to throw + * java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy + * caused by: java.lang.StackOverflowError + */ + public static void main(String[] args) throws Throwable { + System.getLogger("main").log(System.Logger.Level.INFO, "in main"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + List logs = loggerfinder.SimpleLoggerFinder.LOGS; + logs.stream().map(SimpleLogRecord::of).forEach(System.out::println); + logs.stream().map(SimpleLogRecord::of).forEach(SimpleLogRecord::check); + assertEquals(String.valueOf(logs.size()), String.valueOf(3)); + } + + static List asList(Object[] params) { + return params == null ? null : Arrays.asList(params); + } + + public static class SimpleLogRecord { + + String message; + Instant instant; + String loggerName; + java.util.logging.Level level; + List params; + String resourceBundleName; + long seqNumber; + String sourceClassName; + String methodName; + Throwable thrown; + + public SimpleLogRecord(String message, Instant instant, String loggerName, java.util.logging.Level level, List params, + String resourceBundleName, long seqNumber, String sourceClassName, String methodName, Throwable thrown) { + this.message = message; + this.instant = instant; + this.loggerName = loggerName; + this.level = level; + this.params = params; + this.resourceBundleName = resourceBundleName; + this.seqNumber = seqNumber; + this.sourceClassName = sourceClassName; + this.methodName = methodName; + this.thrown = thrown; + } + + public SimpleLogRecord(LogRecord record) { + this(record.getMessage(), record.getInstant(), record.getLoggerName(), record.getLevel(), + asList(record.getParameters()), record.getResourceBundleName(), record.getSequenceNumber(), + record.getSourceClassName(), record.getSourceMethodName(), record.getThrown()); + } + public static SimpleLogRecord of(Object o) { + if (o instanceof LogRecord) { + LogRecord record = (LogRecord) o; + return new SimpleLogRecord(record); + }else { + return null; + } + } + public static SimpleLogRecord check(SimpleLogRecord record) { + if (record.loggerName.equals("dummy")) { + assertEquals(record.sourceClassName, "jdk.internal.logger.BootstrapLogger$LogEvent"); + assertEquals(record.methodName, "log"); + } + if (record.loggerName.equals("main")) { + assertEquals(record.sourceClassName, RecursiveLoadingTest.class.getName()); + assertEquals(record.methodName, "main"); + } + return record; + } + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff --git a/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java new file mode 100644 index 00000000000..5072823f47b --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java @@ -0,0 +1,140 @@ +/* + * 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 loggerfinder; + +import java.lang.*; +import java.util.*; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +public class SimpleLoggerFinder extends System.LoggerFinder { + + public static final CopyOnWriteArrayList LOGS = new CopyOnWriteArrayList<>(); + static { + try { + int sleep = new Random().nextInt(1000) + 1; + // simulate a slow load service + Thread.sleep(sleep); + System.getLogger("dummy") + .log(System.Logger.Level.INFO, + "Logger finder service load sleep value: " + sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + private final Map loggers = new ConcurrentHashMap<>(); + public SimpleLoggerFinder() { + System.getLogger("dummy") + .log(System.Logger.Level.INFO, + "Logger finder service created"); + } + + @Override + public System.Logger getLogger(String name, Module module) { + return loggers.computeIfAbsent(name, SimpleLogger::new); + } + + private static class SimpleLogger implements System.Logger { + private final java.util.logging.Logger logger; + + private static final class SimpleHandler extends Handler { + @Override + public void publish(LogRecord record) { + LOGS.add(record); + } + @Override public void flush() { } + @Override public void close() { } + } + + public SimpleLogger(String name) { + logger = Logger.getLogger(name); + logger.addHandler(new SimpleHandler()); + } + + @Override + public String getName() { + return logger.getName(); + } + + java.util.logging.Level level(Level level) { + switch (level) { + case ALL: + return java.util.logging.Level.ALL; + case DEBUG: + return java.util.logging.Level.FINE; + case TRACE: + return java.util.logging.Level.FINER; + case INFO: + return java.util.logging.Level.INFO; + case WARNING: + return java.util.logging.Level.WARNING; + case ERROR: + return java.util.logging.Level.SEVERE; + case OFF: + return java.util.logging.Level.OFF; + }; + return null; + } + + @Override + public boolean isLoggable(Level level) { + return logger.isLoggable(level(level)); + } + + @Override + public void log(Level level, ResourceBundle bundle, String msg, Throwable thrown) { + var julLevel = level(level); + if (!logger.isLoggable(julLevel)) return; + if (bundle != null) { + logger.logrb(julLevel, bundle, msg, thrown); + } else { + logger.log(julLevel, msg, thrown); + } + } + + @Override + public void log(Level level, ResourceBundle bundle, String format, Object... params) { + var julLevel = level(level); + if (!logger.isLoggable(julLevel)) return; + if (params == null) { + if (bundle == null) { + logger.log(julLevel, format); + } else { + logger.logrb(julLevel, bundle, format); + } + } else { + if (bundle == null) { + logger.log(julLevel, format, params); + } else { + logger.logrb(julLevel, bundle, format, params); + } + } + } + } +} + diff --git a/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder new file mode 100644 index 00000000000..2471db0e957 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder @@ -0,0 +1 @@ +loggerfinder.SimpleLoggerFinder diff --git a/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java new file mode 100644 index 00000000000..b294f557c28 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java @@ -0,0 +1,307 @@ +/* + * 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 8314263 + * @summary Signed jars triggering Logger finder recursion and StackOverflowError + * @library /test/lib ../lib + * @compile/module=java.base share/classes/jdk/internal/event/EventHelper.java + * @modules java.base/jdk.internal.logger:+open + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.process.* + * jdk.test.lib.util.JarUtils + * jdk.test.lib.JDKToolLauncher + * @compile SignedLoggerFinderTest.java SimpleLoggerFinder.java + * @run main SignedLoggerFinderTest init + * @run main SignedLoggerFinderTest init sign + */ + +import java.io.File; +import java.nio.file.*; +import java.security.*; +import java.util.*; +import java.util.function.*; +import java.util.jar.*; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Utils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.JarUtils; + +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +import static java.util.Arrays.asList; + +public class SignedLoggerFinderTest { + + /** + * This test triggers recursion in the broken JDK. The error can + * manifest in a few different ways. + * One error seen is "java.lang.NoClassDefFoundError: + * Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy" + * + * The original reported error was a StackOverflow (also seen in different iterations + * of this run). Running test in signed and unsigned jar mode for sanity coverage. + * The current bug only manifests when jars are signed. + */ + + private static boolean init = false; + private static boolean signJars = false; + private static boolean mutliThreadLoad = false; + private static volatile boolean testComplete = false; + + private static final String KEYSTORE = "8314263.keystore"; + private static final String ALIAS = "JavaTest"; + private static final String STOREPASS = "changeit"; + private static final String KEYPASS = "changeit"; + private static final String DNAME = "CN=sample"; + private static final String CUSTOM_LOGGER_FINDER_NAME = + "loggerfinder.SimpleLoggerFinder"; + private static final String CUSTOM_LOGGER_NAME = + "loggerfinder.SimpleLoggerFinder$SimpleLogger"; + private static final String INTERNAL_LOGGER_FINDER_NAME = + "sun.util.logging.internal.LoggingProviderImpl"; + private static final String INTERNAL_LOGGER_NAME = + "sun.util.logging.internal.LoggingProviderImpl$JULWrapper"; + private static final Path jarPath1 = + Path.of(System.getProperty("test.classes", "."), "SimpleLoggerFinder.jar"); + private static final Path jarPath2 = + Path.of(System.getProperty("test.classes", "."), "SimpleLoggerFinder2.jar"); + + public static void main(String[] args) throws Throwable { + init = args.length >=1 && args[0].equals("init"); + signJars = args.length >=2 && args[1].equals("sign"); + + // init only passed in by jtreg test run, initialize the environment + // for the subsequent test run + if (init) { + initialize(); + launchTest(false, false); + launchTest(false, true); + launchTest(true, false); + launchTest(true, true); + + } else { + // set up complete. Run the code to trigger the recursion + // We're in the JVM launched by ProcessTools.executeCommand + boolean multiThreadLoad = Boolean.getBoolean("multiThreadLoad"); + boolean withCustomLoggerFinder = Boolean.getBoolean("withCustomLoggerFinder"); + + if (multiThreadLoad) { + int sleep = new Random().nextInt(1000) + 1; + System.out.println("multi thread load sleep value: " + sleep); + new Thread(runnableWithSleep( + () -> System.getLogger("logger" + System.currentTimeMillis()), + sleep, "System.getLogger type: ")).start(); + new Thread(runnableWithSleep( + () -> System.LoggerFinder.getLoggerFinder(), + sleep, "System.getLoggerFinder type: ")).start(); + } + + if (withCustomLoggerFinder) { + JarFile jf = new JarFile(jarPath1.toString(), true); + jf.getInputStream(jf.getJarEntry("loggerfinder/SimpleLoggerFinder.class")); + JarFile jf2 = new JarFile(jarPath2.toString(), true); + jf2.getInputStream(jf.getJarEntry("loggerfinder/SimpleLoggerFinder.class")); + } else { + // some other call to prod LoggerFinder loading + System.getLogger("random" + System.currentTimeMillis()); + System.LoggerFinder.getLoggerFinder(); + } + Security.setProperty("test_1", "test"); + + // some extra sanity checks + if (withCustomLoggerFinder) { + assertEquals(System.LoggerFinder.getLoggerFinder().getClass().getName(), + CUSTOM_LOGGER_FINDER_NAME); + System.Logger testLogger = System.getLogger("jdk.event.security"); + assertEquals(testLogger.getClass().getName(), CUSTOM_LOGGER_NAME); + } else { + assertEquals(System.LoggerFinder.getLoggerFinder().getClass().getName(), + INTERNAL_LOGGER_FINDER_NAME); + System.Logger testLogger = System.getLogger("jdk.event.security"); + assertEquals(testLogger.getClass().getName(), INTERNAL_LOGGER_NAME); + } + testComplete = true; + + // LoggerFinder should be initialized, trigger a simple log call + Security.setProperty("test_2", "test"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + } + } + + // helper to create the inner test. Run config variations with the LoggerFinder jars + // on the classpath and with other threads running System.Logger calls during load + private static void launchTest(boolean multiThreadLoad, boolean withCustomLoggerFinder) { + List cmds = new ArrayList<>(); + cmds.add(JDKToolFinder.getJDKTool("java")); + cmds.addAll(asList(Utils.getTestJavaOpts())); + if (withCustomLoggerFinder) { + cmds.addAll(List.of("-classpath", + System.getProperty("test.classes") + File.pathSeparator + + jarPath1.toString() + File.pathSeparator + jarPath2.toString(), + "-Dtest.classes=" + System.getProperty("test.classes"))); + } else { + cmds.addAll(List.of("-classpath", + System.getProperty("test.classes"))); + } + + Path patches = Paths.get(System.getProperty("test.classes"), "patches", "java.base"); + cmds.addAll(List.of( + // patch of EventHelper to log at INFO level (for bootstrap logger) + "--patch-module", "java.base=" + patches.toString(), + // allow test to access internal bootstrap logger functionality + "--add-opens=java.base/jdk.internal.logger=ALL-UNNAMED", + // following debug property seems useful to tickle the issue + "-Dsun.misc.URLClassPath.debug=true", + // console logger level to capture event output + "-Djdk.system.logger.level=DEBUG", + // useful for debug purposes + "-Djdk.logger.finder.error=DEBUG", + // enable logging to verify correct output + "-Djava.util.logging.config.file=" + + Path.of(System.getProperty("test.src", "."), "logging.properties"))); + if (multiThreadLoad) { + cmds.add("-DmultiThreadLoad=true"); + } + if (withCustomLoggerFinder) { + cmds.add("-DwithCustomLoggerFinder=true"); + } + cmds.addAll(List.of( + "SignedLoggerFinderTest", + "no-init")); + + try { + OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(cmds.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + if (withCustomLoggerFinder) { + outputAnalyzer + .shouldContain("TEST LOGGER: [test_1, test]") + .shouldContain("TEST LOGGER: [test_2, test]"); + } else { + outputAnalyzer + .shouldContain("SecurityPropertyModification: key:test_1") + .shouldContain("SecurityPropertyModification: key:test_2"); + } + if (withCustomLoggerFinder && signJars) { + // X509 cert generated during verification of signed jar file + outputAnalyzer + .shouldContain(DNAME); + } + + } catch (Throwable t) { + throw new RuntimeException("Unexpected fail.", t); + } + } + + private static Runnable runnableWithSleep(Supplier s, long sleep, String desc) { + return () -> { + while(!testComplete) { + System.out.println(desc + s.get().getClass().getName()); + try { + Thread.sleep(sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + }; + } + + private static void initialize() throws Throwable { + if (signJars) { + genKey(); + } + + Path classes = Paths.get(System.getProperty("test.classes", "")); + JarUtils.createJarFile(jarPath1, + classes, + classes.resolve("loggerfinder/SimpleLoggerFinder.class"), + classes.resolve("loggerfinder/SimpleLoggerFinder$SimpleLogger.class")); + + JarUtils.updateJarFile(jarPath1, Path.of(System.getProperty("test.src")), + Path.of("META-INF", "services", "java.lang.System$LoggerFinder")); + if (signJars) { + signJar(jarPath1.toString()); + } + // multiple signed jars with services to have ServiceLoader iteration + Files.copy(jarPath1, jarPath2, REPLACE_EXISTING); + } + + private static void genKey() throws Throwable { + String keytool = JDKToolFinder.getJDKTool("keytool"); + Files.deleteIfExists(Paths.get(KEYSTORE)); + ProcessTools.executeCommand(keytool, + "-J-Duser.language=en", + "-J-Duser.country=US", + "-genkey", + "-keyalg", "rsa", + "-alias", ALIAS, + "-keystore", KEYSTORE, + "-keypass", KEYPASS, + "-dname", DNAME, + "-storepass", STOREPASS + ).shouldHaveExitValue(0); + } + + + private static OutputAnalyzer signJar(String jarName) throws Throwable { + List args = new ArrayList<>(); + args.add("-verbose"); + args.add(jarName); + args.add(ALIAS); + + return jarsigner(args); + } + + private static OutputAnalyzer jarsigner(List extra) + throws Throwable { + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jarsigner") + .addVMArg("-Duser.language=en") + .addVMArg("-Duser.country=US") + .addToolArg("-keystore") + .addToolArg(KEYSTORE) + .addToolArg("-storepass") + .addToolArg(STOREPASS) + .addToolArg("-keypass") + .addToolArg(KEYPASS); + for (String s : extra) { + if (s.startsWith("-J")) { + launcher.addVMArg(s.substring(2)); + } else { + launcher.addToolArg(s); + } + } + return ProcessTools.executeCommand(launcher.getCommand()); + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff --git a/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java new file mode 100644 index 00000000000..7d03280c9f8 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java @@ -0,0 +1,74 @@ +/* + * 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 loggerfinder; + +import java.lang.*; +import java.util.*; + +public class SimpleLoggerFinder extends System.LoggerFinder { + + static { + try { + int sleep = new Random().nextInt(1000) + 1; + System.out.println("Logger finder service load sleep value: " + sleep); + // simulate a slow load service + Thread.sleep(sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + @Override + public System.Logger getLogger(String name, Module module) { + return new SimpleLogger(name); + } + + private static class SimpleLogger implements System.Logger { + private final String name; + + public SimpleLogger(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean isLoggable(Level level) { + return true; + } + + @Override + public void log(Level level, ResourceBundle bundle, String msg, Throwable thrown) { + System.out.println("TEST LOGGER: " + msg); + } + + @Override + public void log(Level level, ResourceBundle bundle, String format, Object... params) { + System.out.println("TEST LOGGER: " + Arrays.asList(params)); + + } + } +} diff --git a/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java new file mode 100644 index 00000000000..bdb8e37cbf0 --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java @@ -0,0 +1,155 @@ +/* + * 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.internal.event; + +import jdk.internal.misc.JavaUtilJarAccess; +import jdk.internal.misc.SharedSecrets; + +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.LongStream; + +/** + * A helper class to have events logged to a JDK Event Logger. + */ + +public final class EventHelper { + + private static final JavaUtilJarAccess JUJA = SharedSecrets.javaUtilJarAccess(); + private static volatile boolean loggingSecurity; + private static volatile System.Logger securityLogger; + private static final VarHandle LOGGER_HANDLE; + static { + System.err.println("Patch version of EventHelper loaded"); + try { + LOGGER_HANDLE = + MethodHandles.lookup().findStaticVarHandle( + EventHelper.class, "securityLogger", System.Logger.class); + } catch (ReflectiveOperationException e) { + throw new Error(e); + } + } + // a patch module to help this test ensure events are logged when + // bootstrap logger is in use + private static final System.Logger.Level LOG_LEVEL = System.Logger.Level.INFO; + + // helper class used for logging security related events for now + private static final String SECURITY_LOGGER_NAME = "jdk.event.security"; + + + public static void logTLSHandshakeEvent(Instant start, + String peerHost, + int peerPort, + String cipherSuite, + String protocolVersion, + long peerCertId) { + assert securityLogger != null; + String prepend = getDurationString(start); + securityLogger.log(LOG_LEVEL, prepend + + " TLSHandshake: {0}:{1,number,#}, {2}, {3}, {4,number,#}", + peerHost, peerPort, protocolVersion, cipherSuite, peerCertId); + } + + public static void logSecurityPropertyEvent(String key, + String value) { + + assert securityLogger != null; + securityLogger.log(LOG_LEVEL, + "SecurityPropertyModification: key:{0}, value:{1}", key, value); + } + + public static void logX509ValidationEvent(long anchorCertId, + long[] certIds) { + assert securityLogger != null; + String codes = LongStream.of(certIds) + .mapToObj(Long::toString) + .collect(Collectors.joining(", ")); + securityLogger.log(LOG_LEVEL, + "ValidationChain: {0,number,#}, {1}", anchorCertId, codes); + } + + public static void logX509CertificateEvent(String algId, + String serialNum, + String subject, + String issuer, + String keyType, + int length, + long certId, + long beginDate, + long endDate) { + assert securityLogger != null; + securityLogger.log(LOG_LEVEL, "X509Certificate: Alg:{0}, Serial:{1}" + + ", Subject:{2}, Issuer:{3}, Key type:{4}, Length:{5,number,#}" + + ", Cert Id:{6,number,#}, Valid from:{7}, Valid until:{8}", + algId, serialNum, subject, issuer, keyType, length, + certId, new Date(beginDate), new Date(endDate)); + } + + /** + * Method to calculate a duration timestamp for events which measure + * the start and end times of certain operations. + * @param start Instant indicating when event started recording + * @return A string representing duraction from start time to + * time of this method call. Empty string is start is null. + */ + private static String getDurationString(Instant start) { + if (start != null) { + if (start.equals(Instant.MIN)) { + return "N/A"; + } + Duration duration = Duration.between(start, Instant.now()); + long micros = duration.toNanos() / 1_000; + if (micros < 1_000_000) { + return "duration = " + (micros / 1_000.0) + " ms:"; + } else { + return "duration = " + ((micros / 1_000) / 1_000.0) + " s:"; + } + } else { + return ""; + } + } + + /** + * Helper to determine if security events are being logged + * at a preconfigured logging level. The configuration value + * is read once at class initialization. + * + * @return boolean indicating whether an event should be logged + */ + public static boolean isLoggingSecurity() { + // Avoid a bootstrap issue where the commitEvent attempts to + // trigger early loading of System Logger but where + // the verification process still has JarFiles locked + if (securityLogger == null && !JUJA.isInitializing()) { + LOGGER_HANDLE.compareAndSet( null, System.getLogger(SECURITY_LOGGER_NAME)); + loggingSecurity = securityLogger.isLoggable(LOG_LEVEL); + } + return loggingSecurity; + } + +} diff --git a/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties new file mode 100644 index 00000000000..33595267e5e --- /dev/null +++ b/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties @@ -0,0 +1,14 @@ +############################################################ +# Configuration file for log testing +# +############################################################ + +handlers= java.util.logging.ConsoleHandler + +.level= FINE + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +jdk.event.security.level = FINE + diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java index 19b100960e5..d38d0943928 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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 @@ -29,7 +29,7 @@ import java.util.Enumeration; import java.util.List; import java.util.ResourceBundle; -import java.util.Set; + import jdk.internal.logger.BootstrapLogger; import jdk.internal.logger.LazyLoggers; @@ -38,9 +38,10 @@ * @bug 8144460 8144214 * @summary Cover the logXX and LogEvent.valueOf APIs of BootstrapLogger * and logXX APIs of SimpleConsoleLogger. + * @library ../../lib * @modules java.base/jdk.internal.logger:+open * java.base/sun.util.logging - * @build BootstrapLoggerUtils LogStream + * @build LogStream * @run main/othervm BootstrapLoggerAPIsTest */ diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java index e7a90c7466f..abfb9912d0f 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java @@ -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 @@ -53,9 +53,10 @@ * @summary JDK implementation specific unit test for JDK internal artifacts. Tests the behavior of bootstrap loggers (and SimpleConsoleLoggers * too). + * @library ../../lib * @modules java.base/jdk.internal.logger:+open * java.logging - * @build BootstrapLoggerUtils LogStream + * @build LogStream * @run main/othervm BootstrapLoggerTest NO_SECURITY * @run main/othervm BootstrapLoggerTest SECURE * @run main/othervm/timeout=120 BootstrapLoggerTest SECURE_AND_WAIT diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java index d6e218a2a43..a7f20fc7948 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java +++ b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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,8 +25,6 @@ import java.io.OutputStream; import java.io.PrintStream; -import jdk.internal.logger.BootstrapLogger; - /** * We use an instance of this class to check what the logging system has printed * on System.err. diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java b/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java similarity index 89% rename from test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java rename to test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java index 0e78b588e99..2e551f94491 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java +++ b/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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 @@ -28,7 +28,7 @@ import jdk.internal.logger.BootstrapLogger; -class BootstrapLoggerUtils { +public final class BootstrapLoggerUtils { private static final Field IS_BOOTED; private static final Method AWAIT_PENDING; @@ -46,11 +46,11 @@ class BootstrapLoggerUtils { } } - static void setBootedHook(BooleanSupplier supplier) throws IllegalAccessException { + public static void setBootedHook(BooleanSupplier supplier) throws IllegalAccessException { IS_BOOTED.set(null, supplier); } - static void awaitPending() { + public static void awaitPending() { try { AWAIT_PENDING.invoke(null); } catch (IllegalAccessException | IllegalArgumentException From 2bbab16d08e9c34b050f8f8f744299a9e3bae0de Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 15:52:38 +0000 Subject: [PATCH 135/177] 8185531: [TESTBUG] Improve test configuration for shared strings Added extra test configurations to the tests Backport-of: 8a5467b9c22f80a22aa12d45694e8432e6c6e47d --- test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/InternSharedString.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java | 2 ++ test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java | 2 ++ .../runtime/appcds/sharedStrings/SharedStringsBasicPlus.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java | 2 ++ .../jtreg/runtime/appcds/sharedStrings/SysDictCrash.java | 2 ++ 11 files changed, 22 insertions(+) diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java index 4157894a240..3e3a622c91e 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java @@ -33,6 +33,8 @@ * @build HelloStringGC sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main ExerciseGC + * @run main/othervm -XX:+UseStringDeduplication ExerciseGC + * @run main/othervm -XX:-CompactStrings ExerciseGC */ public class ExerciseGC { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java index 887253d61c0..633a6b80be1 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java @@ -36,6 +36,8 @@ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * @build HelloString * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions + * @run main/othervm -XX:+UseStringDeduplication -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions + * @run main/othervm -XX:-CompactStrings -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions */ import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java index f73b6e1e44b..c945fcbebb9 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java @@ -34,6 +34,8 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main InternSharedString + * @run main/othervm -XX:+UseStringDeduplication InternSharedString + * @run main/othervm -XX:-CompactStrings InternSharedString */ public class InternSharedString { diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java index 6274ee48e86..405c0a1354b 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java @@ -32,6 +32,8 @@ * jdk.jartool/sun.tools.jar * @build HelloString * @run main InvalidFileFormat + * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat + * @run main/othervm -XX:-CompactStrings InvalidFileFormat */ import jdk.test.lib.process.OutputAnalyzer; diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java index 7de39000f48..e7b9020d9a0 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java @@ -32,6 +32,8 @@ * jdk.jartool/sun.tools.jar * @build HelloString * @run main LargePages + * @run main/othervm -XX:+UseStringDeduplication LargePages + * @run main/othervm -XX:-CompactStrings LargePages */ public class LargePages { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java index 8f7a4d99e50..1ff7ff3eee1 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java @@ -34,6 +34,8 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main LockSharedStrings + * @run main/othervm -XX:+UseStringDeduplication LockSharedStrings + * @run main/othervm -XX:-CompactStrings LockSharedStrings */ public class LockSharedStrings { diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java index ea3491999a2..d3ff683fa84 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java @@ -32,6 +32,8 @@ * jdk.jartool/sun.tools.jar * @build HelloString * @run main SharedStringsBasic + * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasic + * @run main/othervm -XX:-CompactStrings SharedStringsBasic */ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java index fd53b804a89..1264955b996 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java @@ -33,6 +33,8 @@ * @build HelloStringPlus sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main SharedStringsBasicPlus + * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasicPlus + * @run main/othervm -XX:-CompactStrings SharedStringsBasicPlus */ public class SharedStringsBasicPlus { diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java index 0b476b1d247..1a0c25fc0b5 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java @@ -30,6 +30,8 @@ * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run main SharedStringsStress + * @run main/othervm -XX:+UseStringDeduplication SharedStringsStress + * @run main/othervm -XX:-CompactStrings SharedStringsStress */ import java.io.File; import java.io.FileOutputStream; diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java index 5438b30bfb7..1b6dd55eee3 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java @@ -33,6 +33,8 @@ * @build sun.hotspot.WhiteBox SharedStringsWb * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main SharedStringsWbTest + * @run main/othervm -XX:+UseStringDeduplication SharedStringsWbTest + * @run main/othervm -XX:-CompactStrings SharedStringsWbTest */ import java.io.*; diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java index 145fdb1afae..9cb9b13d1fa 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java @@ -32,6 +32,8 @@ * @modules java.base/jdk.internal.misc * @modules java.management * @run main SysDictCrash + * @run main/othervm -XX:+UseStringDeduplication SysDictCrash + * @run main/othervm -XX:-CompactStrings SysDictCrash */ import jdk.test.lib.process.OutputAnalyzer; From 8f7589fce8a849f040b07b12747e8c5af2a8a74b Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 15:55:01 +0000 Subject: [PATCH 136/177] 8211045: [Testbug] Fix for 8144279 didn't define a test case! Add missing file from original commit Backport-of: bc6fb26d02791f1f8ed9d60a0535d2066dbb3601 --- test/hotspot/jtreg/runtime/jsig/Testjsig.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/jsig/Testjsig.java diff --git a/test/hotspot/jtreg/runtime/jsig/Testjsig.java b/test/hotspot/jtreg/runtime/jsig/Testjsig.java new file mode 100644 index 00000000000..7109441d8c5 --- /dev/null +++ b/test/hotspot/jtreg/runtime/jsig/Testjsig.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016, 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 Testjsig.java + * @bug 8017498 + * @bug 8020791 + * @bug 8021296 + * @bug 8022301 + * @bug 8025519 + * @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX + * @requires (os.family == "linux") + * @library /test/lib + * @compile TestJNI.java + * @run driver Testjsig + */ + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +public class Testjsig { + + public static void main(String[] args) throws Throwable { + + // Get the JDK, library and class path properties + String libpath = System.getProperty("java.library.path"); + + // Create a new java process for the TestJNI Java/JNI test + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Djava.library.path=" + libpath + ":.", + "TestJNI", + "100"); + + // Start the process and check the output + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("old handler"); + } +} From 623fd8ebe512ff84d40560c43e241472436ccc9f Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 15:57:27 +0000 Subject: [PATCH 137/177] 8212997: [TESTBUG] Remove defmeth tests for class file versions 50 and 51 Remove the unneeded tests. Keep the tests for class file versions 49 and 52. Backport-of: 71637b00c70e1ae9ecb9e5479dc6d9df2e0503af --- .../vmTestbase/vm/runtime/defmeth/README | 2 +- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 46 ------------------ .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- .../TestDescription.java | 41 ---------------- .../TestDescription.java | 48 ------------------- 321 files changed, 1 insertion(+), 14321 deletions(-) delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_redefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_noredefine/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_redefine/TestDescription.java diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/README b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/README index 559060be958..cfdae4fecc3 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/README +++ b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/README @@ -131,7 +131,7 @@ OVERVIEW where majorVer - major version of class files for generated concrete classes - values: ver49, ver50, ver51, ver52 + values: ver49, ver52 methodFlags - additional access flags for methods in generated classes values: diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 245a2957395..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 44a2fe55a31..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 113e6e07c56..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 67c2e2abf53..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index dd2d07cbea1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index a3f9709d037..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 39fdd634bd6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 6422d05fdb4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 30957aa5f47..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index 9a3be1668e3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 668d36e0fc1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 09c25ce9cb9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index c2512896a8b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 30c98d42f97..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 29d5acaf43b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index e8bab57356a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 313db0368f4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index d5c588b1d64..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 3646220b9f4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index f7a2c9f24dc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index c904036db1a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 92360c2cb21..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index a634463b8d6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 960d6afead8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 1892b1123d4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index c3660c853c0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 1508d5c9eed..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 50257abbf23..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 44a084c4647..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index f5c26057d40..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 4875bb59d3d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 08d12140be7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 9b410c8305a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index ac2b21ab072..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index ecaba376e81..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 38f8e023570..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 820e32d7751..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 15ff850ba19..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 9a9806749ed..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index b4259a01b15..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 45d0b756102..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 256bf4ce0f2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 000d356c78a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 178cb0294d0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 624e362a80f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 0c711cae846..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 395bdb052a3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index f6266cf53bc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Basic_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.BasicTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index b68641489e2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 3c3ae4ff135..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index ae61db85258..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 39594f1ed01..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index da7be26ad63..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 42608b5583f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 7b60ba9b49e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index e4a5ad23e15..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 7cf02798af6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index fefe086d61f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 3e8f8bfaf6a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 865037e67c8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 8355b961a5a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index e1e2cb8a618..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 357154f2849..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 6ebf736b60e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index b9584d57d98..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index cd05da32aaa..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 0c537186d19..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index d546066e080..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 21cb3f90390..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index b47099b2ef2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index f3e7da6ce6e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 385e1462f5b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index a4df2663faa..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index b354bb897c2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index b544e7cb50e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 5ff9b1d94d7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index f03eb4fc9f9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 4ea61055a53..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index cb5c00e44ef..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index a5a1b117b73..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index c46d2310b82..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index d01bc792b93..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 899a2ad475b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 779a84ec5b9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index d4c16b38828..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 85287fe763e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 85e8b916c43..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index d8e28817285..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 1f8ab4d3d28..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 2ad29ccf940..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index c9ca8e43d11..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index dd8101aff1d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 10a211c6bae..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index fe9bcb3584a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 4516e25138a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 643884c4c50..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/ConflictingDefaults_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.ConflictingDefaultsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 8ed4602572f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 651ee17b972..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 0bd21827dba..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index db8cff1f566..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 48e2f63d84f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index bc0ec147690..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 9a1632e2e76..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index b12b485e3a9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 40286a45529..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index aca267a69ab..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 2963426bbbd..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 075b6ef1e4f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index f62ceb79140..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 1a2da8c86c3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 0a4e39c497d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 5c49dfa1671..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 5c68310d3a3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 898f0d1bf5f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index d359f8c94b9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 70d8954e94b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 3ccfbd67b6e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 4080870a6ab..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index b2cd55710f6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 8092984e208..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 9efa93abd0b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index d155128c749..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index ad8f8d010ab..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 8e518cd6df1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 1bf298f564e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 1a57feba20c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 250933da6f0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 619c2404c63..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index fa3c9404b9d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index 71829cdd116..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 12291080579..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 907e0daa54a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 362d7804410..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 632bc136d85..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index dd157ebac8f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index b338eb12c6f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 6300b18854b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index d69f583c886..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 5f4a19dbdf1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 9361652ac24..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 8f8dd6fcaef..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index d24d9099902..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 171c48c6c4b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index d98ce780274..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/DefaultVsAbstract_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.DefaultVsAbstractTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index efbff828da7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 563caf777a7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index dd2ba24052a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 09b03329928..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 56becae6544..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 272a0a7b2dc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 17d48a59a00..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 180c33d92d1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index b4bca083c89..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index 890d17aa270..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 6a159667ef3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index b65abf7b45d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index a3ac3db4143..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index d27ce82129f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 8535344bd17..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 81ef4b8a850..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index ec48510b4e4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 265ac8c75f6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 849cb7817da..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 88922b8f3b3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 8b7472dfe0d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 1be36eb11c8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 4be3b5f92ea..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 08955ffdc40..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index d4417a55e17..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index 7b49cc63aed..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 7912c0bbc5e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index d04c36d8f8d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 28c479ccd8a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 90cf6c81242..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 1b00e33c1d5..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 40c249f9ecd..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index dfb833e28fe..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index 555428b45e3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 4baa5eb67a0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index b3fbec01da4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 8d6e4d7a06e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index ca3539bbd44..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index d7034dbc28c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index fe1d7887cf7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index a88c976da4f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index fa14795b681..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 6f90ad4b640..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 11cdd1c8f01..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index cda26b82758..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index a23e995717a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 4f0f7d884d2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index d080f8d565d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/MethodResolution_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.MethodResolutionTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 2b90ad72ca8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 18e0456156f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 15add0b0b98..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index e5a26f76480..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 61336c1ff01..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index f631a3dd646..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index b2d63d6935a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index a74667b895b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 93f40000b88..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index ec5582f56c1..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 7dcd23f2d36..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 7635f88bc31..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 79feaafc70c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 9de3b2b9aaa..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 141c4e13abd..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index be7ec9abc85..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index f94ca0ad792..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 3bbd1277402..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 04b3bb4d6a9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 88716860f60..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 0b7695df99c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index b5aa7dc6b16..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 7b0353e64a9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 069575f3a45..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index c9b359cf781..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index a021560a45f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index e089e16d731..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 1ee0193647f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 83c261a732b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 76083e9d13d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index f64348fc931..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 37029866d12..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index fe3b7924161..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index eeabbcc8863..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 1f45d8266d3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index d2849cbf641..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 2f289d964c4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 67eb080a4cb..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 47ae637d70f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 2a0efe7c3d6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 564abf41485..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 25c655333bb..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index ca12080f1a3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index b9e4fe07f78..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 650cbaa15b9..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 22cf463df06..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 9f25cb9cae5..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index aed5c28e8d6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/PrivateMethods_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.PrivateMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 63dd97e5b97..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index 8149de182b3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 0b04d8719e4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index af9327bba34..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index ff2dd09efc4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 59d67086a8c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 4cedaf2d07e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index b213c812c60..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 1aa186339e8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 99495d51e22..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 73315c8d599..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 74b06ef2bb6..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 771c63c0e6c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 3dc6e1bc202..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 1b3affb1df3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 310615a560c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index fb3de612ba7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index 6258387b3ed..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index e1f54cba3c4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 5740cf7835b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 3c11b3bdb26..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index f822ca0f0c0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 8bc24aad4c4..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index c105515067f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 2459c79d8fc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index f96074b657f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index e6f24a5974a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index bf15b52e750..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index c3d6793ad15..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index cd4b15a2ef0..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index ecc16c8f189..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 4952b3b3496..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Redefine_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.RedefineTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_noredefine/TestDescription.java deleted file mode 100644 index e7ed979225f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_redefine/TestDescription.java deleted file mode 100644 index c3717bd0859..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 1fdab35081d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 96ded93921c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 5d16d677167..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 155295a4a38..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index f776cb6aafb..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 70d81939f7f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index d77d3f14ded..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index 38b5bba2fe3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 658138835ab..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index 2dd7fdb35fd..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index a327777ca7a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 21c8f2a54f3..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index 8ec02147014..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index d912f622a7f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index 4b800e940ef..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index e90532fee6a..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index dc7aa534450..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index 898576eb63d..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 1d170ea6392..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 6e5b6e6a44e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index bff24412612..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 401b72a93e8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v50_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 50 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_noredefine/TestDescription.java deleted file mode 100644 index 7de9c797884..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_redefine/TestDescription.java deleted file mode 100644 index 480437fc41c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_noredefine/TestDescription.java deleted file mode 100644 index 2b7f92b7bdc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_redefine/TestDescription.java deleted file mode 100644 index 4e6ec6cf07b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_noredefine/TestDescription.java deleted file mode 100644 index 6d0dbcf4b04..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_redefine/TestDescription.java deleted file mode 100644 index 0c12ef0aa64..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_none_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 0 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_noredefine/TestDescription.java deleted file mode 100644 index 93536501c8b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_redefine/TestDescription.java deleted file mode 100644 index 3e7e61c1ee2..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_noredefine/TestDescription.java deleted file mode 100644 index 6d001e4172e..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_redefine/TestDescription.java deleted file mode 100644 index f3e092a96de..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_noredefine/TestDescription.java deleted file mode 100644 index 0d6db393c80..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_redefine/TestDescription.java deleted file mode 100644 index ae55956c41f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_strict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2048 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_noredefine/TestDescription.java deleted file mode 100644 index 537b7611247..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_redefine/TestDescription.java deleted file mode 100644 index 81b8799c99c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_noredefine/TestDescription.java deleted file mode 100644 index d65e7b62ecc..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_redefine/TestDescription.java deleted file mode 100644 index 70e71a3f377..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_noredefine/TestDescription.java deleted file mode 100644 index eb7f4617107..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_redefine/TestDescription.java deleted file mode 100644 index 2c341b9530b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_sync_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 32 - * -redefine - * -retransform - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_noredefine/TestDescription.java deleted file mode 100644 index 9cf18552946..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_redefine/TestDescription.java deleted file mode 100644 index f9fad630578..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_direct_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode direct - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_noredefine/TestDescription.java deleted file mode 100644 index be168fa7e55..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_redefine/TestDescription.java deleted file mode 100644 index 2113642a69f..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_invoke_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode invoke - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_noredefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_noredefine/TestDescription.java deleted file mode 100644 index f86ae43e585..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_noredefine/TestDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_noredefine. - * VM Testbase keywords: [defmeth, jdk8, quick] - * - * @library /vmTestbase /test/lib - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm - * -XX:+IgnoreUnrecognizedVMOptions - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -mode reflect - */ - diff --git a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_redefine/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_redefine/TestDescription.java deleted file mode 100644 index 611640fada7..00000000000 --- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_redefine/TestDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open - * - * @summary converted from VM Testbase vm/runtime/defmeth/scenarios/StaticMethods_v51_syncstrict_reflect_redefine. - * VM Testbase keywords: [defmeth, jdk8, jdk_instrument, quick] - * - * @library /vmTestbase /test/lib - * - * @comment build retransform.jar in current dir - * @run driver vm.runtime.defmeth.shared.BuildJar - * - * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm/native - * -agentlib:redefineClasses - * -javaagent:retransform.jar - * vm.runtime.defmeth.StaticMethodsTest - * -ver 51 - * -flags 2080 - * -redefine - * -retransform - * -mode reflect - */ - From 6038e04bf2d05546bb36b6aac1e1f6c4a5076967 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 16:01:57 +0000 Subject: [PATCH 138/177] 8289584: (fs) Print size values in java/nio/file/FileStore/Basic.java when they differ by > 1GiB Backport-of: e291a67e96970d80a9915f8a23afffed6e0b8ded --- test/jdk/java/nio/file/FileStore/Basic.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/nio/file/FileStore/Basic.java b/test/jdk/java/nio/file/FileStore/Basic.java index 07d658a01d8..3d4aad6eaa0 100644 --- a/test/jdk/java/nio/file/FileStore/Basic.java +++ b/test/jdk/java/nio/file/FileStore/Basic.java @@ -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 @@ -57,10 +57,13 @@ static void assertTrue(boolean okay) { throw new RuntimeException("Assertion failed"); } - static void checkWithin1GB(long value1, long value2) { - long diff = Math.abs(value1 - value2); - if (diff > G) - throw new RuntimeException("values differ by more than 1GB"); + static void checkWithin1GB(long expected, long actual) { + long diff = Math.abs(actual - expected); + if (diff > G) { + String msg = String.format("|actual %d - expected %d| = %d (%f G)", + actual, expected, diff, (float)diff/G); + throw new RuntimeException(msg); + } } static void doTests(Path dir) throws IOException { From a2ef2482c45b7cb4c271250be1eef6c9818f8ced Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 16:04:36 +0000 Subject: [PATCH 139/177] 6381945: (cal) Japanese calendar unit test system should avoid multiple static imports Backport-of: f79b3d42f07b703f0e3b9fc67c92dee260b0e602 --- test/jdk/java/util/Calendar/CalendarTestScripts/Symbol.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/jdk/java/util/Calendar/CalendarTestScripts/Symbol.java b/test/jdk/java/util/Calendar/CalendarTestScripts/Symbol.java index a310f968ded..c872d09ab5a 100644 --- a/test/jdk/java/util/Calendar/CalendarTestScripts/Symbol.java +++ b/test/jdk/java/util/Calendar/CalendarTestScripts/Symbol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, 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 @@ -26,7 +26,6 @@ import java.util.Locale; import java.util.Map; -import static java.util.Calendar.*; import static java.util.GregorianCalendar.*; public class Symbol { From 2b9d54a02241dd9fad8a1e330eacc80079385dcc Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Thu, 9 Nov 2023 16:11:27 +0000 Subject: [PATCH 140/177] 8306134: Open source some AWT tests relating to Button and a few other classes Backport-of: fdb4bafa3142cedeb9eb3cb930890e97b35402de --- .../ArrayStoreException.java | 51 +++ .../java/awt/AWTKeyStroke/ToStringTest.java | 323 ++++++++++++++++++ .../BorderLayout/NullConstraintsReturns.java | 42 +++ .../java/awt/Button/ButtonNullLabelTest.java | 94 +++++ .../java/awt/Button/DisabledButtonPress.java | 117 +++++++ .../awt/Button/DoubleActionEventTest.java | 112 ++++++ 6 files changed, 739 insertions(+) create mode 100644 test/jdk/java/awt/AWTEventMulticaster/ArrayStoreException.java create mode 100644 test/jdk/java/awt/AWTKeyStroke/ToStringTest.java create mode 100644 test/jdk/java/awt/BorderLayout/NullConstraintsReturns.java create mode 100644 test/jdk/java/awt/Button/ButtonNullLabelTest.java create mode 100644 test/jdk/java/awt/Button/DisabledButtonPress.java create mode 100644 test/jdk/java/awt/Button/DoubleActionEventTest.java diff --git a/test/jdk/java/awt/AWTEventMulticaster/ArrayStoreException.java b/test/jdk/java/awt/AWTEventMulticaster/ArrayStoreException.java new file mode 100644 index 00000000000..bb61fc13ad7 --- /dev/null +++ b/test/jdk/java/awt/AWTEventMulticaster/ArrayStoreException.java @@ -0,0 +1,51 @@ +/* + * 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 + * 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 4513402 + @summary AWTEventMulticaster.getListeners throws unexpected ArrayStoreException +*/ + +import java.awt.AWTEventMulticaster; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentListener; +import java.awt.event.FocusListener; + +public class ArrayStoreException { + + public static void main(String[] args) throws Exception { + + ComponentListener mc = + AWTEventMulticaster.add( + new ComponentAdapter() {}, + new ComponentAdapter() {}); + + if (AWTEventMulticaster.getListeners(mc, FocusListener.class).length == 0) { + System.out.println("OKAY"); + } else { + System.out.println("empty array expected"); + throw new RuntimeException("Test failed"); + } + } +} diff --git a/test/jdk/java/awt/AWTKeyStroke/ToStringTest.java b/test/jdk/java/awt/AWTKeyStroke/ToStringTest.java new file mode 100644 index 00000000000..14d72f7e242 --- /dev/null +++ b/test/jdk/java/awt/AWTKeyStroke/ToStringTest.java @@ -0,0 +1,323 @@ +/* + * 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. + */ + +/* + @test + @bug 4370733 + @summary AWTKeyStroke's getAWTKeyStroke(String) and toString() method aren't symmetric +*/ + +import java.awt.AWTKeyStroke; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.KeyStroke; + +public class ToStringTest { + + /* Note this test is deliberately testing the deprecated constants + * as well as their replacements. + */ + @SuppressWarnings("deprecation") + public static final int[] modifiers = { + 0, + InputEvent.SHIFT_MASK, + InputEvent.CTRL_MASK, + InputEvent.META_MASK, + InputEvent.ALT_MASK, + InputEvent.ALT_GRAPH_MASK, + InputEvent.BUTTON1_MASK, + InputEvent.BUTTON2_MASK, + InputEvent.BUTTON3_MASK, + InputEvent.SHIFT_DOWN_MASK, + InputEvent.CTRL_DOWN_MASK, + InputEvent.META_DOWN_MASK, + InputEvent.ALT_DOWN_MASK, + InputEvent.BUTTON1_DOWN_MASK, + InputEvent.BUTTON2_DOWN_MASK, + InputEvent.BUTTON3_DOWN_MASK, + InputEvent.ALT_GRAPH_DOWN_MASK + }; + + public static final int[] keys = { + KeyEvent.VK_A, + KeyEvent.VK_B, + KeyEvent.VK_C, + KeyEvent.VK_D, + KeyEvent.VK_E, + KeyEvent.VK_F, + KeyEvent.VK_G, + KeyEvent.VK_H, + KeyEvent.VK_I, + KeyEvent.VK_J, + KeyEvent.VK_K, + KeyEvent.VK_L, + KeyEvent.VK_M, + KeyEvent.VK_N, + KeyEvent.VK_O, + KeyEvent.VK_P, + KeyEvent.VK_Q, + KeyEvent.VK_R, + KeyEvent.VK_S, + KeyEvent.VK_T, + KeyEvent.VK_U, + KeyEvent.VK_V, + KeyEvent.VK_W, + KeyEvent.VK_X, + KeyEvent.VK_Y, + KeyEvent.VK_Z, + KeyEvent.VK_0, + KeyEvent.VK_1, + KeyEvent.VK_2, + KeyEvent.VK_3, + KeyEvent.VK_4, + KeyEvent.VK_5, + KeyEvent.VK_6, + KeyEvent.VK_7, + KeyEvent.VK_8, + KeyEvent.VK_9, + + KeyEvent.VK_COMMA, + KeyEvent.VK_PERIOD, + KeyEvent.VK_SLASH, + KeyEvent.VK_SEMICOLON, + KeyEvent.VK_EQUALS, + KeyEvent.VK_OPEN_BRACKET, + KeyEvent.VK_BACK_SLASH, + KeyEvent.VK_CLOSE_BRACKET, + + KeyEvent.VK_ENTER, + KeyEvent.VK_BACK_SPACE, + KeyEvent.VK_TAB, + KeyEvent.VK_CANCEL, + KeyEvent.VK_CLEAR, + KeyEvent.VK_SHIFT, + KeyEvent.VK_CONTROL, + KeyEvent.VK_ALT, + KeyEvent.VK_PAUSE, + KeyEvent.VK_CAPS_LOCK, + KeyEvent.VK_ESCAPE, + KeyEvent.VK_SPACE, + KeyEvent.VK_PAGE_UP, + KeyEvent.VK_PAGE_DOWN, + KeyEvent.VK_END, + KeyEvent.VK_HOME, + KeyEvent.VK_LEFT, + KeyEvent.VK_UP, + KeyEvent.VK_RIGHT, + KeyEvent.VK_DOWN, + KeyEvent.VK_ADD, + KeyEvent.VK_SEPARATOR, + KeyEvent.VK_SUBTRACT, + KeyEvent.VK_DECIMAL, + KeyEvent.VK_DIVIDE, + KeyEvent.VK_DELETE, + KeyEvent.VK_NUM_LOCK, + KeyEvent.VK_SCROLL_LOCK, + + KeyEvent.VK_WINDOWS, + KeyEvent.VK_CONTEXT_MENU, + + KeyEvent.VK_F1, + KeyEvent.VK_F2, + KeyEvent.VK_F3, + KeyEvent.VK_F4, + KeyEvent.VK_F5, + KeyEvent.VK_F6, + KeyEvent.VK_F7, + KeyEvent.VK_F8, + KeyEvent.VK_F9, + KeyEvent.VK_F10, + KeyEvent.VK_F11, + KeyEvent.VK_F12, + KeyEvent.VK_F13, + KeyEvent.VK_F14, + KeyEvent.VK_F15, + KeyEvent.VK_F16, + KeyEvent.VK_F17, + KeyEvent.VK_F18, + KeyEvent.VK_F19, + KeyEvent.VK_F20, + KeyEvent.VK_F21, + KeyEvent.VK_F22, + KeyEvent.VK_F23, + KeyEvent.VK_F24, + + KeyEvent.VK_PRINTSCREEN, + KeyEvent.VK_INSERT, + KeyEvent.VK_HELP, + KeyEvent.VK_META, + KeyEvent.VK_BACK_QUOTE, + KeyEvent.VK_QUOTE, + + KeyEvent.VK_KP_UP, + KeyEvent.VK_KP_DOWN, + KeyEvent.VK_KP_LEFT, + KeyEvent.VK_KP_RIGHT, + + KeyEvent.VK_DEAD_GRAVE, + KeyEvent.VK_DEAD_ACUTE, + KeyEvent.VK_DEAD_CIRCUMFLEX, + KeyEvent.VK_DEAD_TILDE, + KeyEvent.VK_DEAD_MACRON, + KeyEvent.VK_DEAD_BREVE, + KeyEvent.VK_DEAD_ABOVEDOT, + KeyEvent.VK_DEAD_DIAERESIS, + KeyEvent.VK_DEAD_ABOVERING, + KeyEvent.VK_DEAD_DOUBLEACUTE, + KeyEvent.VK_DEAD_CARON, + KeyEvent.VK_DEAD_CEDILLA, + KeyEvent.VK_DEAD_OGONEK, + KeyEvent.VK_DEAD_IOTA, + KeyEvent.VK_DEAD_VOICED_SOUND, + KeyEvent.VK_DEAD_SEMIVOICED_SOUND, + + KeyEvent.VK_AMPERSAND, + KeyEvent.VK_ASTERISK, + KeyEvent.VK_QUOTEDBL, + KeyEvent.VK_LESS, + KeyEvent.VK_GREATER, + KeyEvent.VK_BRACELEFT, + KeyEvent.VK_BRACERIGHT, + KeyEvent.VK_AT, + KeyEvent.VK_COLON, + KeyEvent.VK_CIRCUMFLEX, + KeyEvent.VK_DOLLAR, + KeyEvent.VK_EURO_SIGN, + KeyEvent.VK_EXCLAMATION_MARK, + KeyEvent.VK_INVERTED_EXCLAMATION_MARK, + KeyEvent.VK_LEFT_PARENTHESIS, + KeyEvent.VK_NUMBER_SIGN, + KeyEvent.VK_MINUS, + KeyEvent.VK_PLUS, + KeyEvent.VK_RIGHT_PARENTHESIS, + KeyEvent.VK_UNDERSCORE, + + KeyEvent.VK_FINAL, + KeyEvent.VK_CONVERT, + KeyEvent.VK_NONCONVERT, + KeyEvent.VK_ACCEPT, + KeyEvent.VK_MODECHANGE, + KeyEvent.VK_KANA, + KeyEvent.VK_KANJI, + KeyEvent.VK_ALPHANUMERIC, + KeyEvent.VK_KATAKANA, + KeyEvent.VK_HIRAGANA, + KeyEvent.VK_FULL_WIDTH, + KeyEvent.VK_HALF_WIDTH, + KeyEvent.VK_ROMAN_CHARACTERS, + KeyEvent.VK_ALL_CANDIDATES, + KeyEvent.VK_PREVIOUS_CANDIDATE, + KeyEvent.VK_CODE_INPUT, + KeyEvent.VK_JAPANESE_KATAKANA, + KeyEvent.VK_JAPANESE_HIRAGANA, + KeyEvent.VK_JAPANESE_ROMAN, + KeyEvent.VK_KANA_LOCK, + KeyEvent.VK_INPUT_METHOD_ON_OFF, + + KeyEvent.VK_AGAIN, + KeyEvent.VK_UNDO, + KeyEvent.VK_COPY, + KeyEvent.VK_PASTE, + KeyEvent.VK_CUT, + KeyEvent.VK_FIND, + KeyEvent.VK_PROPS, + KeyEvent.VK_STOP, + + KeyEvent.VK_COMPOSE, + KeyEvent.VK_ALT_GRAPH, + KeyEvent.VK_BEGIN, + + KeyEvent.VK_NUMPAD0, + KeyEvent.VK_NUMPAD1, + KeyEvent.VK_NUMPAD2, + KeyEvent.VK_NUMPAD3, + KeyEvent.VK_NUMPAD4, + KeyEvent.VK_NUMPAD5, + KeyEvent.VK_NUMPAD6, + KeyEvent.VK_NUMPAD7, + KeyEvent.VK_NUMPAD8, + KeyEvent.VK_NUMPAD9 + }; + + public static void main(String[] args) throws Exception { + + System.err.println("**** Testing AWTKeyStrokes"); + for (int n_key=0; n_key < keys.length; n_key++) { + for (int n_mod=0; n_mod < modifiers.length; n_mod++) { + checkStroke(AWTKeyStroke.getAWTKeyStroke(keys[n_key], + modifiers[n_mod], + true)); + checkStroke(AWTKeyStroke.getAWTKeyStroke(keys[n_key], + modifiers[n_mod], + false)); + } + } + + System.err.println("**** Testing Swing KeyStrokes"); + for (int n_key=0; n_key < keys.length; n_key++) { + for (int n_mod=0; n_mod < modifiers.length; n_mod++) { + checkStroke(KeyStroke.getKeyStroke(keys[n_key], + modifiers[n_mod], + true)); + checkStroke(KeyStroke.getKeyStroke(keys[n_key], + modifiers[n_mod], + false)); + } + } + + Character a = Character.valueOf('a'); + System.err.println("**** Testing KEY_TYPED AWTKeyStrokes"); + for (int n_mod = 0; n_mod < modifiers.length; n_mod++) { + checkStroke(AWTKeyStroke.getAWTKeyStroke(a, modifiers[n_mod])); + } + System.err.println("**** Testing KEY_TYPED Swing KeyStrokes"); + for (int n_mod = 0; n_mod < modifiers.length; n_mod++) { + checkStroke(KeyStroke.getKeyStroke(a, modifiers[n_mod])); + } + + System.out.println("Test passed."); + } + + public static void checkStroke(AWTKeyStroke original) { + System.err.println("AWT Original >> " + original); + AWTKeyStroke copy = AWTKeyStroke.getAWTKeyStroke(original.toString()); + // System.err.println("AWT Copy >> " + copy); + if (!original.equals(copy)) { + System.out.println("AWT bad copy for VK= 0x" + + Integer.toString(original.getKeyCode(), 16)); + throw new RuntimeException("Test Failed: for " + original); + } + } + + public static void checkStroke(KeyStroke original) { + System.err.println("Swing Original >> " + original); + KeyStroke copy = KeyStroke.getKeyStroke(original.toString()); + // System.err.println("Swing Copy >> " + copy); + if (!original.equals(copy)) { + System.out.println("Swing bad copy for VK= 0x" + + Integer.toString(original.getKeyCode(), 16)); + throw new RuntimeException("Test Failed: for " + original); + } + } + +} diff --git a/test/jdk/java/awt/BorderLayout/NullConstraintsReturns.java b/test/jdk/java/awt/BorderLayout/NullConstraintsReturns.java new file mode 100644 index 00000000000..5559636470c --- /dev/null +++ b/test/jdk/java/awt/BorderLayout/NullConstraintsReturns.java @@ -0,0 +1,42 @@ +/* + * 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 + * 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 6242148 + @summary API method java.awt.BorderLayout.getConstraints(null) should return null +*/ + +import java.awt.BorderLayout; + +public class NullConstraintsReturns { + + public static void main(String[] args) { + BorderLayout bl = new BorderLayout(); + Object constraints = bl.getConstraints(null); + if (constraints != null) { + throw new RuntimeException("Test failed. Constraints is not null: " + constraints); + } + System.out.println("Test Passed."); + } +} diff --git a/test/jdk/java/awt/Button/ButtonNullLabelTest.java b/test/jdk/java/awt/Button/ButtonNullLabelTest.java new file mode 100644 index 00000000000..511512bc5de --- /dev/null +++ b/test/jdk/java/awt/Button/ButtonNullLabelTest.java @@ -0,0 +1,94 @@ +/* + * 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 + * 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 4245382 + @summary Tests that Button.setLabel(null) does not cause NPE in Java code or VM crash + @key headful +*/ + +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; + +public class ButtonNullLabelTest { + + public static void main(String args[]) throws Exception { + EventQueue.invokeAndWait(() -> runTest()); + } + + static void runTest() { + // Native code test + Frame frame = new Frame("Test null in native"); + Button button = new Button(); + try { + button.setLabel(null); + System.out.println("Set to null - test native"); + frame.add(button); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + System.out.println("Test null in native **successful**"); + } catch (NullPointerException npe) { + System.out.println("Test failed - test native"); + throw new RuntimeException("Test failed - test native"); + } finally { + frame.dispose(); + } + + // Peer code test + frame = new Frame("Test null in peer before show"); + button = new Button(); + try { + System.out.println("Set to null - test native before show"); + frame.add(button); + frame.pack(); + button.setLabel(null); + frame.setVisible(true); + System.out.println("Set null in peer before show **successful**"); + } catch (NullPointerException npe) { + System.out.println("Test failed - test peer before show"); + throw new RuntimeException("Test failed - test peer before show"); + } finally { + frame.dispose(); + } + + // Peer code test + frame = new Frame("Test null in peer after show"); + button = new Button(); + try { + System.out.println("Set to null - test peer after show"); + frame.add(button); + frame.pack(); + frame.setVisible(true); + button.setLabel(null); + System.out.println("Test null in peer after show **successful**"); + } catch (NullPointerException npe) { + System.out.println("Test failed - peer after show"); + throw new RuntimeException("Test failed - peer after show"); + } finally { + frame.dispose(); + } + } +} diff --git a/test/jdk/java/awt/Button/DisabledButtonPress.java b/test/jdk/java/awt/Button/DisabledButtonPress.java new file mode 100644 index 00000000000..aab1573bed8 --- /dev/null +++ b/test/jdk/java/awt/Button/DisabledButtonPress.java @@ -0,0 +1,117 @@ +/* + * 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 + * 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 5044469 + @summary REG: Disabled component gains focus and receives keyevents on win32 + @key headful +*/ + +import java.awt.AWTException; +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.KeyEvent; + +public class DisabledButtonPress implements ActionListener, FocusListener { + + public static void main(String[] args) throws Exception { + try { + DisabledButtonPress test = new DisabledButtonPress(); + EventQueue.invokeAndWait(() -> test.createUI()); + runTest(); + } finally { + if (f != null) { + f.dispose(); + } + } + if (!testPassed) { + throw new RuntimeException("Test Failed."); + } + } + + final static Object FOCUS_LOCK = new Object(); + final static Object ACTION_LOCK = new Object(); + static volatile Frame f; + static volatile Button b2; + static volatile boolean testPassed = true; + + public void createUI() { + f = new Frame("DisabledButtonPress"); + b2 = new Button("Click Me"); + b2.addActionListener(this); + b2.addFocusListener(this); + f.add(b2); + f.pack(); + f.setVisible(true); + } + + static void runTest() throws Exception { + + Robot robot = new Robot(); + robot.delay(500); + System.out.println("Requesting focus"); + System.out.println(" b2.requestFocusInWindow()="+ b2.requestFocusInWindow()); + b2.setEnabled(false); + synchronized(FOCUS_LOCK) { + FOCUS_LOCK.wait(3000); + } + if (!b2.isFocusOwner()) { + throw new RuntimeException("Test failed. Button doesn't have a focus."); + } + System.out.println("Button disabling"); + robot.delay(1000); + robot.keyPress(KeyEvent.VK_SPACE); + robot.delay(10); + robot.keyRelease(KeyEvent.VK_SPACE); + synchronized(ACTION_LOCK) { + ACTION_LOCK.wait(2000); //give time to handle + // ACTION_PERFORMED event from the Button if it was generated + } + } + + public void focusGained(FocusEvent ae) { + System.out.println("Button got focus"); + synchronized(FOCUS_LOCK) { + FOCUS_LOCK.notify(); + } + } + + public void focusLost(FocusEvent ae) {} + + public void actionPerformed(ActionEvent evt) { + System.out.println("Button: " + evt.getActionCommand() + " Clicked. Event is " +evt); + if (evt.getSource() == b2) { + testPassed = false; + synchronized(ACTION_LOCK) { + ACTION_LOCK.notify(); + } + } + } +} diff --git a/test/jdk/java/awt/Button/DoubleActionEventTest.java b/test/jdk/java/awt/Button/DoubleActionEventTest.java new file mode 100644 index 00000000000..97a5638d2f4 --- /dev/null +++ b/test/jdk/java/awt/Button/DoubleActionEventTest.java @@ -0,0 +1,112 @@ +/* + * 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. + */ + +/* + @test + @bug 4531849 + @summary Test that double action event no longer sent + @key headful +*/ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +public class DoubleActionEventTest implements ActionListener, WindowListener { + + static class Lock { + boolean go = false; + public synchronized boolean getGo() {return go;} + public synchronized void setGo(boolean newGo) {go = newGo;} + } + + static volatile Frame f; + static volatile int numActionEvents = 0; + static volatile Lock lock = new Lock(); + + public static void main(String[] args) throws Exception { + try { + DoubleActionEventTest test = new DoubleActionEventTest(); + EventQueue.invokeAndWait(() -> test.createUI()); + runTest(); + } finally { + if (f != null) { + f.dispose(); + } + } + } + + public void createUI() { + f = new Frame("DoubleActionEventTest"); + f.setLayout (new BorderLayout()); + f.addWindowListener(this); + Button b = new Button("Action Listening Button"); + b.addActionListener(this); + f.add(b); + f.setBounds(100, 100, 200, 200); + f.setVisible(true); + } + + static void runTest() throws Exception { + + Robot robot = new Robot(); + robot.setAutoDelay(250); + robot.setAutoWaitForIdle(true); + robot.mouseMove(200, 200); + + while (!lock.getGo()) {} + + robot.mousePress(InputEvent.BUTTON3_DOWN_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); + + if (numActionEvents != 1) { + System.out.println("Wrong number of ActionEvents. Test FAILS."); + throw new RuntimeException("TEST FAILS"); + } + } + + public void actionPerformed(ActionEvent e) { + numActionEvents++; + System.out.println("Number of ActionEvents: " + numActionEvents); + } + + public void windowActivated(WindowEvent e) { + lock.setGo(true); + } + public void windowClosed(WindowEvent e) {} + public void windowClosing(WindowEvent e) {} + public void windowDeactivated(WindowEvent e) {} + public void windowDeiconified(WindowEvent e) {} + public void windowIconified(WindowEvent e) {} + public void windowOpened(WindowEvent e) {} + +} From 27bfce04731166aeede86c6b6a61329cfdc4e8f7 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Fri, 10 Nov 2023 17:02:44 +0000 Subject: [PATCH 141/177] 8210265: Crash in HSpaceCounters::update_used() Guard call to update HSpaceCounters with flag Reviewed-by: phh Backport-of: a7d4df53fa70015e8efb689bf155ed870bc8e651 --- test/hotspot/jtreg/gc/TestNoPerfCounter.java | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/hotspot/jtreg/gc/TestNoPerfCounter.java diff --git a/test/hotspot/jtreg/gc/TestNoPerfCounter.java b/test/hotspot/jtreg/gc/TestNoPerfCounter.java new file mode 100644 index 00000000000..d5c214878b9 --- /dev/null +++ b/test/hotspot/jtreg/gc/TestNoPerfCounter.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test TestNoPerfCounter + * @bug 8210265 + * @requires vm.gc=="null" + * @library /test/lib / + * @summary Tests that disabling perf counters does not crash the VM + * @run main/othervm -XX:-UsePerfData TestNoPerfCounter + */ + +public class TestNoPerfCounter { + public static void main(String[] args) throws Exception { + // Nothing to do + } +} From 5d14b134c6577cc6f99919a374a0de35621b166c Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 13 Nov 2023 08:36:16 +0000 Subject: [PATCH 142/177] 8275333: Print count in "Too many recored phases?" assert Backport-of: 45ebf85ca9a1e071955ba2e3cb32449bfbd85d14 --- src/hotspot/share/gc/shared/gcTimer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/gcTimer.cpp b/src/hotspot/share/gc/shared/gcTimer.cpp index 229812a0a63..f722814433c 100644 --- a/src/hotspot/share/gc/shared/gcTimer.cpp +++ b/src/hotspot/share/gc/shared/gcTimer.cpp @@ -129,7 +129,7 @@ void TimePartitions::clear() { } void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type) { - assert(_phases->length() <= 1000, "Too many recored phases?"); + assert(_phases->length() <= 1000, "Too many recorded phases? (count: %d)", _phases->length()); int level = _active_phases.count(); From 4aa3196d4ee091b3d0d5a1ebf991610b978805f8 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 13 Nov 2023 08:38:34 +0000 Subject: [PATCH 143/177] 8258914: javax/net/ssl/DTLS/RespondToRetransmit.java timed out Backport-of: b575dd80b6e86821fcf3e065e31c6bddb85db6c4 --- test/jdk/javax/net/ssl/DTLS/RespondToRetransmit.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/net/ssl/DTLS/RespondToRetransmit.java b/test/jdk/javax/net/ssl/DTLS/RespondToRetransmit.java index ce10f53b07e..d61d4d9623e 100644 --- a/test/jdk/javax/net/ssl/DTLS/RespondToRetransmit.java +++ b/test/jdk/javax/net/ssl/DTLS/RespondToRetransmit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,8 @@ /* * @test - * @bug 8161086 + * @bug 8161086 8258914 + * @key intermittent * @summary DTLS handshaking fails if some messages were lost * @modules java.base/sun.security.util * @library /test/lib From 1b6ff86666517b2e9dcd0e4743fa79a0389d8c4c Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 13 Nov 2023 08:40:34 +0000 Subject: [PATCH 144/177] 8260035: Deproblemlist few problemlisted test Reviewed-by: lucy Backport-of: 7f7166dbc8822afaa39382cf9cb42be8458b0e4b --- test/jdk/ProblemList.txt | 2 - .../swing/JMenuItem/6249972/bug6249972.java | 85 ++++++++------- .../javax/swing/JTree/6263446/bug6263446.java | 100 ++++++++++-------- .../javax/swing/plaf/basic/Test6984643.java | 2 +- 4 files changed, 105 insertions(+), 84 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 8c83f666a5a..92f921ad043 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -704,7 +704,6 @@ javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all javax/swing/JTabbedPane/7024235/Test7024235.java 8028281 macosx-all javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all -javax/swing/plaf/basic/Test6984643.java 8198340 windows-all javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all @@ -724,7 +723,6 @@ javax/swing/DataTransfer/8059739/bug8059739.java 8199074 generic-all javax/swing/JTabbedPane/TabProb.java 8236635 linux-all javax/swing/text/GlyphPainter2/6427244/bug6427244.java 8208566 macosx-all javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all -javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all javax/swing/JButton/8151303/PressedIconTest.java 8266246 macosx-aarch64 javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all diff --git a/test/jdk/javax/swing/JMenuItem/6249972/bug6249972.java b/test/jdk/javax/swing/JMenuItem/6249972/bug6249972.java index 7a02490efa9..1e351be38f9 100644 --- a/test/jdk/javax/swing/JMenuItem/6249972/bug6249972.java +++ b/test/jdk/javax/swing/JMenuItem/6249972/bug6249972.java @@ -26,8 +26,6 @@ * @key headful * @bug 6249972 * @summary Tests that JMenuItem(String,int) handles lower-case mnemonics properly. - * @library ../../../../lib/testlibrary - * @build ExtendedRobot * @author Mikhail Lapshin * @run main bug6249972 */ @@ -36,61 +34,76 @@ import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; +import java.awt.event.InputEvent; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Robot; public class bug6249972 implements ActionListener { - - private JFrame frame; + private static JFrame frame; + private static Robot robot; private JMenu menu; private volatile boolean testPassed = false; + private volatile Point p = null; + private volatile Dimension size = null; public static void main(String[] args) throws Exception { - bug6249972 bugTest = new bug6249972(); - bugTest.test(); + try { + robot = new Robot(); + robot.setAutoDelay(100); + bug6249972 bugTest = new bug6249972(); + robot.waitForIdle(); + robot.delay(1000); + bugTest.test(); + } finally { + if (frame != null) { + SwingUtilities.invokeAndWait(() -> frame.dispose()); + } + } } public bug6249972() throws Exception { - SwingUtilities.invokeAndWait( - new Runnable() { - public void run() { - frame = new JFrame("bug6249972"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - JMenuBar bar = new JMenuBar(); - frame.setJMenuBar(bar); - - menu = new JMenu("Problem"); - bar.add(menu); - - JMenuItem item = new JMenuItem("JMenuItem(String,'z')", 'z'); - item.addActionListener(bug6249972.this); - menu.add(item); - - frame.setLocationRelativeTo(null); - frame.pack(); - frame.setVisible(true); - } - } - ); + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame("bug6249972"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JMenuBar bar = new JMenuBar(); + frame.setJMenuBar(bar); + + menu = new JMenu("Problem"); + bar.add(menu); + + JMenuItem item = new JMenuItem("JMenuItem(String,'z')", 'z'); + item.addActionListener(bug6249972.this); + menu.add(item); + + frame.setLocationRelativeTo(null); + frame.pack(); + frame.setVisible(true); + }); } private void test() throws Exception { - ExtendedRobot robot = new ExtendedRobot(); - robot.waitForIdle(); - java.awt.Point p = menu.getLocationOnScreen(); - java.awt.Dimension size = menu.getSize(); + SwingUtilities.invokeAndWait(() -> { + p = menu.getLocationOnScreen(); + size = menu.getSize(); + }); p.x += size.width / 2; p.y += size.height / 2; robot.mouseMove(p.x, p.y); - robot.click(); - robot.delay(100); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); - robot.type(KeyEvent.VK_Z); + robot.delay(100); + robot.keyPress(KeyEvent.VK_Z); + robot.keyRelease(KeyEvent.VK_Z); robot.waitForIdle(); - frame.dispose(); // Try to stop the event dispatch thread + robot.delay(1000); if (!testPassed) { throw new RuntimeException("JMenuItem(String,int) does not handle " + diff --git a/test/jdk/javax/swing/JTree/6263446/bug6263446.java b/test/jdk/javax/swing/JTree/6263446/bug6263446.java index 7094971e383..86b6ee3b59c 100644 --- a/test/jdk/javax/swing/JTree/6263446/bug6263446.java +++ b/test/jdk/javax/swing/JTree/6263446/bug6263446.java @@ -43,83 +43,92 @@ public class bug6263446 { private static final String ALL = FIRST + " " + SECOND; private static JTree tree; private static Robot robot; + private static JFrame frame; public static void main(String[] args) throws Exception { robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); SwingUtilities.invokeAndWait(new Runnable() { - + @Override public void run() { createAndShowGUI(); } }); robot.waitForIdle(); + robot.delay(1000); - Point point = getClickPoint(); - robot.mouseMove(point.x, point.y); + try { + Point point = getClickPoint(); + robot.mouseMove(point.x, point.y); - // click count 3 - click(1); - assertNotEditing(); + // click count 3 + click(1); + assertNotEditing(); - click(2); - assertNotEditing(); + click(2); + assertNotEditing(); - click(3); - assertEditing(); - cancelCellEditing(); - assertNotEditing(); + click(3); + assertEditing(); + cancelCellEditing(); + assertNotEditing(); - click(4); - checkSelectedText(FIRST); + click(4); + checkSelectedText(FIRST); - click(5); - checkSelectedText(ALL); + click(5); + checkSelectedText(ALL); - // click count 4 - setClickCountToStart(4); + // click count 4 + setClickCountToStart(4); - click(1); - assertNotEditing(); + click(1); + assertNotEditing(); - click(2); - assertNotEditing(); + click(2); + assertNotEditing(); - click(3); - assertNotEditing(); + click(3); + assertNotEditing(); - click(4); - assertEditing(); - cancelCellEditing(); - assertNotEditing(); + click(4); + assertEditing(); + cancelCellEditing(); + assertNotEditing(); - click(5); - checkSelectedText(FIRST); + click(5); + checkSelectedText(FIRST); - click(6); - checkSelectedText(ALL); + click(6); + checkSelectedText(ALL); - // start path editing - startPathEditing(); - assertEditing(); + // start path editing + startPathEditing(); + assertEditing(); - click(1); - checkSelection(null); + click(1); + checkSelection(null); - click(2); - checkSelection(FIRST); + click(2); + checkSelection(FIRST); - click(3); - checkSelection(ALL); + click(3); + checkSelection(ALL); + } finally { + if (frame != null) { + SwingUtilities.invokeAndWait(() -> frame.dispose()); + } + } } private static void click(int times) { robot.delay(500); for (int i = 0; i < times; i++) { - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); } } @@ -148,7 +157,7 @@ private static TreeModel createTreeModel() { private static void createAndShowGUI() { - JFrame frame = new JFrame(); + frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); tree = new JTree(createTreeModel()); @@ -158,6 +167,7 @@ private static void createAndShowGUI() { frame.getContentPane().add(tree); frame.pack(); + frame.setLocationRelativeTo(null); frame.setVisible(true); } diff --git a/test/jdk/javax/swing/plaf/basic/Test6984643.java b/test/jdk/javax/swing/plaf/basic/Test6984643.java index 57df156026a..1ab879c212e 100644 --- a/test/jdk/javax/swing/plaf/basic/Test6984643.java +++ b/test/jdk/javax/swing/plaf/basic/Test6984643.java @@ -55,7 +55,7 @@ public boolean isSupportedLookAndFeel() { } }); - SwingUtilities.invokeLater(new Runnable() { + SwingUtilities.invokeAndWait(new Runnable() { public void run() { new JFileChooser(); } From 5a7b227193a4b71697675611031781156ae30f72 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 13 Nov 2023 08:42:55 +0000 Subject: [PATCH 145/177] 8168408: Test java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java fails intermittentently on windows 8265678: Test java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java fails intermittentently on windows Backport-of: 45c474a04c61e65c9a8a305598ea9b34a0513fa7 --- test/jdk/ProblemList.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 92f921ad043..21e92d97058 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -116,7 +116,6 @@ java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.java 8168389 windows-all,macosx-all java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java 8224055 macosx-all -java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8168408 windows-all,macosx-all java/awt/Focus/FocusOwnerFrameOnClick/FocusOwnerFrameOnClick.java 8081489 generic-all java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java 6849364 generic-all java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 generic-all From 046b213712ea32b17a289c546c9719a99bb2ff6c Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Fri, 17 Nov 2023 14:50:38 +0000 Subject: [PATCH 146/177] 8268916: Tests for AffirmTrust roots Reviewed-by: phh, sgehwolf Backport-of: 8c1bb2b28066ee32bef22110df06318d938c7d8b --- .../certification/CAInterop.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index 5ff31ae922d..e298ecefa2a 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -352,6 +352,46 @@ * @run main/othervm -Djava.security.debug=certpath CAInterop certignarootca CRL */ +/* + * @test id=affirmtrustcommercialca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Commercial CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustcommercialca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustcommercialca CRL + */ + +/* + * @test id=affirmtrustnetworkingca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Networking CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustnetworkingca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustnetworkingca CRL + */ + +/* + * @test id=affirmtrustpremiumca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Premium CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumca CRL + */ + +/* + * @test id=affirmtrustpremiumeccca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Premium ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumeccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumeccca CRL + */ + /* * @test id=teliarootcav2 * @bug 8317373 @@ -493,6 +533,20 @@ private CATestURLs getTestURLs(String alias) { return new CATestURLs("https://juolukka.cover.telia.fi:10600", "https://juolukka.cover.telia.fi:10601"); + // These are listed at https://www.affirmtrust.com/resources/ + case "affirmtrustcommercialca": + return new CATestURLs("https://validcommercial.affirmtrust.com", + "https://revokedcommercial.affirmtrust.com"); + case "affirmtrustnetworkingca": + return new CATestURLs("https://validnetworking.affirmtrust.com", + "https://revokednetworking.affirmtrust.com"); + case "affirmtrustpremiumca": + return new CATestURLs("https://validpremium.affirmtrust.com", + "https://revokedpremium.affirmtrust.com"); + case "affirmtrustpremiumeccca": + return new CATestURLs("https://validpremiumecc.affirmtrust.com", + "https://revokedpremiumecc.affirmtrust.com"); + default: throw new RuntimeException("No test setup found for: " + alias); } } From 45e3cbf6ede6d29b47868de354a3878a718ebe10 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 20 Nov 2023 10:45:17 +0000 Subject: [PATCH 147/177] 8294427: Check boxes and radio buttons have rendering issues on Windows in High DPI env Reviewed-by: lucy Backport-of: a63afa4aa62863d1a199a0fb7d2f56ff8fcd04fd --- .../classes/sun/swing/CachedPainter.java | 7 +- .../sun/java/swing/plaf/windows/TMSchema.java | 15 ++- .../sun/java/swing/plaf/windows/XPStyle.java | 57 ++++++-- .../classes/sun/awt/windows/ThemeReader.java | 126 ++++++++++++------ .../native/libawt/windows/ThemeReader.cpp | 53 +++----- 5 files changed, 161 insertions(+), 97 deletions(-) diff --git a/src/java.desktop/share/classes/sun/swing/CachedPainter.java b/src/java.desktop/share/classes/sun/swing/CachedPainter.java index 49d0bd63467..9bc10efb83e 100644 --- a/src/java.desktop/share/classes/sun/swing/CachedPainter.java +++ b/src/java.desktop/share/classes/sun/swing/CachedPainter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2017, 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 @@ -314,8 +314,9 @@ public int getHeight(ImageObserver observer) { @Override public Image getResolutionVariant(double destWidth, double destHeight) { - int w = (int) Math.ceil(destWidth); - int h = (int) Math.ceil(destHeight); + int w = (int) Math.floor(destWidth + 0.5); + int h = (int) Math.floor(destHeight + 0.5); + return getImage(PainterMultiResolutionCachedImage.class, c, baseWidth, baseHeight, w, h, args); } diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java index f45a077e91d..342ee913255 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, 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 @@ -40,10 +40,13 @@ package com.sun.java.swing.plaf.windows; -import java.awt.*; -import java.util.*; - -import javax.swing.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Point; +import java.util.EnumMap; +import javax.swing.JComponent; import sun.awt.windows.ThemeReader; @@ -55,7 +58,7 @@ * * @author Leif Samuelsson */ -class TMSchema { +public final class TMSchema { /** * An enumeration of the various Windows controls (also known as diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java index 2c60209186f..314e29b6897 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, 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 @@ -40,14 +40,41 @@ package com.sun.java.swing.plaf.windows; -import java.awt.*; -import java.awt.image.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; +import java.awt.image.WritableRaster; import java.security.AccessController; -import java.util.*; - -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.plaf.*; +import java.util.HashMap; + +import javax.swing.AbstractButton; +import javax.swing.CellRendererPane; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JRadioButton; +import javax.swing.JToolBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.AbstractBorder; +import javax.swing.border.Border; +import javax.swing.border.EmptyBorder; +import javax.swing.border.LineBorder; +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.InsetsUIResource; +import javax.swing.plaf.UIResource; import javax.swing.text.JTextComponent; import sun.awt.image.SunWritableRaster; @@ -55,8 +82,10 @@ import sun.security.action.GetPropertyAction; import sun.swing.CachedPainter; -import static com.sun.java.swing.plaf.windows.TMSchema.*; - +import static com.sun.java.swing.plaf.windows.TMSchema.Part; +import static com.sun.java.swing.plaf.windows.TMSchema.Prop; +import static com.sun.java.swing.plaf.windows.TMSchema.State; +import static com.sun.java.swing.plaf.windows.TMSchema.TypeEnum; /** * Implements Windows XP Styles for the Windows Look and Feel. @@ -675,6 +704,11 @@ protected void paintToImage(Component c, Image image, Graphics g, w = bi.getWidth(); h = bi.getHeight(); + // Get DPI to pass further to ThemeReader.paintBackground() + Graphics2D g2d = (Graphics2D) g; + AffineTransform at = g2d.getTransform(); + int dpi = (int)(at.getScaleX() * 96); + WritableRaster raster = bi.getRaster(); DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer(); // Note that stealData() requires a markDirty() afterwards @@ -682,7 +716,8 @@ protected void paintToImage(Component c, Image image, Graphics g, ThemeReader.paintBackground(SunWritableRaster.stealData(dbi, 0), part.getControlName(c), part.getValue(), State.getValue(part, state), - 0, 0, w, h, w); + 0, 0, w, h, w, dpi); + SunWritableRaster.markDirty(dbi); } diff --git a/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java b/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java index 167d4d5b910..3652bbdcaa7 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java @@ -30,11 +30,14 @@ import java.awt.Insets; import java.awt.Point; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import static com.sun.java.swing.plaf.windows.TMSchema.Part; + /* !!!! WARNING !!!! * This class has to be in sync with * src/solaris/classes/sun/awt/windows/ThemeReader.java @@ -51,7 +54,24 @@ */ public final class ThemeReader { - private static final Map widgetToTheme = new HashMap<>(); + private static final int defaultDPI = 96; + + /** + * List of widgets for which we need to get the part size for the current DPI. + */ + private static final List partSizeWidgets = + List.of("MENU", "BUTTON"); + + /** + * List of widget parts for which we need to get the part size for the current DPI. + */ + private static final List partSizeWidgetParts = + List.of(Part.BP_RADIOBUTTON.getValue(), + Part.BP_CHECKBOX.getValue(), + Part.MP_POPUPCHECK.getValue()); + + private static final Map> dpiAwareWidgetToTheme + = new HashMap<>(); // lock for the cache // reading should be done with readLock @@ -87,28 +107,30 @@ public static boolean isXPStyleEnabled() { return xpStyleEnabled; } + private static Long openThemeImpl(String widget, int dpi) { + Long theme; + int i = widget.indexOf("::"); + if (i > 0) { + // We're using the syntax "subAppName::controlName" here, as used by msstyles. + // See documentation for SetWindowTheme on MSDN. + setWindowTheme(widget.substring(0, i)); + theme = openTheme(widget.substring(i + 2), dpi); + setWindowTheme(null); + } else { + theme = openTheme(widget, dpi); + } + return theme; + } + // this should be called only with writeLock held - private static Long getThemeImpl(String widget) { - Long theme = widgetToTheme.get(widget); - if (theme == null) { - int i = widget.indexOf("::"); - if (i > 0) { - // We're using the syntax "subAppName::controlName" here, as used by msstyles. - // See documentation for SetWindowTheme on MSDN. - setWindowTheme(widget.substring(0, i)); - theme = openTheme(widget.substring(i+2)); - setWindowTheme(null); - } else { - theme = openTheme(widget); - } - widgetToTheme.put(widget, theme); - } - return theme; + private static Long getThemeImpl(String widget, int dpi) { + return dpiAwareWidgetToTheme.computeIfAbsent(dpi, key -> new HashMap<>()) + .computeIfAbsent(widget, w -> openThemeImpl(widget, dpi)); } // returns theme value // this method should be invoked with readLock locked - private static Long getTheme(String widget) { + private static Long getTheme(String widget, int dpi) { if (!isThemed) { throw new IllegalStateException("Themes are not loaded"); } @@ -118,10 +140,12 @@ private static Long getTheme(String widget) { try { if (!valid) { // Close old themes. - for (Long value : widgetToTheme.values()) { - closeTheme(value); + for (Map dpiVal : dpiAwareWidgetToTheme.values()) { + for (Long value : dpiVal.values()) { + closeTheme(value); + } } - widgetToTheme.clear(); + dpiAwareWidgetToTheme.clear(); valid = true; } } finally { @@ -130,13 +154,20 @@ private static Long getTheme(String widget) { } } + Long theme = null; + + Map widgetToTheme = dpiAwareWidgetToTheme.get(dpi); + + if (widgetToTheme != null) { + theme = widgetToTheme.get(widget); + } + // mostly copied from the javadoc for ReentrantReadWriteLock - Long theme = widgetToTheme.get(widget); if (theme == null) { readLock.unlock(); writeLock.lock(); try { - theme = getThemeImpl(widget); + theme = getThemeImpl(widget, dpi); } finally { readLock.lock(); writeLock.unlock();// Unlock write, still hold read @@ -146,14 +177,23 @@ private static Long getTheme(String widget) { } private static native void paintBackground(int[] buffer, long theme, - int part, int state, int x, - int y, int w, int h, int stride); + int part, int state, + int rectRight, int rectBottom, + int w, int h, int stride); public static void paintBackground(int[] buffer, String widget, - int part, int state, int x, int y, int w, int h, int stride) { + int part, int state, int x, int y, int w, int h, int stride, int dpi) { readLock.lock(); try { - paintBackground(buffer, getTheme(widget), part, state, x, y, w, h, stride); + /* For widgets and parts in the lists, we get the part size + for the current screen DPI to scale them better. */ + Dimension d = (partSizeWidgets.contains(widget) + && partSizeWidgetParts.contains(Integer.valueOf(part))) + ? getPartSize(getTheme(widget, dpi), part, state) + : new Dimension(w, h); + + paintBackground(buffer, getTheme(widget, dpi), part, state, + d.width, d.height, w, h, stride); } finally { readLock.unlock(); } @@ -165,7 +205,7 @@ private static native Insets getThemeMargins(long theme, int part, public static Insets getThemeMargins(String widget, int part, int state, int marginType) { readLock.lock(); try { - return getThemeMargins(getTheme(widget), part, state, marginType); + return getThemeMargins(getTheme(widget, defaultDPI), part, state, marginType); } finally { readLock.unlock(); } @@ -176,7 +216,7 @@ public static Insets getThemeMargins(String widget, int part, int state, int mar public static boolean isThemePartDefined(String widget, int part, int state) { readLock.lock(); try { - return isThemePartDefined(getTheme(widget), part, state); + return isThemePartDefined(getTheme(widget, defaultDPI), part, state); } finally { readLock.unlock(); } @@ -188,7 +228,7 @@ private static native Color getColor(long theme, int part, int state, public static Color getColor(String widget, int part, int state, int property) { readLock.lock(); try { - return getColor(getTheme(widget), part, state, property); + return getColor(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -200,7 +240,7 @@ private static native int getInt(long theme, int part, int state, public static int getInt(String widget, int part, int state, int property) { readLock.lock(); try { - return getInt(getTheme(widget), part, state, property); + return getInt(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -212,7 +252,7 @@ private static native int getEnum(long theme, int part, int state, public static int getEnum(String widget, int part, int state, int property) { readLock.lock(); try { - return getEnum(getTheme(widget), part, state, property); + return getEnum(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -225,7 +265,7 @@ public static boolean getBoolean(String widget, int part, int state, int property) { readLock.lock(); try { - return getBoolean(getTheme(widget), part, state, property); + return getBoolean(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -236,7 +276,7 @@ public static boolean getBoolean(String widget, int part, int state, public static boolean getSysBoolean(String widget, int property) { readLock.lock(); try { - return getSysBoolean(getTheme(widget), property); + return getSysBoolean(getTheme(widget, defaultDPI), property); } finally { readLock.unlock(); } @@ -248,7 +288,7 @@ private static native Point getPoint(long theme, int part, int state, public static Point getPoint(String widget, int part, int state, int property) { readLock.lock(); try { - return getPoint(getTheme(widget), part, state, property); + return getPoint(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -261,7 +301,7 @@ public static Dimension getPosition(String widget, int part, int state, int property) { readLock.lock(); try { - return getPosition(getTheme(widget), part,state,property); + return getPosition(getTheme(widget, defaultDPI), part,state,property); } finally { readLock.unlock(); } @@ -273,13 +313,13 @@ private static native Dimension getPartSize(long theme, int part, public static Dimension getPartSize(String widget, int part, int state) { readLock.lock(); try { - return getPartSize(getTheme(widget), part, state); + return getPartSize(getTheme(widget, defaultDPI), part, state); } finally { readLock.unlock(); } } - private static native long openTheme(String widget); + private static native long openTheme(String widget, int dpi); private static native void closeTheme(long theme); @@ -292,8 +332,9 @@ public static long getThemeTransitionDuration(String widget, int part, int stateFrom, int stateTo, int propId) { readLock.lock(); try { - return getThemeTransitionDuration(getTheme(widget), - part, stateFrom, stateTo, propId); + return getThemeTransitionDuration(getTheme(widget, defaultDPI), + part, stateFrom, stateTo, + propId); } finally { readLock.unlock(); } @@ -308,8 +349,9 @@ public static Insets getThemeBackgroundContentMargins(String widget, int part, int state, int boundingWidth, int boundingHeight) { readLock.lock(); try { - return getThemeBackgroundContentMargins(getTheme(widget), - part, state, boundingWidth, boundingHeight); + return getThemeBackgroundContentMargins(getTheme(widget, defaultDPI), + part, state, + boundingWidth, boundingHeight); } finally { readLock.unlock(); } diff --git a/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp b/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp index e05bd4f4db9..a1b9e0ddacc 100644 --- a/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp +++ b/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp @@ -90,7 +90,7 @@ typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme); typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); -typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); +typedef HTHEME(__stdcall *PFNOPENTHEMEDATAFORDPI)(HWND hwnd, LPCWSTR pszClassList, UINT dpi); typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, @@ -134,7 +134,7 @@ typedef HRESULT (__stdcall *PFNGETTHEMETRANSITIONDURATION) (HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration); -static PFNOPENTHEMEDATA OpenThemeData = NULL; +static PFNOPENTHEMEDATAFORDPI OpenThemeDataForDpiFunc = NULL; static PFNDRAWTHEMEBACKGROUND DrawThemeBackground = NULL; static PFNCLOSETHEMEDATA CloseThemeData = NULL; static PFNDRAWTHEMETEXT DrawThemeText = NULL; @@ -161,8 +161,8 @@ BOOL InitThemes() { DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes); if(hModThemes) { DTRACE_PRINTLN("Loaded UxTheme.dll\n"); - OpenThemeData = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes, - "OpenThemeData"); + OpenThemeDataForDpiFunc = (PFNOPENTHEMEDATAFORDPI)GetProcAddress( + hModThemes, "OpenThemeDataForDpi"); DrawThemeBackground = (PFNDRAWTHEMEBACKGROUND)GetProcAddress( hModThemes, "DrawThemeBackground"); CloseThemeData = (PFNCLOSETHEMEDATA)GetProcAddress( @@ -198,7 +198,7 @@ BOOL InitThemes() { (PFNGETTHEMETRANSITIONDURATION)GetProcAddress(hModThemes, "GetThemeTransitionDuration"); - if(OpenThemeData + if(OpenThemeDataForDpiFunc && DrawThemeBackground && CloseThemeData && DrawThemeText @@ -216,9 +216,12 @@ BOOL InitThemes() { && IsThemeBackgroundPartiallyTransparent ) { DTRACE_PRINTLN("Loaded function pointers.\n"); - // We need to make sure we can load the Theme. This may not be - // the case on a WinXP machine with classic mode enabled. - HTHEME hTheme = OpenThemeData(AwtToolkit::GetInstance().GetHWnd(), L"Button"); + // We need to make sure we can load the Theme. + // Use the default DPI value of 96 on windows. + constexpr unsigned int defaultDPI = 96; + HTHEME hTheme = OpenThemeDataForDpiFunc ( + AwtToolkit::GetInstance().GetHWnd(), + L"Button", defaultDPI); if(hTheme) { DTRACE_PRINTLN("Loaded Theme data.\n"); CloseThemeData(hTheme); @@ -275,7 +278,7 @@ static void assert_result(HRESULT hres, JNIEnv *env) { * Signature: (Ljava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_sun_awt_windows_ThemeReader_openTheme -(JNIEnv *env, jclass klass, jstring widget) { +(JNIEnv *env, jclass klass, jstring widget, jint dpi) { LPCTSTR str = (LPCTSTR) JNU_GetStringPlatformChars(env, widget, NULL); if (str == NULL) { @@ -284,7 +287,9 @@ JNIEXPORT jlong JNICALL Java_sun_awt_windows_ThemeReader_openTheme } // We need to open the Theme on a Window that will stick around. // The best one for that purpose is the Toolkit window. - HTHEME htheme = OpenThemeData(AwtToolkit::GetInstance().GetHWnd(), str); + HTHEME htheme = OpenThemeDataForDpiFunc( + AwtToolkit::GetInstance().GetHWnd(), + str, dpi); JNU_ReleaseStringPlatformChars(env, widget, str); return (jlong) htheme; } @@ -417,7 +422,7 @@ static void copyDIBToBufferedImage(int *pDstBits, int *pSrcBits, */ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground (JNIEnv *env, jclass klass, jintArray array, jlong theme, jint part, jint state, - jint x, jint y, jint w, jint h, jint stride) { + jint rectRight, jint rectBottom, jint w, jint h, jint stride) { int *pDstBits=NULL; int *pSrcBits=NULL; @@ -463,8 +468,8 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground rect.left = 0; rect.top = 0; - rect.bottom = h; - rect.right = w; + rect.bottom = rectBottom; + rect.right = rectRight; ZeroMemory(pSrcBits,(BITS_PER_PIXEL>>3)*w*h); @@ -753,27 +758,6 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPosition return NULL; } -void rescale(SIZE *size) { - static int dpiX = -1; - static int dpiY = -1; - if (dpiX == -1 || dpiY == -1) { - HWND hWnd = ::GetDesktopWindow(); - HDC hDC = ::GetDC(hWnd); - dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX); - dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY); - ::ReleaseDC(hWnd, hDC); - } - - if (dpiX !=0 && dpiX != 96) { - float invScaleX = 96.0f / dpiX; - size->cx = ROUND_TO_INT(size->cx * invScaleX); - } - if (dpiY != 0 && dpiY != 96) { - float invScaleY = 96.0f / dpiY; - size->cy = ROUND_TO_INT(size->cy * invScaleY); - } -} - /* * Class: sun_awt_windows_ThemeReader * Method: getPartSize @@ -800,7 +784,6 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPartSize CHECK_NULL_RETURN(dimMID, NULL); } - rescale(&size); jobject dimObj = env->NewObject(dimClassID, dimMID, size.cx, size.cy); if (safe_ExceptionOccurred(env)) { env->ExceptionDescribe(); From 10ddd51b43aabb2724010cfbc65753baa5acfbc4 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 20 Nov 2023 10:47:42 +0000 Subject: [PATCH 148/177] 8275329: ZGC: vmTestbase/gc/gctests/SoftReference/soft004/soft004.java fails with assert(_phases->length() <= 1000) failed: Too many recored phases? Backport-of: 6b833db3f9cace8fbb09bb803ba31208e37a4622 --- src/hotspot/share/gc/shared/gcTimer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/gcTimer.cpp b/src/hotspot/share/gc/shared/gcTimer.cpp index f722814433c..ceef6982260 100644 --- a/src/hotspot/share/gc/shared/gcTimer.cpp +++ b/src/hotspot/share/gc/shared/gcTimer.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/shared/gcTimer.hpp" +#include "gc/shared/gc_globals.hpp" #include "utilities/growableArray.hpp" // the "time" parameter for most functions @@ -129,7 +130,7 @@ void TimePartitions::clear() { } void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type) { - assert(_phases->length() <= 1000, "Too many recorded phases? (count: %d)", _phases->length()); + assert(UseZGC || _phases->length() <= 1000, "Too many recorded phases? (count: %d)", _phases->length()); int level = _active_phases.count(); From 78141024c23efab479b9e3cac851198299166155 Mon Sep 17 00:00:00 2001 From: Pushkar Kulkarni Date: Mon, 20 Nov 2023 14:50:23 +0000 Subject: [PATCH 149/177] 8244508: JFR: FlightRecorderOptions reset date format Reviewed-by: clanger Backport-of: f3519016c7766934d0aa3014b1a0593d91a0556c --- src/hotspot/share/jfr/dcmd/jfrDcmds.cpp | 6 ++- src/hotspot/share/jfr/dcmd/jfrDcmds.hpp | 4 ++ .../jfr/recorder/service/jfrOptionSet.cpp | 1 + .../jdk/jfr/internal/dcmd/DCmdConfigure.java | 41 ++++++++++++++----- .../startupargs/TestOptionsWithLocale.java | 40 ++++++++++++++++++ 5 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp index 4aa5c56f3bb..024b5b57063 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp @@ -556,7 +556,8 @@ JfrConfigureFlightRecorderDCmd::JfrConfigureFlightRecorderDCmd(outputStream* out _thread_buffer_size("thread_buffer_size", "Size of a thread buffer", "MEMORY SIZE", false, "8k"), _memory_size("memorysize", "Overall memory size, ", "MEMORY SIZE", false, "10m"), _max_chunk_size("maxchunksize", "Size of an individual disk chunk", "MEMORY SIZE", false, "12m"), - _sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true") { + _sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true"), + _verbose(true) { _dcmdparser.add_dcmd_option(&_repository_path); _dcmdparser.add_dcmd_option(&_dump_path); _dcmdparser.add_dcmd_option(&_stack_depth); @@ -643,7 +644,7 @@ void JfrConfigureFlightRecorderDCmd::execute(DCmdSource source, TRAPS) { static const char klass[] = "jdk/jfr/internal/dcmd/DCmdConfigure"; static const char method[] = "execute"; - static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;" + static const char signature[] = "(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/Integer;" "Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;" "Ljava/lang/Long;Ljava/lang/Boolean;)Ljava/lang/String;"; @@ -651,6 +652,7 @@ void JfrConfigureFlightRecorderDCmd::execute(DCmdSource source, TRAPS) { execute_args.set_receiver(h_dcmd_instance); // params + execute_args.push_int(_verbose ? 1 : 0); execute_args.push_jobject(repository_path); execute_args.push_jobject(dump_path); execute_args.push_jobject(stack_depth); diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp index 15d8091a792..7468f7c5180 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp @@ -150,9 +150,13 @@ class JfrConfigureFlightRecorderDCmd : public DCmdWithParser { DCmdArgument _memory_size; DCmdArgument _max_chunk_size; DCmdArgument _sample_threads; + bool _verbose; public: JfrConfigureFlightRecorderDCmd(outputStream* output, bool heap); + void set_verbose(bool verbose) { + _verbose = verbose; + } static const char* name() { return "JFR.configure"; } diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp index 74d1be1aad9..364718f9e63 100644 --- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp +++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp @@ -366,6 +366,7 @@ bool JfrOptionSet::configure(TRAPS) { configure._sample_threads.set_is_set(_dcmd_sample_threads.is_set()); configure._sample_threads.set_value(_dcmd_sample_threads.value()); + configure.set_verbose(false); configure.execute(DCmd_Source_Internal, THREAD); if (HAS_PENDING_EXCEPTION) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java index f15053a7caa..f2625aa6c5b 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java @@ -59,6 +59,7 @@ final class DCmdConfigure extends AbstractDCmd { */ public String execute ( + boolean verbose, String repositoryPath, String dumpPath, Integer stackDepth, @@ -92,66 +93,86 @@ final class DCmdConfigure extends AbstractDCmd { } catch (Exception e) { throw new DCmdException("Could not use " + repositoryPath + " as repository. " + e.getMessage(), e); } - printRepositoryPath(); + if (verbose) { + printRepositoryPath(); + } updated = true; } if (dumpPath != null) { Options.setDumpPath(new SafePath(dumpPath)); Logger.log(LogTag.JFR, LogLevel.INFO, "Emergency dump path set to " + dumpPath); - printDumpPath(); + if (verbose) { + printDumpPath(); + } updated = true; } if (stackDepth != null) { Options.setStackDepth(stackDepth); Logger.log(LogTag.JFR, LogLevel.INFO, "Stack depth set to " + stackDepth); - printStackDepth(); + if (verbose) { + printStackDepth(); + } updated = true; } if (globalBufferCount != null) { Options.setGlobalBufferCount(globalBufferCount); Logger.log(LogTag.JFR, LogLevel.INFO, "Global buffer count set to " + globalBufferCount); - printGlobalBufferCount(); + if (verbose) { + printGlobalBufferCount(); + } updated = true; } if (globalBufferSize != null) { Options.setGlobalBufferSize(globalBufferSize); Logger.log(LogTag.JFR, LogLevel.INFO, "Global buffer size set to " + globalBufferSize); - printGlobalBufferSize(); + if (verbose) { + printGlobalBufferSize(); + } updated = true; } if (threadBufferSize != null) { Options.setThreadBufferSize(threadBufferSize); Logger.log(LogTag.JFR, LogLevel.INFO, "Thread buffer size set to " + threadBufferSize); - printThreadBufferSize(); + if (verbose) { + printThreadBufferSize(); + } updated = true; } if (memorySize != null) { Options.setMemorySize(memorySize); Logger.log(LogTag.JFR, LogLevel.INFO, "Memory size set to " + memorySize); - printMemorySize(); + if (verbose) { + printMemorySize(); + } updated = true; } if (maxChunkSize != null) { Options.setMaxChunkSize(maxChunkSize); Logger.log(LogTag.JFR, LogLevel.INFO, "Max chunk size set to " + maxChunkSize); - printMaxChunkSize(); + if (verbose) { + printMaxChunkSize(); + } updated = true; } if (sampleThreads != null) { Options.setSampleThreads(sampleThreads); Logger.log(LogTag.JFR, LogLevel.INFO, "Sample threads set to " + sampleThreads); - printSampleThreads(); + if (verbose) { + printSampleThreads(); + } updated = true; } - + if (!verbose) { + return ""; + } if (!updated) { println("Current configuration:"); println(); diff --git a/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java b/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java new file mode 100644 index 00000000000..1d1a79040f3 --- /dev/null +++ b/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java @@ -0,0 +1,40 @@ +package jdk.jfr.startupargs; + +import java.io.IOException; +import java.text.DateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/** + * @test + * @summary Checks that locale is respected when using -XX:FlightRecorderOptions + * See JDK-8244508 + * @key jfr + * @requires vm.hasJFR + * @modules jdk.jfr + * @library /test/lib + * @run main jdk.jfr.startupargs.TestOptionsWithLocale + */ +public class TestOptionsWithLocale { + + public static class PrintDate { + public static void main(String... args) { + GregorianCalendar date = new GregorianCalendar(2020, Calendar.JANUARY, 1); + DateFormat formatter = DateFormat.getDateTimeInstance(); + System.out.println(formatter.format(date.getTime())); + } + } + + public static void main(String... args) throws IOException { + ProcessBuilder pb = ProcessTools.createTestJvm( + "-Duser.country=DE", + "-Duser.language=de", + "-XX:FlightRecorderOptions:stackdepth=128", + PrintDate.class.getName()); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("01.01.2020, 00:00:00"); + } +} From f2488a31e002af3e0a7a866c91cbdd28be2d9a1f Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 21 Nov 2023 14:45:09 +0000 Subject: [PATCH 150/177] 8317374: Add Let's Encrypt ISRG Root X2 Reviewed-by: goetz Backport-of: e6f46a43268808d0cbbb3bb93c73aa8e4cbfad83 --- make/data/cacerts/letsencryptisrgx2 | 21 +++++++++++++++++++ .../certification/CAInterop.java | 14 ++++++++++++- .../security/lib/cacerts/VerifyCACerts.java | 8 ++++--- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 make/data/cacerts/letsencryptisrgx2 diff --git a/make/data/cacerts/letsencryptisrgx2 b/make/data/cacerts/letsencryptisrgx2 new file mode 100644 index 00000000000..455822e13a8 --- /dev/null +++ b/make/data/cacerts/letsencryptisrgx2 @@ -0,0 +1,21 @@ +Owner: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Issuer: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Serial number: 41d29dd172eaeea780c12c6ce92f8752 +Valid from: Fri Sep 04 00:00:00 GMT 2020 until: Mon Sep 17 16:00:00 GMT 2040 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw +CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg +R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00 +MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT +ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw +EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW ++1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9 +ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI +zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW +tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1 +/q4AaOeMSQ+2b1tbFfLn +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index e298ecefa2a..ed917d08cad 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -136,12 +136,21 @@ /* * @test id=letsencryptisrgx1 * @bug 8189131 - * @summary Interoperability tests with Let's Encrypt CA + * @summary Interoperability tests with Let's Encrypt ISRG Root X1 CA * @library /test/lib * @build jtreg.SkippedException ValidatePathWithURL CAInterop * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT */ +/* + * @test id=letsencryptisrgx2 + * @bug 8317374 + * @summary Interoperability tests with Let's Encrypt ISRG Root X2 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx2 DEFAULT + */ + /* * @test id=globalsignrootcar6 * @bug 8216577 @@ -455,6 +464,9 @@ private CATestURLs getTestURLs(String alias) { case "letsencryptisrgx1": return new CATestURLs("https://valid-isrgrootx1.letsencrypt.org", "https://revoked-isrgrootx1.letsencrypt.org"); + case "letsencryptisrgx2": + return new CATestURLs("https://valid-isrgrootx2.letsencrypt.org", + "https://revoked-isrgrootx2.letsencrypt.org"); case "globalsignrootcar6": return new CATestURLs("https://valid.r6.roots.globalsign.com", diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index 277ead3a972..fece9aa4025 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 8317373 + * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +47,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 98; + private static final int COUNT = 99; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "63:A7:1F:4F:8E:4B:A1:04:DE:BB:EC:2E:31:35:5B:5A:19:D4:B1:C0:59:62:B1:13:65:C3:AE:C7:DB:78:9A:1E"; + = "DA:61:45:1C:93:F3:6A:30:24:68:C6:72:BC:C5:E6:E4:E3:BA:6A:AE:36:29:7B:45:53:B7:10:53:52:7D:7E:A5"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") private static final Map FINGERPRINT_MAP = new HashMap<>() { @@ -143,6 +143,8 @@ public class VerifyCACerts { "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE"); put("letsencryptisrgx1 [jdk]", "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6"); + put("letsencryptisrgx2 [jdk]", + "69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70"); put("luxtrustglobalrootca [jdk]", "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50"); put("quovadisrootca [jdk]", From fac59555ceabdadd095452f02413926657e85654 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 22 Nov 2023 11:45:28 +0000 Subject: [PATCH 151/177] 8238740: java/net/httpclient/whitebox/FlowTestDriver.java should not specify a TLS protocol Backport-of: edaf548beb1fc991a918983467abc5894e22216f --- .../whitebox/java.net.http/jdk/internal/net/http/FlowTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java index e34a75229e1..bc7a5046f50 100644 --- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java +++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java @@ -90,7 +90,6 @@ public FlowTest() throws IOException { SSLEngine engineClient = ctx.createSSLEngine(); SSLParameters params = ctx.getSupportedSSLParameters(); params.setApplicationProtocols(new String[]{"proto1", "proto2"}); // server will choose proto2 - params.setProtocols(new String[]{"TLSv1.2"}); // TODO: This is essential. Needs to be protocol impl engineClient.setSSLParameters(params); engineClient.setUseClientMode(true); completion = new CompletableFuture<>(); From 250d7a8ad9a7582b4cd9d33a9695be2bf6f88831 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 22 Nov 2023 11:47:40 +0000 Subject: [PATCH 152/177] 8214694: cleanup rawtypes warnings in open jndi tests Backport-of: aba017fa70011d7fa14de07d4c9db1932eeff0f9 --- test/jdk/com/sun/jndi/dns/CheckAccess.java | 4 ++-- .../sun/jndi/dns/EnvTests/AddInherited.java | 6 +++--- .../jdk/com/sun/jndi/dns/EnvTests/GetEnv.java | 6 +++--- .../jndi/dns/EnvTests/RemoveInherited.java | 6 +++--- .../sun/jndi/dns/EnvTests/SubcontextAdd.java | 6 +++--- .../jndi/dns/EnvTests/SubcontextRemove.java | 6 +++--- .../jndi/dns/FactoryTests/TestDnsObject.java | 4 ++-- .../sun/jndi/dns/FedTests/ListFedBase.java | 6 +++--- .../com/sun/jndi/dns/FedTests/ListNns.java | 5 +++-- .../jndi/dns/FedTests/ListSubInterior.java | 5 +++-- .../sun/jndi/dns/FedTests/ListSubLeaf.java | 5 +++-- .../ListBindingsInteriorNotFound.java | 5 +++-- .../ListTests/ListBindingsLeafNotFound.java | 5 +++-- .../dns/ListTests/ListInteriorNotFound.java | 5 +++-- .../jndi/dns/ListTests/ListLeafNotFound.java | 5 +++-- .../sun/jndi/ldap/BalancedParentheses.java | 10 +++++----- test/jdk/com/sun/jndi/ldap/Base64Test.java | 4 ++-- .../sun/jndi/ldap/DeadSSLLdapTimeoutTest.java | 16 +++++++-------- .../com/sun/jndi/ldap/InvalidLdapFilters.java | 4 ++-- .../jndi/ldap/LdapName/EmptyNameSearch.java | 6 +++--- .../com/sun/jndi/ldap/NoWaitForReplyTest.java | 6 +++--- .../jndi/ldap/blits/AddTests/AddNewEntry.java | 5 +++-- .../javax/naming/InitialContext/EnvClone.java | 6 +++--- .../ldap/LdapName/CompareToEqualsTests.java | 6 +++--- .../ldap/LdapName/LdapNameConstruction.java | 6 +++--- .../javax/naming/ldap/LdapName/NameTests.java | 20 +++++++++---------- .../spi/DirectoryManager/DummyContext.java | 8 ++++---- .../spi/DirectoryManager/GetContDirCtx.java | 6 +++--- .../javax/naming/spi/DummyContextFactory.java | 6 +++--- .../naming/spi/DummyContextFactory2.java | 6 +++--- 30 files changed, 101 insertions(+), 93 deletions(-) diff --git a/test/jdk/com/sun/jndi/dns/CheckAccess.java b/test/jdk/com/sun/jndi/dns/CheckAccess.java index 723ee28a983..7207e069db7 100644 --- a/test/jdk/com/sun/jndi/dns/CheckAccess.java +++ b/test/jdk/com/sun/jndi/dns/CheckAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class CheckAccess { public static final void main(String[] args) throws Exception { try { - Class clazz = Class.forName("com.sun.jndi.dns.DnsContext"); + Class clazz = Class.forName("com.sun.jndi.dns.DnsContext"); Field field = clazz.getField("debug"); if (Modifier.isPublic(field.getModifiers())) { throw new Exception( diff --git a/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java b/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java index add79388b0a..bdac5930d1c 100644 --- a/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java +++ b/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -55,8 +55,8 @@ public static void main(String[] args) throws Exception { Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); diff --git a/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java b/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java index 07a40a065d9..8a035894a42 100644 --- a/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java +++ b/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -53,8 +53,8 @@ public static void main(String[] args) throws Exception { Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); diff --git a/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java b/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java index 94221cdd082..52d8d79278a 100644 --- a/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java +++ b/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -67,8 +67,8 @@ public static void main(String[] args) throws Exception { Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); diff --git a/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java b/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java index 3d597c9c98e..0f8ffd6158b 100644 --- a/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java +++ b/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -57,8 +57,8 @@ public static void main(String[] args) throws Exception { addToEnvAndVerifyOldValIsNull(child, "some.irrelevant.property", "somevalue"); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); diff --git a/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java b/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java index 25189c3c23f..920062c826c 100644 --- a/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java +++ b/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -62,8 +62,8 @@ public static void main(String[] args) throws Exception { + val); } - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); diff --git a/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java b/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java index c6212f5b3ab..34a142c7122 100644 --- a/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java +++ b/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,7 +31,7 @@ public class TestDnsObject { public TestDnsObject(Attribute attr) { StringBuilder buf = new StringBuilder(); try { - NamingEnumeration enumObj = attr.getAll(); + NamingEnumeration enumObj = attr.getAll(); while (enumObj.hasMore()) { buf.append(enumObj.next()); } diff --git a/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java b/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java index 4e302fe8ac7..ff5a5c99e9f 100644 --- a/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java +++ b/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ public ListFedBase() { * @param expectedCount given expected count * @throws NamingException */ - public void verifyNamingEnumeration(NamingEnumeration enumObj, + public void verifyNamingEnumeration(NamingEnumeration enumObj, int expectedCount) throws NamingException { DNSTestUtils.debug("Enum is: " + enumObj); @@ -54,7 +54,7 @@ public void verifyNamingEnumeration(NamingEnumeration enumObj, Binding res; while (enumObj.hasMore()) { - res = (Binding) enumObj.next(); + res = enumObj.next(); DNSTestUtils.debug(res); ++count; } diff --git a/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java b/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java index da1d5ec324a..e5743c11791 100644 --- a/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java +++ b/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.Binding; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -52,7 +53,7 @@ public void runTest() throws Exception { env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } diff --git a/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java b/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java index 16c5a7e9e1b..246f16c1283 100644 --- a/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java +++ b/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.Binding; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -54,7 +55,7 @@ public void runTest() throws Exception { env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } diff --git a/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java b/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java index e3d2beb3c15..2a8962b425a 100644 --- a/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java +++ b/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.Binding; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -54,7 +55,7 @@ public void runTest() throws Exception { env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b/c"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b/c"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } diff --git a/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java b/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java index c591f65b851..cf360ab03fb 100644 --- a/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java +++ b/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.Binding; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception { @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey()); + NamingEnumeration enumObj = context().listBindings(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); diff --git a/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java b/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java index 111d16972d1..b890849163b 100644 --- a/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java +++ b/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.Binding; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception { @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey()); + NamingEnumeration enumObj = context().listBindings(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); diff --git a/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java b/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java index 12f8889dca9..2e18c4529dd 100644 --- a/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java +++ b/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.NameClassPair; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception { @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().list(getKey()); + NamingEnumeration enumObj = context().list(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); diff --git a/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java b/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java index 747973d5423..51c76ae5a1a 100644 --- a/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java +++ b/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,6 +21,7 @@ * questions. */ +import javax.naming.NameClassPair; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.directory.InitialDirContext; @@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception { @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().list(getKey()); + NamingEnumeration enumObj = context().list(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); diff --git a/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java b/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java index 774440aee90..2b62888f75a 100644 --- a/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java +++ b/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ void doClientSide() throws Exception { } // set up the environment for creating the initial context - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:" + serverPort); @@ -121,7 +121,7 @@ void doClientSide() throws Exception { scs.setSearchScope(SearchControls.SUBTREE_SCOPE); try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", "(&(cn=Bob)))", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. @@ -132,7 +132,7 @@ void doClientSide() throws Exception { } try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", ")(&(cn=Bob)", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. @@ -143,7 +143,7 @@ void doClientSide() throws Exception { } try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", "(&(cn=Bob))", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. diff --git a/test/jdk/com/sun/jndi/ldap/Base64Test.java b/test/jdk/com/sun/jndi/ldap/Base64Test.java index f31f32e2d7e..b6c47414b82 100644 --- a/test/jdk/com/sun/jndi/ldap/Base64Test.java +++ b/test/jdk/com/sun/jndi/ldap/Base64Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,7 +180,7 @@ private static void deserialize(byte[] bytes) throws Exception { * in an LDAP directory. */ private static void storeObjectInLDAP() { - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.REFERRAL, "follow"); // omit an LDAP control env.put("java.naming.ldap.version", "3"); // omit LDAP bind operation env.put("com.sun.jndi.ldap.trace.ber", System.err); // dump protocol diff --git a/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java b/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java index fc0da2050d9..ea056f25237 100644 --- a/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java +++ b/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -52,14 +52,14 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; -class DeadServerTimeoutSSLTest implements Callable { +class DeadServerTimeoutSSLTest implements Callable { - Hashtable env; + Hashtable env; DeadSSLServer server; boolean passed = false; private int HANGING_TEST_TIMEOUT = 20_000; - public DeadServerTimeoutSSLTest(Hashtable env) throws IOException { + public DeadServerTimeoutSSLTest(Hashtable env) throws IOException { this.server = new DeadSSLServer(); this.env = env; } @@ -106,7 +106,7 @@ boolean shutItDown(InitialContext ctx) { public Boolean call() { InitialContext ctx = null; - ScheduledFuture killer = null; + ScheduledFuture killer = null; long start = System.nanoTime(); try { @@ -174,8 +174,8 @@ public void close() throws IOException { public class DeadSSLLdapTimeoutTest { - static Hashtable createEnv() { - Hashtable env = new Hashtable(11); + static Hashtable createEnv() { + Hashtable env = new Hashtable<>(11); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); return env; @@ -194,7 +194,7 @@ public static void main(String[] args) throws Exception { // this should exit with a SocketTimeoutException as the root cause // it should also use the connect timeout instead of the read timeout System.out.println("Running connect timeout test with 10ms connect timeout, 3000ms read timeout & SSL"); - Hashtable sslenv = createEnv(); + Hashtable sslenv = createEnv(); sslenv.put("com.sun.jndi.ldap.connect.timeout", "10"); sslenv.put("com.sun.jndi.ldap.read.timeout", "3000"); sslenv.put(Context.SECURITY_PROTOCOL, "ssl"); diff --git a/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java b/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java index e846964819c..925bb17e5bb 100644 --- a/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java +++ b/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -192,7 +192,7 @@ void doClientSide() throws Exception { scs.setSearchScope(SearchControls.SUBTREE_SCOPE); try { - NamingEnumeration answer = + NamingEnumeration answer = context.search("o=sun,c=us", searchFilter, scs); } catch (InvalidSearchFilterException isfe) { if (filterIsValid) { diff --git a/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java b/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java index 41062a5158e..57097c79199 100644 --- a/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java +++ b/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -70,7 +70,7 @@ protected void handleRequest(Socket socket, LdapMessage request, Thread.sleep(3000); // Setup JNDI parameters - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, URIBuilder.newBuilder() @@ -86,7 +86,7 @@ protected void handleRequest(Socket socket, LdapMessage request, DirContext ctx = new InitialDirContext(env); System.out.println("Client: performing search..."); - ctx.search(new LdapName(Collections.EMPTY_LIST), "cn=*", null); + ctx.search(new LdapName(Collections.emptyList()), "cn=*", null); ctx.close(); // Exit diff --git a/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java b/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java index e6d304eeed6..5b3359feadc 100644 --- a/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java +++ b/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -43,7 +43,7 @@ public static void main(String[] args) throws Exception { var ldapServer = new BaseLdapServer().start(); // Set up the environment for creating the initial context - Hashtable env = new Hashtable(11); + Hashtable env = new Hashtable<>(11); env.put(Context.PROVIDER_URL, URIBuilder.newBuilder() .scheme("ldap") .loopback() @@ -71,7 +71,7 @@ public static void main(String[] args) throws Exception { SearchControls scl = new SearchControls(); scl.setSearchScope(SearchControls.SUBTREE_SCOPE); System.out.println("Client: performing search"); - NamingEnumeration answer = + NamingEnumeration answer = ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl); // Server will never reply: either we waited in the call above until diff --git a/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java b/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java index 7c56fd8eb61..92528677453 100644 --- a/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java +++ b/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; import javax.naming.directory.SearchControls; +import javax.naming.directory.SearchResult; import java.net.ServerSocket; import java.util.Hashtable; @@ -99,7 +100,7 @@ public static void main(String[] args) throws Exception { SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.OBJECT_SCOPE); - NamingEnumeration results = ctx + NamingEnumeration results = ctx .search(entryDN, "(objectclass=*)", constraints); int found = LDAPTestUtils.checkResult(results, expect); diff --git a/test/jdk/javax/naming/InitialContext/EnvClone.java b/test/jdk/javax/naming/InitialContext/EnvClone.java index 46b4b7944dd..6037d007a68 100644 --- a/test/jdk/javax/naming/InitialContext/EnvClone.java +++ b/test/jdk/javax/naming/InitialContext/EnvClone.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -34,7 +34,7 @@ public class EnvClone extends InitialContext { - EnvClone(Hashtable env) throws NamingException{ + EnvClone(Hashtable env) throws NamingException{ super(env); } @@ -44,7 +44,7 @@ public class EnvClone extends InitialContext { public static void main(String[] args) throws Exception { - Hashtable env = new Hashtable(5); + Hashtable env = new Hashtable<>(5); EnvClone ctx = new EnvClone(env); if (env == ctx.myProps) { diff --git a/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java b/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java index af6c9fcae9c..268439297b5 100644 --- a/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java +++ b/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,12 +74,12 @@ public static void main(String args[]) byte[] value = "abcxyz".getBytes(); Rdn rdn1 = new Rdn("binary", value); - ArrayList rdns1 = new ArrayList(); + ArrayList rdns1 = new ArrayList<>(); rdns1.add(rdn1); LdapName l1 = new LdapName(rdns1); Rdn rdn2 = new Rdn("binary", value); - ArrayList rdns2 = new ArrayList(); + ArrayList rdns2 = new ArrayList<>(); rdns2.add(rdn2); LdapName l2 = new LdapName(rdns2); checkResults(l1, l2, 0); diff --git a/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java b/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java index 2d5d96f5d8a..fa18ae3e5f7 100644 --- a/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java +++ b/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ public static void main(String args[]) /** * LdapName creation tests */ - List rdns = new ArrayList(); + List rdns = new ArrayList<>(); rdns.add(new Rdn("o=Food")); rdns.add(new Rdn("ou=Fruits")); rdns.add(rdn3); @@ -82,7 +82,7 @@ public static void main(String args[]) } System.out.println("ldapname1 and ldapname2 are equal"); - LdapName name = new LdapName(new ArrayList()); + LdapName name = new LdapName(new ArrayList<>()); System.out.println("Empty ldapname:" + name); } } diff --git a/test/jdk/javax/naming/ldap/LdapName/NameTests.java b/test/jdk/javax/naming/ldap/LdapName/NameTests.java index aa448a23b42..e493ce1ebb0 100644 --- a/test/jdk/javax/naming/ldap/LdapName/NameTests.java +++ b/test/jdk/javax/naming/ldap/LdapName/NameTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,25 +42,25 @@ public static void main(String args[]) throws Exception { String[] rdnStr = new String[] {"one=voilet"}; - ArrayList rdnList = new ArrayList(); + ArrayList rdnList = new ArrayList<>(); for (int i = 0; i < rdnStr.length; i++) { rdnList.add(i, new Rdn(rdnStr[i])); } LdapName dn = new LdapName(rdnList); - Collection rdns = dn.getRdns(); + Collection rdns = dn.getRdns(); System.out.println("size is :" + dn.size()); System.out.println("isEmpty :" + dn.isEmpty()); System.out.println("************Printing as Rdns*********"); - Iterator iter = rdns.iterator(); + Iterator iter = rdns.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } System.out.println(); System.out.println("************Printing the Enumeration*********"); - Enumeration dnEnum = dn.getAll(); + Enumeration dnEnum = dn.getAll(); while (dnEnum.hasMoreElements()) { System.out.println(dnEnum.nextElement()); } @@ -70,7 +70,7 @@ public static void main(String args[]) throws Exception { LdapName nameSuffix = new LdapName("two=Indigo"); System.out.println("addAll():" + dn.addAll(nameSuffix)); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new Rdn("five=Yellow")); System.out.println("Rdn- addAll():" + dn.addAll(list)); @@ -79,7 +79,7 @@ public static void main(String args[]) throws Exception { System.out.println("addAll at pos = 2"); System.out.println("addAll():" + dn.addAll(2, nameSuffix)); - list = new ArrayList(); + list = new ArrayList<>(); list.add(new Rdn("four=Green")); System.out.println(); System.out.println("addAll at pos = 3"); @@ -146,12 +146,12 @@ public static void main(String args[]) throws Exception { rdnStr[0] + "): " + dn.startsWith( new CompositeName(rdnStr[0]))); - java.util.List prefixList = (dn.getRdns()).subList(0, size /2); + List prefixList = (dn.getRdns()).subList(0, size /2); System.out.println("Rdn - startsWith(" + prefixList + "):" + dn.startsWith(prefixList)); System.out.println("Rdn - startsWith() - empty RDN list:" + - dn.startsWith(new ArrayList())); + dn.startsWith(new ArrayList<>())); System.out.println(); System.out.println("endsWith(" + rdnStr[0] + "):" + @@ -167,7 +167,7 @@ public static void main(String args[]) throws Exception { dn.endsWith(prefixList)); System.out.println("Rdn - endsWith() empty RDN list:" + - dn.endsWith(new ArrayList())); + dn.endsWith(new ArrayList<>())); // test clone System.out.println(); diff --git a/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java b/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java index fc81fe64587..a43134a21bf 100644 --- a/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java +++ b/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,13 +31,13 @@ public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() throws NamingException { + public Hashtable getEnvironment() throws NamingException { return env; } } diff --git a/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java b/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java index 508f96716f1..1f40e09755e 100644 --- a/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java +++ b/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -39,7 +39,7 @@ public class GetContDirCtx { public static void main(String[] args) throws Exception { CannotProceedException cpe = new CannotProceedException(); - Hashtable env = new Hashtable(1); + Hashtable env = new Hashtable<>(1); cpe.setEnvironment(env); Reference ref = new Reference("java.lang.Object", @@ -52,7 +52,7 @@ public static void main(String[] args) throws Exception { } catch (CannotProceedException e) { } - Hashtable contEnv = contCtx.getEnvironment(); + Hashtable contEnv = contCtx.getEnvironment(); if (contEnv.get(NamingManager.CPE) != cpe) { throw new Exception("Test failed: CPE property not set" + " in the continuation context"); diff --git a/test/jdk/javax/naming/spi/DummyContextFactory.java b/test/jdk/javax/naming/spi/DummyContextFactory.java index e526a765cac..0b7cc3bb86d 100644 --- a/test/jdk/javax/naming/spi/DummyContextFactory.java +++ b/test/jdk/javax/naming/spi/DummyContextFactory.java @@ -126,13 +126,13 @@ public Context getInitialContext(Hashtable environment) throws NamingExcep public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() { + public Hashtable getEnvironment() { return env; } } diff --git a/test/jdk/javax/naming/spi/DummyContextFactory2.java b/test/jdk/javax/naming/spi/DummyContextFactory2.java index 350f64760ad..b9eef460586 100644 --- a/test/jdk/javax/naming/spi/DummyContextFactory2.java +++ b/test/jdk/javax/naming/spi/DummyContextFactory2.java @@ -42,13 +42,13 @@ public Context getInitialContext(Hashtable environment) throws NamingExcep public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() { + public Hashtable getEnvironment() { return env; } } From fca62cfa5007591220965506e213f3ae07851c07 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 23 Nov 2023 10:13:28 +0000 Subject: [PATCH 153/177] 8289077: Add manual tests to open Reviewed-by: goetz Backport-of: 787e16bb444ee3b63803f5d1701d0f0a68b5d474 --- .../ALTTABIconBeingErased.java | 116 ++++++++ .../IconChangingTest/IconChangingTest.java | 209 +++++++++++++ .../awt/Icon/IconChangingTest/java-icon16.png | Bin 0 -> 3512 bytes .../Icon/IconShowingTest/IconShowingTest.java | 279 ++++++++++++++++++ .../awt/Icon/IconShowingTest/java-icon16.png | Bin 0 -> 3512 bytes .../IconTransparencyTest.java | 250 ++++++++++++++++ .../SetLargeIconTest/SetLargeIconTest.java | 88 ++++++ 7 files changed, 942 insertions(+) create mode 100644 test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java create mode 100644 test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java create mode 100644 test/jdk/java/awt/Icon/IconChangingTest/java-icon16.png create mode 100644 test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java create mode 100644 test/jdk/java/awt/Icon/IconShowingTest/java-icon16.png create mode 100644 test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java create mode 100644 test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java diff --git a/test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java b/test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java new file mode 100644 index 00000000000..bf109495a87 --- /dev/null +++ b/test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * 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.Button; +import java.awt.Color; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.lang.reflect.InvocationTargetException; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 6435804 + * @summary REGRESSION: NetBeans 5.0 icon no longer shows up when you alt-tab on XP + * @key headful + * @requires (os.family != "mac") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ALTTABIconBeingErased + */ + +public class ALTTABIconBeingErased { + + private static final String INSTRUCTIONS = + "This test verifies that the Frame's icon is not corrupted after showing\n" + + "and disposing owned dialog\n" + + "You would see a button in a Frame.\n" + + "1) The frame should have icon with 2 black and 2 white squares.\n" + + "2) Verify that icon appearing on ALT-TAB is also a\n" + + "light icon.\n" + + "3) Now open a child by pressing on \"Open Child\" button.\n" + + "Child Dialog should appear. It should have the same icon as frame.\n" + + "4) Now close the dialog by pressing Space or clicking on a button in it.\n" + + "Dialog should be disposed now.\n" + + "5) Verify that icon on ALT-TAB is the same as before"; + + private static Frame frame; + private static final int SIZE = 300; + + private static void updateIconImage() { + BufferedImage image = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_INT_ARGB); + + Graphics gr = image.createGraphics(); + gr.setColor(Color.WHITE); + gr.fillRect(0, 0, SIZE, SIZE); + + gr.setColor(Color.BLACK); + gr.fillRect(0, 0, SIZE / 2, SIZE / 2); + gr.fillRect(SIZE / 2, SIZE / 2, SIZE, SIZE); + + frame.setIconImage(image); + } + + private static void createAndShowGUI(){ + frame = new Frame(); + Button setImageButton5 = new Button("Open Child"); + updateIconImage(); + + setImageButton5.addActionListener(event -> { + try { + final Dialog d1 = new Dialog(frame, true); + d1.setSize(100, 100); + Button ok = new Button("OK"); + ok.addActionListener(e -> { + d1.setVisible(false); + d1.dispose(); + }); + d1.add(ok); + d1.setLocation(frame.getX(), frame.getY() + 70); + d1.setVisible(true); + } catch (Exception e) { + throw new RuntimeException("Test failed because of" + + " exception" + e + ". Press Fail."); + } + }); + + frame.add(setImageButton5, BorderLayout.CENTER); + frame.setSize(200,65); + + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, + PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame passFailJFrame = new PassFailJFrame("Large Icon " + + "Test Instructions", INSTRUCTIONS, 5, 12, 50); + SwingUtilities.invokeAndWait(ALTTABIconBeingErased::createAndShowGUI); + passFailJFrame.awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java b/test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java new file mode 100644 index 00000000000..16a8bf13b1f --- /dev/null +++ b/test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * 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.Dialog; +import java.awt.Frame; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.image.BufferedImage; +import java.lang.reflect.InvocationTargetException; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +import static java.awt.image.BufferedImage.TYPE_INT_ARGB; +import static jdk.test.lib.Platform.isWindows; + +/* + * @test + * @bug 6415057 + * @summary Tests if toplevel's icons are updated in runtime + * @key headful + * @requires (os.family == "windows") + * @modules java.desktop/sun.awt + * @library /java/awt/regtesthelpers /test/lib + * @build PassFailJFrame jdk.test.lib.Platform + * @run main/manual IconChangingTest + */ + +public class IconChangingTest { + private static final int ICON_SIZE = 16; + private static final int MARGIN = 2; + private static final int STACK_SIZE = 4; + // Number of windows per stack + private static final int WIN_PER_STACK = 4; + private static int windowPosX = 0; + + private static final int EXTRA_OFFSET = 50; + + private static ImageIcon ii1; + private static ImageIcon ii2; + private static ImageIcon ji; + + private static final Window[][] windowStack = new Window[STACK_SIZE][WIN_PER_STACK]; + private static final JLabel[][] labels = new JLabel[STACK_SIZE][WIN_PER_STACK]; + private static final boolean[][] isResizable = new boolean[][]{ + {true, true, false, true}, //stack 1 + {true, false, true, false}, //stack 2 + {true, false, true, true}, //stack 3 + {false, true, false, false} //stack 4 + }; + + private static final String INSTRUCTIONS = + "The test is supposed to work on Windows.\n"+ + "It may not work on other platforms.\n"+ + " \n"+ + "Icons and window decorations should change in windows\n"+ + "(frames & dialogs) every 3 seconds.\n"+ + " \n"+ + "Notes:\n"+ + " \n"+ + " * Icons might appear in grayscale.\n"+ + " * Default icon might be either Duke or Java Cup.\n"+ + " \n"+ + "Press PASS if the icons match the labels\n"+ + "and are shown correctly, FAIL otherwise.\n" + ; + + public static void main(String[] args) throws Exception { + PassFailJFrame passFailJFrame = new PassFailJFrame("Icon Changing " + + "Test Instructions", INSTRUCTIONS, 5, 18, 40); + SwingUtilities.invokeAndWait(() -> { + try { + createAndShowGUI(); + } catch (Exception e) { + throw new RuntimeException("Error while running the test", e); + } + }); + passFailJFrame.awaitAndCheck(); + } + + private static void createAndShowGUI() throws InterruptedException, + InvocationTargetException { + PassFailJFrame.positionTestWindow(null, + PassFailJFrame.Position.TOP_LEFT_CORNER); + Rectangle bounds = PassFailJFrame.getInstructionFrameBounds(); + windowPosX = bounds.x + bounds.width; + + ii1 = new ImageIcon(generateIcon(Color.RED)); + ii2 = new ImageIcon(generateIcon(Color.BLUE)); + ji = new ImageIcon(IconChangingTest.class.getResource("java-icon16.png")); + + // Creates STACK_SIZE different combinations of window stacks, + // each stack contains WIN_PER_STACK windows (frame/dialog). + for (int i = 0; i < STACK_SIZE; i++) { + for (int j = 0; j < WIN_PER_STACK; j++) { + createWindow(i, j); + } + } + + Thread thread = new Thread(new Runnable() { + private final ImageIcon[][] icons = { + {null, ii1}, + {ii2, null}, + {ii1, ii2} + }; + + @Override + public void run() { + int index = 0; + while (true) { + try { + setIcons(icons[index][0], icons[index][1]); + Thread.sleep(4000); + if (++index >= icons.length) { + index = 0; + } + } catch (InterruptedException e) { + break; + } + } + } + + private void setIcons(final ImageIcon icon1, final ImageIcon icon2) { + Image i1 = (icon1 == null) ? null : icon1.getImage(); + Image i2 = (icon2 == null) ? null : icon2.getImage(); + ImageIcon li1 = (icon1 == null) ? ji : icon1; + ImageIcon li2 = (icon2 == null) ? li1 : icon2; + + ImageIcon[][] iconList = new ImageIcon[][]{ + {li1, li1, ((i2 == null && isWindows()) ? null : li2), li2}, + {li1, (isWindows()) ? null : li1, li2, (isWindows()) ? null : li2}, + {li1, (isWindows()) ? null : li1, li2, li2}, + {li1, li1, (i2 == null && isWindows()) ? null : li2, (isWindows()) ? null : li2}, + }; + + for (int i = 0; i < STACK_SIZE; i++) { + windowStack[i][0].setIconImage(i1); + windowStack[i][2].setIconImage(i2); + for (int j = 0; j < WIN_PER_STACK; j++) { + labels[i][j].setIcon(iconList[i][j]); + } + } + } + }); + thread.start(); + } + + private static void createWindow(int i, int j) { + boolean isFrame = (i == 0 && j == 0) || (i == 1 && j == 0); + String title = (isFrame ? "Frame ": "Dialog ") + (i+1) + "." + (j+1); + + windowStack[i][j] = isFrame + ? createFrame(title, i, j) + : createDialog(title, i, j); + + labels[i][j]= new JLabel(title); + windowStack[i][j].add(labels[i][j]); + windowStack[i][j].setBounds(windowPosX + (i * 200), (j * 100) + EXTRA_OFFSET, + 200, 100); + windowStack[i][j].toFront(); + windowStack[i][j].setVisible(true); + + PassFailJFrame.addTestWindow(windowStack[i][j]); + } + + private static Frame createFrame(String title, int i, int j) { + Frame frame = new Frame(title); + frame.setResizable(isResizable[i][j]); + return frame; + } + + private static Dialog createDialog(String title, int i, int j) { + Dialog dialog = new Dialog((j == 0 ? null : windowStack[i][j-1]), title); + dialog.setResizable(isResizable[i][j]); + return dialog; + } + + private static Image generateIcon(Color color) { + BufferedImage bImg = new BufferedImage(ICON_SIZE, ICON_SIZE, TYPE_INT_ARGB); + Graphics2D g2d = bImg.createGraphics(); + g2d.setColor(color); + g2d.fillRect(MARGIN, MARGIN, ICON_SIZE - 2 * MARGIN, ICON_SIZE - 2 * MARGIN); + g2d.dispose(); + return bImg; + } +} diff --git a/test/jdk/java/awt/Icon/IconChangingTest/java-icon16.png b/test/jdk/java/awt/Icon/IconChangingTest/java-icon16.png new file mode 100644 index 0000000000000000000000000000000000000000..910dac1068b891bb68fe39d53edf61664404f788 GIT binary patch literal 3512 zcmV;p4M*~cP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rg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 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}0008hNkl(obdpYIQf$+V6ek#x zhGrCW)6>(W(`jzW{R@T>X8x21G;wsDed=q=zue2sC zmBtveYuNXFX0Bi7DaYaRo;|!1jWO}z`zWQFxG@H)G-3IuXpF%aL$y+2VPS!9zPwDY zF=RZCH|ljF#lN_-wuaW4ot+(g-$yEikWyld!Eqd}&3wl%D;qfX?{encd1fXjxwN!I zOb9-ho8!jq+f>SB^7%X?BO^#D2}`Lk#&G5H&se(W@#gt=860|*_GE%uBEcucB8z=} z9PaIKAEmAiuRvWTM`tCies_8oEjP;nM~5%-3`FLC-%~L{3QDi zwBmUljeklQ9UWz2Vv@OUzb4VT58JkJT^Fr2wrvvx0kK$&)S*tYgQxzM@c4+fZBr-| zn4O*F&e}TFY8BUYiO1t~baXHLLh`dDveNDZ`@kUA9?A8EGK%>oajlzYyWP{P$3 literal 0 HcmV?d00001 diff --git a/test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java b/test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java new file mode 100644 index 00000000000..0aeacbf050a --- /dev/null +++ b/test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java @@ -0,0 +1,279 @@ +/* + * 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 + * 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.AlphaComposite; +import java.awt.Color; +import java.awt.Dialog; +import java.awt.Font; +import java.awt.Frame; +import java.awt.GradientPaint; +import java.awt.Graphics2D; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Window; +import java.awt.image.BaseMultiResolutionImage; +import java.awt.image.BufferedImage; +import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.List; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +import static java.awt.image.BufferedImage.TYPE_INT_ARGB; +import static jdk.test.lib.Platform.isWindows; + +/* + * @test + * @bug 6233560 6280303 6292933 + * @summary Tests if toplevel's icons are shown correctly + * @key headful + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers /test/lib + * @build PassFailJFrame jdk.test.lib.Platform + * @run main/manual IconShowingTest + */ + +public class IconShowingTest { + private static final int EXTRA_OFFSET = 50; + + private static final String INSTRUCTIONS = + "Look at the icons shown on frames and dialogs, icons of minimized frames\n" + + (isWindows() ? "are displayed in ALT+TAB window\n" : "") + "\n"+ + "Alpha-channel (transparency) should be supported\n"+ + "by Windows and may not be supported by other platforms.\n"+ + " \n"+ + "Notes:\n"+ + " * Icons might appear in grayscale.\n"+ + " * Default icon might be either Duke or Java Cup.\n"+ + " \n"+ + "Press PASS if the icons match label description in windows\n"+ + "and are shown correctly, FAIL otherwise.\n" + ; + + public static void main(String[] args) throws Exception { + PassFailJFrame passFailJFrame = new PassFailJFrame("Icon Showing " + + "Test Instructions", INSTRUCTIONS, 5, 18, 48); + SwingUtilities.invokeAndWait(() -> { + try { + createAndShowGUI(); + } catch (Exception e) { + throw new RuntimeException("Error while running the test", e); + } + }); + passFailJFrame.awaitAndCheck(); + } + + public static void createAndShowGUI() + throws InterruptedException, InvocationTargetException { + Image i_16 = createIcon(16, 8, "16"); + Image i_32 = createIcon(32, 14, "32"); + Image i_48 = createIcon(48, 24, "48"); + Image i_64 = createIcon(64, 30, "64"); + + ImageIcon ji_16 = new ImageIcon(IconShowingTest.class.getResource( + "java-icon16.png")); + + Image[] images = new Image[] {i_16, i_32, i_48, i_64}; + List imageList = Arrays.asList(images); + ImageIcon icon = new ImageIcon(new MRImage(images)); + + Frame f1 = new Frame("Frame 1"); + f1.setIconImages(imageList); + f1.setLayout(new GridLayout(0, 1)); + + f1.add(new JLabel("Icon 16x16", new ImageIcon(i_16), JLabel.CENTER)); + f1.add(new JLabel("Icon 32x32", new ImageIcon(i_32), JLabel.CENTER)); + f1.add(new JLabel("Icon 48x48", new ImageIcon(i_48), JLabel.CENTER)); + f1.add(new JLabel("Icon 64x64", new ImageIcon(i_64), JLabel.CENTER)); + + PassFailJFrame.positionTestWindow(null, + PassFailJFrame.Position.TOP_LEFT_CORNER); + Rectangle bounds = PassFailJFrame.getInstructionFrameBounds(); + + int windowPosX = bounds.x + bounds.width + 5; + f1.setBounds(windowPosX, EXTRA_OFFSET, 200, 300); + f1.setVisible(true); + f1.toFront(); + PassFailJFrame.addTestWindow(f1); + int windowPosY = f1.getY() + f1.getHeight(); + + + Dialog d11 = new Dialog(f1, "Dialog 1.1"); + d11.setResizable(false); + addIconAndLabelToWindow(d11, windowPosX, windowPosY - EXTRA_OFFSET, + (isWindows() ? "No icon, non-resizable dialog" + : "Inherited icon, non-resizable dialog"), + (isWindows() ? null : icon)); + + Dialog d12 = new Dialog(d11, "Dialog 1.2"); + addIconAndLabelToWindow(d12, windowPosX, windowPosY + EXTRA_OFFSET, + "Inherited icon, resizable dialog", icon); + + Frame f2 = new Frame("Frame 2"); + addIconAndLabelToWindow(f2, windowPosX + 200, 0, + "Default Icon", ji_16); + + Dialog d21 = new Dialog(f2, "Dialog 2.1"); + d21.setResizable(false); + addIconAndLabelToWindow(d21, windowPosX + 200, 100, + (isWindows() ? "No icon, non-resizable dialog" + : "Inherited default Icon, non-resizable dialog"), + (isWindows() ? null : ji_16)); + + Dialog d22 = new Dialog(f2, "Dialog 2.2"); + addIconAndLabelToWindow(d22, windowPosX + 200, 200, + "Inherited default Icon, resizable dialog", ji_16); + + Dialog d23 = new Dialog(f2, "Dialog 2.3"); + d23.setIconImages(imageList); + d23.setResizable(false); + addIconAndLabelToWindow(d23, windowPosX + 200, 300, + "Modified Icon, non-resizable dialog", icon); + + Dialog d24 = new Dialog(f2, "Dialog 2.4"); + d24.setIconImages(imageList); + addIconAndLabelToWindow(d24, windowPosX + 200, 400, + "Modified Icon, resizable dialog", icon); + + Dialog d31 = new Dialog((Frame)null, "Dialog 3.1"); + addIconAndLabelToWindow(d31, windowPosX + 400, 100, + "Default icon, resizable dialog", ji_16); + + Dialog d32 = new Dialog(d31, "Dialog 3.2"); + d32.setResizable(false); + addIconAndLabelToWindow(d32, windowPosX + 400, 200, + (isWindows() ? "No icon, non-resizable dialog" + : "Default Icon, non-resizable dialog"), + (isWindows() ? null : ji_16)); + + Dialog d33 = new Dialog(d31, "Dialog 3.3"); + d33.setIconImages(imageList); + d33.setResizable(false); + addIconAndLabelToWindow(d33, windowPosX + 400, 300, + "Modified icon, non-resizable dialog", icon); + + + Dialog d34 = new Dialog(d33, "Dialog 3.4"); + d34.setResizable(false); + addIconAndLabelToWindow(d34, windowPosX + 400, 400, + (isWindows() ? "No icon, non-resizable dialog" + : "Inherited modified icon, non-resizable dialog"), + (isWindows() ? null : icon)); + + + Dialog d41 = new Dialog((Frame) null, "Dialog 4.1"); + d41.setResizable(false); + addIconAndLabelToWindow(d41, windowPosX + 600, 100, + "Default icon, non-resizable dialog", ji_16); + + + Dialog d42 = new Dialog(d41, "Dialog 4.2"); + addIconAndLabelToWindow(d42, windowPosX + 600, 200, + "Inherited default icon, resizable dialog", ji_16); + + Dialog d43 = new Dialog(d41, "Dialog 4.3"); + d43.setIconImages(imageList); + addIconAndLabelToWindow(d43, windowPosX + 600, 300, + "Modified icon, resizable dialog", icon); + + Dialog d44 = new Dialog(d43, "Dialog 4.4"); + addIconAndLabelToWindow(d44, windowPosX + 600, 400, + "Inherited modified icon, resizable dialog", icon); + } + + private static void addIconAndLabelToWindow(Window win, int x, int y, + String title, ImageIcon icon) { + win.setBounds(x, (y + EXTRA_OFFSET), 200, 100); + win.add(new JLabel(title, icon, JLabel.CENTER)); + win.setVisible(true); + win.toFront(); + PassFailJFrame.addTestWindow(win); + } + + public static Image createIcon(int size, int fontSize, String value) { + BufferedImage bImg = new BufferedImage(size, size, TYPE_INT_ARGB); + Graphics2D g2d = bImg.createGraphics(); + + int half = size / 2; + for (int i = 0; i < half - 1; i += 2) { + g2d.setComposite(AlphaComposite.Src); + g2d.setColor(Color.RED); + g2d.fillRect(0, i, half, 1); + g2d.setComposite(AlphaComposite.Clear); + g2d.fillRect(0, i + 1, half, 1); + } + g2d.setComposite(AlphaComposite.Clear); + g2d.fillRect(half, 0, half, half); + g2d.setComposite(AlphaComposite.Src); + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2d.setFont(new Font("Dialog", Font.PLAIN, fontSize)); + g2d.setColor(Color.BLUE); + g2d.drawString(value, half - 1, half - 2); + + int height = (half + 1) / 3; + // Green + GradientPaint greenGradient = new GradientPaint(0, half - 1, Color.GREEN, + size, half - 1, new Color(0, 255, 0, 0)); + g2d.setPaint(greenGradient); + g2d.fillRect(0, half - 1, size, height); + + // Blue + GradientPaint blueGradient = new GradientPaint(0, (half - 1) + height, Color.BLUE, + size, (half - 1) + height, new Color(0, 0, 255, 0)); + g2d.setPaint(blueGradient); + g2d.fillRect(0, (half - 1) + height, size, height); + + // Red + GradientPaint redGradient = new GradientPaint(0, (half - 1) + height * 2, Color.RED, + size, (half - 1) + height * 2, new Color(255, 0, 0, 0)); + g2d.setPaint(redGradient); + g2d.fillRect(0, (half - 1) + height * 2, size, height); + g2d.dispose(); + + return bImg; + } + + private static class MRImage extends BaseMultiResolutionImage { + public MRImage(Image... resolutionVariants) { + super(resolutionVariants); + } + + @Override + public Image getResolutionVariant(double expectedSize, double unused) { + final int size = (int) Math.round(expectedSize / 16.0) * 16; + List imageList = getResolutionVariants(); + for (int i = 0; i < imageList.size(); i++) { + if (size == imageList.get(i).getWidth(null)) { + return imageList.get(i); + } else if (imageList.get(i).getWidth(null) > size) { + return imageList.get(i > 0 ? i - 1 : i); + } + } + return imageList.get(0); //default/base image + } + } +} diff --git a/test/jdk/java/awt/Icon/IconShowingTest/java-icon16.png b/test/jdk/java/awt/Icon/IconShowingTest/java-icon16.png new file mode 100644 index 0000000000000000000000000000000000000000..910dac1068b891bb68fe39d53edf61664404f788 GIT binary patch literal 3512 zcmV;p4M*~cP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkU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d1fXjxwN!I zOb9-ho8!jq+f>SB^7%X?BO^#D2}`Lk#&G5H&se(W@#gt=860|*_GE%uBEcucB8z=} z9PaIKAEmAiuRvWTM`tCies_8oEjP;nM~5%-3`FLC-%~L{3QDi zwBmUljeklQ9UWz2Vv@OUzb4VT58JkJT^Fr2wrvvx0kK$&)S*tYgQxzM@c4+fZBr-| zn4O*F&e}TFY8BUYiO1t~baXHLLh`dDveNDZ`@kUA9?A8EGK%>oajlzYyWP{P$3 literal 0 HcmV?d00001 diff --git a/test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java b/test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java new file mode 100644 index 00000000000..362997e2c09 --- /dev/null +++ b/test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java @@ -0,0 +1,250 @@ +/* + * 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 + * 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.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.awt.image.IndexColorModel; +import java.awt.image.WritableRaster; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +import static java.awt.image.BufferedImage.TYPE_INT_ARGB; + +/* + * @test + * @bug 4987171 + * @key headful + * @summary GIF transparency in frame icons not work with Metacity/GNOME + * @requires (os.family != "mac") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual IconTransparencyTest + */ + +public class IconTransparencyTest { + private static final String INSTRUCTIONS = + "The icon of the frame and the resized icon in the label should be transparent.\n"+ + "Transparency can be verified by checking if the background color (pink)\n"+ + "is visible in and around icon within the JLabel.\n"+ + " \n"+ + "Press continue to view next icon (6 total).\n"+ + "Icon might be presented as grayscale image.\n"+ + " \n"+ + "For the 3rd icon in JLabel, the 2nd vertical slot is transparent, hence\n"+ + "the background color (pink) should be visible at the 2nd vertical slot.\n"+ + " \n"+ + "For the 4th icon in JLabel, the 5th vertical slot is transparent, hence\n"+ + "the background color (pink) should be visible at the 5th vertical slot.\n"+ + " \n"+ + "Press Pass or Fail at the end of test.\n"; + + static class TestLabel extends JLabel { + public void paint(Graphics g) { + Dimension d = getSize(); + g.setColor(Color.PINK); + g.fillRect(0, 0, d.width, d.height); + Icon icon = getIcon(); + if (icon != null) { + icon.paintIcon(this, g, 0, 0); + } + int iw = (icon != null) ? icon.getIconWidth() + 3 : 3; + if (d.width - iw > 0) { + g.setColor(Color.BLACK); + g.drawString(getText(), iw, 16); + } + } + } + + static class TestFrame implements ActionListener { + static final int TEST_CNT = 6; + int currTest = 0; + static ImageIcon[] testIcon; + + TestLabel label; + JButton button; + static JFrame frame; + + final String[] testText = { + "1st Icon: Size 16x16, GIF", + "2nd Icon: Size 48x48, GIF", + "3rd Icon: Size 64x64, GIF", + "4th Icon: Size 64x64, GIF", + "5th Icon: Size 64x64, PNG", + "No Icon (system default)" + }; + + TestFrame() throws IOException { + + generateIcon(16, "img_16.gif", 13, 15, 1, "gif"); + generateIcon(48, "img_48.gif", 36, 40, 4, "gif"); + generateIcon(64, "img_64.png", 50, 58, 4, "png"); + + // gif created with GREEN selected as transparent color index in IndexColorModel + generateGIFWithIndexColorModel(64, "greenTransparent.gif", 1); + // gif created with BLACK selected as transparent color index in IndexColorModel + generateGIFWithIndexColorModel(64, "blackTransparent.gif", 4); + + testIcon = new ImageIcon[] { + new ImageIcon("img_16.gif"), + new ImageIcon("img_48.gif"), + new ImageIcon("greenTransparent.gif"), + new ImageIcon("blackTransparent.gif"), + new ImageIcon("img_64.png"), + null + }; + } + + public void createAndShowGUI() { + frame = new JFrame(); + //create hint label + label = new TestLabel(); + label.setVisible(true); + frame.add(label, BorderLayout.WEST); + + //create button + button = new JButton("Continue"); + button.setVisible(true); + button.addActionListener(this); + frame.add(button, BorderLayout.EAST); + + //show first sample + frame.setIconImage(testIcon[0].getImage()); + label.setIcon(testIcon[0]); + label.setText(testText[0]); + frame.pack(); + + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, + PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); + } + + public void actionPerformed(ActionEvent event) { + currTest++; + if (currTest < TEST_CNT) { + if (testIcon[currTest] != null) { + frame.setIconImage(testIcon[currTest].getImage()); + } else { + frame.setIconImage(null); + } + + label.setIcon(testIcon[currTest]); + label.setText(testText[currTest]); + } else { + button.setEnabled(false); + button.setText("No more icons left."); + } + frame.revalidate(); + frame.pack(); + } + } + + public static void main(String[] args) throws Exception { + TestFrame testFrame = new TestFrame(); + PassFailJFrame passFailJFrame = new PassFailJFrame("Icon Transparency " + + "Test Instructions", INSTRUCTIONS, 5, 16, 46); + SwingUtilities.invokeAndWait(testFrame::createAndShowGUI); + passFailJFrame.awaitAndCheck(); + } + + public static void generateIcon(int size, String filename, int fontSize, + int yText, int lnHeight, String type) throws IOException { + BufferedImage bImg = new BufferedImage(size, size, TYPE_INT_ARGB); + Graphics2D g2d = bImg.createGraphics(); + g2d.setComposite(AlphaComposite.Clear); + g2d.fillRect(0, 0, size, size); + + g2d.setComposite(AlphaComposite.Src); + g2d.setColor(Color.BLUE); + g2d.fillRect(0, 0, size, lnHeight); + g2d.setColor(Color.GREEN); + g2d.fillRect(0, lnHeight * 2, size, lnHeight); + + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + g2d.setFont(new Font("Dialog", Font.PLAIN, fontSize)); + g2d.setColor(Color.RED); + g2d.drawString("TR", 0, yText); + g2d.dispose(); + + ImageIO.write(bImg, type, new File(filename)); + } + + protected static void generateGIFWithIndexColorModel(int size, String filename, + int transparentColorIndex) throws IOException { + IndexColorModel icm = createIndexedBitmaskColorModel(transparentColorIndex); + BufferedImage img = new BufferedImage(size, size, + BufferedImage.TYPE_BYTE_INDEXED, icm); + int mapSize = icm.getMapSize(); + int width = 64 / mapSize; + + WritableRaster wr = img.getRaster(); + for (int i = 0; i < mapSize; i++) { + for (int y = 0; y < 64; y++) { + for (int x = 0; x < width; x++) { + wr.setSample(i * width + x, y, 0, i); + } + } + } + ImageIO.write(img, "gif", new File(filename)); + } + + protected static IndexColorModel createIndexedBitmaskColorModel(int transparentColorIndex) { + int paletteSize = 8; + byte[] red = new byte[paletteSize]; + byte[] green = new byte[paletteSize]; + byte[] blue = new byte[paletteSize]; + + red[0] = (byte)0xff; green[0] = (byte)0x00; blue[0] = (byte)0x00; //red + red[1] = (byte)0x00; green[1] = (byte)0xff; blue[1] = (byte)0x00; //green + red[2] = (byte)0x00; green[2] = (byte)0x00; blue[2] = (byte)0xff; //blue + red[3] = (byte)0xff; green[3] = (byte)0xff; blue[3] = (byte)0xff; //white + red[4] = (byte)0x00; green[4] = (byte)0x00; blue[4] = (byte)0x00; //black + red[5] = (byte)0x80; green[5] = (byte)0x80; blue[5] = (byte)0x80; //grey + red[6] = (byte)0xff; green[6] = (byte)0xff; blue[6] = (byte)0x00; //yellow + red[7] = (byte)0x00; green[7] = (byte)0xff; blue[7] = (byte)0xff; //cyan + + int numBits = 3; + + return new IndexColorModel(numBits, paletteSize, + red, green, blue, transparentColorIndex); + } +} + diff --git a/test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java b/test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java new file mode 100644 index 00000000000..c0b9f9e993e --- /dev/null +++ b/test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * 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.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; + +/* + * @test + * @key headful + * @bug 6425089 + * @summary PIT. Frame does not show a big size jpg image as icon + * @requires (os.family != "mac") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetLargeIconTest + */ + +public class SetLargeIconTest { + private static final String INSTRUCTIONS = + "Case 1: Press \"Pass\" button if this frame does not have icon with green color.\n"+ + " \n"+ + "Case 2: Press \"Change to red\" if the frame icon is in green color.\n"+ + "For case 2, press \"Pass\" button if green icon changes to a larger red icon,\n"+ + "press \"Fail\" otherwise.\n"; + private static JFrame frame; + + private static void createAndShowGUI() { + frame = new JFrame(); + + setColoredIcon(Color.green, 128, 128); + JButton btnChangeIcon = new JButton("Change to red"); + btnChangeIcon.addActionListener(e -> setColoredIcon(Color.red, 400, 400)); + + frame.add(btnChangeIcon, BorderLayout.CENTER); + frame.setSize(200,65); + + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, + PassFailJFrame.Position.HORIZONTAL); + frame.setVisible(true); + } + + private static void setColoredIcon(Color color, int width, int height) { + BufferedImage image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_ARGB); + Graphics gr = image.createGraphics(); + gr.setColor(color); + gr.fillRect(0, 0, width, height); + + ArrayList imageList = new java.util.ArrayList<>(); + imageList.add(image); + + frame.setIconImages(imageList); + } + + public static void main(String[] args) throws Exception { + PassFailJFrame passFailJFrame = new PassFailJFrame("Large Icon " + + "Test Instructions", INSTRUCTIONS, 5, 8, 50); + SwingUtilities.invokeAndWait(SetLargeIconTest::createAndShowGUI); + passFailJFrame.awaitAndCheck(); + } +} From a72d0b2894a2fa26eb521c3ceb21a86b2f517bb3 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 23 Nov 2023 13:08:59 +0000 Subject: [PATCH 154/177] 8240754: Instrument FlowTest.java to provide more debug traces. Backport-of: 5c8f935641bf76e570e7370933d2d3c204dd0fb3 --- .../jdk/internal/net/http/FlowTest.java | 132 +++++++++++++----- 1 file changed, 96 insertions(+), 36 deletions(-) diff --git a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java index bc7a5046f50..8dd5139ce44 100644 --- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java +++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,26 +99,27 @@ public FlowTest() throws IOException { SSLFlowDelegate sslClient = new SSLFlowDelegate(engineClient, executor, end, looper); // going to measure how long handshake takes final long start = System.currentTimeMillis(); - sslClient.alpn().whenComplete((String s, Throwable t) -> { + var alpnCF = sslClient.alpn() + .whenComplete((String s, Throwable t) -> { if (t != null) t.printStackTrace(); long endTime = System.currentTimeMillis(); alpn = s; - System.out.println("ALPN: " + alpn); + println("ALPN: " + alpn); long period = (endTime - start); - System.out.printf("Handshake took %d ms\n", period); + printf("Handshake took %d ms", period); }); Subscriber> reader = sslClient.upstreamReader(); Subscriber> writer = sslClient.upstreamWriter(); looper.setReturnSubscriber(reader); // now connect all the pieces srcPublisher.subscribe(writer); - String aa = sslClient.alpn().join(); - System.out.println("AAALPN = " + aa); + String aa = alpnCF.join(); + println("AAALPN = " + aa); } private void handlePublisherException(Object o, Throwable t) { - System.out.println("Src Publisher exception"); + println("Src Publisher exception"); t.printStackTrace(System.out); } @@ -134,29 +135,43 @@ private static ByteBuffer getBuffer(long startingAt) { @Test public void run() { long count = 0; - System.out.printf("Submitting %d buffer arrays\n", COUNTER); - System.out.printf("LoopCount should be %d\n", TOTAL_LONGS); + printf("Submitting %d buffer arrays", COUNTER); + printf("LoopCount should be %d", TOTAL_LONGS); for (long i = 0; i < COUNTER; i++) { ByteBuffer b = getBuffer(count); count += LONGS_PER_BUF; srcPublisher.submit(List.of(b)); } - System.out.println("Finished submission. Waiting for loopback"); + println("Finished submission. Waiting for loopback"); // make sure we don't wait for allBytesReceived in case of error. - completion.whenComplete((r,t) -> allBytesReceived.countDown()); + var done = completion.whenComplete((r,t) -> { + try { + if (t != null) { + println("Completion with error: " + t); + t.printStackTrace(System.out); + } else { + println("Successful completion"); + } + } finally { + println("allBytesReceived.countDown()"); + allBytesReceived.countDown(); + } + }); + try { allBytesReceived.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } - System.out.println("All bytes received: "); + println("All bytes received; latch count:" + + allBytesReceived.getCount()); srcPublisher.close(); try { - completion.join(); + done.join(); if (!alpn.equals("proto2")) { throw new RuntimeException("wrong alpn received"); } - System.out.println("OK"); + println("OK"); } finally { executor.shutdownNow(); } @@ -186,6 +201,7 @@ public static void main(String[]args) throws Exception { */ static class SSLLoopbackSubscriber implements Subscriber> { private final BlockingQueue buffer; + private final SSLServerSocket serv; private final Socket clientSock; private final SSLSocket serverSock; private final Thread thread1, thread2, thread3; @@ -197,7 +213,7 @@ static class SSLLoopbackSubscriber implements Subscriber> { ExecutorService exec, CountDownLatch allBytesReceived) throws IOException { SSLServerSocketFactory fac = ctx.getServerSocketFactory(); - SSLServerSocket serv = (SSLServerSocket) fac.createServerSocket(); + serv = (SSLServerSocket) fac.createServerSocket(); serv.setReuseAddress(false); serv.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); SSLParameters params = serv.getSSLParameters(); @@ -225,7 +241,7 @@ public void start() { } private void handlePublisherException(Object o, Throwable t) { - System.out.println("Loopback Publisher exception"); + println("Loopback Publisher exception"); t.printStackTrace(System.out); } @@ -236,20 +252,21 @@ private void clientReader() { try { InputStream is = clientSock.getInputStream(); final int bufsize = FlowTest.randomRange(512, 16 * 1024); - System.out.println("clientReader: bufsize = " + bufsize); + println("clientReader: bufsize = " + bufsize); while (true) { byte[] buf = new byte[bufsize]; int n = is.read(buf); if (n == -1) { - System.out.println("clientReader close: read " + println("clientReader close: read " + readCount.get() + " bytes"); - System.out.println("clientReader: got EOF. " - + "Waiting signal to close publisher."); + println("clientReader: got EOF. " + + "Waiting signal to close publisher."); allBytesReceived.await(); - System.out.println("clientReader: closing publisher"); + println("clientReader: closing publisher; latch count: " + + allBytesReceived.getCount()); publisher.close(); sleep(2000); - Utils.close(is, clientSock); + Utils.close(is, clientSock, serv); return; } ByteBuffer bb = ByteBuffer.wrap(buf, 0, n); @@ -257,6 +274,7 @@ private void clientReader() { publisher.submit(List.of(bb)); } } catch (Throwable e) { + println("clientReader failed: " + e); e.printStackTrace(); Utils.close(clientSock); } @@ -275,9 +293,9 @@ private void clientWriter() { if (buf == FlowTest.SENTINEL) { // finished //Utils.sleep(2000); - System.out.println("clientWriter close: " + nbytes + " written"); + println("clientWriter close: " + nbytes + " written"); clientSock.shutdownOutput(); - System.out.println("clientWriter close return"); + println("clientWriter close return"); return; } int len = buf.remaining(); @@ -289,6 +307,7 @@ private void clientWriter() { clientSubscription.request(1); } } catch (Throwable e) { + println("clientWriter failed: " + e); e.printStackTrace(); } } @@ -316,14 +335,15 @@ private void serverLoopback() { InputStream is = serverSock.getInputStream(); OutputStream os = serverSock.getOutputStream(); final int bufsize = FlowTest.randomRange(512, 16 * 1024); - System.out.println("serverLoopback: bufsize = " + bufsize); + println("serverLoopback: bufsize = " + bufsize); byte[] bb = new byte[bufsize]; while (true) { int n = is.read(bb); if (n == -1) { sleep(2000); - is.close(); - serverSock.close(); + println("Received EOF: closing server socket"); + Utils.close(is, serverSock, serv); + println("Server socket closed"); return; } os.write(bb, 0, n); @@ -331,6 +351,7 @@ private void serverLoopback() { loopCount.addAndGet(n); } } catch (Throwable e) { + println("serverLoopback failed: " + e); e.printStackTrace(); } } @@ -385,18 +406,18 @@ public void onComplete() { */ static class EndSubscriber implements Subscriber> { - private final long nbytes; + private final long nlongs; private final AtomicLong counter; private volatile Flow.Subscription subscription; private final CompletableFuture completion; private final CountDownLatch allBytesReceived; - EndSubscriber(long nbytes, + EndSubscriber(long nlongs, CompletableFuture completion, CountDownLatch allBytesReceived) { counter = new AtomicLong(0); - this.nbytes = nbytes; + this.nlongs = nlongs; this.completion = completion; this.allBytesReceived = allBytesReceived; } @@ -426,12 +447,16 @@ public void onNext(List buffers) { for (ByteBuffer buf : buffers) { while (buf.hasRemaining()) { + if (buf.remaining() % 8 != 0) { + completion.completeExceptionally( + new AssertionError("Unaligned buffer: " + buf.remaining())); + } long n = buf.getLong(); //if (currval > (FlowTest.TOTAL_LONGS - 50)) { //System.out.println("End: " + currval); //} if (n != currval++) { - System.out.println("ERROR at " + n + " != " + (currval - 1)); + println("ERROR at " + n + " != " + (currval - 1)); completion.completeExceptionally(new RuntimeException("ERROR")); subscription.cancel(); return; @@ -442,25 +467,24 @@ public void onNext(List buffers) { counter.set(currval); subscription.request(1); if (currval >= TOTAL_LONGS) { + println("allBytesReceived.countDown(): currval=" +currval); allBytesReceived.countDown(); } } @Override public void onError(Throwable throwable) { - allBytesReceived.countDown(); completion.completeExceptionally(throwable); } @Override public void onComplete() { long n = counter.get(); - if (n != nbytes) { - System.out.printf("nbytes=%d n=%d\n", nbytes, n); + if (n != nlongs) { + printf("Error at end: nlongs=%d n=%d", nlongs, n); completion.completeExceptionally(new RuntimeException("ERROR AT END")); } else { - System.out.println("DONE OK: counter = " + n); - allBytesReceived.countDown(); + println("DONE OK: counter = " + n); completion.complete(null); } } @@ -547,4 +571,40 @@ private static void sleep(int millis) { e.printStackTrace(); } } + + static final long START = System.nanoTime(); + + static String now() { + long now = System.nanoTime() - START; + long min = now / 1000_000_000L / 60L; + long sec = (now / 1000_000_000L) % 60L; + long mil = (now / 1000_000L) % 1000L; + long nan = (now % 1000_000L); + StringBuilder str = new StringBuilder(); + if (min != 0) { + str = str.append(min).append("m "); + } + if (sec != 0) { + str = str.append(sec).append("s "); + } + if (mil != 0) { + str.append(mil).append("ms "); + } + if (nan != 0) { + str.append(nan).append("ns "); + } + assert now == min * 60L * 1000_000_000L + + sec * 1000_000_000L + + mil * 1000_000L + nan; + return str.toString().trim(); + } + + static void printf(String fmt, Object... args) { + println(String.format(fmt, args)); + } + + static void println(String msg) { + System.out.println("[" + Thread.currentThread() + "] [" + now() + "] " + msg); + } + } From 24205922cddb65bfa9f2f16b96b4e753387396e1 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Fri, 24 Nov 2023 15:06:46 +0000 Subject: [PATCH 155/177] 8312126: NullPointerException in CertStore.getCRLs after 8297955 Backport-of: 3c743cfea00692d0b938cb1cbde936084eecf369 --- .../security/provider/certpath/ldap/LDAPCertStoreImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java b/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java index d438341ac62..c8a11052c67 100644 --- a/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java +++ b/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java @@ -775,9 +775,13 @@ synchronized Collection getCRLs(X509CRLSelector xsel, } catch (IllegalArgumentException e) { continue; } - } else { + } else if (nameObject instanceof String) { issuerName = (String)nameObject; + } else { + throw new CertStoreException( + "unrecognized issuerName: must be String or byte[]"); } + // If all we want is CA certs, try to get the (probably shorter) ARL Collection entryCRLs = Collections.emptySet(); if (certChecking == null || certChecking.getBasicConstraints() != -1) { From 6321d3eaf111716430b83dcbabf2112b69dae5a6 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 27 Nov 2023 09:57:31 +0000 Subject: [PATCH 156/177] 8316746: Top of lock-stack does not match the unlocked object Reviewed-by: rrich Backport-of: 7d8adfa855e51a90c2f125fc20a06f9a488e6248 --- src/hotspot/cpu/ppc/frame_ppc.inline.hpp | 1 - src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 2 +- src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 140 ++++++++---------- .../jtreg/compiler/locks/TestUnlockOSR.java | 56 +++++++ 4 files changed, 117 insertions(+), 82 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java diff --git a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp b/src/hotspot/cpu/ppc/frame_ppc.inline.hpp index c5b0fba54e0..56472b9b498 100644 --- a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/frame_ppc.inline.hpp @@ -143,7 +143,6 @@ inline intptr_t* frame::interpreter_frame_mdp_addr() const { return (intptr_t*) &(get_ijava_state()->mdx); } -// Pointer beyond the "oldest/deepest" BasicObjectLock on stack. inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { return (BasicObjectLock*) get_ijava_state()->monitors; } diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index e800e7d014b..52760466f5d 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -1978,7 +1978,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register } } -// Add a InterpMonitorElem to stack (see frame_sparc.hpp). +// Add a monitor (see frame_ppc.hpp). void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty, Register Rtemp1, Register Rtemp2) { // Very-local scratch registers. diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp index b1411b0fcec..f57eaf061af 100644 --- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp @@ -4056,90 +4056,78 @@ void TemplateTable::athrow() { // at next monitor exit. void TemplateTable::monitorenter() { transition(atos, vtos); - __ verify_oop(R17_tos); - Register Rcurrent_monitor = R11_scratch1, - Rcurrent_obj = R12_scratch2, + Register Rcurrent_monitor = R3_ARG1, + Rcurrent_obj = R4_ARG2, Robj_to_lock = R17_tos, - Rscratch1 = R3_ARG1, - Rscratch2 = R4_ARG2, - Rscratch3 = R5_ARG3, - Rcurrent_obj_addr = R6_ARG4; + Rscratch1 = R11_scratch1, + Rscratch2 = R12_scratch2, + Rbot = R5_ARG3, + Rfree_slot = R6_ARG4; + + Label Lfound, Lallocate_new; + + __ ld(Rscratch1, _abi(callers_sp), R1_SP); // load FP + __ li(Rfree_slot, 0); // Points to free slot or null. + + // Set up search loop - start with topmost monitor. + __ mr(Rcurrent_monitor, R26_monitor); + __ addi(Rbot, Rscratch1, -frame::ijava_state_size); // ------------------------------------------------------------------------------ // Null pointer exception. - __ null_check_throw(Robj_to_lock, -1, R11_scratch1); + __ null_check_throw(Robj_to_lock, -1, Rscratch1); - // Try to acquire a lock on the object. - // Repeat until succeeded (i.e., until monitorenter returns true). + // Check if any slot is present => short cut to allocation if not. + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ beq(CCR0, Lallocate_new); // ------------------------------------------------------------------------------ // Find a free slot in the monitor block. - Label Lfound, Lexit, Lallocate_new; - ConditionRegister found_free_slot = CCR0, - found_same_obj = CCR1, - reached_limit = CCR6; + // Note: The order of the monitors is important for C2 OSR which derives the + // unlock order from it (see comments for interpreter_frame_monitor_*). { - Label Lloop, Lentry; - Register Rlimit = Rcurrent_monitor; - - // Set up search loop - start with topmost monitor. - __ add(Rcurrent_obj_addr, BasicObjectLock::obj_offset_in_bytes(), R26_monitor); + Label Lloop, LnotFree, Lexit; - __ ld(Rlimit, 0, R1_SP); - __ addi(Rlimit, Rlimit, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes() - BasicObjectLock::obj_offset_in_bytes())); // Monitor base + __ bind(Lloop); + __ ld(Rcurrent_obj, BasicObjectLock::obj_offset_in_bytes(), Rcurrent_monitor); + // Exit if current entry is for same object; this guarantees, that new monitor + // used for recursive lock is above the older one. + __ cmpd(CCR0, Rcurrent_obj, Robj_to_lock); + __ beq(CCR0, Lexit); // recursive locking - // Check if any slot is present => short cut to allocation if not. - __ cmpld(reached_limit, Rcurrent_obj_addr, Rlimit); - __ bgt(reached_limit, Lallocate_new); + __ cmpdi(CCR0, Rcurrent_obj, 0); + __ bne(CCR0, LnotFree); + __ mr(Rfree_slot, Rcurrent_monitor); // remember free slot closest to the bottom + __ bind(LnotFree); - // Pre-load topmost slot. - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - // The search loop. - __ bind(Lloop); - // Found free slot? - __ cmpdi(found_free_slot, Rcurrent_obj, 0); - // Is this entry for same obj? If so, stop the search and take the found - // free slot or allocate a new one to enable recursive locking. - __ cmpd(found_same_obj, Rcurrent_obj, Robj_to_lock); - __ cmpld(reached_limit, Rcurrent_obj_addr, Rlimit); - __ beq(found_free_slot, Lexit); - __ beq(found_same_obj, Lallocate_new); - __ bgt(reached_limit, Lallocate_new); - // Check if last allocated BasicLockObj reached. - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - // Next iteration if unchecked BasicObjectLocks exist on the stack. - __ b(Lloop); + __ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes()); + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ bne(CCR0, Lloop); + __ bind(Lexit); } // ------------------------------------------------------------------------------ // Check if we found a free slot. - __ bind(Lexit); - - __ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size() * wordSize) - BasicObjectLock::obj_offset_in_bytes()); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size() * wordSize); - __ b(Lfound); + __ cmpdi(CCR0, Rfree_slot, 0); + __ bne(CCR0, Lfound); // We didn't find a free BasicObjLock => allocate one. - __ align(32, 12); __ bind(Lallocate_new); __ add_monitor_to_stack(false, Rscratch1, Rscratch2); - __ mr(Rcurrent_monitor, R26_monitor); - __ addi(Rcurrent_obj_addr, R26_monitor, BasicObjectLock::obj_offset_in_bytes()); + __ mr(Rfree_slot, R26_monitor); // ------------------------------------------------------------------------------ // We now have a slot to lock. __ bind(Lfound); // Increment bcp to point to the next bytecode, so exception handling for async. exceptions work correctly. - // The object has already been poped from the stack, so the expression stack looks correct. + // The object has already been popped from the stack, so the expression stack looks correct. __ addi(R14_bcp, R14_bcp, 1); - __ std(Robj_to_lock, 0, Rcurrent_obj_addr); - __ lock_object(Rcurrent_monitor, Robj_to_lock); + __ std(Robj_to_lock, BasicObjectLock::obj_offset_in_bytes(), Rfree_slot); + __ lock_object(Rfree_slot, Robj_to_lock); // Check if there's enough space on the stack for the monitors after locking. // This emits a single store. @@ -4153,46 +4141,40 @@ void TemplateTable::monitorexit() { transition(atos, vtos); __ verify_oop(R17_tos); - Register Rcurrent_monitor = R11_scratch1, - Rcurrent_obj = R12_scratch2, + Register Rcurrent_monitor = R3_ARG1, + Rcurrent_obj = R4_ARG2, Robj_to_lock = R17_tos, - Rcurrent_obj_addr = R3_ARG1, - Rlimit = R4_ARG2; + Rscratch = R11_scratch1, + Rbot = R12_scratch2; + Label Lfound, Lillegal_monitor_state; - // Check corner case: unbalanced monitorEnter / Exit. - __ ld(Rlimit, 0, R1_SP); - __ addi(Rlimit, Rlimit, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base + __ ld(Rscratch, _abi(callers_sp), R1_SP); // load FP + + // Set up search loop - start with topmost monitor. + __ mr(Rcurrent_monitor, R26_monitor); + __ addi(Rbot, Rscratch, -frame::ijava_state_size); // Null pointer check. - __ null_check_throw(Robj_to_lock, -1, R11_scratch1); + __ null_check_throw(Robj_to_lock, -1, Rscratch); - __ cmpld(CCR0, R26_monitor, Rlimit); - __ bgt(CCR0, Lillegal_monitor_state); + // Check corner case: unbalanced monitorEnter / Exit. + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ beq(CCR0, Lillegal_monitor_state); // Find the corresponding slot in the monitors stack section. { Label Lloop; - // Start with topmost monitor. - __ addi(Rcurrent_obj_addr, R26_monitor, BasicObjectLock::obj_offset_in_bytes()); - __ addi(Rlimit, Rlimit, BasicObjectLock::obj_offset_in_bytes()); - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - __ bind(Lloop); + __ ld(Rcurrent_obj, BasicObjectLock::obj_offset_in_bytes(), Rcurrent_monitor); // Is this entry for same obj? __ cmpd(CCR0, Rcurrent_obj, Robj_to_lock); __ beq(CCR0, Lfound); - // Check if last allocated BasicLockObj reached. - - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ cmpld(CCR0, Rcurrent_obj_addr, Rlimit); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - - // Next iteration if unchecked BasicObjectLocks exist on the stack. - __ ble(CCR0, Lloop); + __ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes()); + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ bne(CCR0, Lloop); } // Fell through without finding the basic obj lock => throw up! @@ -4202,8 +4184,6 @@ void TemplateTable::monitorexit() { __ align(32, 12); __ bind(Lfound); - __ addi(Rcurrent_monitor, Rcurrent_obj_addr, - -(frame::interpreter_frame_monitor_size() * wordSize) - BasicObjectLock::obj_offset_in_bytes()); __ unlock_object(Rcurrent_monitor); } diff --git a/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java b/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java new file mode 100644 index 00000000000..f2133b49658 --- /dev/null +++ b/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8316746 + * @summary During OSR, locks get transferred from interpreter frame. + * Check that unlocking 2 such locks works in the OSR compiled nmethod. + * Some platforms verify that the unlocking happens in the corrent order. + * + * @run main/othervm -Xbatch TestUnlockOSR + */ + +public class TestUnlockOSR { + static void test_method(Object a, Object b, int limit) { + synchronized(a) { // allocate space for monitors + synchronized(b) { + } + } // free space to test allocation in reused space + synchronized(a) { // reuse the space + synchronized(b) { + for (int i = 0; i < limit; i++) {} + } + } + } + + public static void main(String[] args) { + Object a = new TestUnlockOSR(), + b = new TestUnlockOSR(); + // avoid uncommon trap before last unlocks + for (int i = 0; i < 100; i++) { test_method(a, b, 0); } + // trigger OSR + test_method(a, b, 100000); + } +} From 1f4decf7a72411b194203ba5a97924d242eaca86 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 28 Nov 2023 11:18:47 +0000 Subject: [PATCH 157/177] 8318759: Add four DigiCert root certificates Reviewed-by: mbaesken Backport-of: 0ea58048f9b4cdaaa0470b2bcc03913fb3939453 --- make/data/cacerts/digicertcseccrootg5 | 21 ++ make/data/cacerts/digicertcsrsarootg5 | 38 +++ make/data/cacerts/digicerttlseccrootg5 | 21 ++ make/data/cacerts/digicerttlsrsarootg5 | 38 +++ .../certification/CAInterop.java | 27 ++ .../certification/DigicertCSRootG5.java | 303 ++++++++++++++++++ .../security/lib/cacerts/VerifyCACerts.java | 14 +- 7 files changed, 459 insertions(+), 3 deletions(-) create mode 100644 make/data/cacerts/digicertcseccrootg5 create mode 100644 make/data/cacerts/digicertcsrsarootg5 create mode 100644 make/data/cacerts/digicerttlseccrootg5 create mode 100644 make/data/cacerts/digicerttlsrsarootg5 create mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java diff --git a/make/data/cacerts/digicertcseccrootg5 b/make/data/cacerts/digicertcseccrootg5 new file mode 100644 index 00000000000..04e1eb1be68 --- /dev/null +++ b/make/data/cacerts/digicertcseccrootg5 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 3698fe712d519f3ced0fdb7b1643011 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICFjCCAZ2gAwIBAgIQA2mP5xLVGfPO0P23sWQwETAKBggqhkjOPQQDAzBNMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp +Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcNNDYw +MTE0MjM1OTU5WjBNMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu +Yy4xJTAjBgNVBAMTHERpZ2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAR/FK2Ftpf9AiE1TWDoOJOTmz0FEG2v0/7v+rv7c5nz +7DISjcdouIveiaKIVHeNuyF+M5VWlgno1YyhBLibbhkAYuhCKKZYN4QZVSZ7Mzdn +8ppyraGurgBCPBx+uHqeIZyjQjBAMB0GA1UdDgQWBBTwjJhxOThlwjobphdmHcjt +Zd6SNjAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQD +AwNnADBkAjAjb+EAGSZQ5EYgZYs3p8/rBuHMMskqoewyDXOiHgIcNWEqTmmrOXft +l4jAfWvqid0CMEPx0VijdT6Gm7ZVEYsX9z3+CmnFf07GdRtalMvqERHGCCKI3tB6 +oqV56OMhp80Tsw== +-----END CERTIFICATE----- diff --git a/make/data/cacerts/digicertcsrsarootg5 b/make/data/cacerts/digicertcsrsarootg5 new file mode 100644 index 00000000000..fd570aeee8b --- /dev/null +++ b/make/data/cacerts/digicertcsrsarootg5 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 6cee131be6d55c807f7c0c7fb44e620 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZDCCA0ygAwIBAgIQBs7hMb5tVcgH98DH+0TmIDANBgkqhkiG9w0BAQwFADBM +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT +G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAxMTUwMDAwMDBaFw00 +NjAxMTQyMzU5NTlaMEwxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg +SW5jLjEkMCIGA1UEAxMbRGlnaUNlcnQgQ1MgUlNBNDA5NiBSb290IEc1MIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtjNzgNhiA3AULBEcOV58rnyDhh3+ +Ji9MJK2L6oNfqbw9W/wLmEwCRzDs4v7s6DRbZl6/O9cspiX/jFmz3+rafCnZRlBy +CB1u0RsK3R/NmYn6Dw9zxOGcHXUyzW+X2ipqlbJsyQnQ6gt7fRcGSZnv1t7gyFPU +rsZ38Ya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hBapsQdrqW7uxs/msEQpwvCzYYAq +i2/SFFwlh1Rk86RMwaH4p2vq/uo6/HnbDo/cxvPJ1Gze6YOhjh0i7Mk6sgB73Dun +Qhp/3IupET2Op8Agb10JXUNE5o9mzKlbB/Hvm3oOs1ThlP0OLMaT11X9cZg1uAlK +/8YpKCz2Ui3bFBiSJ+IWfozK1GG+goeR65g3P79fXXc/NKwbOEOraHKZMh46Ghml +ozhMI9ej58zVKpIXkAtaS70WvfuGauKJmezkoFUYyaMIHxPgMghy0A== +-----END CERTIFICATE----- diff --git a/make/data/cacerts/digicerttlseccrootg5 b/make/data/cacerts/digicerttlseccrootg5 new file mode 100644 index 00000000000..9356292ef08 --- /dev/null +++ b/make/data/cacerts/digicerttlseccrootg5 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 9e09365acf7d9c8b93e1c0b042a2ef3 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJjAkBgNVBAMTHURp +Z2lDZXJ0IFRMUyBFQ0MgUDM4NCBSb290IEc1MB4XDTIxMDExNTAwMDAwMFoXDTQ2 +MDExNDIzNTk1OVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJ +bmMuMSYwJAYDVQQDEx1EaWdpQ2VydCBUTFMgRUNDIFAzODQgUm9vdCBHNTB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABMFEoc8Rl1Ca3iOCNQfN0MsYndLxf3c1TzvdlHJS +7cI7+Oz6e2tYIOyZrsn8aLN1udsJ7MgT9U7GCh1mMEy7H0cKPGEQQil8pQgO4CLp +0zVozptjn4S1mU1YoI71VOeVyaNCMEAwHQYDVR0OBBYEFMFRRVBZqz7nLFr6ICIS +B4CIfBFqMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 +BAMDA2gAMGUCMQCJao1H5+z8blUD2WdsJk6Dxv3J+ysTvLd6jLRl0mlpYxNjOyZQ +LgGheQaRnUi/wr4CMEfDFXuxoJGZSZOoPHzoRgaLLPIxAJSdYsiJvRmEFOml+wG4 +DXZDjC5Ty3zfDBeWUA== +-----END CERTIFICATE----- diff --git a/make/data/cacerts/digicerttlsrsarootg5 b/make/data/cacerts/digicerttlsrsarootg5 new file mode 100644 index 00000000000..ac66e174f06 --- /dev/null +++ b/make/data/cacerts/digicerttlsrsarootg5 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 8f9b478a8fa7eda6a333789de7ccf8a +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCPm0eKj6ftpqMzeJ3nzPijANBgkqhkiG9w0BAQwFADBN +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMT +HERpZ2lDZXJ0IFRMUyBSU0E0MDk2IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcN +NDYwMTE0MjM1OTU5WjBNMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQs +IEluYy4xJTAjBgNVBAMTHERpZ2lDZXJ0IFRMUyBSU0E0MDk2IFJ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PK8qHWgQ9w+iUuQrm0D4ByjoJYJu32jtyoQ +REtGBzRj7TG5BO6jm5qu5jF49OokYTurWGT/u4cnYiWB39yhL/btp/96j1EuMPik +AdKFOV8BmZZvWltwGUb+hmA+rYAQCd05JS9Yf7vSdPD3Rh9GOUrYU9DzLjtxpdRv +/PNn5AeP3SYZ4Y1b+qOTEZvpyDrDVWiakuFSdjjo4bq9+0/V77PnSIMx8IIh47a+ +p6tv75/fTM8BuGJqIz3nCU2AG3swpMPdB380vqQmsvZB6Akd4yCYqjdP//fx4ilw +MUc/dNAUFvohigLVigmUdy7yWSiLfFCSCmZ4OIN1xLVaqBHG5cGdZlXPU8Sv13WF +qUITVuwhd4GTWgzqltlJyqEI8pc7bZsEGCREjnwB8twl2F6GmrE52/WRMmrRpnCK +ovfepEWFJqgejF0pW8hL2JpqA15w8oVPbEtoL8pU9ozaMv7Da4M/OMZ+ +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index ed917d08cad..9d535d02da5 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -301,6 +301,26 @@ * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca3g3 CRL */ +/* + * @test id=digicerttlseccrootg5 + * @bug 8318759 + * @summary Interoperability tests with DigiCert TLS ECC P384 Root G5 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlseccrootg5 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlseccrootg5 CRL + */ + +/* + * @test id=digicerttlsrsarootg5 + * @bug 8318759 + * @summary Interoperability tests with DigiCert TLS RSA4096 Root G5 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlsrsarootg5 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlsrsarootg5 CRL + */ + /* * @test id=sslrootrsaca * @bug 8243320 @@ -509,6 +529,7 @@ private CATestURLs getTestURLs(String alias) { return new CATestURLs("https://actrsaroot2017.pki.microsoft.com", "https://rvkrsaroot2017.pki.microsoft.com"); + // Test URLs are listed at https://www.digicert.com/kb/digicert-root-certificates.htm case "quovadisrootca1g3": return new CATestURLs("https://quovadis-root-ca-1-g3.chain-demos.digicert.com", "https://quovadis-root-ca-1-g3-revoked.chain-demos.digicert.com"); @@ -518,6 +539,12 @@ private CATestURLs getTestURLs(String alias) { case "quovadisrootca3g3": return new CATestURLs("https://quovadis-root-ca-3-g3.chain-demos.digicert.com", "https://quovadis-root-ca-3-g3-revoked.chain-demos.digicert.com"); + case "digicerttlseccrootg5": + return new CATestURLs("https://digicert-tls-ecc-p384-root-g5.chain-demos.digicert.com", + "https://digicert-tls-ecc-p384-root-g5-revoked.chain-demos.digicert.com"); + case "digicerttlsrsarootg5": + return new CATestURLs("https://digicert-tls-rsa4096-root-g5.chain-demos.digicert.com", + "https://digicert-tls-rsa4096-root-g5-revoked.chain-demos.digicert.com"); case "sslrootrsaca": return new CATestURLs("https://test-dv-rsa.ssl.com", diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java new file mode 100644 index 00000000000..30ad81b1755 --- /dev/null +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java @@ -0,0 +1,303 @@ +/* + * 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 8318759 + * @summary Interoperability tests with Digicert CS Root G5 certificates + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP + * @run main/othervm -Djava.security.debug=certpath DigicertCSRootG5 CRL + */ + +public class DigicertCSRootG5 { + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + new Digicert_CS_ECC().runTest(pathValidator); + new Digicert_CS_RSA().runTest(pathValidator); + } +} + +class Digicert_CS_ECC { + + // Owner: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US + // Serial number: d926818addd3c47758f0ace9379b2e7 + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIDOTCCAsCgAwIBAgIQDZJoGK3dPEd1jwrOk3my5zAKBggqhkjOPQQDAzBNMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp\n" + + "Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMjExMDAwMDAwWhcNMzYw\n" + + "MjEwMjM1OTU5WjBTMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu\n" + + "Yy4xKzApBgNVBAMTIkRpZ2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEw\n" + + "djAQBgcqhkjOPQIBBgUrgQQAIgNiAAS/zvKH4sLLu/zze3/+vHyfRE5OcO77TNw3\n" + + "MCMAlad2Y/ja50KTooGSmXhfwMXpbBTob7hsoxpvIU92W6DhFn9lg4pcKf5UHLEi\n" + + "0iDdHQ9w0hpFJiMABwK60nk+OwsGTZSjggFdMIIBWTASBgNVHRMBAf8ECDAGAQH/\n" + + "AgEAMB0GA1UdDgQWBBTXHcf6xvqCdCBFcTQSL1XVmEGSXjAfBgNVHSMEGDAWgBTw\n" + + "jJhxOThlwjobphdmHcjtZd6SNjAOBgNVHQ8BAf8EBAMCAYYwEwYDVR0lBAwwCgYI\n" + + "KwYBBQUHAwMweQYIKwYBBQUHAQEEbTBrMCQGCCsGAQUFBzABhhhodHRwOi8vb2Nz\n" + + "cC5kaWdpY2VydC5jb20wQwYIKwYBBQUHMAKGN2h0dHA6Ly9jYWNlcnRzLmRpZ2lj\n" + + "ZXJ0LmNvbS9EaWdpQ2VydENTRUNDUDM4NFJvb3RHNS5jcnQwRQYDVR0fBD4wPDA6\n" + + "oDigNoY0aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0Q1NFQ0NQMzg0\n" + + "Um9vdEc1LmNybDAcBgNVHSAEFTATMAcGBWeBDAEDMAgGBmeBDAEEATAKBggqhkjO\n" + + "PQQDAwNnADBkAjByCWijRCnJogZf94U5HG/5S4QFMxEOBSAyxECbFxgrXMKXh5qa\n" + + "7oS2F+hT2DPzxTwCMCIthK0X/14bxZvrNNiNSWzer2TDUyRw6HNIfnkHgqaGFQVA\n" + + "KyS5I77prv53stK0XQ==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US, SERIALNUMBER=9637546-0160, OID.2.5.4.15=Private + // Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Utah, OID.1.3.6.1.4.1.311.60.2.1.3=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: b13737c3caf58eecb4359f441522133 + // Valid from: Wed Jan 25 16:00:00 PST 2023 until: Tue Jan 28 15:59:59 PST 2025 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIEEjCCA5mgAwIBAgIQCxNzfDyvWO7LQ1n0QVIhMzAKBggqhkjOPQQDAzBTMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xKzApBgNVBAMTIkRp\n" + + "Z2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEwHhcNMjMwMTI2MDAwMDAw\n" + + "WhcNMjUwMTI4MjM1OTU5WjCB2TETMBEGCysGAQQBgjc8AgEDEwJVUzEVMBMGCysG\n" + + "AQQBgjc8AgECEwRVdGFoMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjEV\n" + + "MBMGA1UEBRMMOTYzNzU0Ni0wMTYwMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRh\n" + + "aDEZMBcGA1UEBxMQU2FyYXRvZ2EgU3ByaW5nczEeMBwGA1UEChMVV2luIFRoZSBD\n" + + "dXN0b21lciwgTExDMR4wHAYDVQQDExVXaW4gVGhlIEN1c3RvbWVyLCBMTEMwWTAT\n" + + "BgcqhkjOPQIBBggqhkjOPQMBBwNCAASyShgaH44RcHazlEEMpwRKY4YebnygI9hG\n" + + "wTMQE/VFG40k3tR8lnyjgxTzZbC0aCVavdv1eglDGejQ+6iD8nzgo4IBxjCCAcIw\n" + + "HwYDVR0jBBgwFoAU1x3H+sb6gnQgRXE0Ei9V1ZhBkl4wHQYDVR0OBBYEFLGgEWb9\n" + + "GF89JoXyan/FD/auNIVVMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEF\n" + + "BQcDAzCBjQYDVR0fBIGFMIGCMD+gPaA7hjlodHRwOi8vY3JsMy5kaWdpY2VydC5j\n" + + "b20vRGlnaUNlcnRHNUNTRUNDU0hBMzg0MjAyMUNBMS5jcmwwP6A9oDuGOWh0dHA6\n" + + "Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEc1Q1NFQ0NTSEEzODQyMDIxQ0Ex\n" + + "LmNybDA9BgNVHSAENjA0MDIGBWeBDAEDMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93\n" + + "d3cuZGlnaWNlcnQuY29tL0NQUzB+BggrBgEFBQcBAQRyMHAwJAYIKwYBBQUHMAGG\n" + + "GGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBIBggrBgEFBQcwAoY8aHR0cDovL2Nh\n" + + "Y2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEu\n" + + "Y3J0MAwGA1UdEwEB/wQCMAAwCgYIKoZIzj0EAwMDZwAwZAIwLkWJc/eLxftorFCv\n" + + "ocOA1dfUFx7Al18d5Xsgpkx47kj2DWgQU+/bQEbbyPrKzYgCAjAP5ErLauJRC2to\n" + + "pPk/yXZYXsusmWVH7ozl9O5WR7+a3gVQ1zwVFWuqdjbq3zWWqJM=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: 201e51cb1ec8a56a1e8438c95adf024 + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIFdjCCBP2gAwIBAgIQAgHlHLHsilah6EOMla3wJDAKBggqhk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AcjyHseVU4jeLIQl7/4gZATjePzSy/bo62SZXWzCOFp6zzy8VGGavRmMobe193gn\n" + + "cz/17hmFvqECAwEAAaOCAcQwggHAMB8GA1UdIwQYMBaAFNcdx/rG+oJ0IEVxNBIv\n" + + "VdWYQZJeMB0GA1UdDgQWBBR5Hkdl3jgG88ixGc1wEwO6N9Rn2TA+BgNVHSAENzA1\n" + + "MDMGBmeBDAEEATApMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2ljZXJ0LmNv\n" + + "bS9DUFMwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMIGNBgNV\n" + + "HR8EgYUwgYIwP6A9oDuGOWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2Vy\n" + + "dEc1Q1NFQ0NTSEEzODQyMDIxQ0ExLmNybDA/oD2gO4Y5aHR0cDovL2NybDQuZGln\n" + + "aWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEuY3JsMH4GCCsG\n" + + "AQUFBwEBBHIwcDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29t\n" + + "MEgGCCsGAQUFBzAChjxodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNl\n" + + "cnRHNUNTRUNDU0hBMzg0MjAyMUNBMS5jcnQwCQYDVR0TBAIwADAKBggqhkjOPQQD\n" + + "AwNnADBkAjA9aX3CSzCOZiHdC6JBF0nQwPLGNipPdHFMSbINmfpuHCC3Go4prf8M\n" + + "WCsWEQr2gQYCMErfcrU8zfxnQ9SxsmGJ8jkM3MDGvAr0CtzDwmWis32V60jAUFBQ\n" + + "lGm/Mdb5/EqKpw==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:48:38 PDT 2023", System.out); + } +} + +class Digicert_CS_RSA { + + // Owner: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US + // Serial number: 10262e16224ca6dfef584f8c63048db + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGjDCCBHSgAwIBAgIQAQJi4WIkym3+9YT4xjBI2zANBgkqhkiG9w0BAQwFADBM\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT\n" + + "G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAyMTEwMDAwMDBaFw0z\n" + + "NjAyMTAyMzU5NTlaMFcxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg\n" + + "SW5jLjEvMC0GA1UEAxMmRGlnaUNlcnQgRzUgQ1MgUlNBNDA5NiBTSEEzODQgMjAy\n" + + "MSBDQTEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC1GOMV0tdTLLBk\n" + + "Ylmccgb6bFa9By5zkuLg9NfFMl4y9P9f21C7N+mMA4fWgfjEs+7/3ByGLaB+7/Pi\n" + + "TT3qXpvBz4uVWob9xv3lkAsIpwh/TMJulijy3GdpAQBMdvW/+HFrbRJGaJ3MM9d1\n" + + "pC3CRPmFWyXUpxqhb0FbMPA8OlsZNjg9fd/zCLevSJlL6ZdjfZ/4FiF26OfO60V6\n" + + "bOuTnd8JbDuwPfMWLP6qEinlFr7V9mjcZc4dfUWH70y7M6av7R1Tc68YQjrtPwIA\n" + + "5pdEcG/VeBVplpne1uxuc61ucVgTpjwOTV6E2KrCe+O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mRc\n" + + "xZoXxspSgqpk+jd5iMtVSDBzlaF7s1feDh9qKa7O/7OB5KAiIO2VYFx1ia9ne3tV\n" + + "lY98G+3TnEdjo7r9lBi4KDGmDJv56h7Sb4WeVFlJ/8b4u9IHblq3ykQ/LyKuCYDf\n" + + "v2bnqlT+HY4mgU9ZA0WoO/L7V7m0sBrBYhpdM0pmxlqn6mpvWIHA2tC4rsTY2TXn\n" + + "ZlXbyJaMd5mvjRjvK0DF/2yoKC+us/1li2blLZKS9k0Z36/m4D7z5nVXkmUvRvE2\n" + + "70BhJ0NnM5lHtytTR+OgiaPapeiDy6AA+VbdnV7hhINGEhP7tF3IZPPfmKZN7/bN\n" + + "Qr7wuKZx/jO5sTBtblBaOU2+xric+MlTt2k3ilDnO3EzkZOp1JMWnNjAZciRa8Gy\n" + + "bYAXrsxY4vQnxgA7dj1/3KDB+pCRT7CTMOJJQu27OOv0MuNkb1E+8chPx/eFwfrN\n" + + "rft1Eiqp3Te0w4njDkzukP6EMhebcTp3POm0YhMZl8s1fTI6DCcHFwcMVywXiWwv\n" + + "QG+Td+dHlFT0P8jq/ecaMj6s8j69q36MER+QMyrxGAl3MHyEA7BBut1WCh9dsOnY\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: bfec2fd49eeacb347ddbea5c1576083 + // Valid from: Fri Jun 23 17:00:00 PDT 2023 until: Wed Jun 26 16:59:59 PDT 2024 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGqzCCBJOgAwIBAgIQC/7C/UnurLNH3b6lwVdggzANBgkqhkiG9w0BAQsFADBX" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0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uKBV7WlEGCmj0QTWZ0/AFBLzNcq7" + + "+0rgP0GM98MZpKa8pHZaS1A3uP1TFzamfVGdv0FVHXSkN5Kvg0iPh4Qz9TRiCkyE" + + "boJeU1LYdyTrP/+q3zQqsGa9xdQ50EovjWymbvWzCQ==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, + // ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: f409d101094769abaf06f085f11ca4f + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIHKTCCBRGgAwIBAgIQD0CdEBCUdpq68G8IXxHKTzANBgkqhkiG9w0BAQsFADBX\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT\n" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMB4XDTIzMTAy\n" + + "MzAwMDAwMFoXDTI0MTAyMjIzNTk1OVowdTELMAkGA1UEBhMCVVMxDTALBgNVBAgT\n" + + "BFV0YWgxGTAXBgNVBAcTEFNhcmF0b2dhIFNwcmluZ3MxHTAbBgNVBAoTFFdpbiB0\n" + + "aGUgQ3VzdG9tZXIgTExDMR0wGwYDVQQDExRXaW4gdGhlIEN1c3RvbWVyIExMQzCC\n" + + "AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANKPhVjUn2MyZs/l4AO0kQCE\n" + + "HdR9aWJ86nT8jSSbHdRv56n3h5P3sxMfFne4jCY3DzrykndeLp4gAt2sot1ziinh\n" + + "ahMOYOZtvyUzt5/McvQyuQjdXLaSuWcvlKaTl67U3QWQe+P6kmkRDsrCH0S51UeH\n" + + "8Tct/bq7ZUyX9Jb80VPVegUN80YzDgkJ2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UHMAGGGGh0dHA6Ly9v\n" + + "Y3NwLmRpZ2ljZXJ0LmNvbTBMBggrBgEFBQcwAoZAaHR0cDovL2NhY2VydHMuZGln\n" + + "aWNlcnQuY29tL0RpZ2lDZXJ0RzVDU1JTQTQwOTZTSEEzODQyMDIxQ0ExLmNydDAJ\n" + + "BgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4ICAQAKCH6ri6f507/j2ifF7VQbavWE\n" + + "Wn4T63PzJveL6/kedV7avhrQ/B6uHrez1xy/RH/MlL/B+TF6YTg+ILqtKR/PyJrg\n" + + "N+1RON0Eg3AEWWDtGl3KBYFlklz8Szo+xmXf5GYiqueejbxscH1BA0PU/5CgGkr6\n" + + "1Kk4OXqKqmpuPeQCxca1ARDD749E/2IFsDGC8kBCWepV62l0/xcDKWD5Zn+y4Tkh\n" + + "5+YJJ21D746sNDOsDNJ4DuqEYrXWUH6BlT5EDYelGqRCOdyTYUdDg+QcSFWnH7wR\n" + + "O+eIA3BLSw0x1Vh6DJRKm5H644sPVppaI1jVZDe+zBwp2e/j8XH7KDlp/WaRUhcU\n" + + "bjGg2Ss5TMbBjR6B4nMwjvqaCIFoAD6aFRYc80px/KY6KTSyOFF0FBQNuhSsUZQy\n" + + "p74aRjUraSu/RiJMA8A6OYGo1b7W9o/UOg0MB4WQkfwl+Mxh+58QKjLjZr9VVapW\n" + + "4yv0G/G6rT/pHrRiyBcT7Kt4xNFsmMFAN4BXL9WI9mkGDa4iwDmWVjIjAaiilaaC\n" + + "MIXwwm3eg/QBgWBUrwXf3YC+1HXkaFDZc5apQ5uaNJPjQo9nQ6xqfpnACXTJ/Lwm\n" + + "JBu4YlXPby5Vh6mWWSyVdbICrCD7BtGP8aSBPFGPEuPEjK32uyeoGWVwwSubVFPX\n" + + "ARhLX5oSFZUySvHgYg==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:44:23 PDT 2023", System.out); + } +} diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index fece9aa4025..f244633e4ab 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 + * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +47,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 99; + private static final int COUNT = 103; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "DA:61:45:1C:93:F3:6A:30:24:68:C6:72:BC:C5:E6:E4:E3:BA:6A:AE:36:29:7B:45:53:B7:10:53:52:7D:7E:A5"; + = "A6:73:50:DD:6B:49:E6:F0:E7:E7:7B:F9:F9:11:9F:83:2D:FD:95:97:69:03:54:54:9C:B7:DF:46:A4:05:7A:15"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") private static final Map FINGERPRINT_MAP = new HashMap<>() { @@ -159,6 +159,14 @@ public class VerifyCACerts { "18:F1:FC:7F:20:5D:F8:AD:DD:EB:7F:E0:07:DD:57:E3:AF:37:5A:9C:4D:8D:73:54:6B:F4:F1:FE:D1:E1:8D:35"); put("quovadisrootca3g3 [jdk]", "88:EF:81:DE:20:2E:B0:18:45:2E:43:F8:64:72:5C:EA:5F:BD:1F:C2:D9:D2:05:73:07:09:C5:D8:B8:69:0F:46"); + put("digicertcseccrootg5 [jdk]", + "26:C5:6A:D2:20:8D:1E:9B:15:2F:66:85:3B:F4:79:7C:BE:B7:55:2C:1F:3F:47:72:51:E8:CB:1A:E7:E7:97:BF"); + put("digicertcsrsarootg5 [jdk]", + "73:53:B6:D6:C2:D6:DA:42:47:77:3F:3F:07:D0:75:DE:CB:51:34:21:2B:EA:D0:92:8E:F1:F4:61:15:26:09:41"); + put("digicerttlseccrootg5 [jdk]", + "01:8E:13:F0:77:25:32:CF:80:9B:D1:B1:72:81:86:72:83:FC:48:C6:E1:3B:E9:C6:98:12:85:4A:49:0C:1B:05"); + put("digicerttlsrsarootg5 [jdk]", + "37:1A:00:DC:05:33:B3:72:1A:7E:EB:40:E8:41:9E:70:79:9D:2B:0A:0F:2C:1D:80:69:31:65:F7:CE:C4:AD:75"); put("secomscrootca2 [jdk]", "51:3B:2C:EC:B8:10:D4:CD:E5:DD:85:39:1A:DF:C6:C2:DD:60:D8:7B:B7:36:D2:B5:21:48:4A:A4:7A:0E:BE:F6"); put("swisssigngoldg2ca [jdk]", From 345122d7ad9c2148e117fb7ebfe515fc2955dafa Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 28 Nov 2023 11:31:13 +0000 Subject: [PATCH 158/177] 8067250: [mlvm] vm/mlvm/mixed/stress/regression/b6969574 fails and perf regression Backport-of: 2b003cb4aab2d9c6fc3233b678070951cb9b6f6b --- .../regression/b6969574/INDIFY_Test.java | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java index 970411e0502..7dc874f3a53 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,7 @@ * @bug 6969574 * * @summary converted from VM Testbase vm/mlvm/mixed/stress/regression/b6969574. - * VM Testbase keywords: [feature_mlvm, nonconcurrent, quarantine] - * VM Testbase comments: 8079650 + * VM Testbase keywords: [feature_mlvm, nonconcurrent] * * @library /vmTestbase * /test/lib @@ -313,10 +312,8 @@ private void verifyTimeOrder(Result value, Result base) { private final static int REFLECTION_CALL = 1; private final static int INVOKE_EXACT = 2; private final static int INVOKE = 3; - private final static int INVOKE_WITHARG = 4; - private final static int INVOKE_WITHARG_TYPECONV = 5; - private final static int INDY = 6; - private final static int BENCHMARK_COUNT = 7; + private final static int INDY = 4; + private final static int BENCHMARK_COUNT = 5; // // Test body @@ -356,18 +353,6 @@ public void run() throws Throwable { } }); - benchmarks[INVOKE_WITHARG] = new Benchmark("MH.invokeWithArguments(), exact types", new T() { - public void run() throws Throwable { - mhTestee.invokeWithArguments(testData, TESTEE_ARG2, TESTEE_ARG3); - } - }); - - benchmarks[INVOKE_WITHARG_TYPECONV] = new Benchmark("MH.invokeWithArguments() + type conv.", new T() { - public void run() throws Throwable { - mhTestee.invokeWithArguments((Object) testData, null, (Short) Short.MAX_VALUE); - } - }); - benchmarks[INDY] = new Benchmark("invokedynamic instruction", new T() { public void run() throws Throwable { indyWrapper(testData); @@ -415,8 +400,6 @@ public void run() throws Throwable { verifyTimeOrder(results[REFLECTION_CALL], results[INVOKE_EXACT]); verifyTimeOrder(results[INVOKE_EXACT], results[DIRECT_CALL]); verifyTimeOrder(results[INVOKE], results[DIRECT_CALL]); - verifyTimeOrder(results[INVOKE_WITHARG], results[INVOKE_EXACT]); - verifyTimeOrder(results[INVOKE_WITHARG_TYPECONV], results[INVOKE_EXACT]); verifyTimeOrder(results[INVOKE_EXACT], results[INDY]); return true; From f9bedac07d7c0f77cd6e8f05c2f05a7bb1efe126 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 28 Nov 2023 11:33:21 +0000 Subject: [PATCH 159/177] 8218178: vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java fails with -Xcomp Backport-of: 103b6b2d6978bbd6f66a862d017bba8b0ef71102 --- .../vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java index 7dc874f3a53..a80ff855c91 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java @@ -397,7 +397,7 @@ public void run() throws Throwable { // TODO: exclude GC time, compilation time (optionally) from measurements print("Comparing invocation time orders"); - verifyTimeOrder(results[REFLECTION_CALL], results[INVOKE_EXACT]); + verifyTimeOrder(results[INDY], results[REFLECTION_CALL]); verifyTimeOrder(results[INVOKE_EXACT], results[DIRECT_CALL]); verifyTimeOrder(results[INVOKE], results[DIRECT_CALL]); verifyTimeOrder(results[INVOKE_EXACT], results[INDY]); From bd7420a71ce34eeed33feece917ac84bb52359e9 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 28 Nov 2023 11:37:34 +0000 Subject: [PATCH 160/177] 8224035: Replace wildcard address with loopback or local host in tests - part 9 Backport-of: 57d319210a1b6a98efb0b8f1ff9363b175012e20 --- .../jdk/java/net/ServerSocket/ThreadStop.java | 7 ++-- test/jdk/java/net/Socket/asyncClose/Race.java | 10 ++++-- .../jdk/java/net/URLClassLoader/HttpTest.java | 17 ++++++--- .../java/net/URLConnection/TimeoutTest.java | 5 +-- .../http/HttpClient/CookieHttpClientTest.java | 16 +++++++-- .../www/protocol/http/HttpInputStream.java | 18 ++++++++-- .../net/www/protocol/http/HttpStreams.java | 35 +++++++++++++------ .../net/www/protocol/http/RedirectOnPost.java | 8 +++-- .../http/SetChunkedStreamingMode.java | 5 +-- .../www/protocol/http/SetIfModifiedSince.java | 23 +++++++----- 10 files changed, 101 insertions(+), 43 deletions(-) diff --git a/test/jdk/java/net/ServerSocket/ThreadStop.java b/test/jdk/java/net/ServerSocket/ThreadStop.java index adf19379280..da8f1fb2b97 100644 --- a/test/jdk/java/net/ServerSocket/ThreadStop.java +++ b/test/jdk/java/net/ServerSocket/ThreadStop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ static class Server implements Runnable { ServerSocket ss; Server() throws IOException { - ss = new ServerSocket(0); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); } public int localPort() { @@ -81,7 +82,7 @@ public static void main(String args[]) throws Exception { // still in accept() so we connect to server which causes // it to unblock and do JNI-stuff with a pending exception - try (Socket s = new Socket("localhost", svr.localPort())) { + try (Socket s = new Socket(svr.ss.getInetAddress(), svr.localPort())) { } catch (IOException ioe) { } thr.join(); diff --git a/test/jdk/java/net/Socket/asyncClose/Race.java b/test/jdk/java/net/Socket/asyncClose/Race.java index 3a7b7affeec..47dac318543 100644 --- a/test/jdk/java/net/Socket/asyncClose/Race.java +++ b/test/jdk/java/net/Socket/asyncClose/Race.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,8 @@ */ import java.io.InputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.ConnectException; @@ -40,12 +42,14 @@ public class Race { final static int THREADS = 100; public static void main(String[] args) throws Exception { - try (ServerSocket ss = new ServerSocket(0)) { + try (ServerSocket ss = new ServerSocket()) { + InetAddress loopback = InetAddress.getLoopbackAddress(); + ss.bind(new InetSocketAddress(loopback, 0)); final int port = ss.getLocalPort(); final Phaser phaser = new Phaser(THREADS + 1); for (int i=0; i<100; i++) { try { - final Socket s = new Socket("localhost", port); + final Socket s = new Socket(loopback, port); s.setSoLinger(false, 0); try (Socket sa = ss.accept()) { sa.setSoLinger(false, 0); diff --git a/test/jdk/java/net/URLClassLoader/HttpTest.java b/test/jdk/java/net/URLClassLoader/HttpTest.java index 87e10d4106d..620eb34dbaa 100644 --- a/test/jdk/java/net/URLClassLoader/HttpTest.java +++ b/test/jdk/java/net/URLClassLoader/HttpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /** * @test * @bug 4636331 + * @library /test/lib * @summary Check that URLClassLoader doesn't create excessive http * connections */ @@ -31,6 +32,8 @@ import java.io.*; import java.util.*; +import jdk.test.lib.net.URIBuilder; + public class HttpTest { /* @@ -119,7 +122,8 @@ public void run() { } HttpServer() throws Exception { - ss = new ServerSocket(0); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); } public void run() { @@ -200,9 +204,12 @@ public static void main(String args[]) throws Exception { HttpServer svr = HttpServer.create(); // create class loader - URL urls[] = - { new URL("http://localhost:" + svr.port() + "/dir1/"), - new URL("http://localhost:" + svr.port() + "/dir2/") }; + URL urls[] = { + URIBuilder.newBuilder().scheme("http").loopback().port(svr.port()) + .path("/dir1/").toURL(), + URIBuilder.newBuilder().scheme("http").loopback().port(svr.port()) + .path("/dir2/").toURL(), + }; URLClassLoader cl = new URLClassLoader(urls); // Test 1 - check that getResource does single HEAD request diff --git a/test/jdk/java/net/URLConnection/TimeoutTest.java b/test/jdk/java/net/URLConnection/TimeoutTest.java index 82868ad01f0..57ad060662c 100644 --- a/test/jdk/java/net/URLConnection/TimeoutTest.java +++ b/test/jdk/java/net/URLConnection/TimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -67,7 +67,8 @@ public static void main(String[] args) throws Exception { } public void test() throws Exception { - ServerSocket ss = new ServerSocket(0); + ServerSocket ss = new ServerSocket(); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); Server s = new Server (ss); try{ URL url = URIBuilder.newBuilder() diff --git a/test/jdk/sun/net/www/http/HttpClient/CookieHttpClientTest.java b/test/jdk/sun/net/www/http/HttpClient/CookieHttpClientTest.java index e2c14229302..f54dcb678a1 100644 --- a/test/jdk/sun/net/www/http/HttpClient/CookieHttpClientTest.java +++ b/test/jdk/sun/net/www/http/HttpClient/CookieHttpClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* * @test * @bug 7129083 + * @library /test/lib * @summary Cookiemanager does not store cookies if url is read * before setting cookiemanager */ @@ -31,12 +32,16 @@ import java.net.CookieHandler; import java.net.CookieManager; import java.net.CookiePolicy; +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.URL; import java.io.InputStream; import java.io.IOException; +import jdk.test.lib.net.URIBuilder; + public class CookieHttpClientTest implements Runnable { final ServerSocket ss; static final int TIMEOUT = 10 * 1000; @@ -85,10 +90,15 @@ static void readOneRequest(InputStream is) throws IOException { CookieHttpClientTest() throws Exception { /* start the server */ - ss = new ServerSocket(0); + ss = new ServerSocket(); + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); (new Thread(this)).start(); - URL url = new URL("http://localhost:" + ss.getLocalPort() +"/"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(ss.getLocalPort()) + .path("/").toURL(); // Run without a CookieHandler first InputStream in = url.openConnection().getInputStream(); diff --git a/test/jdk/sun/net/www/protocol/http/HttpInputStream.java b/test/jdk/sun/net/www/protocol/http/HttpInputStream.java index d9478caebed..6c3f68c2bde 100644 --- a/test/jdk/sun/net/www/protocol/http/HttpInputStream.java +++ b/test/jdk/sun/net/www/protocol/http/HttpInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ /* @test * @bug 4937598 + * @library /test/lib * @summary http://www.clipstream.com video does not play; read() problem */ @@ -30,10 +31,14 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.URL; +import jdk.test.lib.net.URIBuilder; + public class HttpInputStream { private static final int CONTENT_LENGTH = 20; @@ -45,7 +50,9 @@ static class Server implements AutoCloseable, Runnable { static final int TIMEOUT = 10 * 1000; Server() throws IOException { - serverSocket = new ServerSocket(0); + serverSocket = new ServerSocket(); + serverSocket.bind(new InetSocketAddress( + InetAddress.getLoopbackAddress(), 0)); } void readOneRequest(InputStream is) throws IOException { @@ -106,7 +113,12 @@ private static int read(InputStream is) throws IOException { public static void main(String args[]) throws IOException { try (Server server = new Server()) { (new Thread(server)).start(); - URL url = new URL("http://localhost:" + server.getPort() + "/anything"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getPort()) + .path("/anything") + .toURLUnchecked(); try (InputStream is = url.openConnection().getInputStream()) { if (read(is) != CONTENT_LENGTH) { throw new RuntimeException("HttpInputStream.read() failed with 0xff"); diff --git a/test/jdk/sun/net/www/protocol/http/HttpStreams.java b/test/jdk/sun/net/www/protocol/http/HttpStreams.java index 9b94b53e09b..0b33e4327cb 100644 --- a/test/jdk/sun/net/www/protocol/http/HttpStreams.java +++ b/test/jdk/sun/net/www/protocol/http/HttpStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /** * @test * @bug 8011719 + * @library /test/lib * @modules jdk.httpserver * @summary Basic checks to verify behavior of returned input streams */ @@ -36,6 +37,8 @@ import java.nio.charset.StandardCharsets; import java.util.*; +import jdk.test.lib.net.URIBuilder; + public class HttpStreams { void client(String u) throws Exception { @@ -56,24 +59,33 @@ void client(String u) throws Exception { expectThrow(() -> { is.read(ba, 0, 2); }, "read on closed stream should throw: " + u); } + String constructUrlString(int port, String path) throws Exception { + return URIBuilder.newBuilder() + .scheme("http") + .port(port) + .loopback() + .path(path) + .toURL().toString(); + } + void test() throws Exception { HttpServer server = null; try { server = startHttpServer(); - String baseUrl = "http://localhost:" + server.getAddress().getPort() + "/"; - client(baseUrl + "chunked/"); - client(baseUrl + "fixed/"); - client(baseUrl + "error/"); - client(baseUrl + "chunkedError/"); + int serverPort = server.getAddress().getPort(); + client(constructUrlString(serverPort, "/chunked/")); + client(constructUrlString(serverPort, "/fixed/")); + client(constructUrlString(serverPort, "/error/")); + client(constructUrlString(serverPort, "/chunkedError/")); // Test with a response cache ResponseCache ch = ResponseCache.getDefault(); ResponseCache.setDefault(new TrivialCacheHandler()); try { - client(baseUrl + "chunked/"); - client(baseUrl + "fixed/"); - client(baseUrl + "error/"); - client(baseUrl + "chunkedError/"); + client(constructUrlString(serverPort, "/chunked/")); + client(constructUrlString(serverPort, "/fixed/")); + client(constructUrlString(serverPort, "/error/")); + client(constructUrlString(serverPort, "/chunkedError/")); } finally { ResponseCache.setDefault(ch); } @@ -93,7 +105,8 @@ public static void main(String[] args) throws Exception { // HTTP Server HttpServer startHttpServer() throws IOException { - HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0); + HttpServer httpServer = HttpServer.create(); + httpServer.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0); httpServer.createContext("/chunked/", new ChunkedHandler()); httpServer.createContext("/fixed/", new FixedHandler()); httpServer.createContext("/error/", new ErrorHandler()); diff --git a/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java b/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java index 9b464c46669..9939b9b025c 100644 --- a/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java +++ b/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,7 +166,8 @@ public void handle(HttpExchange msg) { private static HttpServer getHttpServer(ExecutorService execs) throws Exception { - InetSocketAddress inetAddress = new InetSocketAddress(0); + InetSocketAddress inetAddress = new InetSocketAddress( + InetAddress.getLoopbackAddress(), 0); HttpServer testServer = HttpServer.create(inetAddress, 15); int port = testServer.getAddress().getPort(); testServer.setExecutor(execs); @@ -181,7 +182,8 @@ private static HttpsServer getHttpsServer( ) throws Exception { - InetSocketAddress inetAddress = new InetSocketAddress(0); + InetSocketAddress inetAddress = new InetSocketAddress( + InetAddress.getLoopbackAddress(), 0); HttpsServer testServer = HttpsServer.create(inetAddress, 15); int port = testServer.getAddress().getPort(); testServer.setExecutor(execs); diff --git a/test/jdk/sun/net/www/protocol/http/SetChunkedStreamingMode.java b/test/jdk/sun/net/www/protocol/http/SetChunkedStreamingMode.java index 5639f4a3eb1..bda2e404108 100644 --- a/test/jdk/sun/net/www/protocol/http/SetChunkedStreamingMode.java +++ b/test/jdk/sun/net/www/protocol/http/SetChunkedStreamingMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -67,7 +67,8 @@ static void read (InputStream is) throws IOException { public static void main (String[] args) throws Exception { try { - server = new TestHttpServer (new SetChunkedStreamingMode(), 1, 10, 0); + server = new TestHttpServer(new SetChunkedStreamingMode(), 1, 10, + InetAddress.getLoopbackAddress(), 0); System.out.println ("Server: listening on port: " + server.getLocalPort()); URL url = URIBuilder.newBuilder() .scheme("http") diff --git a/test/jdk/sun/net/www/protocol/http/SetIfModifiedSince.java b/test/jdk/sun/net/www/protocol/http/SetIfModifiedSince.java index df6045cd302..1ccc1b81b5c 100644 --- a/test/jdk/sun/net/www/protocol/http/SetIfModifiedSince.java +++ b/test/jdk/sun/net/www/protocol/http/SetIfModifiedSince.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,13 +22,15 @@ */ /* @test - @bug 4213164 8172253 - @summary setIfModifiedSince mehtod in HttpURLConnection sometimes fails - */ + * @bug 4213164 8172253 + * @library /test/lib + * @summary setIfModifiedSince method in HttpURLConnection sometimes fails + */ import java.util.*; import java.io.*; import java.net.*; -import java.text.*; + +import jdk.test.lib.net.URIBuilder; public class SetIfModifiedSince implements Runnable { @@ -75,7 +77,8 @@ public void run() { public SetIfModifiedSince() throws Exception { - serverSock = new ServerSocket(0); + serverSock = new ServerSocket(); + serverSock.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); int port = serverSock.getLocalPort(); Thread thr = new Thread(this); @@ -86,8 +89,12 @@ public SetIfModifiedSince() throws Exception { HttpURLConnection con; //url = new URL(args[0]); - url = new URL("http://localhost:" + String.valueOf(port) + - "/anything"); + url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .path("/anything") + .toURL(); con = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); con.setIfModifiedSince(date.getTime()); From 911c3597a2f373204b2f00d1d1d5d71867920c5c Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Tue, 28 Nov 2023 11:39:52 +0000 Subject: [PATCH 161/177] 8249812: java/net/DatagramSocket/PortUnreachable.java still fails intermittently with SocketTimeoutException 8232513: java/net/DatagramSocket/PortUnreachable.java still fails intermittently with BindException Fixed the test to reenable its retry logic Reviewed-by: lucy Backport-of: 9f23c2c159fdb992edc4023f9dc5e9e88b15e53e --- .../net/DatagramSocket/PortUnreachable.java | 73 +++++++++++-------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/test/jdk/java/net/DatagramSocket/PortUnreachable.java b/test/jdk/java/net/DatagramSocket/PortUnreachable.java index 5fc64909a82..b1def0a23d4 100644 --- a/test/jdk/java/net/DatagramSocket/PortUnreachable.java +++ b/test/jdk/java/net/DatagramSocket/PortUnreachable.java @@ -25,10 +25,12 @@ * @test * @bug 4361783 * @key intermittent - * @summary Test to see if ICMP Port Unreachable on non-connected - * DatagramSocket causes a SocketException "socket closed" - * exception on Windows 2000. + * @summary Test to see if ICMP Port Unreachable on non-connected + * DatagramSocket causes a SocketException "socket closed" + * exception on Windows 2000. + * @run main/othervm PortUnreachable */ + import java.net.BindException; import java.net.DatagramPacket; import java.net.DatagramSocket; @@ -41,25 +43,22 @@ public class PortUnreachable { int serverPort; int clientPort; - public void serverSend() { - try { - InetAddress addr = InetAddress.getLocalHost(); - Thread.sleep(1000); - // send a delayed packet which should mean a delayed icmp - // port unreachable - byte b[] = "A late msg".getBytes(); - DatagramPacket packet = new DatagramPacket(b, b.length, addr, - serverPort); - clientSock.send(packet); - - DatagramSocket sock = recreateServerSocket(serverPort); - b = "Greetings from the server".getBytes(); - packet = new DatagramPacket(b, b.length, addr, clientPort); - sock.send(packet); - sock.close(); - } catch (Exception e) { - e.printStackTrace(); - } + public void serverSend() throws Exception { + InetAddress addr = InetAddress.getLocalHost(); + Thread.sleep(1000); + // send a delayed packet which should mean a delayed icmp + // port unreachable + byte b[] = "A late msg".getBytes(); + DatagramPacket packet = new DatagramPacket(b, b.length, addr, + serverPort); + clientSock.send(packet); + + DatagramSocket sock = recreateServerSocket(serverPort); + b = "Greetings from the server".getBytes(); + packet = new DatagramPacket(b, b.length, addr, clientPort); + sock.send(packet); + Thread.sleep(500); // give time to the kernel to send packet + sock.close(); } DatagramSocket recreateServerSocket (int serverPort) throws Exception { @@ -70,15 +69,15 @@ DatagramSocket recreateServerSocket (int serverPort) throws Exception { serverPort); // it's possible that this method intermittently fails, if some other // process running on the machine grabs the port we want before us, - // and doesn't release it before the 5 * 500 ms are elapsed... + // and doesn't release it before the 10 * 500 ms are elapsed... while (serverSocket == null) { try { serverSocket = new DatagramSocket(serverPort, InetAddress.getLocalHost()); } catch (BindException bEx) { - if (retryCount++ < 5) { - sleeptime += sleepAtLeast(500); + if (retryCount++ < 10) { + sleeptime += sleepAtLeast(500); } else { - System.out.println("Give up after 5 retries and " + sleeptime(sleeptime)); + System.out.println("Give up after 10 retries and " + sleeptime(sleeptime)); System.out.println("Has some other process grabbed port " + serverPort + "?"); throw bEx; } @@ -154,6 +153,7 @@ void execute () throws Exception{ clientSock.send(packet); serverSend(); + // try to receive b = new byte[25]; packet = new DatagramPacket(b, b.length, addr, serverPort); @@ -166,8 +166,23 @@ void execute () throws Exception{ } public static void main(String[] args) throws Exception { - PortUnreachable test = new PortUnreachable(); - test.execute(); - } + // A BindException might be thrown intermittently. In that case retry + // 3 times before propagating the exception to finish execution. + int catchCount = 0; + while (true) { + try { + PortUnreachable test = new PortUnreachable(); + test.execute(); + return; + } catch (BindException bEx) { + System.out.println("Failed to bind server: " + bEx); + if (++catchCount > 3) { + System.out.printf("Max retry count exceeded (%d)%n", catchCount); + throw bEx; + } + System.out.printf("Retrying; retry count: %d%n", catchCount); + } + } + } } From a956ba6a82e117d50b1677d6e027e3b6175457d3 Mon Sep 17 00:00:00 2001 From: Soumadipta Roy Date: Tue, 28 Nov 2023 11:42:56 +0000 Subject: [PATCH 162/177] 8315692: Parallelize gc/stress/TestStressRSetCoarsening.java test Reviewed-by: phh Backport-of: a564d436c722f14041231158f21c4ad3a2f6a3a5 --- .../gc/stress/TestStressRSetCoarsening.java | 75 +++++++++++++++++-- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java b/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java index 3e69832d7cd..68a69eefa68 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java +++ b/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java @@ -27,13 +27,12 @@ import sun.hotspot.WhiteBox; /* - * @test TestStressRSetCoarsening.java + * @test * @key stress * @bug 8146984 8147087 * @requires vm.gc.G1 * @requires os.maxMemory > 3G * @requires vm.opt.MaxGCPauseMillis == "null" - * * @summary Stress G1 Remembered Set by creating a lot of cross region links * @modules java.base/jdk.internal.misc * @library /test/lib @@ -43,27 +42,87 @@ * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 1 0 300 + * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 1 0 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=8m gc.stress.TestStressRSetCoarsening 1 10 300 + * -Xmx500m -XX:G1HeapRegionSize=8m gc.stress.TestStressRSetCoarsening 1 10 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 * -Xmx500m -XX:G1HeapRegionSize=32m gc.stress.TestStressRSetCoarsening 42 10 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 2 0 300 + * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 2 0 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=1800 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 500 0 1800 + * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 500 0 1800 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=1800 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 10 10 1800 + * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 10 10 1800 */ /** @@ -96,7 +155,7 @@ public static void main(String... args) throws InterruptedException { } int objectsPerRegion = Integer.parseInt(args[0]); // 1 means humongous int regsToRefresh = Integer.parseInt(args[1]); // 0 means no regions to refresh at the end of cycle - int timeout = Integer.parseInt(args[2]); // in seconds, test should stop working eariler + int timeout = Integer.parseInt(args[2]); // in seconds, test should stop working earlier new TestStressRSetCoarsening(objectsPerRegion, regsToRefresh, timeout).go(); } From f65058efd6b174406bc7459fc1fcc56c2bfe734e Mon Sep 17 00:00:00 2001 From: Kangcheng Xu Date: Tue, 28 Nov 2023 13:43:24 +0000 Subject: [PATCH 163/177] 8053479: (dc) DatagramChannel.read() throws exception instead of discarding data when buffer too small Backport-of: 6ef474a4f4cfacc12db5e349c419fa4b41b346aa --- .../native/libnio/ch/DatagramDispatcher.c | 34 ++--- .../native/libnio/ch/DatagramDispatcher.c | 56 +++---- .../channels/DatagramChannel/Truncate.java | 140 ++++++++++++++++++ 3 files changed, 185 insertions(+), 45 deletions(-) create mode 100644 test/jdk/java/nio/channels/DatagramChannel/Truncate.java diff --git a/src/java.base/unix/native/libnio/ch/DatagramDispatcher.c b/src/java.base/unix/native/libnio/ch/DatagramDispatcher.c index f9f2391d862..3979b34173c 100644 --- a/src/java.base/unix/native/libnio/ch/DatagramDispatcher.c +++ b/src/java.base/unix/native/libnio/ch/DatagramDispatcher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,32 +23,30 @@ * questions. */ -/* - */ - -#include "jni.h" -#include "jni_util.h" -#include "jvm.h" -#include "jlong.h" -#include "sun_nio_ch_DatagramDispatcher.h" #include #include #include #include +#include +#include "jni.h" +#include "jni_util.h" +#include "jvm.h" +#include "jlong.h" +#include "nio.h" #include "nio_util.h" -#include +#include "sun_nio_ch_DatagramDispatcher.h" JNIEXPORT jint JNICALL Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz, - jobject fdo, jlong address, jint len) + jobject fdo, jlong address, jint len) { jint fd = fdval(env, fdo); void *buf = (void *)jlong_to_ptr(address); int result = recv(fd, buf, len, 0); if (result < 0 && errno == ECONNREFUSED) { JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); - return -2; + return IOS_THROWN; } return convertReturnVal(env, result, JNI_TRUE); } @@ -56,7 +54,7 @@ Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz, JNIEXPORT jlong JNICALL Java_sun_nio_ch_DatagramDispatcher_readv0(JNIEnv *env, jclass clazz, - jobject fdo, jlong address, jint len) + jobject fdo, jlong address, jint len) { jint fd = fdval(env, fdo); ssize_t result = 0; @@ -74,28 +72,28 @@ Java_sun_nio_ch_DatagramDispatcher_readv0(JNIEnv *env, jclass clazz, result = recvmsg(fd, &m, 0); if (result < 0 && errno == ECONNREFUSED) { JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); - return -2; + return IOS_THROWN; } return convertLongReturnVal(env, (jlong)result, JNI_TRUE); } JNIEXPORT jint JNICALL Java_sun_nio_ch_DatagramDispatcher_write0(JNIEnv *env, jclass clazz, - jobject fdo, jlong address, jint len) + jobject fdo, jlong address, jint len) { jint fd = fdval(env, fdo); void *buf = (void *)jlong_to_ptr(address); int result = send(fd, buf, len, 0); if (result < 0 && errno == ECONNREFUSED) { JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); - return -2; + return IOS_THROWN; } return convertReturnVal(env, result, JNI_FALSE); } JNIEXPORT jlong JNICALL Java_sun_nio_ch_DatagramDispatcher_writev0(JNIEnv *env, jclass clazz, - jobject fdo, jlong address, jint len) + jobject fdo, jlong address, jint len) { jint fd = fdval(env, fdo); struct iovec *iov = (struct iovec *)jlong_to_ptr(address); @@ -113,7 +111,7 @@ Java_sun_nio_ch_DatagramDispatcher_writev0(JNIEnv *env, jclass clazz, result = sendmsg(fd, &m, 0); if (result < 0 && errno == ECONNREFUSED) { JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); - return -2; + return IOS_THROWN; } return convertLongReturnVal(env, (jlong)result, JNI_FALSE); } diff --git a/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c b/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c index e111b8947f1..8d3a14ffd91 100644 --- a/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c +++ b/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,21 +23,19 @@ * questions. */ -/* - */ - #include #include #include + #include "jni.h" #include "jni_util.h" #include "jvm.h" #include "jlong.h" -#include "sun_nio_ch_DatagramDispatcher.h" - #include "nio.h" #include "nio_util.h" +#include "sun_nio_ch_DatagramDispatcher.h" + /************************************************************** * DatagramDispatcher.c @@ -45,7 +43,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz, jobject fdo, - jlong address, jint len) + jlong address, jint len) { /* set up */ int i = 0; @@ -69,16 +67,18 @@ Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz, jobject fdo, if (i == SOCKET_ERROR) { int theErr = (jint)WSAGetLastError(); - if (theErr == WSAEWOULDBLOCK) { - return IOS_UNAVAILABLE; - } - if (theErr == WSAECONNRESET) { - purgeOutstandingICMP(env, clazz, fd); - JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); + if (theErr != WSAEMSGSIZE) { + if (theErr == WSAEWOULDBLOCK) { + return IOS_UNAVAILABLE; + } + if (theErr == WSAECONNRESET) { + purgeOutstandingICMP(env, clazz, fd); + JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); + return IOS_THROWN; + } + JNU_ThrowIOExceptionWithLastError(env, "WSARecv failed"); return IOS_THROWN; } - JNU_ThrowIOExceptionWithLastError(env, "Write failed"); - return IOS_THROWN; } return convertReturnVal(env, (jint)read, JNI_TRUE); @@ -104,7 +104,7 @@ Java_sun_nio_ch_DatagramDispatcher_readv0(JNIEnv *env, jclass clazz, for(i=0; i buffer.put((byte)i)); + buffer.flip(); + + int n = dc.send(buffer, target); + assertTrue(n == size); + buffer.flip(); + return buffer; + } + + static void assertTrue(boolean e) { + if (!e) throw new RuntimeException(); + } +} From a3661a5857105b83a942df01a175c3c4a5ef368d Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Tue, 28 Nov 2023 13:46:23 +0000 Subject: [PATCH 164/177] 8231556: Wrong font ligatures used when 2 versions of same font used Backport-of: d86eb1de69c2f5e3e9388c61ed6c5d928dc17d20 --- .../share/classes/sun/font/PhysicalFont.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/share/classes/sun/font/PhysicalFont.java b/src/java.desktop/share/classes/sun/font/PhysicalFont.java index 1ca522e3517..dc05c0e0a5f 100644 --- a/src/java.desktop/share/classes/sun/font/PhysicalFont.java +++ b/src/java.desktop/share/classes/sun/font/PhysicalFont.java @@ -41,12 +41,19 @@ public abstract class PhysicalFont extends Font2D { protected Object nativeNames; public boolean equals(Object o) { - return (o != null && o.getClass() == this.getClass() && - ((Font2D)o).fullName.equals(this.fullName)); + if (o == null || o.getClass() != this.getClass()) { + return false; + } + PhysicalFont other = (PhysicalFont)o; + return + (this.fullName.equals(other.fullName)) && + ((this.platName == null && other.platName == null) || + (this.platName != null && this.platName.equals(other.platName))); } public int hashCode() { - return fullName.hashCode(); + return fullName.hashCode() + + (platName != null ? platName.hashCode() : 0); } /** From 40ee106645007a71b919e23cb8673f878f3e91cc Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Tue, 28 Nov 2023 13:49:19 +0000 Subject: [PATCH 165/177] 8282143: Objects.requireNonNull should be ForceInline Backport-of: fc52a2182a9debc04b2ac302801b3d61989f54ec --- src/java.base/share/classes/java/util/Objects.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java.base/share/classes/java/util/Objects.java b/src/java.base/share/classes/java/util/Objects.java index 1b97a2be6d0..48633c57da8 100644 --- a/src/java.base/share/classes/java/util/Objects.java +++ b/src/java.base/share/classes/java/util/Objects.java @@ -216,6 +216,7 @@ public static int compare(T a, T b, Comparator c) { * @return {@code obj} if not {@code null} * @throws NullPointerException if {@code obj} is {@code null} */ + @ForceInline public static T requireNonNull(T obj) { if (obj == null) throw new NullPointerException(); @@ -241,6 +242,7 @@ public static T requireNonNull(T obj) { * @return {@code obj} if not {@code null} * @throws NullPointerException if {@code obj} is {@code null} */ + @ForceInline public static T requireNonNull(T obj, String message) { if (obj == null) throw new NullPointerException(message); From be01e6e792dea3da59f3c6b5f14882f678dcc1ce Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Tue, 28 Nov 2023 13:49:42 +0000 Subject: [PATCH 166/177] 8263530: sun.awt.X11.ListHelper.removeAll() should use clear() Backport-of: 7b4aefe9e1e5bcd370de1bf510a1ed97e57a65bb --- src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java b/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java index 5ef2e3ac0bf..39c8c469e2c 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java @@ -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 @@ -147,7 +147,7 @@ void remove(int index) { } void removeAll() { - items.removeAll(items); + items.clear(); updateScrollbars(); } From 09b402a6bcecce976ee17ce358b0a90ea127ab69 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 30 Nov 2023 11:18:45 +0000 Subject: [PATCH 167/177] 8319187: Add three eMudhra emSign roots Reviewed-by: lucy Backport-of: 0bda467f6e29c866c661e88a76a9fe3efc0a0d19 --- make/data/cacerts/emsigneccrootcag3 | 22 +++ make/data/cacerts/emsignrootcag1 | 29 +++ make/data/cacerts/emsignrootcag2 | 39 ++++ .../certification/CAInterop.java | 27 +++ .../certification/EmSignRootG2CA.java | 179 ++++++++++++++++++ .../security/lib/cacerts/VerifyCACerts.java | 12 +- 6 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 make/data/cacerts/emsigneccrootcag3 create mode 100644 make/data/cacerts/emsignrootcag1 create mode 100644 make/data/cacerts/emsignrootcag2 create mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java diff --git a/make/data/cacerts/emsigneccrootcag3 b/make/data/cacerts/emsigneccrootcag3 new file mode 100644 index 00000000000..a286f81c2f4 --- /dev/null +++ b/make/data/cacerts/emsigneccrootcag3 @@ -0,0 +1,22 @@ +Owner: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 3cf607a968700eda8b84 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG +EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo +bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ +TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s +b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw +djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0 +WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS +fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB +zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq +hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB +CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD ++JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- diff --git a/make/data/cacerts/emsignrootcag1 b/make/data/cacerts/emsignrootcag1 new file mode 100644 index 00000000000..6b06f6689bc --- /dev/null +++ b/make/data/cacerts/emsignrootcag1 @@ -0,0 +1,29 @@ +Owner: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 31f5e4620c6c58edd6d8 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 2048-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD +VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU +ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH +MTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgxODMwMDBaMGcxCzAJBgNVBAYTAklO +MRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRlY2hub2xv +Z2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQz +f2N4aLTNLnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO +8oG0x5ZOrRkVUkr+PHB1cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aq +d7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHWDV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhM +tTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ6DqS0hdW5TUaQBw+jSzt +Od9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrHhQIDAQAB +o0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31x +PaOfG1vR2vjTnGs2vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjM +wiI/aTvFthUvozXGaCocV685743QNcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6d +GNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q+Mri/Tm3R7nrft8EI6/6nAYH +6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby +RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- diff --git a/make/data/cacerts/emsignrootcag2 b/make/data/cacerts/emsignrootcag2 new file mode 100644 index 00000000000..e4e4ddda65a --- /dev/null +++ b/make/data/cacerts/emsignrootcag2 @@ -0,0 +1,39 @@ +Owner: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 864dbf0fe35ed77d8ed8 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFlTCCA32gAwIBAgILAIZNvw/jXtd9jtgwDQYJKoZIhvcNAQEMBQAwZzELMAkG +A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEg +VGVjaG5vbG9naWVzIExpbWl0ZWQxHDAaBgNVBAMTE2VtU2lnbiBSb290IENBIC0g +RzIwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBnMQswCQYDVQQGEwJJ +TjETM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dgmA8Vbq0GxhwPM5YN/SZquNyRIxO3cU +dlAcwf+vSezdVCf9wOzvSAF3q0a5ljvbdbNJNpfScQVp7UUd5sBsZk8jXO1KQ/go +/Vf/GDPnrIFmxpAIGE3sgnO8lAv9FzUaAeuv7HWe47xN9J7+bQzF93yHuIXACPTL +pQHhg2zMv5C7BAbuDHfbj1Cu294Z832yhSfBcziWGskOvl3es2EcHytbS9c9P+0z +Mpka7zGC1FHrvLb/FoduH86TeZt0QjZ6pcplNzoaxDnDvzTJ6CC2Eny+qH/APFCu +VUv5/wjwF+HPm8Pup2ARj9cEp92+0qcerfHacNq5hMeGZdbA/dzdUR/5z5zXdxAk +nl8mcfGb0eMNSTXQmmB/i4AecNnr72uYjzlaXUGYN7Nrb6XouG0pnh0/BBtWWp0U +ShIPpWEAqs7RJBj6+1ZUYXZ4ObrCw962DxhN2p19Hxw9LtuUUcLqqTPrFXYvwO4t +ouj7KJnAkaTUfXGdEaFVtFig1EA30WzJY2X1vAQ7hVnniCjgaXAGqjsU6sklNM9n +xDx5rFCCCEtj9Kh8UHjGK2QqgP5kwgttjOApQMaCoezMfK4KD7WpOXU= +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index 9d535d02da5..da1bc15589a 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -431,6 +431,26 @@ * @run main/othervm -Djava.security.debug=certpath CAInterop teliarootcav2 CRL */ +/* + * @test id=emsignrootcag1 + * @bug 8319187 + * @summary Interoperability tests with eMudhra Root CA G1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsignrootcag1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop emsignrootcag1 CRL + */ + +/* + * @test id=emsigneccrootcag3 + * @bug 8319187 + * @summary Interoperability tests with eMudhra ECC Root CA G3 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsigneccrootcag3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop emsigneccrootcag3 CRL + */ + /** * Collection of certificate validation tests for interoperability with external CAs */ @@ -586,6 +606,13 @@ private CATestURLs getTestURLs(String alias) { return new CATestURLs("https://validpremiumecc.affirmtrust.com", "https://revokedpremiumecc.affirmtrust.com"); + case "emsignrootcag1": + return new CATestURLs("https://testovg1.emsign.com/RootOVG1.html", + "https://testovg1r.emsign.com/RootOVG1MR.html"); + case "emsigneccrootcag3": + return new CATestURLs("https://testovg3.emsign.com/RootOVG3.html", + "https://testovg3r.emsign.com/RootOVG3MR.html"); + default: throw new RuntimeException("No test setup found for: " + alias); } } diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java new file mode 100644 index 00000000000..eb8fc2c2029 --- /dev/null +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java @@ -0,0 +1,179 @@ +/* + * 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 8319187 + * @summary Interoperability tests with eMudhra emSign Root CA G2 CS root + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA OCSP + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA CRL + */ + +public class EmSignRootG2CA { + + // Owner: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Issuer: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: c084e666596139a1fa9b + // Valid from: Sun Feb 18 10:30:00 PST 2018 until: Fri Feb 18 10:30:00 PST 2033 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGeDCCBGCgAwIBAgILAMCE5mZZYTmh+pswDQYJKoZIhvcNAQEMBQAwZzELMAkG\n" + + "A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEg\n" + + "VGVjaG5vbG9naWVzIExpbWl0ZWQxHDAaBgNVBAMTE2VtU2lnbiBSb290IENBIC0g\n" + + "RzIwHhcNMTgwMjE4MTgzMDAwWhcNMzMwMjE4MTgzMDAwWjBlMQswCQYDVQQGEwJJ\n" + + "TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s\n" + + "b2dpZXMgTGltaXRlZDEaMBgGA1UEAxMRZW1TaWduIENTIENBIC0gRzIwggIiMA0G\n" + + "CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDYYkv6Q9an5RylOJ6rkTAHT0cAwfYg\n" + + "ZsFKk/Hz/4VwWYsmzf+Z7M8i3CK3mnUcqgw0AIzrVLUwxiKAaL0qca+SbXwOk/7p\n" + + "Y/zwwLdg0OhHVGeeU3OTvkbsBpiLS08i7ids9FGrte6m1kqk+QSOY2F5AESxA4+F\n" + + "AKXGtzIImQd15m67C88A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HHmbHX6emHIR31bxuK\n" + + "7mY77XjrJMWp+71udC/DgDy4tfZTXIzEekI0XQfcui1UPC08Ysl0taQKTANwsAOV\n" + + "VSi7boSGqLet0qSmeKVyQ5/blbwx1NhjyLTyi66rVYf7fYdPV55X5TKUJdKDgiRI\n" + + "BomNVRcrrnHZtS8+t9CXxSXR35VAu2ube44Tl+dQHIWz9XwLxtYFwIPSEdqPpoAu\n" + + "5XEVo7evwMHQoY/MQj6Ywbw6tYh6bHu6C/qrp4oSyYXbz2ZWlHkz1oEXvefi7a9Z\n" + + "6mKnnaY3UYHq5AI+k6ojazVFbSTenb/TO/Z247gdhG7Wssshd6pgyqcTEa+FZz+F\n" + + "5ZZdoiIl8UJsTCPPg0xP9Ab0WE3BjCCqTPt+Czbd3cgBxiBS7KTQs/DnQRFuPCjC\n" + + "khbDtHsCN4aUoLM9OOw94/ZcoU0G5cg9mSvONBxUv9W7SIpJreXXMPXixcBKULoJ\n" + + "focui3s0yzGqTA9tSzQ4nmA9aXBCAAxrABlY/hk10ImeBa1SPjocRb/vuCaGp74T\n" + + "n8oADP42XudDnp8wlOKWxFJulhNi960Rev+5vZOPF/LGfS78GI6yzBjR49VJGhOP\n" + + "EJK8NSNmK3FNblQfOyFM7VE0uOGHOUwpMGVM2A==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: 7c9ade672c0ad1b6 + // Valid from: Wed Aug 30 05:39:25 PDT 2023 until: Sat Aug 30 05:39:25 PDT 2025 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNjCCBB6gAwIBAgIIfJreZywK0bYwDQYJKoZIhvcNAQEMBQAwZTELMAkGA1UE\n" + + "BhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEgVGVj\n" + + "aG5vbG9naWVzIExpbWl0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v9cnQt6\n" + + "3CW5aMAsfTbmOw==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: cf02dedd03d2f509 + // Valid from: Thu Oct 05 22:38:51 PDT 2023 until: Sun Oct 05 22:38:51 PDT 2025 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNzCCBB+gAwIBAgIJAM8C3t0D0vUJMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNV\n" + + "BAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRl\n" + + "Y2hub2xvZ2llcyBMaW1pdGVkMRowGAYDVQQDExFlbVNpZ24gQ1MgQ0EgLSBHMjAe\n" + + "Fw0yMzEwMDYwNTM4NTFaFw0yNTEwMDYwNTM4NTFaMFgxCzAJBgNVBAYTAklOMQ0w\n" + + "CwYDVQQIEwR0ZXN0MQ0wCwYDVQQHEwR0ZXN0MQ0wCwYDVQQKDAR0ZXN0MQ0wCwYD\n" + + "VQQLEwR0ZXN0MQ0wCwYDVQQDEwR0ZXN0MIIBojANBgkqhkiG9w0BAQEFAAOCAY8A\n" + + "MIIBigKCAYEAmUSghjvjUvVgYguH2PMLwW4TwtYsNDpAuGPqux53lI9v9S5u4oAv\n" + + "m1Sa3MW7CeEnhHNAIFu/AKvNXSfkvnJpTozWstZMjd93DcNacteBG0fBKTkIq+5k\n" + + "A8qIBiXWk8NORlbjV5bXnoW2pO7wbrALDK3FGf2JAQjuYWXE1mlVk0+SJewUSN+F\n" + + "XTl63V3tcaqjxhoViY8/dCWc7pNTPgQ/f+Rmnm1bpE0hxVPpQ29+60lyoNtKiOWj\n" + + "InKRKBV8jYkR/xI13bKWguaxZnswpf2MrophQTvO9ivPHADWhZlNYYjYYEMl4tbi\n" + + "rG2EquJ7g8Jdo+aL3BggLv5gFkpfo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9gSsVu6vfsnWhLhz0VLG\n" + + "sYPXcWIssLbBQW3v5z0l1Isj7vy2UFfbn8AmZ0PanPo3v3C2sk19DK+Zlc9xBAXc\n" + + "KKwc4m8le6QkP/EB2wUA7ey5Cf29hjNDJpZznquEaWl9aKbBRdJDKsK88IBJjzK0\n" + + "Gbpw9fYJ3txuGA7Q27gyaZAeGAIrFvOtRY0XFbr20qSh2GBBYN57+lBPh4UKqgy8\n" + + "Z2Kk/2jK9k+nm41JYCmwVZHg3Va9RRfW8FkeE95gAUFPDWjeV+GvcimCbcB3DwaZ\n" + + "9fy1qfV4xsduhC3ei6f7Ask8LbAEWaEIXmgK10YbIfhzomCyCzlA+E+gwkq/bmkv\n" + + "B8hh27KWA6IRt7URI51MZlh0e8fULyXlOZcoJA/IPX9RdePa2RHFuPSypBHjoN7z\n" + + "6bCML1XZ2xnHIAg=\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Thu Oct 05 22:51:36 PDT 2023", System.out); + } +} \ No newline at end of file diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index f244633e4ab..7a81fd11c6e 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 + * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +47,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 103; + private static final int COUNT = 106; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "A6:73:50:DD:6B:49:E6:F0:E7:E7:7B:F9:F9:11:9F:83:2D:FD:95:97:69:03:54:54:9C:B7:DF:46:A4:05:7A:15"; + = "61:5F:6D:C5:9C:A3:8A:65:3F:CB:F9:F5:26:04:23:F4:53:A6:8C:B3:8B:2B:0A:F0:66:7D:9E:67:B9:4D:AC:B7"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") private static final Map FINGERPRINT_MAP = new HashMap<>() { @@ -263,6 +263,12 @@ public class VerifyCACerts { "D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68"); put("teliarootcav2 [jdk]", "24:2B:69:74:2F:CB:1E:5B:2A:BF:98:89:8B:94:57:21:87:54:4E:5B:4D:99:11:78:65:73:62:1F:6A:74:B8:2C"); + put("emsignrootcag1 [jdk]", + "40:F6:AF:03:46:A9:9A:A1:CD:1D:55:5A:4E:9C:CE:62:C7:F9:63:46:03:EE:40:66:15:83:3D:C8:C8:D0:03:67"); + put("emsigneccrootcag3 [jdk]", + "86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B"); + put("emsignrootcag2 [jdk]", + "1A:A0:C2:70:9E:83:1B:D6:E3:B5:12:9A:00:BA:41:F7:EE:EF:02:08:72:F1:E6:50:4B:F0:F6:C3:F2:4F:3A:F3"); } }; From abed94cca6614f3d84d371c0b82f618b9aa5abb6 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Fri, 15 Dec 2023 04:26:38 +0000 Subject: [PATCH 168/177] 8302017: Allocate BadPaddingException only if it will be thrown Reviewed-by: mbalao Backport-of: 334b977259930368160db705c1f2feda0b0e8707 --- .../com/sun/crypto/provider/RSACipher.java | 27 +++++-- .../classes/sun/security/rsa/RSAPadding.java | 72 ++++++++----------- .../sun/security/rsa/RSASignature.java | 26 +++---- .../sun/security/pkcs11/P11Signature.java | 11 +-- .../jdk/sun/security/rsa/RSAPaddingCheck.java | 63 ++++++++++++++++ 5 files changed, 137 insertions(+), 62 deletions(-) create mode 100644 test/jdk/sun/security/rsa/RSAPaddingCheck.java diff --git a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java index 549b073bfa6..480e99d551f 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java @@ -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 @@ -354,21 +354,38 @@ private byte[] doFinal() throws BadPaddingException, switch (mode) { case MODE_SIGN: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, privateKey, true); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, privateKey, true); + } else { + throw new BadPaddingException("Padding error in signing"); + } break; case MODE_VERIFY: byte[] verifyBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(verifyBuffer, publicKey); result = padding.unpad(paddingCopy); + if (result == null) { + throw new BadPaddingException + ("Padding error in verification"); + } break; case MODE_ENCRYPT: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, publicKey); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, publicKey); + } else { + throw new BadPaddingException + ("Padding error in encryption"); + } break; case MODE_DECRYPT: byte[] decryptBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(decryptBuffer, privateKey, false); result = padding.unpad(paddingCopy); + if (result == null) { + throw new BadPaddingException + ("Padding error in decryption"); + } break; default: throw new AssertionError("Internal error"); @@ -377,9 +394,9 @@ private byte[] doFinal() throws BadPaddingException, } finally { Arrays.fill(buffer, 0, bufOfs, (byte)0); bufOfs = 0; - if (paddingCopy != null // will not happen + if (paddingCopy != null && paddingCopy != buffer // already cleaned - && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT! + && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT Arrays.fill(paddingCopy, (byte)0); } } diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPadding.java b/src/java.base/share/classes/sun/security/rsa/RSAPadding.java index c54dbdb8d43..0cd1c8a7a0d 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPadding.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPadding.java @@ -30,7 +30,6 @@ import java.security.*; import java.security.spec.*; -import javax.crypto.BadPaddingException; import javax.crypto.spec.PSource; import javax.crypto.spec.OAEPParameterSpec; @@ -236,24 +235,22 @@ public int getMaxDataSize() { } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data) throws BadPaddingException { + public byte[] pad(byte[] data) { return pad(data, 0, data.length); } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data, int ofs, int len) - throws BadPaddingException { + public byte[] pad(byte[] data, int ofs, int len) { if (len > maxDataSize) { - throw new BadPaddingException("Data must be shorter than " - + (maxDataSize + 1) + " bytes but received " - + len + " bytes."); + return null; } switch (type) { case PAD_NONE: + // assert len == paddedSize and data.length - ofs > len? return RSACore.convert(data, ofs, len); case PAD_BLOCKTYPE_1: case PAD_BLOCKTYPE_2: @@ -266,31 +263,30 @@ public byte[] pad(byte[] data, int ofs, int len) } /** - * Unpad the padded block and return the data. + * Unpad the padded block and return the result or null if error occurred. */ - public byte[] unpad(byte[] padded) throws BadPaddingException { - if (padded.length != paddedSize) { - throw new BadPaddingException("Decryption error." + - "The padded array length (" + padded.length + - ") is not the specified padded size (" + paddedSize + ")"); - } - switch (type) { - case PAD_NONE: - return padded; - case PAD_BLOCKTYPE_1: - case PAD_BLOCKTYPE_2: - return unpadV15(padded); - case PAD_OAEP_MGF1: - return unpadOAEP(padded); - default: - throw new AssertionError(); + public byte[] unpad(byte[] padded) { + if (padded.length == paddedSize) { + switch (type) { + case PAD_NONE: + return padded; + case PAD_BLOCKTYPE_1: + case PAD_BLOCKTYPE_2: + return unpadV15(padded); + case PAD_OAEP_MGF1: + return unpadOAEP(padded); + default: + throw new AssertionError(); + } + } else { + return null; } } /** * PKCS#1 v1.5 padding (blocktype 1 and 2). */ - private byte[] padV15(byte[] data, int ofs, int len) throws BadPaddingException { + private byte[] padV15(byte[] data, int ofs, int len) { byte[] padded = new byte[paddedSize]; System.arraycopy(data, ofs, padded, paddedSize - len, len); int psSize = paddedSize - 3 - len; @@ -327,10 +323,10 @@ private byte[] padV15(byte[] data, int ofs, int len) throws BadPaddingException /** * PKCS#1 v1.5 unpadding (blocktype 1 (signature) and 2 (encryption)). - * + * Return the result or null if error occurred. * Note that we want to make it a constant-time operation */ - private byte[] unpadV15(byte[] padded) throws BadPaddingException { + private byte[] unpadV15(byte[] padded) { int k = 0; boolean bp = false; @@ -366,10 +362,8 @@ private byte[] unpadV15(byte[] padded) throws BadPaddingException { byte[] data = new byte[n]; System.arraycopy(padded, p, data, 0, n); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - if (bp) { - throw bpe; + return null; } else { return data; } @@ -378,8 +372,9 @@ private byte[] unpadV15(byte[] padded) throws BadPaddingException { /** * PKCS#1 v2.0 OAEP padding (MGF1). * Paragraph references refer to PKCS#1 v2.1 (June 14, 2002) + * Return the result or null if error occurred. */ - private byte[] padOAEP(byte[] M, int ofs, int len) throws BadPaddingException { + private byte[] padOAEP(byte[] M, int ofs, int len) { if (random == null) { random = JCAUtil.getSecureRandom(); } @@ -428,8 +423,9 @@ private byte[] padOAEP(byte[] M, int ofs, int len) throws BadPaddingException { /** * PKCS#1 v2.1 OAEP unpadding (MGF1). + * Return the result or null if error occurred. */ - private byte[] unpadOAEP(byte[] padded) throws BadPaddingException { + private byte[] unpadOAEP(byte[] padded) { byte[] EM = padded; boolean bp = false; int hLen = lHash.length; @@ -485,12 +481,6 @@ private byte[] unpadOAEP(byte[] padded) throws BadPaddingException { byte [] m = new byte[EM.length - mStart]; System.arraycopy(EM, mStart, m, 0, m.length); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - - if (bp) { - throw bpe; - } else { - return m; - } + return (bp? null : m); } } diff --git a/src/java.base/share/classes/sun/security/rsa/RSASignature.java b/src/java.base/share/classes/sun/security/rsa/RSASignature.java index ea2ef985082..ca74e1e2319 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSASignature.java +++ b/src/java.base/share/classes/sun/security/rsa/RSASignature.java @@ -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 @@ -189,13 +189,15 @@ protected byte[] engineSign() throws SignatureException { try { byte[] encoded = encodeSignature(digestOID, digest); byte[] padded = padding.pad(encoded); - byte[] encrypted = RSACore.rsa(padded, privateKey, true); - return encrypted; + if (padded != null) { + return RSACore.rsa(padded, privateKey, true); + } } catch (GeneralSecurityException e) { throw new SignatureException("Could not sign data", e); } catch (IOException e) { throw new SignatureException("Could not encode data", e); } + throw new SignatureException("Could not sign data"); } // verify the data and return the result. See JCA doc @@ -207,20 +209,20 @@ protected boolean engineVerify(byte[] sigBytes) throws SignatureException { } try { if (sigBytes.length != RSACore.getByteLength(publicKey)) { - throw new SignatureException("Signature length not correct: got " + + throw new SignatureException("Bad signature length: got " + sigBytes.length + " but was expecting " + RSACore.getByteLength(publicKey)); } - byte[] digest = getDigestValue(); + + // https://www.rfc-editor.org/rfc/rfc8017.html#section-8.2.2 + // Step 4 suggests comparing the encoded message byte[] decrypted = RSACore.rsa(sigBytes, publicKey); - byte[] unpadded = padding.unpad(decrypted); - byte[] decodedDigest = decodeSignature(digestOID, unpadded); - return MessageDigest.isEqual(digest, decodedDigest); + + byte[] digest = getDigestValue(); + byte[] encoded = encodeSignature(digestOID, digest); + byte[] padded = padding.pad(encoded); + return MessageDigest.isEqual(padded, decrypted); } catch (javax.crypto.BadPaddingException e) { - // occurs if the app has used the wrong RSA public key - // or if sigBytes is invalid - // return false rather than propagating the exception for - // compatibility/ease of use return false; } catch (IOException e) { throw new SignatureException("Signature encoding error", e); diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java index e3af106d05a..fbb277c82e3 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java @@ -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 @@ -766,9 +766,12 @@ private byte[] pkcs1Pad(byte[] data) { int len = (p11Key.length() + 7) >> 3; RSAPadding padding = RSAPadding.getInstance (RSAPadding.PAD_BLOCKTYPE_1, len); - byte[] padded = padding.pad(data); - return padded; - } catch (GeneralSecurityException e) { + byte[] result = padding.pad(data); + if (result == null) { + throw new ProviderException("Error padding data"); + } + return result; + } catch (InvalidKeyException | InvalidAlgorithmParameterException e) { throw new ProviderException(e); } } diff --git a/test/jdk/sun/security/rsa/RSAPaddingCheck.java b/test/jdk/sun/security/rsa/RSAPaddingCheck.java new file mode 100644 index 00000000000..bce35dc082e --- /dev/null +++ b/test/jdk/sun/security/rsa/RSAPaddingCheck.java @@ -0,0 +1,63 @@ +/* + * 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 8302017 + * @summary Ensure that RSAPadding class works as expected after refactoring + * @modules java.base/sun.security.rsa + */ +import java.util.Arrays; +import sun.security.rsa.RSAPadding; + +public class RSAPaddingCheck { + + private static int[] PADDING_TYPES = { + RSAPadding.PAD_BLOCKTYPE_1, + RSAPadding.PAD_BLOCKTYPE_2, + RSAPadding.PAD_NONE, + RSAPadding.PAD_OAEP_MGF1, + }; + + public static void main(String[] args) throws Exception { + int size = 2048 >> 3; + byte[] testData = "This is some random to-be-padded Data".getBytes(); + for (int type : PADDING_TYPES) { + byte[] data = (type == RSAPadding.PAD_NONE? + Arrays.copyOf(testData, size) : testData); + System.out.println("Testing PaddingType: " + type); + RSAPadding padding = RSAPadding.getInstance(type, size); + byte[] paddedData = padding.pad(data); + if (paddedData == null) { + throw new RuntimeException("Unexpected padding op failure!"); + } + + byte[] data2 = padding.unpad(paddedData); + if (data2 == null) { + throw new RuntimeException("Unexpected unpadding op failure!"); + } + if (!Arrays.equals(data, data2)) { + throw new RuntimeException("diff check failure!"); + } + } + } +} \ No newline at end of file From 31a6a539734ccfc8c52336ae7399c9457bfc3472 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Fri, 15 Dec 2023 22:30:41 +0000 Subject: [PATCH 169/177] 8320597: RSA signature verification fails on signed data that does not encode params correctly Reviewed-by: mbalao Backport-of: 11e4a925bec3c1f79e03045d48def53188b655e6 --- .../sun/security/rsa/RSASignature.java | 39 ++++++------- test/jdk/sun/security/rsa/WithoutNULL.java | 57 +++++++++++++++++++ 2 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 test/jdk/sun/security/rsa/WithoutNULL.java diff --git a/src/java.base/share/classes/sun/security/rsa/RSASignature.java b/src/java.base/share/classes/sun/security/rsa/RSASignature.java index ca74e1e2319..bced188ca8c 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSASignature.java +++ b/src/java.base/share/classes/sun/security/rsa/RSASignature.java @@ -219,8 +219,17 @@ protected boolean engineVerify(byte[] sigBytes) throws SignatureException { byte[] decrypted = RSACore.rsa(sigBytes, publicKey); byte[] digest = getDigestValue(); + byte[] encoded = encodeSignature(digestOID, digest); byte[] padded = padding.pad(encoded); + if (MessageDigest.isEqual(padded, decrypted)) { + return true; + } + + // Some vendors might omit the NULL params in digest algorithm + // identifier. Try again. + encoded = encodeSignatureWithoutNULL(digestOID, digest); + padded = padding.pad(encoded); return MessageDigest.isEqual(padded, decrypted); } catch (javax.crypto.BadPaddingException e) { return false; @@ -246,27 +255,19 @@ public static byte[] encodeSignature(ObjectIdentifier oid, byte[] digest) } /** - * Decode the signature data. Verify that the object identifier matches - * and return the message digest. + * Encode the digest without the NULL params, return the to-be-signed data. + * This is only used by SunRsaSign. */ - public static byte[] decodeSignature(ObjectIdentifier oid, byte[] sig) + static byte[] encodeSignatureWithoutNULL(ObjectIdentifier oid, byte[] digest) throws IOException { - // Enforce strict DER checking for signatures - DerInputStream in = new DerInputStream(sig, 0, sig.length, false); - DerValue[] values = in.getSequence(2); - if ((values.length != 2) || (in.available() != 0)) { - throw new IOException("SEQUENCE length error"); - } - AlgorithmId algId = AlgorithmId.parse(values[0]); - if (algId.getOID().equals(oid) == false) { - throw new IOException("ObjectIdentifier mismatch: " - + algId.getOID()); - } - if (algId.getEncodedParams() != null) { - throw new IOException("Unexpected AlgorithmId parameters"); - } - byte[] digest = values[1].getOctetString(); - return digest; + DerOutputStream out = new DerOutputStream(); + DerOutputStream oidout = new DerOutputStream(); + oidout.putOID(oid); + out.write(DerValue.tag_Sequence, oidout); + out.putOctetString(digest); + DerValue result = + new DerValue(DerValue.tag_Sequence, out.toByteArray()); + return result.toByteArray(); } // set parameter, not supported. See JCA doc diff --git a/test/jdk/sun/security/rsa/WithoutNULL.java b/test/jdk/sun/security/rsa/WithoutNULL.java new file mode 100644 index 00000000000..4a403c93941 --- /dev/null +++ b/test/jdk/sun/security/rsa/WithoutNULL.java @@ -0,0 +1,57 @@ +/* + * 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 8320597 + * @summary Verify RSA signature with omitted digest params (should be encoded as NULL) + * for backward compatibility + */ +import java.security.KeyFactory; +import java.security.Signature; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +public class WithoutNULL { + public static void main(String[] args) throws Exception { + + // A 1024-bit RSA public key + byte[] key = Base64.getMimeDecoder().decode( + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrfTrEm4KvdFSpGAM7InrFEzALTKdphT9fK6Gu" + + "eVjHtKsuCSEaULCdjhJvPpFK40ONr1JEC1Ywp1UYrfBBdKunnbDZqNZL1cFv+IzF4Yj6JO6pOeHi" + + "1Zpur1GaQRRlYTvzmyWY/AATQDh8JfKObNnDVwXeezFODUG8h5+XL1ZXZQIDAQAB"); + + // A SHA1withRSA signature on an empty input where the digestAlgorithm + // inside DigestInfo does not have a parameters field. + byte[] sig = Base64.getMimeDecoder().decode( + "D1FpiT44WEXlDfYK880bdorLO+e9qJVXZWiBgqs9dfK7lYQwyEt9dL23mbUAKm5TVEj2ZxtHkEvk" + + "b8oaWkxk069jDTM1RhllPJZkAjeQRbw4gkg4N6wKZz9B/jdSRMNJg/b9QdRYZOHOBxsEHMbUREPV" + + "DoCOLaxB8eIXX0EWkiE="); + + Signature s = Signature.getInstance("SHA1withRSA", "SunRsaSign"); + s.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key))); + if (!s.verify(sig)) { + throw new RuntimeException("Does not verify"); + } + } +} From 89e0f9baae4a84be8f0d5ab0bef4a28f4e49dac1 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Tue, 9 Jan 2024 17:09:22 +0100 Subject: [PATCH 170/177] 8308204: Enhanced certificate processing Reviewed-by: mbalao Backport-of: ef0ea85bf1398b73bd308ba2b395c917b449aa3b --- .../provider/certpath/ForwardBuilder.java | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java index 00351647349..83f61823ed0 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java @@ -336,8 +336,11 @@ private void getMatchingCACerts(ForwardState currentState, } } + // Thread-local gate to prevent recursive provider lookups + private static ThreadLocal gate = new ThreadLocal<>(); + /** - * Download Certificates from the given AIA and add them to the + * Download certificates from the given AIA and add them to the * specified Collection. */ // cs.getCertificates(caSelector) returns a collection of X509Certificate's @@ -349,32 +352,47 @@ private boolean getCerts(AuthorityInfoAccessExtension aiaExt, if (Builder.USE_AIA == false) { return false; } + List adList = aiaExt.getAccessDescriptions(); if (adList == null || adList.isEmpty()) { return false; } - boolean add = false; - for (AccessDescription ad : adList) { - CertStore cs = URICertStore.getInstance(ad); - if (cs != null) { - try { - if (certs.addAll((Collection) - cs.getCertificates(caSelector))) { - add = true; - if (!searchAllCertStores) { - return true; + if (gate.get() != null) { + // Avoid recursive fetching of certificates + if (debug != null) { + debug.println("Recursive fetching of certs via the AIA " + + "extension detected"); + } + return false; + } + + gate.set(gate); + try { + boolean add = false; + for (AccessDescription ad : adList) { + CertStore cs = URICertStore.getInstance(ad); + if (cs != null) { + try { + if (certs.addAll((Collection) + cs.getCertificates(caSelector))) { + add = true; + if (!searchAllCertStores) { + return true; + } + } + } catch (CertStoreException cse) { + if (debug != null) { + debug.println("exception getting certs from CertStore:"); + cse.printStackTrace(); } - } - } catch (CertStoreException cse) { - if (debug != null) { - debug.println("exception getting certs from CertStore:"); - cse.printStackTrace(); } } } + return add; + } finally { + gate.set(null); } - return add; } /** From 8fe2b2959e174c8d8263bb5a8d68672c99fd7b5f Mon Sep 17 00:00:00 2001 From: Martin Balao Date: Tue, 9 Jan 2024 17:10:09 +0100 Subject: [PATCH 171/177] 8314284: Enhance Nashorn performance Co-authored-by: Francisco Ferrari Bihurriet Co-authored-by: Martin Balao Alonso Reviewed-by: andrew --- .../classes/jdk/nashorn/internal/objects/Global.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java index 75558cb9000..81268ce4c07 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java @@ -1604,9 +1604,11 @@ public static Object __noSuchProperty__(final Object self, final Object name) { if ("context".equals(nameStr)) { return sctxt; } else if ("engine".equals(nameStr)) { - // expose "engine" variable only when there is no security manager - // or when no class filter is set. - if (System.getSecurityManager() == null || global.getClassFilter() == null) { + // expose "engine" variable only when there is no security manager, + // or when no class filter is set and --no-java is not set + if (System.getSecurityManager() == null || + (global.getClassFilter() == null && + !global.getContext().getEnv()._no_java)) { return global.engine; } } From 6944c161004bbd1f57ba3a76e6d024314177e8e7 Mon Sep 17 00:00:00 2001 From: Martin Balao Date: Tue, 9 Jan 2024 17:10:38 +0100 Subject: [PATCH 172/177] 8314295: Enhance verification of verifier Reviewed-by: yan Backport-of: 08980a0a60bc48c17eacd57fd2d7065ac2d986a8 --- src/hotspot/share/classfile/verifier.cpp | 5 +++-- src/hotspot/share/interpreter/bytecodes.cpp | 22 ++++++++++++++----- .../share/native/libverify/check_code.c | 11 ++++++---- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp index 96a6407dc6f..70edfa9ef78 100644 --- a/src/hotspot/share/classfile/verifier.cpp +++ b/src/hotspot/share/classfile/verifier.cpp @@ -2182,11 +2182,12 @@ void ClassVerifier::verify_switch( "low must be less than or equal to high in tableswitch"); return; } - keys = high - low + 1; - if (keys < 0) { + int64_t keys64 = ((int64_t)high - low) + 1; + if (keys64 > 65535) { // Max code length verify_error(ErrorContext::bad_code(bci), "too many keys in tableswitch"); return; } + keys = (int)keys64; delta = 1; } else { keys = (int)Bytes::get_Java_u4(aligned_bcp + jintSize); diff --git a/src/hotspot/share/interpreter/bytecodes.cpp b/src/hotspot/share/interpreter/bytecodes.cpp index 4035927ce9e..a6a4c323aad 100644 --- a/src/hotspot/share/interpreter/bytecodes.cpp +++ b/src/hotspot/share/interpreter/bytecodes.cpp @@ -99,12 +99,18 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) if (end != NULL && aligned_bcp + 3*jintSize >= end) { return -1; // don't read past end of code buffer } + // Promote calculation to signed 64 bits to do range checks, used by the verifier. jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize); jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize); jlong len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and lo <= hi. + // The caller checks for bytecode stream overflow. + if (lo <= hi && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } case _lookupswitch: // fall through @@ -116,9 +122,13 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) } jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize); jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and npairs >= 0. + if (npairs >= 0 && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } default: // Note: Length functions must return <=0 for invalid bytecodes. diff --git a/src/java.base/share/native/libverify/check_code.c b/src/java.base/share/native/libverify/check_code.c index e56102820ef..704e7f28185 100644 --- a/src/java.base/share/native/libverify/check_code.c +++ b/src/java.base/share/native/libverify/check_code.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. * 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,6 +84,7 @@ #include #include #include +#include #include "jni.h" #include "jni_util.h" @@ -1210,7 +1211,7 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset) } } if (opcode == JVM_OPC_tableswitch) { - keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; + keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; delta = 1; } else { keys = _ck_ntohl(lpc[1]); /* number of pairs */ @@ -1692,11 +1693,13 @@ static int instruction_length(unsigned char *iptr, unsigned char *end) switch (instruction) { case JVM_OPC_tableswitch: { int *lpc = (int *)UCALIGN(iptr + 1); - int index; if (lpc + 2 >= (int *)end) { return -1; /* do not read pass the end */ } - index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]); + int64_t low = _ck_ntohl(lpc[1]); + int64_t high = _ck_ntohl(lpc[2]); + int64_t index = high - low; + // The value of low must be less than or equal to high - i.e. index >= 0 if ((index < 0) || (index > 65535)) { return -1; /* illegal */ } else { From 4576161fb39dc5eea99b050d44935280bb27ebb9 Mon Sep 17 00:00:00 2001 From: Yuri Nesterenko Date: Tue, 9 Jan 2024 17:11:03 +0100 Subject: [PATCH 173/177] 8314468: Improve Compiler loops Reviewed-by: mbalao Backport-of: 2621f68c0672092254a52414705d0e916a3a3fbc --- .../share/c1/c1_RangeCheckElimination.cpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/c1/c1_RangeCheckElimination.cpp b/src/hotspot/share/c1/c1_RangeCheckElimination.cpp index 4f2092774b3..cf5b81e032d 100644 --- a/src/hotspot/share/c1/c1_RangeCheckElimination.cpp +++ b/src/hotspot/share/c1/c1_RangeCheckElimination.cpp @@ -384,8 +384,11 @@ void RangeCheckEliminator::add_access_indexed_info(InstructionList &indices, int aii->_max = idx; aii->_list = new AccessIndexedList(); } else if (idx >= aii->_min && idx <= aii->_max) { - remove_range_check(ai); - return; + // Guard against underflow/overflow (see 'range_cond' check in RangeCheckEliminator::in_block_motion) + if (aii->_max < 0 || (aii->_max + min_jint) <= aii->_min) { + remove_range_check(ai); + return; + } } aii->_min = MIN2(aii->_min, idx); aii->_max = MAX2(aii->_max, idx); @@ -428,9 +431,9 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList } } } else { - int last_integer = 0; + jint last_integer = 0; Instruction *last_instruction = index; - int base = 0; + jint base = 0; ArithmeticOp *ao = index->as_ArithmeticOp(); while (ao != NULL && (ao->x()->as_Constant() || ao->y()->as_Constant()) && (ao->op() == Bytecodes::_iadd || ao->op() == Bytecodes::_isub)) { @@ -442,12 +445,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList } if (c) { - int value = c->type()->as_IntConstant()->value(); + jint value = c->type()->as_IntConstant()->value(); if (value != min_jint) { if (ao->op() == Bytecodes::_isub) { value = -value; } - base += value; + base = java_add(base, value); last_integer = base; last_instruction = other; } @@ -469,12 +472,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList assert(info != NULL, "Info must not be null"); // if idx < 0, max > 0, max + idx may fall between 0 and - // length-1 and if min < 0, min + idx may overflow and be >= + // length-1 and if min < 0, min + idx may underflow/overflow and be >= // 0. The predicate wouldn't trigger but some accesses could // be with a negative index. This test guarantees that for the // min and max value that are kept the predicate can't let // some incorrect accesses happen. - bool range_cond = (info->_max < 0 || info->_max + min_jint <= info->_min); + bool range_cond = (info->_max < 0 || (info->_max + min_jint) <= info->_min); // Generate code only if more than 2 range checks can be eliminated because of that. // 2 because at least 2 comparisons are done @@ -814,7 +817,7 @@ void RangeCheckEliminator::process_access_indexed(BlockBegin *loop_header, Block ); remove_range_check(ai); - } else if (_optimistic && loop_header) { + } else if (false && _optimistic && loop_header) { assert(ai->array(), "Array must not be null!"); assert(ai->index(), "Index must not be null!"); From 4ec94b1aa7a8833c33f97f37a434d2ae4b54b500 Mon Sep 17 00:00:00 2001 From: Aleksei Voitylov Date: Tue, 9 Jan 2024 17:11:33 +0100 Subject: [PATCH 174/177] 8316976: Improve signature handling Reviewed-by: mbalao Backport-of: ed1269b7410759e8fa0d97d85328f20d11ae8d9a --- .../org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java | 1 - .../org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java | 1 - 2 files changed, 2 deletions(-) diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java index 74f2d72ced9..4cb9c1c00f0 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java @@ -275,7 +275,6 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) throw new XMLSignatureException(e); } LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java index 98cf1772fe8..12f923381a7 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java @@ -334,7 +334,6 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) } signature.initSign((PrivateKey)key); LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { From a9145c7a192568d82f766e43459ec813eabf0045 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Tue, 9 Jan 2024 17:13:24 +0100 Subject: [PATCH 175/177] 8317547: Enhance TLS connection support Reviewed-by: mbalao Backport-of: 066482f9686ca81068f9386322afda8e73323f5e --- .../com/sun/crypto/provider/RSACipher.java | 22 +++-- .../classes/sun/security/util/KeyUtil.java | 55 +++++++------ .../sun/security/mscapi/CRSACipher.java | 82 ++++++++++++------- .../windows/native/libsunmscapi/security.cpp | 36 +++++--- 4 files changed, 119 insertions(+), 76 deletions(-) diff --git a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java index 480e99d551f..c6de64e970f 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java @@ -98,6 +98,7 @@ public final class RSACipher extends CipherSpi { // cipher parameter for OAEP padding and TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; // buffer for the data private byte[] buffer; @@ -291,6 +292,7 @@ private void init(int opmode, Key key, SecureRandom random, } spec = params; + forTlsPremasterSecret = true; this.random = random; // for TLS RSA premaster secret } int blockType = (mode <= MODE_DECRYPT) ? RSAPadding.PAD_BLOCKTYPE_2 @@ -382,7 +384,7 @@ private byte[] doFinal() throws BadPaddingException, byte[] decryptBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(decryptBuffer, privateKey, false); result = padding.unpad(paddingCopy); - if (result == null) { + if (result == null && !forTlsPremasterSecret) { throw new BadPaddingException ("Padding error in decryption"); } @@ -471,26 +473,22 @@ protected Key engineUnwrap(byte[] wrappedKey, String algorithm, boolean isTlsRsaPremasterSecret = algorithm.equals("TlsRsaPremasterSecret"); - Exception failover = null; byte[] encoded = null; update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } - } catch (IllegalBlockSizeException e) { - // should not occur, handled with length check above + } catch (BadPaddingException | IllegalBlockSizeException e) { + // BadPaddingException cannot happen for TLS RSA unwrap. + // In that case, padding error is indicated by returning null. + // IllegalBlockSizeException cannot happen in any case, + // because of the length check above. throw new InvalidKeyException("Unwrapping failed", e); } try { if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { + if (!forTlsPremasterSecret) { throw new IllegalStateException( "No TlsRsaPremasterSecretParameterSpec specified"); } @@ -499,7 +497,7 @@ protected Key engineUnwrap(byte[] wrappedKey, String algorithm, encoded = KeyUtil.checkTlsPreMasterSecretKey( ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), - random, encoded, (failover != null)); + random, encoded, encoded == null); } return ConstructKeys.constructKey(encoded, algorithm, type); diff --git a/src/java.base/share/classes/sun/security/util/KeyUtil.java b/src/java.base/share/classes/sun/security/util/KeyUtil.java index e477b9f8db3..781d3344b05 100644 --- a/src/java.base/share/classes/sun/security/util/KeyUtil.java +++ b/src/java.base/share/classes/sun/security/util/KeyUtil.java @@ -254,13 +254,14 @@ public static final boolean isOracleJCEProvider(String providerName) { * contains the lower of that suggested by the client in the client * hello and the highest supported by the server. * @param encoded the encoded key in its "RAW" encoding format - * @param isFailOver whether or not the previous decryption of the - * encrypted PreMasterSecret message run into problem + * @param failure true if encoded is incorrect according to previous checks * @return the polished PreMasterSecret key in its "RAW" encoding format */ public static byte[] checkTlsPreMasterSecretKey( int clientVersion, int serverVersion, SecureRandom random, - byte[] encoded, boolean isFailOver) { + byte[] encoded, boolean failure) { + + byte[] tmp; if (random == null) { random = JCAUtil.getSecureRandom(); @@ -268,30 +269,38 @@ public static byte[] checkTlsPreMasterSecretKey( byte[] replacer = new byte[48]; random.nextBytes(replacer); - if (!isFailOver && (encoded != null)) { - // check the length - if (encoded.length != 48) { - // private, don't need to clone the byte array. - return replacer; - } - - int encodedVersion = - ((encoded[0] & 0xFF) << 8) | (encoded[1] & 0xFF); - if (clientVersion != encodedVersion) { - if (clientVersion > 0x0301 || // 0x0301: TLSv1 - serverVersion != encodedVersion) { - encoded = replacer; - } // Otherwise, For compatibility, we maintain the behavior - // that the version in pre_master_secret can be the - // negotiated version for TLS v1.0 and SSL v3.0. - } + if (failure) { + tmp = replacer; + } else { + tmp = encoded; + } + if (tmp == null) { + encoded = replacer; + } else { + encoded = tmp; + } + // check the length + if (encoded.length != 48) { // private, don't need to clone the byte array. - return encoded; + tmp = replacer; + } else { + tmp = encoded; } - // private, don't need to clone the byte array. - return replacer; + int encodedVersion = + ((tmp[0] & 0xFF) << 8) | (tmp[1] & 0xFF); + int check1 = 0; + int check2 = 0; + int check3 = 0; + if (clientVersion != encodedVersion) check1 = 1; + if (clientVersion > 0x0301) check2 = 1; + if (serverVersion != encodedVersion) check3 = 1; + if ((check1 & (check2 | check3)) == 1) { + return replacer; + } else { + return tmp; + } } /** diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java index 56a4fabca71..d68fd6861a4 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, 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 @@ -30,6 +30,7 @@ import java.security.Key; import java.security.interfaces.*; import java.security.spec.*; +import java.util.Arrays; import javax.crypto.*; import javax.crypto.spec.*; @@ -61,6 +62,9 @@ */ public final class CRSACipher extends CipherSpi { + private static final int ERROR_INVALID_PARAMETER = 0x57; + private static final int NTE_INVALID_PARAMETER = 0x80090027; + // constant for an empty byte array private final static byte[] B0 = new byte[0]; @@ -101,6 +105,8 @@ public final class CRSACipher extends CipherSpi { // cipher parameter for TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; + // the source of randomness private SecureRandom random; @@ -171,6 +177,9 @@ protected void engineInit(int opmode, Key key, } spec = params; this.random = random; // for TLS RSA premaster secret + this.forTlsPremasterSecret = true; + } else { + this.forTlsPremasterSecret = false; } init(opmode, key); } @@ -277,8 +286,7 @@ private void update(byte[] in, int inOfs, int inLen) { } // internal doFinal() method. Here we perform the actual RSA operation - private byte[] doFinal() throws BadPaddingException, - IllegalBlockSizeException { + private byte[] doFinal() throws IllegalBlockSizeException { if (bufOfs > buffer.length) { throw new IllegalBlockSizeException("Data must not be longer " + "than " + (buffer.length - paddingLength) + " bytes"); @@ -307,7 +315,7 @@ private byte[] doFinal() throws BadPaddingException, throw new AssertionError("Internal error"); } - } catch (KeyException e) { + } catch (KeyException | BadPaddingException e) { throw new ProviderException(e); } finally { @@ -330,14 +338,14 @@ protected int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out, // see JCE spec protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) - throws BadPaddingException, IllegalBlockSizeException { + throws IllegalBlockSizeException { update(in, inOfs, inLen); return doFinal(); } // see JCE spec protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, - int outOfs) throws ShortBufferException, BadPaddingException, + int outOfs) throws ShortBufferException, IllegalBlockSizeException { if (outputSize > out.length - outOfs) { throw new ShortBufferException @@ -353,6 +361,7 @@ protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, // see JCE spec protected byte[] engineWrap(Key key) throws InvalidKeyException, IllegalBlockSizeException { + byte[] encoded = key.getEncoded(); // TODO - unextractable key if ((encoded == null) || (encoded.length == 0)) { throw new InvalidKeyException("Could not obtain encoded key"); @@ -361,12 +370,7 @@ protected byte[] engineWrap(Key key) throws InvalidKeyException, throw new InvalidKeyException("Key is too long for wrapping"); } update(encoded, 0, encoded.length); - try { - return doFinal(); - } catch (BadPaddingException e) { - // should not occur - throw new InvalidKeyException("Wrapping failed", e); - } + return doFinal(); } // see JCE spec @@ -387,31 +391,31 @@ protected java.security.Key engineUnwrap(byte[] wrappedKey, update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } } catch (IllegalBlockSizeException e) { // should not occur, handled with length check above throw new InvalidKeyException("Unwrapping failed", e); } - if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { - throw new IllegalStateException( - "No TlsRsaPremasterSecretParameterSpec specified"); + try { + if (isTlsRsaPremasterSecret) { + if (!forTlsPremasterSecret) { + throw new IllegalStateException( + "No TlsRsaPremasterSecretParameterSpec specified"); + } + + // polish the TLS premaster secret + encoded = KeyUtil.checkTlsPreMasterSecretKey( + ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), + ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), + random, encoded, encoded == null); } - // polish the TLS premaster secret - encoded = KeyUtil.checkTlsPreMasterSecretKey( - ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(), - ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(), - random, encoded, (failover != null)); + return constructKey(encoded, algorithm, type); + } finally { + if (encoded != null) { + Arrays.fill(encoded, (byte) 0); + } } - - return constructKey(encoded, algorithm, type); } // see JCE spec @@ -495,7 +499,23 @@ private static Key constructKey(byte[] encodedKey, * Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY. * It expects and returns ciphertext data in big-endian form. */ - private native static byte[] encryptDecrypt(byte[] data, int dataSize, - long hCryptKey, boolean doEncrypt) throws KeyException; + private byte[] encryptDecrypt(byte[] data, int dataSize, + long hCryptKey, boolean doEncrypt) throws KeyException, BadPaddingException { + int[] returnStatus = new int[1]; + byte[] result= encryptDecrypt(returnStatus, data, dataSize, hCryptKey, doEncrypt); + if ((returnStatus[0] == ERROR_INVALID_PARAMETER) || (returnStatus[0] == NTE_INVALID_PARAMETER)) { + if (forTlsPremasterSecret) { + result = null; + } else { + throw new BadPaddingException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + } else if (returnStatus[0] != 0) { + throw new KeyException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + + return result; + } + private static native byte[] encryptDecrypt(int[] returnStatus, byte[] data, int dataSize, + long key, boolean doEncrypt) throws KeyException; } diff --git a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp index 684588cac26..ef15c81a324 100644 --- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp +++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp @@ -1869,18 +1869,25 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_destroyKeyContainer /* * Class: sun_security_mscapi_CRSACipher * Method: encryptDecrypt - * Signature: ([BIJZ)[B + * Signature: ([I[BIJZ)[B */ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt - (JNIEnv *env, jclass clazz, jbyteArray jData, jint jDataSize, jlong hKey, + (JNIEnv *env, jclass clazz, jintArray jResultStatus, jbyteArray jData, jint jDataSize, jlong hKey, jboolean doEncrypt) { jbyteArray result = NULL; jbyte* pData = NULL; + jbyte* resultData = NULL; DWORD dwDataLen = jDataSize; DWORD dwBufLen = env->GetArrayLength(jData); DWORD i; BYTE tmp; + BOOL success; + DWORD ss = ERROR_SUCCESS; + DWORD lastError = ERROR_SUCCESS; + DWORD resultLen = 0; + DWORD pmsLen = 48; + jbyte pmsArr[48] = {0}; __try { @@ -1907,6 +1914,8 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt pData[i] = pData[dwBufLen - i -1]; pData[dwBufLen - i - 1] = tmp; } + resultData = pData; + resultLen = dwBufLen; } else { // convert to little-endian for (i = 0; i < dwBufLen / 2; i++) { @@ -1916,21 +1925,28 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt } // decrypt - if (! ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated - &dwBufLen)) { - - ThrowException(env, KEY_EXCEPTION, GetLastError()); - __leave; + success = ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated + &dwBufLen); + lastError = GetLastError(); + if (success) { + ss = ERROR_SUCCESS; + resultData = pData; + resultLen = dwBufLen; + } else { + ss = lastError; + resultData = pmsArr; + resultLen = pmsLen; } + env->SetIntArrayRegion(jResultStatus, 0, 1, (jint*) &ss); } - // Create new byte array - if ((result = env->NewByteArray(dwBufLen)) == NULL) { + // Create new byte array + if ((result = env->NewByteArray(resultLen)) == NULL) { __leave; } // Copy data from native buffer to Java buffer - env->SetByteArrayRegion(result, 0, dwBufLen, (jbyte*) pData); + env->SetByteArrayRegion(result, 0, resultLen, (jbyte*) resultData); } __finally { From e059fc7575a8c450a5ed227651a00ebc355e3a46 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 9 Jan 2024 17:13:59 +0100 Subject: [PATCH 176/177] 8314307: Improve loop handling Reviewed-by: mbalao, fferrari Backport-of: 62ac93d145ca9fa1ab0c040533c62c42c202703a --- src/hotspot/share/opto/ifnode.cpp | 59 ++++- src/hotspot/share/opto/loopnode.cpp | 390 +++++++++++++++++++++------- src/hotspot/share/opto/loopnode.hpp | 3 + 3 files changed, 356 insertions(+), 96 deletions(-) diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index ae553351ead..2570f85d17f 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -1702,6 +1702,46 @@ Node* RangeCheckNode::Ideal(PhaseGVN *phase, bool can_reshape) { // then we are guaranteed to fail, so just start interpreting there. // We 'expand' the top 3 range checks to include all post-dominating // checks. + // + // Example: + // a[i+x] // (1) 1 < x < 6 + // a[i+3] // (2) + // a[i+4] // (3) + // a[i+6] // max = max of all constants + // a[i+2] + // a[i+1] // min = min of all constants + // + // If x < 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+max] = a[i+6]: i+x < i+3 <= i+6 -> (2) is covered + // (3) a[i+4]: Replace with a[i+min] = a[i+1]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // If x >= 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+min] = a[i+1]: i+1 < i+3 <= i+x -> (2) is covered + // (3) a[i+4]: Replace with a[i+max] = a[i+6]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // We only need the top 2 range checks if x is the min or max of all constants. + // + // This, however, only works if the interval [i+min,i+max] is not larger than max_int (i.e. abs(max - min) < max_int): + // The theoretical max size of an array is max_int with: + // - Valid index space: [0,max_int-1] + // - Invalid index space: [max_int,-1] // max_int, min_int, min_int - 1 ..., -1 + // + // The size of the consecutive valid index space is smaller than the size of the consecutive invalid index space. + // If we choose min and max in such a way that: + // - abs(max - min) < max_int + // - i+max and i+min are inside the valid index space + // then all indices [i+min,i+max] must be in the valid index space. Otherwise, the invalid index space must be + // smaller than the valid index space which is never the case for any array size. + // + // Choosing a smaller array size only makes the valid index space smaller and the invalid index space larger and + // the argument above still holds. + // + // Note that the same optimization with the same maximal accepted interval size can also be found in C1. + const jlong maximum_number_of_min_max_interval_indices = (jlong)max_jint; // The top 3 range checks seen const int NRC =3; @@ -1736,13 +1776,18 @@ Node* RangeCheckNode::Ideal(PhaseGVN *phase, bool can_reshape) { found_immediate_dominator = true; break; } - // Gather expanded bounds - off_lo = MIN2(off_lo,offset2); - off_hi = MAX2(off_hi,offset2); - // Record top NRC range checks - prev_checks[nb_checks%NRC].ctl = prev_dom; - prev_checks[nb_checks%NRC].off = offset2; - nb_checks++; + + // "x - y" -> must add one to the difference for number of elements in [x,y] + const jlong diff = (jlong)MIN2(offset2, off_lo) - (jlong)MAX2(offset2, off_hi); + if (ABS(diff) < maximum_number_of_min_max_interval_indices) { + // Gather expanded bounds + off_lo = MIN2(off_lo, offset2); + off_hi = MAX2(off_hi, offset2); + // Record top NRC range checks + prev_checks[nb_checks % NRC].ctl = prev_dom; + prev_checks[nb_checks % NRC].off = offset2; + nb_checks++; + } } } prev_dom = dom; diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index c803001c525..f3100e5dd6a 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -350,6 +350,25 @@ void PhaseIdealLoop::insert_loop_limit_check(ProjNode* limit_check_proj, Node* c #endif } +static int check_stride_overflow(jlong final_correction, const TypeInt* limit_t) { + if (final_correction > 0) { + if (limit_t->_lo > (max_jint - final_correction)) { + return -1; + } + if (limit_t->_hi > (max_jint - final_correction)) { + return 1; + } + } else { + if (limit_t->_hi < (min_jint - final_correction)) { + return -1; + } + if (limit_t->_lo < (min_jint - final_correction)) { + return 1; + } + } + return 0; +} + //------------------------------is_counted_loop-------------------------------- bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { PhaseGVN *gvn = &_igvn; @@ -585,52 +604,202 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { assert(x->Opcode() == Op_Loop, "regular loops only"); C->print_method(PHASE_BEFORE_CLOOPS, 3); - Node *hook = new Node(6); - // =================================================== - // Generate loop limit check to avoid integer overflow - // in cases like next (cyclic loops): + // We can only convert this loop to a counted loop if we can guarantee that the iv phi will never overflow at runtime. + // This is an implicit assumption taken by some loop optimizations. We therefore must ensure this property at all cost. + // At this point, we've already excluded some trivial cases where an overflow could have been proven statically. + // But even though we cannot prove that an overflow will *not* happen, we still want to speculatively convert this loop + // to a counted loop. This can be achieved by adding additional iv phi overflow checks before the loop. If they fail, + // we trap and resume execution before the loop without having executed any iteration of the loop, yet. // - // for (i=0; i <= max_jint; i++) {} - // for (i=0; i < max_jint; i+=2) {} + // These additional iv phi overflow checks can be inserted as Loop Limit Check Predicates above the Loop Limit Check + // Parse Predicate which captures a JVM state just before the entry of the loop. If there is no such Parse Predicate, + // we cannot generate a Loop Limit Check Predicate and thus cannot speculatively convert the loop to a counted loop. // + // In the following, we only focus on int loops with stride > 0 to keep things simple. The argumentation and proof + // for stride < 0 is analogously. For long loops, we would replace max_int with max_long. // - // Limit check predicate depends on the loop test: // - // for(;i != limit; i++) --> limit <= (max_jint) - // for(;i < limit; i+=stride) --> limit <= (max_jint - stride + 1) - // for(;i <= limit; i+=stride) --> limit <= (max_jint - stride ) + // The loop to be converted does not always need to have the often used shape: // - - // Check if limit is excluded to do more precise int overflow check. - bool incl_limit = (bt == BoolTest::le || bt == BoolTest::ge); - int stride_m = stride_con - (incl_limit ? 0 : (stride_con > 0 ? 1 : -1)); - - // If compare points directly to the phi we need to adjust - // the compare so that it points to the incr. Limit have - // to be adjusted to keep trip count the same and the - // adjusted limit should be checked for int overflow. - if (phi_incr != NULL) { - stride_m += stride_con; - } - - if (limit->is_Con()) { - int limit_con = limit->get_int(); - if ((stride_con > 0 && limit_con > (max_jint - stride_m)) || - (stride_con < 0 && limit_con < (min_jint - stride_m))) { - // Bailout: it could be integer overflow. - return false; + // i = init + // i = init loop: + // do { ... + // // ... equivalent i+=stride + // i+=stride <==> if (i < limit) + // } while (i < limit); goto loop + // exit: + // ... + // + // where the loop exit check uses the post-incremented iv phi and a '<'-operator. + // + // We could also have '<='-operator (or '>='-operator for negative strides) or use the pre-incremented iv phi value + // in the loop exit check: + // + // i = init + // loop: + // ... + // if (i <= limit) + // i+=stride + // goto loop + // exit: + // ... + // + // Let's define the following terms: + // - iv_pre_i: The pre-incremented iv phi before the i-th iteration. + // - iv_post_i: The post-incremented iv phi after the i-th iteration. + // + // The iv_pre_i and iv_post_i have the following relation: + // iv_pre_i + stride = iv_post_i + // + // When converting a loop to a counted loop, we want to have a canonicalized loop exit check of the form: + // iv_post_i < adjusted_limit + // + // If that is not the case, we need to canonicalize the loop exit check by using different values for adjusted_limit: + // (LE1) iv_post_i < limit: Already canonicalized. We can directly use limit as adjusted_limit. + // -> adjusted_limit = limit. + // (LE2) iv_post_i <= limit: + // iv_post_i < limit + 1 + // -> adjusted limit = limit + 1 + // (LE3) iv_pre_i < limit: + // iv_pre_i + stride < limit + stride + // iv_post_i < limit + stride + // -> adjusted_limit = limit + stride + // (LE4) iv_pre_i <= limit: + // iv_pre_i < limit + 1 + // iv_pre_i + stride < limit + stride + 1 + // iv_post_i < limit + stride + 1 + // -> adjusted_limit = limit + stride + 1 + // + // Note that: + // (AL) limit <= adjusted_limit. + // + // The following loop invariant has to hold for counted loops with n iterations (i.e. loop exit check true after n-th + // loop iteration) and a canonicalized loop exit check to guarantee that no iv_post_i over- or underflows: + // (INV) For i = 1..n, min_int <= iv_post_i <= max_int + // + // To prove (INV), we require the following two conditions/assumptions: + // (i): adjusted_limit - 1 + stride <= max_int + // (ii): init < limit + // + // If we can prove (INV), we know that there can be no over- or underflow of any iv phi value. We prove (INV) by + // induction by assuming (i) and (ii). + // + // Proof by Induction + // ------------------ + // > Base case (i = 1): We show that (INV) holds after the first iteration: + // min_int <= iv_post_1 = init + stride <= max_int + // Proof: + // First, we note that (ii) implies + // (iii) init <= limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= limit - 1 + stride [using (AL)] + // >= init + stride [using (iii)] + // >= min_int [using stride > 0, no underflow] + // Thus, no overflow happens after the first iteration and (INV) holds for i = 1. + // + // Note that to prove the base case we need (i) and (ii). + // + // > Induction Hypothesis (i = j, j > 1): Assume that (INV) holds after the j-th iteration: + // min_int <= iv_post_j <= max_int + // > Step case (i = j + 1): We show that (INV) also holds after the j+1-th iteration: + // min_int <= iv_post_{j+1} = iv_post_j + stride <= max_int + // Proof: + // If iv_post_j >= adjusted_limit: + // We exit the loop after the j-th iteration, and we don't execute the j+1-th iteration anymore. Thus, there is + // also no iv_{j+1}. Since (INV) holds for iv_j, there is nothing left to prove. + // If iv_post_j < adjusted_limit: + // First, we note that: + // (iv) iv_post_j <= adjusted_limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= iv_post_j + stride [using (iv)] + // >= min_int [using stride > 0, no underflow] + // + // Note that to prove the step case we only need (i). + // + // Thus, by assuming (i) and (ii), we proved (INV). + // + // + // It is therefore enough to add the following two Loop Limit Check Predicates to check assumptions (i) and (ii): + // + // (1) Loop Limit Check Predicate for (i): + // Using (i): adjusted_limit - 1 + stride <= max_int + // + // This condition is now restated to use limit instead of adjusted_limit: + // + // To prevent an overflow of adjusted_limit -1 + stride itself, we rewrite this check to + // max_int - stride + 1 >= adjusted_limit + // We can merge the two constants into + // canonicalized_correction = stride - 1 + // which gives us + // max_int - canonicalized_correction >= adjusted_limit + // + // To directly use limit instead of adjusted_limit in the predicate condition, we split adjusted_limit into: + // adjusted_limit = limit + limit_correction + // 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 + // which gives us: + // + // Final predicate condition: + // max_int - final_correction >= limit + // + // (2) Loop Limit Check Predicate for (ii): + // Using (ii): init < limit + // + // This Loop Limit Check Predicate is not required if we can prove at compile time that either: + // (2.1) type(init) < type(limit) + // In this case, we know: + // all possible values of init < all possible values of limit + // and we can skip the predicate. + // + // (2.2) init < limit is already checked before (i.e. found as a dominating check) + // In this case, we do not need to re-check the condition and can skip the predicate. + // This is often found for while- and for-loops which have the following shape: + // + // if (init < limit) { // Dominating test. Do not need the Loop Limit Check Predicate below. + // i = init; + // if (init >= limit) { trap(); } // Here we would insert the Loop Limit Check Predicate + // do { + // i += stride; + // } while (i < limit); + // } + // + // (2.3) init + stride <= max_int + // In this case, there is no overflow of the iv phi after the first loop iteration. + // In the proof of the base case above we showed that init + stride <= max_int by using assumption (ii): + // init < limit + // In the proof of the step case above, we did not need (ii) anymore. Therefore, if we already know at + // compile time that init + stride <= max_int then we have trivially proven the base case and that + // 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. + + + // 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 != NULL) ? stride_con : 0; + + // Accounting for (LE2) and (LE4) where we use <= or >= in the loop exit check. + const bool includes_limit = (bt == BoolTest::le || bt == BoolTest::ge); + const jlong limit_correction_for_le_ge_exit_check = (includes_limit ? (stride_con > 0 ? 1 : -1) : 0); + + const jlong limit_correction = limit_correction_for_pre_iv_exit_check + limit_correction_for_le_ge_exit_check; + const jlong canonicalized_correction = stride_con + (stride_con > 0 ? -1 : 1); + const jlong final_correction = canonicalized_correction + limit_correction; + + int sov = check_stride_overflow(final_correction, limit_t); + + // If sov==0, limit's type always satisfies the condition, for + // example, when it is an array length. + if (sov != 0) { + if (sov < 0) { + return false; // Bailout: integer overflow is certain. } - } else if ((stride_con > 0 && limit_t->_hi <= (max_jint - stride_m)) || - (stride_con < 0 && limit_t->_lo >= (min_jint - stride_m))) { - // Limit's type may satisfy the condition, for example, - // when it is an array length. - } else { - // Generate loop's limit check. - // Loop limit check predicate should be near the loop. + // (1) Loop Limit Check Predicate is required because we could not statically prove that + // limit + final_correction = adjusted_limit - 1 + stride <= max_int ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); if (!limit_check_proj) { - // The limit check predicate is not generated if this method trapped here before. + // The Loop Limit Check Parse Predicate is not generated if this method trapped here before. #ifdef ASSERT if (TraceLoopLimitCheck) { tty->print("missing loop limit check:"); @@ -651,68 +820,83 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { Node* bol; if (stride_con > 0) { - cmp_limit = new CmpINode(limit, _igvn.intcon(max_jint - stride_m)); + cmp_limit = new CmpINode(limit, _igvn.intcon(max_jint - final_correction)); bol = new BoolNode(cmp_limit, BoolTest::le); } else { - cmp_limit = new CmpINode(limit, _igvn.intcon(min_jint - stride_m)); + cmp_limit = new CmpINode(limit, _igvn.intcon(min_jint - final_correction)); bol = new BoolNode(cmp_limit, BoolTest::ge); } insert_loop_limit_check(limit_check_proj, cmp_limit, bol); } - // Now we need to canonicalize loop condition. - if (bt == BoolTest::ne) { - assert(stride_con == 1 || stride_con == -1, "simple increment only"); - if (stride_con > 0 && init_t->_hi < limit_t->_lo) { - // 'ne' can be replaced with 'lt' only when init < limit. - bt = BoolTest::lt; - } else if (stride_con < 0 && init_t->_lo > limit_t->_hi) { - // 'ne' can be replaced with 'gt' only when init > limit. - bt = BoolTest::gt; - } else { - ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); - if (!limit_check_proj) { - // The limit check predicate is not generated if this method trapped here before. + // (2.3) + const bool init_plus_stride_could_overflow = + (stride_con > 0 && init_t->_hi > max_jint - stride_con) || + (stride_con < 0 && init_t->_lo < min_jint - stride_con); + // (2.1) + const bool init_gte_limit = (stride_con > 0 && init_t->_hi >= limit_t->_lo) || + (stride_con < 0 && init_t->_lo <= limit_t->_hi); + + if (init_gte_limit && // (2.1) + ((bt == BoolTest::ne || init_plus_stride_could_overflow) && // (2.3) + !has_dominating_loop_limit_check(init_trip, limit, stride_con, init_control))) { // (2.2) + // (2) Iteration Loop Limit Check Predicate is required because neither (2.1), (2.2), nor (2.3) holds. + // We use the following condition: + // - stride > 0: init < limit + // - stride < 0: init > limit + // + // This predicate is always required if we have a non-equal-operator in the loop exit check (where stride = 1 is + // a requirement). We transform the loop exit check by using a less-than-operator. By doing so, we must always + // check that init < limit. Otherwise, we could have a different number of iterations at runtime. + + ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); + if (!limit_check_proj) { + // The limit check predicate is not generated if this method trapped here before. #ifdef ASSERT - if (TraceLoopLimitCheck) { - tty->print("missing loop limit check:"); - loop->dump_head(); - x->dump(1); - } -#endif - return false; + if (TraceLoopLimitCheck) { + tty->print("missing loop limit check:"); + loop->dump_head(); + x->dump(1); } - IfNode* check_iff = limit_check_proj->in(0)->as_If(); +#endif + return false; + } + IfNode* check_iff = limit_check_proj->in(0)->as_If(); - if (!is_dominator(get_ctrl(limit), check_iff->in(0)) || - !is_dominator(get_ctrl(init_trip), check_iff->in(0))) { - return false; - } + if (!is_dominator(get_ctrl(limit), check_iff->in(0)) || + !is_dominator(get_ctrl(init_trip), check_iff->in(0))) { + return false; + } - Node* cmp_limit; - Node* bol; + Node* cmp_limit; + Node* bol; - if (stride_con > 0) { - cmp_limit = new CmpINode(init_trip, limit); - bol = new BoolNode(cmp_limit, BoolTest::lt); - } else { - cmp_limit = new CmpINode(init_trip, limit); - bol = new BoolNode(cmp_limit, BoolTest::gt); - } + if (stride_con > 0) { + cmp_limit = new CmpINode(init_trip, limit); + bol = new BoolNode(cmp_limit, BoolTest::lt); + } else { + cmp_limit = new CmpINode(init_trip, limit); + bol = new BoolNode(cmp_limit, BoolTest::gt); + } - insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + } - if (stride_con > 0) { - // 'ne' can be replaced with 'lt' only when init < limit. - bt = BoolTest::lt; - } else if (stride_con < 0) { - // 'ne' can be replaced with 'gt' only when init > limit. - bt = BoolTest::gt; - } + if (bt == BoolTest::ne) { + // Now we need to canonicalize the loop condition if it is 'ne'. + assert(stride_con == 1 || stride_con == -1, "simple increment only - checked before"); + if (stride_con > 0) { + // 'ne' can be replaced with 'lt' only when init < limit. This is ensured by the inserted predicate above. + bt = BoolTest::lt; + } else { + assert(stride_con < 0, "must be"); + // 'ne' can be replaced with 'gt' only when init > limit. This is ensured by the inserted predicate above. + bt = BoolTest::gt; } } + Node* adjusted_limit = limit; if (phi_incr != NULL) { // If compare points directly to the phi we need to adjust // the compare so that it points to the incr. Limit have @@ -723,15 +907,15 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { // is converted to // i = init; do {} while(++i < limit+1); // - limit = gvn->transform(new AddINode(limit, stride)); + adjusted_limit = gvn->transform(new AddINode(limit, stride)); } - if (incl_limit) { + if (includes_limit) { // The limit check guaranties that 'limit <= (max_jint - stride)' so // we can convert 'i <= limit' to 'i < limit+1' since stride != 0. // Node* one = (stride_con > 0) ? gvn->intcon( 1) : gvn->intcon(-1); - limit = gvn->transform(new AddINode(limit, one)); + adjusted_limit = gvn->transform(new AddINode(adjusted_limit, one)); if (bt == BoolTest::le) bt = BoolTest::lt; else if (bt == BoolTest::ge) @@ -739,7 +923,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { else ShouldNotReachHere(); } - set_subtree_ctrl( limit ); + set_subtree_ctrl(adjusted_limit); if (LoopStripMiningIter == 0) { // Check for SafePoint on backedge and remove @@ -776,7 +960,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { } cmp = cmp->clone(); cmp->set_req(1,incr); - cmp->set_req(2,limit); + cmp->set_req(2, adjusted_limit); cmp = _igvn.register_new_node_with_optimizer(cmp); set_ctrl(cmp, iff->in(0)); @@ -869,9 +1053,6 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { } } - // Free up intermediate goo - _igvn.remove_dead_node(hook); - #ifdef ASSERT assert(l->is_valid_counted_loop(), "counted loop shape is messed up"); assert(l == loop->_head && l->phi() == phi && l->loopexit_or_null() == lex, "" ); @@ -900,6 +1081,37 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { return true; } +// Check if there is a dominating loop limit check of the form 'init < limit' starting at the loop entry. +// If there is one, then we do not need to create an additional Loop Limit Check Predicate. +bool PhaseIdealLoop::has_dominating_loop_limit_check(Node* init_trip, Node* limit, const int stride_con, + Node* loop_entry) { + // Eagerly call transform() on the Cmp and Bool node to common them up if possible. This is required in order to + // successfully find a dominated test with the If node below. + Node* cmp_limit; + Node* bol; + if (stride_con > 0) { + cmp_limit = _igvn.transform(new CmpINode(init_trip, limit)); + bol = _igvn.transform(new BoolNode(cmp_limit, BoolTest::lt)); + } else { + cmp_limit = _igvn.transform(new CmpINode(init_trip, limit)); + bol = _igvn.transform(new BoolNode(cmp_limit, BoolTest::gt)); + } + + // Check if there is already a dominating init < limit check. If so, we do not need a Loop Limit Check Predicate. + IfNode* iff = new IfNode(loop_entry, bol, PROB_MIN, COUNT_UNKNOWN); + // Also add fake IfProj nodes in order to call transform() on the newly created IfNode. + IfFalseNode* if_false = new IfFalseNode(iff); + IfTrueNode* if_true = new IfTrueNode(iff); + Node* dominated_iff = _igvn.transform(iff); + // ConI node? Found dominating test (IfNode::dominated_by() returns a ConI node). + const bool found_dominating_test = dominated_iff != NULL && dominated_iff->Opcode() == Op_ConI; + + // Kill the If with its projections again in the next IGVN round by cutting it off from the graph. + _igvn.replace_input_of(iff, 0, C->top()); + _igvn.replace_input_of(iff, 1, C->top()); + return found_dominating_test; +} + //----------------------exact_limit------------------------------------------- Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) { assert(loop->_head->is_CountedLoop(), ""); diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 707a97c069c..d1d6aeb512e 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1135,6 +1135,9 @@ class PhaseIdealLoop : public PhaseTransform { // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason, int opcode, bool if_cont_is_true_proj = true); + bool has_dominating_loop_limit_check(Node* init_trip, Node* limit, int stride_con, + Node* loop_entry); + void register_control(Node* n, IdealLoopTree *loop, Node* pred); From 6739881b2fa7e8e8c05198bc7d5d4834638bd7d1 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Tue, 9 Jan 2024 22:19:49 +0100 Subject: [PATCH 177/177] 8323423: [11u] Remove designator DEFAULT_PROMOTED_VERSION_PRE=ea for release 11.0.22 Reviewed-by: goetz --- make/autoconf/version-numbers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index 1657ac50291..819d28cf637 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -37,7 +37,7 @@ DEFAULT_VERSION_DATE=2024-01-16 DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11" -DEFAULT_PROMOTED_VERSION_PRE=ea +DEFAULT_PROMOTED_VERSION_PRE= LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK