diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..d3f63784ece --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ + + + +--------- +- [ ] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). diff --git a/make/Hsdis.gmk b/make/Hsdis.gmk index 469cc488f16..76695fc8dde 100644 --- a/make/Hsdis.gmk +++ b/make/Hsdis.gmk @@ -44,6 +44,9 @@ ifeq ($(HSDIS_BACKEND), capstone) else ifeq ($(call isTargetCpuArch, aarch64), true) CAPSTONE_ARCH := CS_ARCH_$(CAPSTONE_ARCH_AARCH64_NAME) CAPSTONE_MODE := CS_MODE_ARM + else ifeq ($(call isTargetCpuArch, arm), true) + CAPSTONE_ARCH := CS_ARCH_ARM + CAPSTONE_MODE := CS_MODE_ARM else $(error No support for Capstone on this platform) endif diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index ab878a4d2a5..de496b3f606 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -87,6 +87,7 @@ public class CLDRConverter { static final String EXEMPLAR_CITY_PREFIX = "timezone.excity."; static final String ZONE_NAME_PREFIX = "timezone.displayname."; static final String METAZONE_ID_PREFIX = "metazone.id."; + static final String METAZONE_DSTOFFSET_PREFIX = "metazone.dstoffset."; static final String PARENT_LOCALE_PREFIX = "parentLocale."; static final String LIKELY_SCRIPT_PREFIX = "likelyScript."; static final String META_EMPTY_ZONE_NAME = "EMPTY_ZONE"; @@ -139,6 +140,11 @@ public class CLDRConverter { private static final Map tzdbSubstLetters = HashMap.newHashMap(512); private static final Map tzdbLinks = HashMap.newHashMap(512); + // Map of explicit dst offsets for metazones + // key: time zone ID + // value: explicit dstOffset for the corresponding metazone name + static final Map explicitDstOffsets = HashMap.newHashMap(32); + static enum DraftType { UNCONFIRMED, PROVISIONAL, @@ -867,6 +873,12 @@ public class CLDRConverter { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); names.putAll(exCities); + // Explicit metazone offsets + if (id.equals("root")) { + explicitDstOffsets.forEach((k, v) -> + names.put(METAZONE_DSTOFFSET_PREFIX + k, v)); + } + // If there's no UTC entry at this point, add an empty one if (!names.isEmpty() && !names.containsKey("UTC")) { names.putIfAbsent(METAZONE_ID_PREFIX + META_EMPTY_ZONE_NAME, EMPTY_ZONE); diff --git a/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java index 2c3757b7a47..45de46d2476 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,15 @@ class MetaZonesParseHandler extends AbstractLDMLHandler { if (fromLDT.isBefore(now) && toLDT.isAfter(now)) { metazone = attributes.getValue("mzone"); + + // Explicit metazone DST offsets. Only the "dst" offset is needed, + // as "std" is used by default when it doesn't match. + String dstOffset = attributes.getValue("dstOffset"); + if (dstOffset != null) { + CLDRConverter.explicitDstOffsets.put(tzid, dstOffset); + } } + pushIgnoredContainer(qName); break; diff --git a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java index 3953f38f653..8278bf6bcfa 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,7 +198,8 @@ class ResourceBundleGenerator implements BundleGenerator { } else if (value instanceof String) { String valStr = (String)value; if (type == BundleType.TIMEZONE && - !key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) || + !(key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) || + key.startsWith(CLDRConverter.METAZONE_DSTOFFSET_PREFIX)) || valStr.startsWith(META_VALUE_PREFIX)) { out.printf(" { \"%s\", %s },\n", key, CLDRConverter.saveConvert(valStr, useJava)); } else { diff --git a/make/modules/jdk.hotspot.agent/Lib.gmk b/make/modules/jdk.hotspot.agent/Lib.gmk index ed8de631dc3..da02e0dab39 100644 --- a/make/modules/jdk.hotspot.agent/Lib.gmk +++ b/make/modules/jdk.hotspot.agent/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. # 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,6 +55,12 @@ else LIBSAPROC_LINK_TYPE := C endif +# DWARF related sources would be included on supported platforms only. +LIBSAPROC_EXCLUDE_FILES := +ifneq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, x86_64 aarch64)), true) + LIBSAPROC_EXCLUDE_FILES := DwarfParser.cpp dwarf.cpp +endif + $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \ NAME := saproc, \ LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \ @@ -70,6 +76,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \ CFLAGS := $(LIBSAPROC_CFLAGS), \ CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \ EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \ + EXCLUDE_FILES := $(LIBSAPROC_EXCLUDE_FILES), \ JDK_LIBS := java.base:libjava, \ LIBS_linux := $(LIBDL), \ LIBS_macosx := \ diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 7899a2f7e51..39a9c618350 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1098,6 +1098,7 @@ void VM_Version::get_processor_features() { if (supports_apx_f() && os_supports_apx_egprs() && supports_avx512vl()) { if (FLAG_IS_DEFAULT(UseAPX)) { UseAPX = false; // by default UseAPX is false + _features.clear_feature(CPU_APX_F); } else if (!UseAPX) { _features.clear_feature(CPU_APX_F); } @@ -1206,16 +1207,7 @@ void VM_Version::get_processor_features() { } } } else { - if (!UseAES) { - if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { - warning("AES intrinsics require UseAES flag to be enabled. Intrinsics will be disabled."); - } - FLAG_SET_DEFAULT(UseAESIntrinsics, false); - if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { - warning("AES_CTR intrinsics require UseAES flag to be enabled. AES_CTR intrinsics will be disabled."); - } - FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); - } else if (!cpu_supports_aes()) { + if (!cpu_supports_aes()) { if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { warning("AES intrinsics are not available on this CPU"); } @@ -1224,6 +1216,15 @@ void VM_Version::get_processor_features() { warning("AES-CTR intrinsics are not available on this CPU"); } FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } else if (!UseAES) { + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { + warning("AES intrinsics require UseAES flag to be enabled. Intrinsics will be disabled."); + } + FLAG_SET_DEFAULT(UseAESIntrinsics, false); + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("AES_CTR intrinsics require UseAES flag to be enabled. AES_CTR intrinsics will be disabled."); + } + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); } } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index bf096897aa7..a87c0ab33fa 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2163,8 +2163,6 @@ void os::print_os_info(outputStream* st) { os::Posix::print_rlimit_info(st); - os::print_open_file_descriptors(st); - os::Posix::print_load_average(st); st->cr(); diff --git a/src/hotspot/share/code/aotCodeCache.cpp b/src/hotspot/share/code/aotCodeCache.cpp index d3888d1b7eb..6594d94fa91 100644 --- a/src/hotspot/share/code/aotCodeCache.cpp +++ b/src/hotspot/share/code/aotCodeCache.cpp @@ -1905,9 +1905,6 @@ void AOTCodeAddressTable::init_extrs() { ADD_EXTERNAL_ADDRESS(SharedRuntime::handle_wrong_method_ic_miss); #if defined(AARCH64) && !defined(ZERO) ADD_EXTERNAL_ADDRESS(JavaThread::aarch64_get_thread_helper); -#endif - -#if defined(AARCH64) ADD_EXTERNAL_ADDRESS(BarrierSetAssembler::patching_epoch_addr()); #endif diff --git a/src/hotspot/share/code/codeBlob.hpp b/src/hotspot/share/code/codeBlob.hpp index 6a1686b80e2..1c6904e7446 100644 --- a/src/hotspot/share/code/codeBlob.hpp +++ b/src/hotspot/share/code/codeBlob.hpp @@ -45,9 +45,10 @@ class OopMapSet; enum class CodeBlobType { MethodNonProfiled = 0, // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods) MethodProfiled = 1, // Execution level 2 and 3 (profiled) nmethods - NonNMethod = 2, // Non-nmethods like Buffers, Adapters and Runtime Stubs - All = 3, // All types (No code cache segmentation) - NumTypes = 4 // Number of CodeBlobTypes + MethodHot = 2, // Nmethods predicted to be always hot + NonNMethod = 3, // Non-nmethods like Buffers, Adapters and Runtime Stubs + All = 4, // All types (No code cache segmentation) + NumTypes = 5 // Number of CodeBlobTypes }; // CodeBlob - superclass for all entries in the CodeCache. diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 2a0256cc316..c0b4918102e 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -201,6 +201,7 @@ void CodeCache::initialize_heaps() { CodeHeapInfo non_nmethod = {NonNMethodCodeHeapSize, FLAG_IS_CMDLINE(NonNMethodCodeHeapSize), true}; CodeHeapInfo profiled = {ProfiledCodeHeapSize, FLAG_IS_CMDLINE(ProfiledCodeHeapSize), true}; CodeHeapInfo non_profiled = {NonProfiledCodeHeapSize, FLAG_IS_CMDLINE(NonProfiledCodeHeapSize), true}; + CodeHeapInfo hot = {HotCodeHeapSize, FLAG_IS_CMDLINE(HotCodeHeapSize), true}; const bool cache_size_set = FLAG_IS_CMDLINE(ReservedCodeCacheSize); const size_t ps = page_size(false, 8); @@ -219,6 +220,12 @@ void CodeCache::initialize_heaps() { profiled.enabled = false; } + if (!heap_available(CodeBlobType::MethodHot)) { + hot.size = 0; + hot.set = true; + hot.enabled = false; + } + assert(heap_available(CodeBlobType::MethodNonProfiled), "MethodNonProfiled heap is always available for segmented code heap"); size_t compiler_buffer_size = 0; @@ -238,14 +245,36 @@ void CodeCache::initialize_heaps() { set_size_of_unset_code_heap(&non_profiled, cache_size, non_nmethod.size + profiled.size, min_size); } - if (!profiled.set && non_profiled.set) { - set_size_of_unset_code_heap(&profiled, cache_size, non_nmethod.size + non_profiled.size, min_size); + if (!profiled.set && non_profiled.set && hot.set) { + set_size_of_unset_code_heap(&profiled, cache_size, non_nmethod.size + non_profiled.size + hot.size, min_size); + } + + if (hot.enabled) { + if (!hot.set) { + assert(hot.size == 0, "must be calculated during heaps initialization"); + // An application usually has ~20% hot code which is mostly non-profiled code. + // We set the hot code heap size to 20% of the non-profiled code heap. + hot.size = MAX2(non_profiled.size / 5, min_size); + + if (non_profiled.set) { + err_msg msg("Must manually set HotCodeHeapSize when NonProfiledCodeHeapSize is set"); + vm_exit_during_initialization("Invalid code heap sizes", msg); + } + + non_profiled.size -= hot.size; + } + + if (hot.size > non_profiled.size) { + err_msg msg("Hot (%zuK) exceeds NonProfiled (%zuK).", + hot.size / K, non_profiled.size / K); + vm_exit_during_initialization("Invalid code heap sizes", msg); + } } // Compatibility. size_t non_nmethod_min_size = min_cache_size + compiler_buffer_size; - if (!non_nmethod.set && profiled.set && non_profiled.set) { - set_size_of_unset_code_heap(&non_nmethod, cache_size, profiled.size + non_profiled.size, non_nmethod_min_size); + if (!non_nmethod.set && profiled.set && non_profiled.set && hot.set) { + set_size_of_unset_code_heap(&non_nmethod, cache_size, profiled.size + non_profiled.size + hot.size, non_nmethod_min_size); } // Note: if large page support is enabled, min_size is at least the large @@ -253,8 +282,9 @@ void CodeCache::initialize_heaps() { non_nmethod.size = align_up(non_nmethod.size, min_size); profiled.size = align_up(profiled.size, min_size); non_profiled.size = align_up(non_profiled.size, min_size); + hot.size = align_up(hot.size, min_size); - size_t aligned_total = non_nmethod.size + profiled.size + non_profiled.size; + size_t aligned_total = non_nmethod.size + profiled.size + non_profiled.size + hot.size; if (!cache_size_set) { // If ReservedCodeCacheSize is explicitly set and exceeds CODE_CACHE_SIZE_LIMIT, // it is rejected by flag validation elsewhere. Here we only handle the case @@ -262,15 +292,15 @@ void CodeCache::initialize_heaps() { // sizes (after alignment) exceed the platform limit. if (aligned_total > CODE_CACHE_SIZE_LIMIT) { err_msg message("ReservedCodeCacheSize (%zuK), Max (%zuK)." - "Segments: NonNMethod (%zuK), NonProfiled (%zuK), Profiled (%zuK).", + "Segments: NonNMethod (%zuK), NonProfiled (%zuK), Profiled (%zuK), Hot (%zuK).", aligned_total/K, CODE_CACHE_SIZE_LIMIT/K, - non_nmethod.size/K, non_profiled.size/K, profiled.size/K); + non_nmethod.size/K, non_profiled.size/K, profiled.size/K, hot.size/K); vm_exit_during_initialization("Code cache size exceeds platform limit", message); } if (aligned_total != cache_size) { log_info(codecache)("ReservedCodeCache size %zuK changed to total segments size NonNMethod " - "%zuK NonProfiled %zuK Profiled %zuK = %zuK", - cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K, aligned_total/K); + "%zuK NonProfiled %zuK Profiled %zuK Hot %zuK = %zuK", + cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K, hot.size/K, aligned_total/K); // Adjust ReservedCodeCacheSize as necessary because it was not set explicitly cache_size = aligned_total; } @@ -295,19 +325,23 @@ void CodeCache::initialize_heaps() { } if (profiled.enabled && !profiled.set && profiled.size > min_size) { profiled.size -= min_size; + if (--delta == 0) break; + } + if (hot.enabled && !hot.set && hot.size > min_size) { + hot.size -= min_size; delta--; } if (delta == start_delta) { break; } } - aligned_total = non_nmethod.size + profiled.size + non_profiled.size; + aligned_total = non_nmethod.size + profiled.size + non_profiled.size + hot.size; } } log_debug(codecache)("Initializing code heaps ReservedCodeCache %zuK NonNMethod %zuK" - " NonProfiled %zuK Profiled %zuK", - cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K); + " NonProfiled %zuK Profiled %zuK Hot %zuK", + cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K, hot.size/K); // Validation // Check minimal required sizes @@ -318,6 +352,9 @@ void CodeCache::initialize_heaps() { if (non_profiled.enabled) { // non_profiled.enabled is always ON for segmented code heap, leave it checked for clarity check_min_size("non-profiled code heap", non_profiled.size, min_size); } + if (hot.enabled) { + check_min_size("hot code heap", hot.size, min_size); + } // ReservedCodeCacheSize was set explicitly, so report an error and abort if it doesn't match the segment sizes if (aligned_total != cache_size && cache_size_set) { @@ -328,6 +365,9 @@ void CodeCache::initialize_heaps() { if (non_profiled.enabled) { message.append(" + NonProfiledCodeHeapSize (%zuK)", non_profiled.size/K); } + if (hot.enabled) { + message.append(" + HotCodeHeapSize (%zuK)", hot.size/K); + } message.append(" = %zuK", aligned_total/K); message.append((aligned_total > cache_size) ? " is greater than " : " is less than "); message.append("ReservedCodeCacheSize (%zuK).", cache_size/K); @@ -348,6 +388,7 @@ void CodeCache::initialize_heaps() { FLAG_SET_ERGO(NonNMethodCodeHeapSize, non_nmethod.size); FLAG_SET_ERGO(ProfiledCodeHeapSize, profiled.size); FLAG_SET_ERGO(NonProfiledCodeHeapSize, non_profiled.size); + FLAG_SET_ERGO(HotCodeHeapSize, hot.size); FLAG_SET_ERGO(ReservedCodeCacheSize, cache_size); ReservedSpace rs = reserve_heap_memory(cache_size, ps); @@ -368,6 +409,13 @@ void CodeCache::initialize_heaps() { // Non-nmethods (stubs, adapters, ...) add_heap(non_method_space, "CodeHeap 'non-nmethods'", CodeBlobType::NonNMethod); + if (hot.enabled) { + ReservedSpace hot_space = rs.partition(offset, hot.size); + offset += hot.size; + // Nmethods known to be always hot. + add_heap(hot_space, "CodeHeap 'hot nmethods'", CodeBlobType::MethodHot); + } + if (non_profiled.enabled) { ReservedSpace non_profiled_space = rs.partition(offset, non_profiled.size); // Tier 1 and tier 4 (non-profiled) methods and native methods @@ -406,16 +454,25 @@ bool CodeCache::heap_available(CodeBlobType code_blob_type) { // Interpreter only: we don't need any method code heaps return (code_blob_type == CodeBlobType::NonNMethod); } else if (CompilerConfig::is_c1_profiling()) { - // Tiered compilation: use all code heaps + // Tiered compilation: use all code heaps including + // the hot code heap when it is present. + + if (COMPILER2_PRESENT(!HotCodeHeap &&) (code_blob_type == CodeBlobType::MethodHot)) { + return false; + } + return (code_blob_type < CodeBlobType::All); } else { // No TieredCompilation: we only need the non-nmethod and non-profiled code heap + // and the hot code heap if it is requested. return (code_blob_type == CodeBlobType::NonNMethod) || - (code_blob_type == CodeBlobType::MethodNonProfiled); + (code_blob_type == CodeBlobType::MethodNonProfiled) + COMPILER2_PRESENT(|| ((code_blob_type == CodeBlobType::MethodHot) && HotCodeHeap)); } } -const char* CodeCache::get_code_heap_flag_name(CodeBlobType code_blob_type) { +// Returns the name of the VM option to set the size of the corresponding CodeHeap +static const char* get_code_heap_flag_name(CodeBlobType code_blob_type) { switch(code_blob_type) { case CodeBlobType::NonNMethod: return "NonNMethodCodeHeapSize"; @@ -426,6 +483,9 @@ const char* CodeCache::get_code_heap_flag_name(CodeBlobType code_blob_type) { case CodeBlobType::MethodProfiled: return "ProfiledCodeHeapSize"; break; + case CodeBlobType::MethodHot: + return "HotCodeHeapSize"; + break; default: ShouldNotReachHere(); return nullptr; @@ -542,7 +602,7 @@ CodeBlob* CodeCache::allocate(uint size, CodeBlobType code_blob_type, bool handl // Get CodeHeap for the given CodeBlobType CodeHeap* heap = get_code_heap(code_blob_type); - assert(heap != nullptr, "heap is null"); + assert(heap != nullptr, "No heap for given code_blob_type (%d), heap is null", (int)code_blob_type); while (true) { cb = (CodeBlob*)heap->allocate(size); @@ -570,6 +630,9 @@ CodeBlob* CodeCache::allocate(uint size, CodeBlobType code_blob_type, bool handl type = CodeBlobType::MethodNonProfiled; } break; + case CodeBlobType::MethodHot: + type = CodeBlobType::MethodNonProfiled; + break; default: break; } diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp index 349cc652bf4..6384cb397b8 100644 --- a/src/hotspot/share/code/codeCache.hpp +++ b/src/hotspot/share/code/codeCache.hpp @@ -118,10 +118,6 @@ class CodeCache : AllStatic { // Creates a new heap with the given name and size, containing CodeBlobs of the given type static void add_heap(ReservedSpace rs, const char* name, CodeBlobType code_blob_type); static CodeHeap* get_code_heap_containing(void* p); // Returns the CodeHeap containing the given pointer, or nullptr - static CodeHeap* get_code_heap(const void* cb); // Returns the CodeHeap for the given CodeBlob - static CodeHeap* get_code_heap(CodeBlobType code_blob_type); // Returns the CodeHeap for the given CodeBlobType - // Returns the name of the VM option to set the size of the corresponding CodeHeap - static const char* get_code_heap_flag_name(CodeBlobType code_blob_type); static ReservedSpace reserve_heap_memory(size_t size, size_t rs_ps); // Reserves one continuous chunk of memory for the CodeHeaps // Iteration @@ -145,6 +141,8 @@ class CodeCache : AllStatic { static int code_heap_compare(CodeHeap* const &lhs, CodeHeap* const &rhs); static void add_heap(CodeHeap* heap); + static CodeHeap* get_code_heap(const void* cb); // Returns the CodeHeap for the given CodeBlob + static CodeHeap* get_code_heap(CodeBlobType code_blob_type); // Returns the CodeHeap for the given CodeBlobType static const GrowableArray* heaps() { return _heaps; } static const GrowableArray* nmethod_heaps() { return _nmethod_heaps; } @@ -264,7 +262,7 @@ class CodeCache : AllStatic { } static bool code_blob_type_accepts_nmethod(CodeBlobType type) { - return type == CodeBlobType::All || type <= CodeBlobType::MethodProfiled; + return type == CodeBlobType::All || type <= CodeBlobType::MethodHot; } static bool code_blob_type_accepts_allocable(CodeBlobType type) { diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index a302df418d7..815c0c7b4b0 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -66,6 +66,9 @@ #include "runtime/flags/flagSetting.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" +#ifdef COMPILER2 +#include "runtime/hotCodeCollector.hpp" +#endif // COMPILER2 #include "runtime/icache.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/orderAccess.hpp" @@ -1258,6 +1261,11 @@ void nmethod::post_init() { ICache::invalidate_range(code_begin(), code_size()); Universe::heap()->register_nmethod(this); + +#ifdef COMPILER2 + HotCodeCollector::register_nmethod(this); +#endif // COMPILER2 + DEBUG_ONLY(Universe::heap()->verify_nmethod(this)); CodeCache::commit(this); @@ -2476,6 +2484,11 @@ void nmethod::purge(bool unregister_nmethod) { if (unregister_nmethod) { Universe::heap()->unregister_nmethod(this); } + +#ifdef COMPILER2 + HotCodeCollector::unregister_nmethod(this); +#endif // COMPILER2 + CodeCache::unregister_old_nmethod(this); JVMCI_ONLY( _metadata_size = 0; ) diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index 0e4e211453b..cf7744cfe03 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -286,8 +286,38 @@ void CompilerConfig::set_compilation_policy_flags() { } } +#ifdef COMPILER2 + if (HotCodeHeap) { + if (FLAG_IS_DEFAULT(SegmentedCodeCache)) { + FLAG_SET_ERGO(SegmentedCodeCache, true); + } else if (!SegmentedCodeCache) { + vm_exit_during_initialization("HotCodeHeap requires SegmentedCodeCache enabled"); + } + + if (FLAG_IS_DEFAULT(NMethodRelocation)) { + FLAG_SET_ERGO(NMethodRelocation, true); + } else if (!NMethodRelocation) { + vm_exit_during_initialization("HotCodeHeap requires NMethodRelocation enabled"); + } + + if (!is_c2_enabled()) { + vm_exit_during_initialization("HotCodeHeap requires C2 enabled"); + } + + if (HotCodeMinSamplingMs > HotCodeMaxSamplingMs) { + vm_exit_during_initialization("HotCodeMinSamplingMs cannot be larger than HotCodeMaxSamplingMs"); + } + } else if (HotCodeHeapSize > 0) { + vm_exit_during_initialization("HotCodeHeapSize requires HotCodeHeap enabled"); + } +#else + if (HotCodeHeapSize > 0) { + vm_exit_during_initialization("HotCodeHeapSize requires C2 present"); + } +#endif // COMPILER2 + if (CompileThresholdScaling < 0) { - vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", nullptr); + vm_exit_during_initialization("Negative value specified for CompileThresholdScaling"); } if (CompilationModeFlag::disable_intermediate()) { diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp index 8546e6e2d64..e12a8c284de 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -326,11 +326,14 @@ bool G1ConcurrentRefineSweepState::complete_work(bool concurrent, bool print_log if (print_log) { G1ConcurrentRefineStats* s = &_stats; - log_debug(gc, refine)("Refinement took %.2fms (pre-sweep %.2fms card refine %.2f) " + State state_bounded_by_sweeprt = (_state == State::SweepRT || _state == State::CompleteRefineWork) + ? State::SweepRT : _state; + + log_debug(gc, refine)("Refinement took %.2fms (pre-sweep %.2fms card refine %.2fms) " "(scanned %zu clean %zu (%.2f%%) not_clean %zu (%.2f%%) not_parsable %zu " "refers_to_cset %zu (%.2f%%) still_refers_to_cset %zu (%.2f%%) no_cross_region %zu pending %zu)", get_duration(State::Idle, _state).seconds() * 1000.0, - get_duration(State::Idle, State::SweepRT).seconds() * 1000.0, + get_duration(State::Idle, state_bounded_by_sweeprt).seconds() * 1000.0, TimeHelper::counter_to_millis(s->refine_duration()), s->cards_scanned(), s->cards_clean(), diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp index 5744bbc2f03..78a533d62c0 100644 --- a/src/hotspot/share/gc/g1/g1Policy.cpp +++ b/src/hotspot/share/gc/g1/g1Policy.cpp @@ -962,12 +962,12 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar _free_regions_at_end_of_collection = _g1h->num_free_regions(); + _old_gen_alloc_tracker.reset_after_gc(_g1h->humongous_regions_count() * G1HeapRegion::GrainBytes); // Do not update dynamic IHOP due to G1 periodic collection as it is highly likely // that in this case we are not running in a "normal" operating mode. if (_g1h->gc_cause() != GCCause::_g1_periodic_collection) { update_young_length_bounds(); - _old_gen_alloc_tracker.reset_after_gc(_g1h->humongous_regions_count() * G1HeapRegion::GrainBytes); if (update_ihop_prediction(app_time_ms / 1000.0, is_young_only_pause)) { _ihop_control->report_statistics(_g1h->gc_tracer_stw(), _g1h->non_young_occupancy_after_allocation(allocation_word_size)); } diff --git a/src/hotspot/share/logging/logTag.hpp b/src/hotspot/share/logging/logTag.hpp index 20d61b542b0..2b8d6a72be4 100644 --- a/src/hotspot/share/logging/logTag.hpp +++ b/src/hotspot/share/logging/logTag.hpp @@ -96,6 +96,7 @@ class outputStream; LOG_TAG(heap) \ LOG_TAG(heapdump) \ NOT_PRODUCT(LOG_TAG(heapsampling)) \ + COMPILER2_PRESENT(LOG_TAG(hotcode)) \ LOG_TAG(humongous) \ LOG_TAG(ihop) \ LOG_TAG(iklass) \ diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp index dab0ca98911..2f64482f55b 100644 --- a/src/hotspot/share/opto/arraycopynode.cpp +++ b/src/hotspot/share/opto/arraycopynode.cpp @@ -258,6 +258,19 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c return mem; } +// We may have narrowed the type of base because this runs with PhaseIterGVN::_delay_transform true, explicitly +// update the type of the AddP so it's consistent with its base and load() picks the right memory slice. +Node* ArrayCopyNode::make_and_transform_addp(PhaseGVN* phase, Node* base, Node* offset) { + return make_and_transform_addp(phase, base, base, offset); +} + +Node* ArrayCopyNode::make_and_transform_addp(PhaseGVN* phase, Node* base, Node* ptr, Node* offset) { + assert(phase->is_IterGVN() == nullptr || phase->is_IterGVN()->delay_transform(), "helper method when delay transform is set"); + Node* addp = phase->transform(AddPNode::make_with_base(base, ptr, offset)); + phase->set_type(addp, addp->Value(phase)); + return addp; +} + bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape, Node*& adr_src, Node*& base_src, @@ -332,12 +345,11 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape, Node* dest_scale = phase->transform(new LShiftXNode(dest_offset, phase->intcon(shift))); - adr_src = phase->transform(AddPNode::make_with_base(base_src, src_scale)); - adr_dest = phase->transform(AddPNode::make_with_base(base_dest, dest_scale)); - - adr_src = phase->transform(AddPNode::make_with_base(base_src, adr_src, phase->MakeConX(header))); - adr_dest = phase->transform(AddPNode::make_with_base(base_dest, adr_dest, phase->MakeConX(header))); + adr_src = make_and_transform_addp(phase, base_src, src_scale); + adr_dest = make_and_transform_addp(phase, base_dest, dest_scale); + adr_src = make_and_transform_addp(phase, base_src, adr_src, phase->MakeConX(header)); + adr_dest = make_and_transform_addp(phase, base_dest, adr_dest, phase->MakeConX(header)); copy_type = dest_elem; } else { assert(ary_src != nullptr, "should be a clone"); @@ -355,8 +367,8 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape, return false; } - adr_src = phase->transform(AddPNode::make_with_base(base_src, src_offset)); - adr_dest = phase->transform(AddPNode::make_with_base(base_dest, dest_offset)); + adr_src = make_and_transform_addp(phase, base_src, src_offset); + adr_dest = make_and_transform_addp(phase, base_dest, dest_offset); // The address is offsetted to an aligned address where a raw copy would start. // If the clone copy is decomposed into load-stores - the address is adjusted to @@ -366,8 +378,8 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape, int diff = arrayOopDesc::base_offset_in_bytes(elem) - offset; assert(diff >= 0, "clone should not start after 1st array element"); if (diff > 0) { - adr_src = phase->transform(AddPNode::make_with_base(base_src, adr_src, phase->MakeConX(diff))); - adr_dest = phase->transform(AddPNode::make_with_base(base_dest, adr_dest, phase->MakeConX(diff))); + adr_src = make_and_transform_addp(phase, base_src, adr_src, phase->MakeConX(diff)); + adr_dest = make_and_transform_addp(phase, base_dest, adr_dest, phase->MakeConX(diff)); } copy_type = elem; value_type = ary_src->elem(); @@ -429,12 +441,8 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, store(bs, phase, forward_ctl, mm, adr_dest, atp_dest, v, value_type, copy_type); for (int i = 1; i < count; i++) { Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); - Node* next_src = phase->transform(AddPNode::make_with_base(base_src,adr_src,off)); - // We may have narrowed the type of next_src right before calling this method but because this runs with - // PhaseIterGVN::_delay_transform true, explicitly update the type of the AddP so it's consistent with its - // base and load() picks the right memory slice. - phase->set_type(next_src, next_src->Value(phase)); - Node* next_dest = phase->transform(AddPNode::make_with_base(base_dest,adr_dest,off)); + Node* next_src = make_and_transform_addp(phase, base_src,adr_src,off); + Node* next_dest = make_and_transform_addp(phase, base_dest,adr_dest,off); // Same as above phase->set_type(next_dest, next_dest->Value(phase)); v = load(bs, phase, forward_ctl, mm, next_src, atp_src, value_type, copy_type); @@ -473,13 +481,8 @@ Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase, if (count > 0) { for (int i = count-1; i >= 1; i--) { Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); - Node* next_src = phase->transform(AddPNode::make_with_base(base_src,adr_src,off)); - // We may have narrowed the type of next_src right before calling this method but because this runs with - // PhaseIterGVN::_delay_transform true, explicitly update the type of the AddP so it's consistent with its - // base and store() picks the right memory slice. - phase->set_type(next_src, next_src->Value(phase)); - Node* next_dest = phase->transform(AddPNode::make_with_base(base_dest,adr_dest,off)); - phase->set_type(next_dest, next_dest->Value(phase)); + Node* next_src = make_and_transform_addp(phase, base_src,adr_src,off); + Node* next_dest = make_and_transform_addp(phase, base_dest,adr_dest,off); Node* v = load(bs, phase, backward_ctl, mm, next_src, atp_src, value_type, copy_type); store(bs, phase, backward_ctl, mm, next_dest, atp_dest, v, value_type, copy_type); } @@ -618,21 +621,31 @@ Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) { phase->set_type(src, phase->type(src)->join_speculative(atp_src)); phase->set_type(dest, phase->type(dest)->join_speculative(atp_dest)); + // Control flow is going to be created, it's easier to do with _delay_transform set to true. + + // prepare_array_copy() doesn't build control flow, but it creates AddP nodes. The src/dest type possibly gets + // narrowed above. If a newly created AddP node is commoned with a pre-existing one, then the type narrowing is lost. + // Setting _delay_transform before prepare_array_copy() guarantees this doesn't happen. + if (can_reshape) { + assert(!phase->is_IterGVN()->delay_transform(), "cannot delay transforms"); + phase->is_IterGVN()->set_delay_transform(true); + } + if (!prepare_array_copy(phase, can_reshape, adr_src, base_src, adr_dest, base_dest, copy_type, value_type, disjoint_bases)) { assert(adr_src == nullptr, "no node can be left behind"); assert(adr_dest == nullptr, "no node can be left behind"); + if (can_reshape) { + assert(phase->is_IterGVN()->delay_transform(), "cannot delay transforms"); + phase->is_IterGVN()->set_delay_transform(false); + } + return nullptr; } Node* in_mem = in(TypeFunc::Memory); - if (can_reshape) { - assert(!phase->is_IterGVN()->delay_transform(), "cannot delay transforms"); - phase->is_IterGVN()->set_delay_transform(true); - } - Node* backward_ctl = phase->C->top(); Node* forward_ctl = phase->C->top(); array_copy_test_overlap(phase, can_reshape, disjoint_bases, count, forward_ctl, backward_ctl); diff --git a/src/hotspot/share/opto/arraycopynode.hpp b/src/hotspot/share/opto/arraycopynode.hpp index 483a3a86267..aa62ee05cd0 100644 --- a/src/hotspot/share/opto/arraycopynode.hpp +++ b/src/hotspot/share/opto/arraycopynode.hpp @@ -104,6 +104,10 @@ private: static const TypePtr* get_address_type(PhaseGVN* phase, const TypePtr* atp, Node* n); Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count); + + Node* make_and_transform_addp(PhaseGVN* phase, Node* base, Node* offset); + Node* make_and_transform_addp(PhaseGVN* phase, Node* base, Node* ptr, Node* offset); + bool prepare_array_copy(PhaseGVN *phase, bool can_reshape, Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest, BasicType& copy_type, const Type*& value_type, bool& disjoint_bases); diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index 983ac8a32c6..6974d50741e 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -914,6 +914,44 @@ \ develop(bool, StressCountedLoop, false, \ "Randomly delay conversion to counted loops") \ + \ + product(bool, HotCodeHeap, false, EXPERIMENTAL, \ + "Enable the code heap for hot C2 nmethods") \ + \ + product(double, HotCodeSamplePercent, 80, EXPERIMENTAL, \ + "Minimum percentage of profiling samples that must be in " \ + "the MethodHot heap before stopping hot code collection") \ + range(0, 100) \ + \ + product(double, HotCodeStablePercent, 5, EXPERIMENTAL, \ + "Maximum percentage of newly compiled to total C2 nmethods " \ + "to treat nmethod count as stable. " \ + "Values less than zero disable the stable check") \ + range(-1, DBL_MAX) \ + \ + product(uint, HotCodeIntervalSeconds, 300, EXPERIMENTAL, \ + "Seconds between hot code grouping attempts") \ + range(0, max_juint) \ + \ + product(uint, HotCodeSampleSeconds, 120, EXPERIMENTAL, \ + "Seconds to sample application threads per grouping attempt") \ + range(0, max_juint) \ + \ + product(uint, HotCodeStartupDelaySeconds, 120, EXPERIMENTAL, \ + "Seconds to delay before starting hot code grouping thread") \ + range(0, max_juint) \ + \ + product(uint, HotCodeMinSamplingMs, 5, EXPERIMENTAL, \ + "Minimum sampling interval in milliseconds") \ + range(0, max_juint) \ + \ + product(uint, HotCodeMaxSamplingMs, 15, EXPERIMENTAL, \ + "Maximum sampling interval in milliseconds") \ + range(0, max_juint) \ + \ + product(uint, HotCodeCallLevel, 1, EXPERIMENTAL, \ + "Number of levels of callees to relocate per candidate") \ + range(0, max_juint) \ // end of C2_FLAGS diff --git a/src/hotspot/share/runtime/abstract_vm_version.hpp b/src/hotspot/share/runtime/abstract_vm_version.hpp index 61a8aa84080..794fa4dabcf 100644 --- a/src/hotspot/share/runtime/abstract_vm_version.hpp +++ b/src/hotspot/share/runtime/abstract_vm_version.hpp @@ -55,7 +55,7 @@ enum class vmIntrinsicID; } \ } else if (Use##feature) { \ if (!FLAG_IS_DEFAULT(Use##feature)) { \ - warning(#feature " instructions not available on this CPU"); \ + warning(#feature " instructions are not available on this CPU"); \ } \ FLAG_SET_DEFAULT(Use##feature, false); \ } diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index b5c19d8aa36..ac1ddec7cbc 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1514,6 +1514,10 @@ const int ObjectAlignmentInBytes = 8; "Size of code heap with non-nmethods (in bytes)") \ constraint(VMPageSizeConstraintFunc, AtParse) \ \ + product(size_t, HotCodeHeapSize, 0, EXPERIMENTAL, \ + "Size of code heap with predicted hot methods (in bytes)") \ + range(0, SIZE_MAX) \ + \ product_pd(size_t, CodeCacheExpansionSize, \ "Code cache expansion size (in bytes)") \ range(32*K, SIZE_MAX) \ diff --git a/src/hotspot/share/runtime/hotCodeCollector.cpp b/src/hotspot/share/runtime/hotCodeCollector.cpp new file mode 100644 index 00000000000..643cf3a8bbb --- /dev/null +++ b/src/hotspot/share/runtime/hotCodeCollector.cpp @@ -0,0 +1,258 @@ +/* + * 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. + * + */ + +#ifdef COMPILER2 + +#include "code/codeCache.hpp" +#include "code/compiledIC.hpp" +#include "compiler/compilerDefinitions.inline.hpp" +#include "logging/log.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/hotCodeCollector.hpp" +#include "runtime/hotCodeSampler.hpp" +#include "runtime/java.hpp" +#include "runtime/javaThread.inline.hpp" + +// Initialize static variables +bool HotCodeCollector::_is_initialized = false; +int HotCodeCollector::_new_c2_nmethods_count = 0; +int HotCodeCollector::_total_c2_nmethods_count = 0; + +HotCodeCollector::HotCodeCollector() : JavaThread(thread_entry) {} + +void HotCodeCollector::initialize() { + EXCEPTION_MARK; + + assert(HotCodeHeap, "HotCodeCollector requires HotCodeHeap enabled"); + assert(CompilerConfig::is_c2_enabled(), "HotCodeCollector requires C2 enabled"); + assert(NMethodRelocation, "HotCodeCollector requires NMethodRelocation enabled"); + assert(HotCodeHeapSize > 0, "HotCodeHeapSize must be non-zero to use HotCodeCollector"); + assert(CodeCache::get_code_heap(CodeBlobType::MethodHot) != nullptr, "MethodHot code heap not found"); + + Handle thread_oop = JavaThread::create_system_thread_object("HotCodeCollectorThread", CHECK); + HotCodeCollector* thread = new HotCodeCollector(); + JavaThread::vm_exit_on_osthread_failure(thread); + JavaThread::start_internal_daemon(THREAD, thread, thread_oop, NormPriority); + + _is_initialized = true; +} + +bool HotCodeCollector::is_nmethod_count_stable() { + if (HotCodeStablePercent < 0) { + log_info(hotcode)("HotCodeStablePercent is less than zero, stable check disabled"); + return true; + } + + MutexLocker ml_CodeCache_lock(CodeCache_lock, Mutex::_no_safepoint_check_flag); + + if (_total_c2_nmethods_count <= 0) { + log_info(hotcode)("No registered C2 nmethods"); + return false; + } + + const double percent_new = 100.0 * _new_c2_nmethods_count / _total_c2_nmethods_count; + bool is_stable_nmethod_count = percent_new <= HotCodeStablePercent; + + log_info(hotcode)("C2 nmethod count %s", is_stable_nmethod_count ? "stable" : "not stable"); + log_debug(hotcode)("C2 nmethod stats: New: %d, Total: %d, Percent new: %f", _new_c2_nmethods_count, _total_c2_nmethods_count, percent_new); + + _new_c2_nmethods_count = 0; + + return is_stable_nmethod_count; +} + +void HotCodeCollector::thread_entry(JavaThread* thread, TRAPS) { + // Initial sleep to allow JVM to warm up + thread->sleep(HotCodeStartupDelaySeconds * 1000); + + while (true) { + ResourceMark rm; + + // Sample application and group hot nmethods if nmethod count is stable + if (is_nmethod_count_stable()) { + log_info(hotcode)("Sampling..."); + + ThreadSampler sampler; + uint64_t start_time = os::javaTimeMillis(); + while (os::javaTimeMillis() - start_time <= HotCodeSampleSeconds * 1000) { + sampler.sample_all_java_threads(); + thread->sleep(rand_sampling_period_ms()); + } + + Candidates candidates(sampler); + do_grouping(candidates); + } + + thread->sleep(HotCodeIntervalSeconds * 1000); + } +} + +void HotCodeCollector::do_grouping(Candidates& candidates) { + int num_relocated = 0; + + // Sort nmethods by increasing sample count so pop() returns the hottest + candidates.sort(); + + while (candidates.has_candidates()) { + + double percent_from_hot = candidates.get_hot_sample_percent(); + log_debug(hotcode)("Percentage of samples from hot code heap: %f", percent_from_hot); + if (percent_from_hot >= HotCodeSamplePercent) { + log_info(hotcode)("Percentage of samples from hot nmethods over threshold. Done collecting hot code"); + break; + } + + nmethod* candidate = candidates.get_candidate(); + + MutexLocker ml_Compile_lock(Compile_lock); + MutexLocker ml_CompiledIC_lock(CompiledIC_lock, Mutex::_no_safepoint_check_flag); + MutexLocker ml_CodeCache_lock(CodeCache_lock, Mutex::_no_safepoint_check_flag); + + num_relocated += do_relocation(candidate, 0); + } + + log_info(hotcode)("Collection done. Relocated %d nmethods to the MethodHot heap", num_relocated); +} + +int HotCodeCollector::do_relocation(void* candidate, uint call_level) { + if (candidate == nullptr) { + return 0; + } + + // Verify that address still points to CodeBlob + CodeBlob* blob = CodeCache::find_blob(candidate); + if (blob == nullptr) { + return 0; + } + + // Verify that blob is nmethod + nmethod* nm = blob->as_nmethod_or_null(); + if (nm == nullptr || nm->method() == nullptr) { + return 0; + } + + // The candidate may have been recompiled or already relocated. + // Retrieve the latest nmethod from the Method + nm = nm->method()->code(); + + // Verify the nmethod is still valid for relocation + if (nm == nullptr || !nm->is_in_use() || !nm->is_compiled_by_c2()) { + return 0; + } + + // Verify code heap has space + if (CodeCache::get_code_heap(CodeBlobType::MethodHot)->unallocated_capacity() < (size_t)nm->size()) { + log_info(hotcode)("Not enough free space in MethodHot heap (%zd bytes) to relocate nm (%d bytes). Bailing out", + CodeCache::get_code_heap(CodeBlobType::MethodHot)->unallocated_capacity(), nm->size()); + return 0; + } + + // Number of nmethods relocated (candidate + callees) + int num_relocated = 0; + + // Pointer to nmethod in hot heap + nmethod* hot_nm = nullptr; + + if (CodeCache::get_code_blob_type(nm) != CodeBlobType::MethodHot) { + CompiledICLocker ic_locker(nm); + hot_nm = nm->relocate(CodeBlobType::MethodHot); + + if (hot_nm != nullptr) { + // Successfully relocated nmethod. Update counts and proceed to callee relocation. + log_debug(hotcode)("Successful relocation: nmethod (%p), method (%s), call level (%d)", nm, hot_nm->method()->name_and_sig_as_C_string(), call_level); + num_relocated++; + } else { + // Relocation failed so return and do not attempt to relocate callees + log_debug(hotcode)("Failed relocation: nmethod (%p), call level (%d)", nm, call_level); + return 0; + } + } else { + // Skip relocation since already in hot heap, but still relocate callees + // since they may not have been compiled when this method was first relocated + log_debug(hotcode)("Already relocated: nmethod (%p), method (%s), call level (%d)", nm, nm->method()->name_and_sig_as_C_string(), call_level); + hot_nm = nm; + } + + assert(hot_nm != nullptr, "unable to relocate callees"); + + if (call_level < HotCodeCallLevel) { + // Loop over relocations to relocate callees + RelocIterator relocIter(hot_nm); + while (relocIter.next()) { + // Check if this is a call + Relocation* reloc = relocIter.reloc(); + if (!reloc->is_call()) { + continue; + } + + // Find the call destination address + address dest = ((CallRelocation*) reloc)->destination(); + + // Recursively relocate callees + num_relocated += do_relocation(dest, call_level + 1); + } + } + + return num_relocated; +} + +void HotCodeCollector::unregister_nmethod(nmethod* nm) { + assert_lock_strong(CodeCache_lock); + if (!_is_initialized) { + return; + } + + if (!nm->is_compiled_by_c2()) { + return; + } + + if (CodeCache::get_code_blob_type(nm) == CodeBlobType::MethodHot) { + // Nmethods in the hot code heap do not count towards total C2 nmethods. + return; + } + + // CodeCache_lock is held, so we can safely decrement the count. + _total_c2_nmethods_count--; +} + +void HotCodeCollector::register_nmethod(nmethod* nm) { + assert_lock_strong(CodeCache_lock); + if (!_is_initialized) { + return; + } + + if (!nm->is_compiled_by_c2()) { + return; // Only C2 nmethods are relocated to HotCodeHeap. + } + + if (CodeCache::get_code_blob_type(nm) == CodeBlobType::MethodHot) { + // Nmethods in the hot code heap do not count towards total C2 nmethods. + return; + } + + // CodeCache_lock is held, so we can safely increment the count. + _new_c2_nmethods_count++; + _total_c2_nmethods_count++; +} +#endif // COMPILER2 diff --git a/src/hotspot/share/runtime/hotCodeCollector.hpp b/src/hotspot/share/runtime/hotCodeCollector.hpp new file mode 100644 index 00000000000..dbefa3dc788 --- /dev/null +++ b/src/hotspot/share/runtime/hotCodeCollector.hpp @@ -0,0 +1,56 @@ +/* + * 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. + * + */ + +#ifdef COMPILER2 +#ifndef SHARE_RUNTIME_HOTCODECOLLECTOR_HPP +#define SHARE_RUNTIME_HOTCODECOLLECTOR_HPP + +#include "runtime/javaThread.hpp" + +class Candidates; + +class HotCodeCollector : public JavaThread { + private: + static bool _is_initialized; + + static int _new_c2_nmethods_count; + static int _total_c2_nmethods_count; + + HotCodeCollector(); + + static void do_grouping(Candidates& candidates); + + static int do_relocation(void* candidate, uint call_level); + + public: + static void initialize(); + static void thread_entry(JavaThread* thread, TRAPS); + static void unregister_nmethod(nmethod* nm); + static void register_nmethod(nmethod* nm); + + static bool is_nmethod_count_stable(); +}; + +#endif // SHARE_RUNTIME_HOTCODECOLLECTOR_HPP +#endif // COMPILER2 diff --git a/src/hotspot/share/runtime/hotCodeSampler.cpp b/src/hotspot/share/runtime/hotCodeSampler.cpp new file mode 100644 index 00000000000..730a47d238a --- /dev/null +++ b/src/hotspot/share/runtime/hotCodeSampler.cpp @@ -0,0 +1,121 @@ +/* + * 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. + * + */ + +#ifdef COMPILER2 + +#include "code/codeCache.hpp" +#include "logging/log.hpp" +#include "runtime/hotCodeSampler.hpp" +#include "runtime/javaThread.inline.hpp" + +void ThreadSampler::sample_all_java_threads() { + // Collect samples for each JavaThread + for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) { + if (jt->is_hidden_from_external_view() || + jt->in_deopt_handler() || + (jt->thread_state() != _thread_in_native && jt->thread_state() != _thread_in_Java)) { + continue; + } + + GetPCTask task(jt); + task.run(); + address pc = task.pc(); + if (pc == nullptr) { + continue; + } + + if (CodeCache::contains(pc)) { + nmethod* nm = CodeCache::find_blob(pc)->as_nmethod_or_null(); + if (nm != nullptr) { + bool created = false; + int *count = _samples.put_if_absent(nm, 0, &created); + (*count)++; + if (created) { + _samples.maybe_grow(); + } + } + } + } +} + +Candidates::Candidates(ThreadSampler& sampler) + : _hot_sample_count(0), _non_profiled_sample_count(0) { + auto func = [&](nmethod* nm, int count) { + if (CodeCache::get_code_blob_type(nm) == CodeBlobType::MethodNonProfiled) { + _candidates.append(Pair(nm, count)); + add_non_profiled_sample_count(count); + } else if (CodeCache::get_code_blob_type(nm) == CodeBlobType::MethodHot) { + add_hot_sample_count(count); + } + }; + sampler.iterate_samples(func); + + log_info(hotcode)("Generated candidate list from %d samples corresponding to %d nmethods", _non_profiled_sample_count + _hot_sample_count, _candidates.length()); +} + +void Candidates::add_candidate(nmethod* nm, int count) { + _candidates.append(Pair(nm, count)); +} + +void Candidates::add_hot_sample_count(int count) { + _hot_sample_count += count; +} + +void Candidates::add_non_profiled_sample_count(int count) { + _non_profiled_sample_count += count; +} + +void Candidates::sort() { + _candidates.sort( + [](Pair* a, Pair* b) { + if (a->second > b->second) return 1; + if (a->second < b->second) return -1; + return 0; + } + ); +} + +bool Candidates::has_candidates() { + return !_candidates.is_empty(); +} + +nmethod* Candidates::get_candidate() { + assert(has_candidates(), "must not be empty"); + Pair candidate = _candidates.pop(); + + _hot_sample_count += candidate.second; + _non_profiled_sample_count -= candidate.second; + + return candidate.first; +} + +double Candidates::get_hot_sample_percent() { + if (_hot_sample_count + _non_profiled_sample_count == 0) { + return 0; + } + + return 100.0 * _hot_sample_count / (_hot_sample_count + _non_profiled_sample_count); +} + +#endif // COMPILER2 diff --git a/src/hotspot/share/runtime/hotCodeSampler.hpp b/src/hotspot/share/runtime/hotCodeSampler.hpp new file mode 100644 index 00000000000..d61cac791e1 --- /dev/null +++ b/src/hotspot/share/runtime/hotCodeSampler.hpp @@ -0,0 +1,104 @@ +/* + * 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. + * + */ + +#ifdef COMPILER2 +#ifndef SHARE_RUNTIME_HOTCODESAMPLER_HPP +#define SHARE_RUNTIME_HOTCODESAMPLER_HPP + +#include "runtime/javaThread.hpp" +#include "runtime/suspendedThreadTask.hpp" +#include "runtime/threadSMR.hpp" +#include "utilities/pair.hpp" +#include "utilities/resizableHashTable.hpp" + +// Generate a random sampling period between min and max +static inline uint rand_sampling_period_ms() { + assert(HotCodeMaxSamplingMs >= HotCodeMinSamplingMs, "max cannot be smaller than min"); + julong range = (julong)HotCodeMaxSamplingMs - (julong)HotCodeMinSamplingMs + 1; + return (uint)(os::random() % range) + HotCodeMinSamplingMs; +} + +class ThreadSampler; + +class Candidates : public StackObj { + private: + GrowableArray> _candidates; + int _hot_sample_count; + int _non_profiled_sample_count; + + public: + Candidates(ThreadSampler& sampler); + + void add_candidate(nmethod* nm, int count); + void add_hot_sample_count(int count); + void add_non_profiled_sample_count(int count); + void sort(); + + bool has_candidates(); + nmethod* get_candidate(); + double get_hot_sample_percent(); +}; + +class GetPCTask : public SuspendedThreadTask { + private: + address _pc; + + void do_task(const SuspendedThreadTaskContext& context) override { + JavaThread* jt = JavaThread::cast(context.thread()); + if (jt->thread_state() != _thread_in_native && jt->thread_state() != _thread_in_Java) { + return; + } + _pc = os::fetch_frame_from_context(context.ucontext(), nullptr, nullptr); + } + + public: + GetPCTask(JavaThread* thread) : SuspendedThreadTask(thread), _pc(nullptr) {} + + address pc() const { + return _pc; + } +}; + +class ThreadSampler : public StackObj { + private: + static const int INITIAL_TABLE_SIZE = 109; + + // Table of nmethods found during profiling with sample count + ResizeableHashTable _samples; + + public: + ThreadSampler() : _samples(INITIAL_TABLE_SIZE, HotCodeSampleSeconds * 1000 / HotCodeMaxSamplingMs) {} + + // Iterate over and sample all Java threads + void sample_all_java_threads(); + + // Iterate over all samples with a callback function + template + void iterate_samples(Function func) { + _samples.iterate_all(func); + } +}; + +#endif // SHARE_RUNTIME_HOTCODESAMPLER_HPP +#endif // COMPILER2 diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index 442b68e596a..b83389a1929 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -113,6 +113,7 @@ #endif #ifdef COMPILER2 #include "opto/idealGraphPrinter.hpp" +#include "runtime/hotCodeCollector.hpp" #endif #if INCLUDE_JFR #include "jfr/jfr.hpp" @@ -798,6 +799,12 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { StringDedup::start(); } +#ifdef COMPILER2 + if (HotCodeHeap) { + HotCodeCollector::initialize(); + } +#endif // COMPILER2 + // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. // It is done after compilers are initialized, because otherwise compilations of // signature polymorphic MH intrinsics can be missed diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index d78fd331b56..1cecdc0cb33 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1327,13 +1327,13 @@ void VMError::report(outputStream* st, bool _verbose) { STEP_IF("printing OS information", _verbose) os::print_os_info(st); - st->cr(); #ifdef __APPLE__ // Avoid large stack allocation on Mac for FD count during signal-handling. os::Bsd::print_open_file_descriptors(st, buf, sizeof(buf)); st->cr(); #else os::print_open_file_descriptors(st); + st->cr(); #endif STEP_IF("printing CPU info", _verbose) @@ -1553,7 +1553,6 @@ void VMError::print_vm_info(outputStream* st) { // STEP("printing OS information") os::print_os_info(st); - st->cr(); os::print_open_file_descriptors(st); st->cr(); diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index c6c08ed4473..760f3ebc255 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -70,9 +70,9 @@ import sun.nio.cs.UTF_8; * string literals in Java programs, such as {@code "abc"}, are * implemented as instances of this class. *

- * Strings are constant; their values cannot be changed after they - * are created. String buffers support mutable strings. - * Because String objects are immutable they can be shared. For example: + * Strings are immutable; their values cannot be changed after they + * are created. Because String objects are immutable they can be shared. + * For example: *

  *     String str = "abc";
  * 

diff --git a/src/java.base/share/classes/java/text/SimpleDateFormat.java b/src/java.base/share/classes/java/text/SimpleDateFormat.java index ba73e5b5a86..4c57214dbba 100644 --- a/src/java.base/share/classes/java/text/SimpleDateFormat.java +++ b/src/java.base/share/classes/java/text/SimpleDateFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ package java.text; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; -import static java.text.DateFormatSymbols.*; +import java.time.ZoneOffset; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -57,6 +57,8 @@ import sun.util.calendar.ZoneInfoFile; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.TimeZoneNameUtility; +import static java.text.DateFormatSymbols.*; + /** * {@code SimpleDateFormat} is a concrete class for formatting and * parsing dates in a locale-sensitive manner. It allows for formatting @@ -1293,15 +1295,22 @@ public class SimpleDateFormat extends DateFormat { case PATTERN_ZONE_NAME: // 'z' if (current == null) { + TimeZone tz = calendar.getTimeZone(); + String tzid = tz.getID(); + int zoneOffset = calendar.get(Calendar.ZONE_OFFSET); + int dstOffset = calendar.get(Calendar.DST_OFFSET) + zoneOffset; + + // Check if an explicit metazone DST offset exists + String explicitDstOffset = TimeZoneNameUtility.explicitDstOffset(tzid); + boolean daylight = explicitDstOffset != null ? + dstOffset == ZoneOffset.of(explicitDstOffset).getTotalSeconds() * 1_000 : + dstOffset != zoneOffset; if (formatData.locale == null || formatData.isZoneStringsSet) { - int zoneIndex = - formatData.getZoneIndex(calendar.getTimeZone().getID()); + int zoneIndex = formatData.getZoneIndex(tzid); if (zoneIndex == -1) { - value = calendar.get(Calendar.ZONE_OFFSET) + - calendar.get(Calendar.DST_OFFSET); - buffer.append(ZoneInfoFile.toCustomID(value)); + buffer.append(ZoneInfoFile.toCustomID(dstOffset)); } else { - int index = (calendar.get(Calendar.DST_OFFSET) == 0) ? 1: 3; + int index = daylight ? 3 : 1; if (count < 4) { // Use the short name index++; @@ -1310,8 +1319,6 @@ public class SimpleDateFormat extends DateFormat { buffer.append(zoneStrings[zoneIndex][index]); } } else { - TimeZone tz = calendar.getTimeZone(); - boolean daylight = (calendar.get(Calendar.DST_OFFSET) != 0); int tzstyle = (count < 4 ? TimeZone.SHORT : TimeZone.LONG); buffer.append(tz.getDisplayName(daylight, tzstyle, formatData.locale)); } diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index 4708094effb..4594dc6f1dc 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2025, Alibaba Group Holding Limited. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -4513,7 +4513,11 @@ public final class DateTimeFormatterBuilder { TemporalAccessor dt = context.getTemporal(); int type = GENERIC; if (!isGeneric) { - if (dt.isSupported(ChronoField.INSTANT_SECONDS)) { + // Check if an explicit metazone DST offset exists + String dstOffset = TimeZoneNameUtility.explicitDstOffset(zname); + if (dt.isSupported(OFFSET_SECONDS) && dstOffset != null) { + type = ZoneOffset.from(dt).equals(ZoneOffset.of(dstOffset)) ? DST : STD; + } else if (dt.isSupported(ChronoField.INSTANT_SECONDS)) { type = zone.getRules().isDaylightSavings(Instant.from(dt)) ? DST : STD; } else if (dt.isSupported(ChronoField.EPOCH_DAY) && dt.isSupported(ChronoField.NANO_OF_DAY)) { diff --git a/src/java.base/share/classes/java/util/Locale.java b/src/java.base/share/classes/java/util/Locale.java index 682476d8082..6b071cd15b2 100644 --- a/src/java.base/share/classes/java/util/Locale.java +++ b/src/java.base/share/classes/java/util/Locale.java @@ -1932,7 +1932,7 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale's language that is appropriate for display to the + * Returns a name for {@code this} locale's language that is appropriate for display to the * user. * If possible, the name returned will be localized for the default * {@link Locale.Category#DISPLAY DISPLAY} locale. @@ -1946,14 +1946,15 @@ public final class Locale implements Cloneable, Serializable { * this function falls back on the English name, and uses the ISO code as a last-resort * value. If the locale doesn't specify a language, this function returns the empty string. * - * @return The name of the display language. + * @return The name of the display language appropriate to the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. */ - public final String getDisplayLanguage() { + public String getDisplayLanguage() { return getDisplayLanguage(getDefault(Category.DISPLAY)); } /** - * Returns a name for the locale's language that is appropriate for display to the + * Returns a name for {@code this} locale's language that is appropriate for display to the * user. * If possible, the name returned will be localized according to inLocale. * For example, if the locale is fr_FR and inLocale @@ -1964,7 +1965,7 @@ public final class Locale implements Cloneable, Serializable { * on the ISO code as a last-resort value. If the locale doesn't specify a language, * this function returns the empty string. * - * @param inLocale The locale for which to retrieve the display language. + * @param inLocale The locale in which to localize the display language. * @return The name of the display language appropriate to the given locale. * @throws NullPointerException if {@code inLocale} is {@code null} */ @@ -1973,13 +1974,13 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale's script that is appropriate for display to + * Returns a name for {@code this} locale's script that is appropriate for display to * the user. If possible, the name will be localized for the default * {@link Locale.Category#DISPLAY DISPLAY} locale. Returns * the empty string if this locale doesn't specify a script code. * - * @return the display name of the script code for the current default - * {@link Locale.Category#DISPLAY DISPLAY} locale + * @return The display name of the script code appropriate to the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. * @since 1.7 */ public String getDisplayScript() { @@ -1987,14 +1988,13 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale's script that is appropriate + * Returns a name for {@code this} locale's script that is appropriate * for display to the user. If possible, the name will be * localized for the given locale. Returns the empty string if * this locale doesn't specify a script code. * - * @param inLocale The locale for which to retrieve the display script. - * @return the display name of the script code for the current default - * {@link Locale.Category#DISPLAY DISPLAY} locale + * @param inLocale The locale in which to localize the display script. + * @return The display name of the script code appropriate to the given locale. * @throws NullPointerException if {@code inLocale} is {@code null} * @since 1.7 */ @@ -2003,7 +2003,7 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale's country that is appropriate for display to the + * Returns a name for {@code this} locale's country that is appropriate for display to the * user. * If possible, the name returned will be localized for the default * {@link Locale.Category#DISPLAY DISPLAY} locale. @@ -2017,14 +2017,15 @@ public final class Locale implements Cloneable, Serializable { * this function falls back on the English name, and uses the ISO code as a last-resort * value. If the locale doesn't specify a country, this function returns the empty string. * - * @return The name of the country appropriate to the locale. + * @return The name of the country appropriate to the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. */ - public final String getDisplayCountry() { + public String getDisplayCountry() { return getDisplayCountry(getDefault(Category.DISPLAY)); } /** - * Returns a name for the locale's country that is appropriate for display to the + * Returns a name for {@code this} locale's country that is appropriate for display to the * user. * If possible, the name returned will be localized according to inLocale. * For example, if the locale is fr_FR and inLocale @@ -2035,7 +2036,7 @@ public final class Locale implements Cloneable, Serializable { * on the ISO code as a last-resort value. If the locale doesn't specify a country, * this function returns the empty string. * - * @param inLocale The locale for which to retrieve the display country. + * @param inLocale The locale in which to localize the display country. * @return The name of the country appropriate to the given locale. * @throws NullPointerException if {@code inLocale} is {@code null} */ @@ -2061,23 +2062,24 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale's variant code that is appropriate for display to the + * Returns a name for {@code this} locale's variant code that is appropriate for display to the * user. If possible, the name will be localized for the default * {@link Locale.Category#DISPLAY DISPLAY} locale. If the locale * doesn't specify a variant code, this function returns the empty string. * - * @return The name of the display variant code appropriate to the locale. + * @return The name of the display variant code appropriate to the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. */ - public final String getDisplayVariant() { + public String getDisplayVariant() { return getDisplayVariant(getDefault(Category.DISPLAY)); } /** - * Returns a name for the locale's variant code that is appropriate for display to the + * Returns a name for {@code this} locale's variant code that is appropriate for display to the * user. If possible, the name will be localized for inLocale. If the locale * doesn't specify a variant code, this function returns the empty string. * - * @param inLocale The locale for which to retrieve the display variant code. + * @param inLocale The locale in which to localize the display variant code. * @return The name of the display variant code appropriate to the given locale. * @throws NullPointerException if {@code inLocale} is {@code null} */ @@ -2098,7 +2100,7 @@ public final class Locale implements Cloneable, Serializable { } /** - * Returns a name for the locale that is appropriate for display to the + * Returns a name for {@code this} locale that is appropriate for display to the * user. This will be the values returned by getDisplayLanguage(), * getDisplayScript(), getDisplayCountry(), getDisplayVariant() and * optional {@linkplain ##def_locale_extension Unicode extensions} @@ -2116,14 +2118,15 @@ public final class Locale implements Cloneable, Serializable { * be localized depending on the locale. If the language, script, country, * and variant fields are all empty, this function returns the empty string. * - * @return The name of the locale appropriate to display. + * @return The display name appropriate to the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. */ - public final String getDisplayName() { + public String getDisplayName() { return getDisplayName(getDefault(Category.DISPLAY)); } /** - * Returns a name for the locale that is appropriate for display + * Returns a name for {@code this} locale that is appropriate for display * to the user. This will be the values returned by * getDisplayLanguage(), getDisplayScript(), getDisplayCountry(), * getDisplayVariant(), and optional {@linkplain ##def_locale_extension @@ -2142,8 +2145,8 @@ public final class Locale implements Cloneable, Serializable { * be localized depending on the locale. If the language, script, country, * and variant fields are all empty, this function returns the empty string. * - * @param inLocale The locale for which to retrieve the display name. - * @return The name of the locale appropriate to display. + * @param inLocale The locale in which to localize the display name. + * @return The display name appropriate to the given locale. * @throws NullPointerException if {@code inLocale} is {@code null} */ public String getDisplayName(Locale inLocale) { diff --git a/src/java.base/share/classes/java/util/zip/ZipEntry.java b/src/java.base/share/classes/java/util/zip/ZipEntry.java index bf0bf55ff98..0206d2a5154 100644 --- a/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ public class ZipEntry implements ZipConstants, Cloneable { } /** - * Sets the optional comment string for the entry. - * @param comment the comment string + * Sets the optional comment string for the entry. If {@code comment} is an + * empty string or {@code null} then the entry will have no comment. + * @param comment the comment string, or an empty string or null for no comment * @throws IllegalArgumentException if the combined length * of the specified entry comment, the {@linkplain #getName() entry name}, * the {@linkplain #getExtra() extra field data}, and the diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index 4ea4a103fef..d79b0a1bd9c 100644 --- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -43,6 +43,10 @@ import sun.nio.cs.UTF_8; *

Unless otherwise noted, passing a {@code null} argument to a constructor * or method in this class will cause a {@link NullPointerException} to be * thrown. + *

By default, the UTF-8 charset is used to encode entry names and comments. + * {@link #ZipOutputStream(OutputStream, Charset)} may be be used to specify + * an alternative charset. + * * @author David Connelly * @since 1.1 */ @@ -110,10 +114,8 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant public static final int DEFLATED = ZipEntry.DEFLATED; /** - * Creates a new ZIP output stream. - * - *

The UTF-8 {@link java.nio.charset.Charset charset} is used - * to encode the entry names and comments. + * Creates a new ZIP output stream using the UTF-8 + * {@link Charset charset} to encode entry names and comments. * * @param out the actual output stream */ @@ -122,12 +124,13 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant } /** - * Creates a new ZIP output stream. + * Creates a new ZIP output stream using the specified + * {@link Charset charset} to encode entry names and comments. * * @param out the actual output stream * * @param charset the {@linkplain java.nio.charset.Charset charset} - * to be used to encode the entry names and comments + * to be used to encode entry names and comments * * @since 1.7 */ @@ -140,10 +143,15 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant } /** - * Sets the ZIP file comment. - * @param comment the comment string - * @throws IllegalArgumentException if the length of the specified - * ZIP file comment is greater than 0xFFFF bytes + * Sets the ZIP file comment. If {@code comment} is an empty string or + * {@code null} then the output will have no ZIP file comment. + * + * @param comment the comment string, or an empty string or null for no comment + * + * @throws IllegalArgumentException if the length of the specified ZIP file + * comment is greater than 0xFFFF bytes or if the {@code comment} + * contains characters that cannot be mapped by the {@code Charset} + * used to encode entry names and comments */ public void setComment(String comment) { byte[] bytes = null; diff --git a/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java b/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java index ac43b22a3bd..76b383c03e1 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java +++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java @@ -105,6 +105,9 @@ public class LocaleResources { // TimeZoneNamesBundle exemplar city prefix private static final String TZNB_EXCITY_PREFIX = "timezone.excity."; + // TimeZoneNamesBundle explicit metazone dst offset prefix + private static final String TZNB_METAZONE_DSTOFFSET_PREFIX = "metazone.dstoffset."; + // null singleton cache value private static final Object NULLOBJECT = new Object(); @@ -321,7 +324,8 @@ public class LocaleResources { if (Objects.isNull(data) || Objects.isNull(val = data.get())) { TimeZoneNamesBundle tznb = localeData.getTimeZoneNames(locale); - if (key.startsWith(TZNB_EXCITY_PREFIX)) { + if (key.startsWith(TZNB_EXCITY_PREFIX) || + key.startsWith(TZNB_METAZONE_DSTOFFSET_PREFIX)) { if (tznb.containsKey(key)) { val = tznb.getString(key); assert val instanceof String; @@ -378,7 +382,8 @@ public class LocaleResources { Set value = new LinkedHashSet<>(); Set tzIds = new HashSet<>(Arrays.asList(TimeZone.getAvailableIDs())); for (String key : keyset) { - if (!key.startsWith(TZNB_EXCITY_PREFIX)) { + if (!key.startsWith(TZNB_EXCITY_PREFIX) && + !key.startsWith(TZNB_METAZONE_DSTOFFSET_PREFIX)) { value.add(rb.getStringArray(key)); tzIds.remove(key); } diff --git a/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java b/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java index fd3d4965db3..6c684e176c8 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java +++ b/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java @@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.spi.TimeZoneNameProvider; import sun.util.calendar.ZoneInfo; import sun.util.cldr.CLDRLocaleProviderAdapter; -import static sun.util.locale.provider.LocaleProviderAdapter.Type; +import static sun.util.locale.provider.LocaleProviderAdapter.Type.CLDR; /** * Utility class that deals with the localized time zone names @@ -169,10 +169,22 @@ public final class TimeZoneNameUtility { * Returns the canonical ID for the given ID */ public static Optional canonicalTZID(String id) { - return ((CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(Type.CLDR)) + return ((CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(CLDR)) .canonicalTZID(id); } + /** + * {@return the explicit metazone DST offset for the specified time zone ID, if exists} + * @param tzid the time zone ID + */ + public static String explicitDstOffset(String tzid) { + return (String) (LocaleProviderAdapter.forType(CLDR) instanceof CLDRLocaleProviderAdapter ca ? + ca.getLocaleResources(Locale.ROOT) + .getTimeZoneNames("metazone.dstoffset." + + ca.canonicalTZID(tzid).orElse(tzid)) : + null); + } + private static String[] retrieveDisplayNamesImpl(String id, Locale locale) { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class); diff --git a/src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java b/src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java index a30b84c6872..c5e95c8a404 100644 --- a/src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java +++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved. * 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,8 +43,6 @@ package sun.util.resources; import java.util.Map; import java.util.LinkedHashMap; import java.util.LinkedHashSet; -import java.util.MissingResourceException; -import java.util.Objects; import java.util.Set; /** diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp index 62dbc84f88c..cc03f3fc832 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp @@ -31,73 +31,54 @@ #define CHECK_EXCEPTION if (env->ExceptionCheck()) { return; } static jfieldID p_dwarf_context_ID = 0; -static jint sa_RAX = -1; -static jint sa_RDX = -1; -static jint sa_RCX = -1; -static jint sa_RBX = -1; -static jint sa_RSI = -1; -static jint sa_RDI = -1; -static jint sa_RBP = -1; -static jint sa_RSP = -1; -static jint sa_R8 = -1; -static jint sa_R9 = -1; -static jint sa_R10 = -1; -static jint sa_R11 = -1; -static jint sa_R12 = -1; -static jint sa_R13 = -1; -static jint sa_R14 = -1; -static jint sa_R15 = -1; + +// DWARF_REG macro is used by DWARF_REGLIST. +#define DWARF_REG(reg, _) \ + static jint sa_##reg = -1; + +DWARF_REGLIST + +#undef DWARF_REG static jlong get_dwarf_context(JNIEnv *env, jobject obj) { return env->GetLongField(obj, p_dwarf_context_ID); } -#define SET_REG(env, reg, reg_cls) \ +/* + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser + * Method: init0 + * Signature: ()V + */ +extern "C" +JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_init0 + (JNIEnv *env, jclass this_cls) { + jclass cls = env->FindClass("sun/jvm/hotspot/debugger/linux/DwarfParser"); + CHECK_EXCEPTION + p_dwarf_context_ID = env->GetFieldID(cls, "p_dwarf_context", "J"); + CHECK_EXCEPTION + + jclass reg_cls = env->FindClass(THREAD_CONTEXT_CLASS); + CHECK_EXCEPTION + +// DWARF_REG macro is used by DWARF_REGLIST. +#define DWARF_REG(reg, _) \ jfieldID reg##_ID = env->GetStaticFieldID(reg_cls, #reg, "I"); \ CHECK_EXCEPTION \ sa_##reg = env->GetStaticIntField(reg_cls, reg##_ID); \ CHECK_EXCEPTION -/* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser - * Method: init0 - * Signature: ()V - */ -extern "C" -JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_init0 - (JNIEnv *env, jclass this_cls) { - jclass cls = env->FindClass("sun/jvm/hotspot/debugger/linux/amd64/DwarfParser"); - CHECK_EXCEPTION - p_dwarf_context_ID = env->GetFieldID(cls, "p_dwarf_context", "J"); - CHECK_EXCEPTION + DWARF_REGLIST - jclass reg_cls = env->FindClass("sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext"); - CHECK_EXCEPTION - SET_REG(env, RAX, reg_cls); - SET_REG(env, RDX, reg_cls); - SET_REG(env, RCX, reg_cls); - SET_REG(env, RBX, reg_cls); - SET_REG(env, RSI, reg_cls); - SET_REG(env, RDI, reg_cls); - SET_REG(env, RBP, reg_cls); - SET_REG(env, RSP, reg_cls); - SET_REG(env, R8, reg_cls); - SET_REG(env, R9, reg_cls); - SET_REG(env, R10, reg_cls); - SET_REG(env, R11, reg_cls); - SET_REG(env, R12, reg_cls); - SET_REG(env, R13, reg_cls); - SET_REG(env, R14, reg_cls); - SET_REG(env, R15, reg_cls); +#undef DWARF_REG } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: createDwarfContext * Signature: (J)J */ extern "C" -JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_createDwarfContext +JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_createDwarfContext (JNIEnv *env, jclass this_cls, jlong lib) { DwarfParser *parser = new DwarfParser(reinterpret_cast(lib)); if (!parser->is_parseable()) { @@ -113,36 +94,36 @@ JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_cr } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: destroyDwarfContext * Signature: (J)V */ extern "C" -JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_destroyDwarfContext +JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_destroyDwarfContext (JNIEnv *env, jclass this_cls, jlong context) { DwarfParser *parser = reinterpret_cast(context); delete parser; } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: isIn0 * Signature: (J)Z */ extern "C" -JNIEXPORT jboolean JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_isIn0 +JNIEXPORT jboolean JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_isIn0 (JNIEnv *env, jobject this_obj, jlong pc) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); return static_cast(parser->is_in(pc)); } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: processDwarf0 * Signature: (J)V */ extern "C" -JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_processDwarf0 +JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_processDwarf0 (JNIEnv *env, jobject this_obj, jlong pc) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); if (!parser->process_dwarf(pc)) { @@ -155,67 +136,106 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_pro } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: getCFARegister * Signature: ()I */ extern "C" -JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getCFARegister +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getCFARegister (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); + switch (parser->get_cfa_register()) { - case RAX: return sa_RAX; - case RDX: return sa_RDX; - case RCX: return sa_RCX; - case RBX: return sa_RBX; - case RSI: return sa_RSI; - case RDI: return sa_RDI; - case RBP: return sa_RBP; - case RSP: return sa_RSP; - case R8: return sa_R8; - case R9: return sa_R9; - case R10: return sa_R10; - case R11: return sa_R11; - case R12: return sa_R12; - case R13: return sa_R13; - case R14: return sa_R14; - case R15: return sa_R15; +// DWARF_REG macro is used by DWARF_REGLIST. +#define DWARF_REG(reg, _) \ + case reg: return sa_##reg; + + DWARF_REGLIST + +#undef DWARF_REG + default: return -1; } } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: getCFAOffset * Signature: ()I */ extern "C" -JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getCFAOffset +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getCFAOffset (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); return parser->get_cfa_offset(); } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser + * Method: getOffsetFromCFA + * Signature: (I)I + */ +extern "C" +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getOffsetFromCFA + (JNIEnv *env, jobject this_obj, jint sareg) { + DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); + +// DWARF_REG macro is used by DWARF_REGLIST. +#define DWARF_REG(reg, dwreg) \ + if (sareg == sa_##reg) { \ + return parser->get_offset_from_cfa(static_cast(dwreg)); \ + } else + + DWARF_REGLIST + +#undef DWARF_REG + + return INT_MAX; +} + +/* + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser + * Method: getRARegister + * Signature: ()I + */ +extern "C" +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getRARegister + (JNIEnv *env, jobject this_obj) { + DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); + + switch (parser->get_ra_register()) { +// DWARF_REG macro is used by DWARF_REGLIST. +#define DWARF_REG(reg, _) \ + case reg: return sa_##reg; + + DWARF_REGLIST + +#undef DWARF_REG + + default: return -1; + } +} + +/* + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: getReturnAddressOffsetFromCFA * Signature: ()I */ extern "C" -JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getReturnAddressOffsetFromCFA +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getReturnAddressOffsetFromCFA (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); return parser->get_offset_from_cfa(RA); } /* - * Class: sun_jvm_hotspot_debugger_linux_amd64_DwarfParser + * Class: sun_jvm_hotspot_debugger_linux_DwarfParser * Method: getBasePointerOffsetFromCFA * Signature: ()I */ extern "C" -JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getBasePointerOffsetFromCFA +JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_DwarfParser_getBasePointerOffsetFromCFA (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); - return parser->get_offset_from_cfa(RBP); + return parser->get_offset_from_cfa(BP); } diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp index caf948019af..214e2f21ac6 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2019, 2021, NTT DATA. + * Copyright (c) 2002, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, NTT DATA. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -289,6 +289,13 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at snprintf(msg, sizeof(msg), "Can't attach to the process: %s", err_buf); THROW_NEW_DEBUGGER_EXCEPTION(msg); } + +#ifdef __aarch64__ + if (pac_enabled(ph)) { + printf("WARNING: PAC is enabled. Stack traces might be incomplete.\n"); + } +#endif + env->SetLongField(this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph); fillThreadsAndLoadObjects(env, this_obj, ph); } @@ -313,6 +320,13 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at if ( (ph = Pgrab_core(execName_cstr, coreName_cstr)) == NULL) { THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file. For more information, export LIBSAPROC_DEBUG=1 and try again."); } + +#ifdef __aarch64__ + if (pac_enabled(ph)) { + printf("WARNING: PAC is enabled. Stack traces might be incomplete.\n"); + } +#endif + env->SetLongField(this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph); fillThreadsAndLoadObjects(env, this_obj, ph); } diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp index 459e3cc57e9..28eb92a285f 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp @@ -217,6 +217,20 @@ void DwarfParser::parse_dwarf_instructions(uintptr_t begin, uintptr_t pc, const _state.offset_from_cfa[reg] = _initial_state.offset_from_cfa[reg]; break; } +#ifdef __aarch64__ + // SA hasn't yet supported Pointer Authetication Code (PAC), so following + // instructions would be ignored with warning message. + // https://github.com/ARM-software/abi-aa/blob/2025Q4/aadwarf64/aadwarf64.rst + case 0x2d: // DW_CFA_AARCH64_negate_ra_state + print_debug("DWARF: DW_CFA_AARCH64_negate_ra_state is unimplemented.\n", op); + break; + case 0x2c: // DW_CFA_AARCH64_negate_ra_state_with_pc + print_debug("DWARF: DW_CFA_AARCH64_negate_ra_state_with_pc is unimplemented.\n", op); + break; + case 0x2b: // DW_CFA_AARCH64_set_ra_state + print_debug("DWARF: DW_CFA_AARCH64_set_ra_state is unimplemented.\n", op); + break; +#endif default: print_debug("DWARF: Unknown opcode: 0x%x\n", op); return; diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp index 0a38c9a0f2e..2bfdba65a78 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp @@ -30,30 +30,21 @@ #include "libproc_impl.h" -/* - * from System V Application Binary Interface - * AMD64 Architecture Processor Supplement - * Figure 3.38: DWARF Register Number Mapping - * https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf - */ +#ifdef __x86_64__ +#include "dwarf_regs_amd64.h" +#elif defined(__aarch64__) +#include "dwarf_regs_aarch64.h" +#endif + enum DWARF_Register { - RAX, - RDX, - RCX, - RBX, - RSI, - RDI, - RBP, - RSP, - R8, - R9, - R10, - R11, - R12, - R13, - R14, - R15, - RA, +// DWARF_REG macro is used by DWARF_REGLIST and DWARF_PSEUDO_REGLIST. +#define DWARF_REG(reg, no) \ + reg = no, + + DWARF_REGLIST + DWARF_PSEUDO_REGLIST + +#undef DWARF_REG MAX_VALUE }; @@ -94,6 +85,7 @@ class DwarfParser { bool process_dwarf(const uintptr_t pc); enum DWARF_Register get_cfa_register() { return _state.cfa_reg; } int get_cfa_offset() { return _state.cfa_offset; } + enum DWARF_Register get_ra_register() { return _state.return_address_reg; } int get_offset_from_cfa(enum DWARF_Register reg) { return _state.offset_from_cfa[reg]; } bool is_in(long pc) { diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_aarch64.h b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_aarch64.h new file mode 100644 index 00000000000..5a95e9405e1 --- /dev/null +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_aarch64.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef DWARF_REGS_AARCH64_H +#define DWARF_REGS_AARCH64_H + +#define THREAD_CONTEXT_CLASS "sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext" + +/* + * from DWARF for the Arm (R) 64-bit Architecture (AArch64) + * https://github.com/ARM-software/abi-aa/blob/2025Q4/aadwarf64/aadwarf64.rst + * 4.1 DWARF register names + */ +#define DWARF_REGLIST \ + DWARF_REG(R0, 0) \ + DWARF_REG(R1, 1) \ + DWARF_REG(R2, 2) \ + DWARF_REG(R3, 3) \ + DWARF_REG(R4, 4) \ + DWARF_REG(R5, 5) \ + DWARF_REG(R6, 6) \ + DWARF_REG(R7, 7) \ + DWARF_REG(R8, 8) \ + DWARF_REG(R9, 9) \ + DWARF_REG(R10, 10) \ + DWARF_REG(R11, 11) \ + DWARF_REG(R12, 12) \ + DWARF_REG(R13, 13) \ + DWARF_REG(R14, 14) \ + DWARF_REG(R15, 15) \ + DWARF_REG(R16, 16) \ + DWARF_REG(R17, 17) \ + DWARF_REG(R18, 18) \ + DWARF_REG(R19, 19) \ + DWARF_REG(R20, 20) \ + DWARF_REG(R21, 21) \ + DWARF_REG(R22, 22) \ + DWARF_REG(R23, 23) \ + DWARF_REG(R24, 24) \ + DWARF_REG(R25, 25) \ + DWARF_REG(R26, 26) \ + DWARF_REG(R27, 27) \ + DWARF_REG(R28, 28) \ + DWARF_REG(FP, 29) \ + DWARF_REG(LR, 30) \ + DWARF_REG(SP, 31) \ + DWARF_REG(PC, 32) + +// RA_SIGN_STATE might be needed in future to handle PAC. +#define DWARF_PSEUDO_REGLIST + +/* Aliases */ +#define BP FP +#define RA LR + +#endif diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_amd64.h b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_amd64.h new file mode 100644 index 00000000000..8226bc0864c --- /dev/null +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf_regs_amd64.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef DWARF_REGS_AMD64_H +#define DWARF_REGS_AMD64_H + +#define THREAD_CONTEXT_CLASS "sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext" + +/* + * from System V Application Binary Interface + * AMD64 Architecture Processor Supplement + * https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf + * Figure 3.36: DWARF Register Number Mapping + */ +#define DWARF_REGLIST \ + DWARF_REG(RAX, 0) \ + DWARF_REG(RDX, 1) \ + DWARF_REG(RCX, 2) \ + DWARF_REG(RBX, 3) \ + DWARF_REG(RSI, 4) \ + DWARF_REG(RDI, 5) \ + DWARF_REG(RBP, 6) \ + DWARF_REG(RSP, 7) \ + DWARF_REG(R8, 8) \ + DWARF_REG(R9, 9) \ + DWARF_REG(R10, 10) \ + DWARF_REG(R11, 11) \ + DWARF_REG(R12, 12) \ + DWARF_REG(R13, 13) \ + DWARF_REG(R14, 14) \ + DWARF_REG(R15, 15) + +#define DWARF_PSEUDO_REGLIST \ + DWARF_REG(RA, 16) + +/* Aliases */ +#define BP RBP + +#endif diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h index a69496e77a4..c584131e285 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,6 +119,10 @@ struct ps_prochandle* get_proc_handle(JNIEnv* env, jobject this_obj); void throw_new_debugger_exception(JNIEnv* env, const char* errMsg); +#ifdef __aarch64__ +bool pac_enabled(struct ps_prochandle* ph); +#endif + #ifdef __cplusplus } #endif diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c index 029aac1f107..815902045cf 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c @@ -478,6 +478,12 @@ struct lib_info *find_lib_by_address(struct ps_prochandle* ph, uintptr_t pc) { return NULL; } +#ifdef __aarch64__ +bool pac_enabled(struct ps_prochandle* ph) { + return ph->pac_enabled; +} +#endif + //-------------------------------------------------------------------------- // proc service functions diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h index 62b1b4d0d6b..d5aa74e73ad 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h @@ -115,6 +115,10 @@ struct ps_prochandle { int num_threads; thread_info* threads; // head of thread list struct core_data* core; // data only used for core dumps, NULL for process +#ifdef __aarch64__ + // true if the HWCAP_PACA variant of Pointer Authentication Code (PAC) is enabled. + bool pac_enabled; +#endif }; #ifdef __cplusplus diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c index 6298f569aaf..c500360f39d 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c @@ -39,6 +39,12 @@ #include "proc_service.h" #include "salibelf.h" +// HWCAP_PACA was introduced in glibc 2.30 +// https://sourceware.org/git/?p=glibc.git;a=commit;h=a2e57f89a35e6056c9488428e68c4889e114ef71 +#if defined(__aarch64__) && !defined(HWCAP_PACA) +#define HWCAP_PACA (1 << 30) +#endif + // This file has the libproc implementation to read core files. // For live processes, refer to ps_proc.c. Portions of this is adapted // /modelled after Solaris libproc.so (in particular Pcore.c) @@ -290,6 +296,10 @@ static bool core_handle_note(struct ps_prochandle* ph, ELF_PHDR* note_phdr) { break; } else if (auxv->a_type == AT_SYSINFO_EHDR) { ph->core->vdso_addr = auxv->a_un.a_val; +#ifdef __aarch64__ + } else if (auxv->a_type == AT_HWCAP) { + ph->pac_enabled = auxv->a_un.a_val & HWCAP_PACA; +#endif } auxv++; } @@ -610,23 +620,38 @@ static uintptr_t calc_prelinked_load_address(struct ps_prochandle* ph, int lib_f return load_addr; } +static int handle_vdso_internal(struct ps_prochandle* ph, char* vdso_name, char* lib_name, size_t lib_name_len) { + int lib_fd; + struct utsname uts; + uname(&uts); + + char *vdso_path = (char*)malloc(lib_name_len); + snprintf(vdso_path, lib_name_len, "/lib/modules/%s/vdso/%s", uts.release, vdso_name); + print_debug("Try to open vDSO: %s\n", vdso_path); + lib_fd = pathmap_open(vdso_path); + if (lib_fd != -1) { + print_debug("replace vDSO: %s -> %s\n", lib_name, vdso_path); + strncpy(lib_name, vdso_path, lib_name_len); + } + + free(vdso_path); + return lib_fd; +} + // Check for vDSO binary in kernel directory (/lib/modules//vdso), // rewrite the given lib_name string if found. // Otherwise copy vDSO memory in coredump to temporal file generated by tmpfile(). // Returns FD for vDSO (should be closed by caller), or -1 on error. static int handle_vdso(struct ps_prochandle* ph, char* lib_name, size_t lib_name_len) { int lib_fd; - struct utsname uts; - uname(&uts); // Check vDSO binary first (for referring debuginfo if possible). - char *vdso_path = (char*)malloc(lib_name_len); - snprintf(vdso_path, lib_name_len, "/lib/modules/%s/vdso/vdso64.so", uts.release); - lib_fd = pathmap_open(vdso_path); - if (lib_fd != -1) { - print_debug("replace vDSO: %s -> %s\n", lib_name, vdso_path); - strncpy(lib_name, vdso_path, lib_name_len); - } else { + lib_fd = handle_vdso_internal(ph, "vdso64.so", lib_name, lib_name_len); + if (lib_fd == -1) { + // Try again with vdso.so + lib_fd = handle_vdso_internal(ph, "vdso.so", lib_name, lib_name_len); + } + if (lib_fd == -1) { // Copy vDSO memory segment from core to temporal memory // if vDSO binary is not available. FILE* tmpf = tmpfile(); @@ -644,7 +669,6 @@ static int handle_vdso(struct ps_prochandle* ph, char* lib_name, size_t lib_name } } - free(vdso_path); return lib_fd; } diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c index fdaa30c3f5d..9cbde7319f0 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved. * 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,17 @@ #include #include "libproc_impl.h" +#ifdef __aarch64__ +#include + +// HWCAP_PACA was introduced in glibc 2.30 +// https://sourceware.org/git/?p=glibc.git;a=commit;h=a2e57f89a35e6056c9488428e68c4889e114ef71 +#ifndef HWCAP_PACA +#define HWCAP_PACA (1 << 30) +#endif + +#endif + #if defined(x86_64) && !defined(amd64) #define amd64 1 #endif @@ -460,6 +471,10 @@ Pgrab(pid_t pid, char* err_buf, size_t err_buf_len) { return NULL; } +#ifdef __aarch64__ + ph->pac_enabled = HWCAP_PACA & getauxval(AT_HWCAP); +#endif + // initialize ps_prochandle ph->pid = pid; if (add_thread_info(ph, ph->pid) == NULL) { diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c b/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c index c8f3fb2ed4c..8f8ce28be1e 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c @@ -417,10 +417,14 @@ static struct symtab* build_symtab_internal(int fd, const char *filename, bool t uintptr_t sym_value; char *sym_name = symtab->strs + syms->st_name; - // skip non-object and non-function symbols + // skip non-object and non-function symbols, but STT_NOTYPE is allowed for + // signal trampoline. int st_type = ELF_ST_TYPE(syms->st_info); - if ( st_type != STT_FUNC && st_type != STT_OBJECT) + if (st_type != STT_FUNC && + st_type != STT_OBJECT && + st_type != STT_NOTYPE) { continue; + } // skip empty strings and undefined symbols if (*sym_name == '\0' || syms->st_shndx == SHN_UNDEF) continue; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java index bc366ef02b5..86f9e990af8 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, Oracle and/or its affiliates. All rights reserved. * 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 interface CFrame { public CFrame sender(ThreadProxy th); /** Find sender frame with given FP and PC */ - public default CFrame sender(ThreadProxy th, Address sp, Address fp, Address pc) { + public default CFrame sender(ThreadProxy th, Address senderSP, Address senderFP, Address senderPC) { return sender(th); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfCFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfCFrame.java new file mode 100644 index 00000000000..7baa399ea75 --- /dev/null +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfCFrame.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.debugger.linux; + +import sun.jvm.hotspot.debugger.Address; +import sun.jvm.hotspot.debugger.ThreadProxy; +import sun.jvm.hotspot.debugger.UnalignedAddressException; +import sun.jvm.hotspot.debugger.UnmappedAddressException; +import sun.jvm.hotspot.debugger.cdbg.CFrame; +import sun.jvm.hotspot.debugger.cdbg.ClosestSymbol; +import sun.jvm.hotspot.debugger.cdbg.basic.BasicCFrame; +import sun.jvm.hotspot.runtime.VM; + +public class DwarfCFrame extends BasicCFrame { + + private Address sp; + private Address fp; + private Address pc; + private Address cfa; + private LinuxDebugger linuxDbg; + private DwarfParser dwarf; + private boolean use1ByteBeforeToLookup; + + /** + * @return DwarfParser instance for the PC, null if native library relates to the pc not found. + * @throws DebuggerException if DWARF processing is failed. + * For example: pc is not covered in this DWARF, Common Information Entry (CIE) has + * language personality routine and/or Language Data Area (LSDA). + */ + protected static DwarfParser createDwarfParser(LinuxDebugger linuxDbg, Address pc) { + Address libptr = linuxDbg.findLibPtrByAddress(pc); + if (libptr != null) { + DwarfParser dwarf = new DwarfParser(libptr); + dwarf.processDwarf(pc); + return dwarf; + } + return null; + } + + protected DwarfCFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, DwarfParser dwarf) { + this(linuxDbg, sp, fp, cfa, pc, dwarf, false); + } + + protected DwarfCFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, DwarfParser dwarf, boolean use1ByteBeforeToLookup) { + super(linuxDbg.getCDebugger()); + this.sp = sp; + this.fp = fp; + this.cfa = cfa; + this.pc = pc; + this.linuxDbg = linuxDbg; + this.dwarf = dwarf; + this.use1ByteBeforeToLookup = use1ByteBeforeToLookup; + } + + public Address sp() { + return sp; + } + + public Address fp() { + return fp; + } + + public Address pc() { + return pc; + } + + public LinuxDebugger linuxDbg() { + return linuxDbg; + } + + public DwarfParser dwarf() { + return dwarf; + } + + // override base class impl to avoid ELF parsing + @Override + public ClosestSymbol closestSymbolToPC() { + Address symAddr = use1ByteBeforeToLookup ? pc.addOffsetTo(-1) : pc; + var sym = linuxDbg.lookup(linuxDbg.getAddressValue(symAddr)); + + // Returns a special symbol if the address is signal trampoline, + // otherwise returns closest symbol generated by LinuxDebugger. + return linuxDbg.isSignalTrampoline(symAddr) + ? new ClosestSymbol(sym.getName() + " ", 0) + : sym; + } + + @Override + public Address localVariableBase() { + return (dwarf != null && dwarf.isBPOffsetAvailable()) + ? cfa.addOffsetTo(dwarf.getBasePointerOffsetFromCFA()) + : fp; + } + + protected boolean isValidFrame(Address senderCFA, Address senderFP) { + // Both CFA and FP must not be null. + if (senderCFA == null && senderFP == null) { + return false; + } + + // FP must not be null if CFA is null - it happens between Java frame and Native frame. + // We cannot validate FP value because it might be used as GPR. Thus returns true + // if FP is not null. + if (senderCFA == null && senderFP != null) { + return true; + } + + // senderCFA must be greater than current CFA. + if (senderCFA != null && senderCFA.greaterThanOrEqual(cfa)) { + return true; + } + + // Otherwise, the frame is not valid. + return false; + } + + protected Address getSenderPC(Address senderPC) { + if (senderPC != null) { + return senderPC; + } + + try { + return dwarf == null + ? fp.getAddressAt(VM.getVM().getAddressSize()) // Current frame is Java + : cfa.getAddressAt(dwarf.getReturnAddressOffsetFromCFA()); // current frame is Native + } catch (UnmappedAddressException | UnalignedAddressException _) { + // Sender PC is invalid - maybe bottom of stack + return null; + } + } + + protected Address getSenderSP(Address senderSP) { + if (senderSP != null) { + return senderSP; + } else if (dwarf == null) { + // Current frame is Java - skip saved BP and RA + return fp.addOffsetTo(2 * VM.getVM().getAddressSize()); + } else { + // Current frame is Native + // CFA points SP at the call site in the previous frame. + // See 6.4 Call Frame Information in DWARF Debugging Information Format + // https://dwarfstd.org/dwarf4std.html + return cfa; + } + } + + protected Address getSenderFP(Address senderFP) { + if (senderFP != null) { + return senderFP; + } else if (dwarf == null) { // Current frame is Java + return fp.getAddressAt(0); + } else { // Current frame is Native + return dwarf.isBPOffsetAvailable() + ? cfa.getAddressAt(dwarf.getBasePointerOffsetFromCFA()) + : fp; + } + } + + @Override + public CFrame sender(ThreadProxy th) { + return sender(th, null, null, null); + } + +} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/DwarfParser.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfParser.java similarity index 95% rename from src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/DwarfParser.java rename to src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfParser.java index 53351c918d3..3e8099cf75b 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/DwarfParser.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/DwarfParser.java @@ -23,7 +23,7 @@ * */ -package sun.jvm.hotspot.debugger.linux.amd64; +package sun.jvm.hotspot.debugger.linux; import java.lang.ref.Cleaner; import sun.jvm.hotspot.debugger.Address; @@ -75,6 +75,8 @@ public class DwarfParser { public native int getCFARegister(); public native int getCFAOffset(); + public native int getOffsetFromCFA(int sareg); + public native int getRARegister(); public native int getReturnAddressOffsetFromCFA(); public native int getBasePointerOffsetFromCFA(); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java index 15f6615421c..57ba419aa9d 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java @@ -91,13 +91,7 @@ class LinuxCDebugger implements CDebugger { return new LinuxPPC64CFrame(dbg, sp, pc, LinuxDebuggerLocal.getAddressSize()); } else if (cpu.equals("aarch64")) { AARCH64ThreadContext context = (AARCH64ThreadContext) thread.getContext(); - Address sp = context.getRegisterAsAddress(AARCH64ThreadContext.SP); - if (sp == null) return null; - Address fp = context.getRegisterAsAddress(AARCH64ThreadContext.FP); - if (fp == null) return null; - Address pc = context.getRegisterAsAddress(AARCH64ThreadContext.PC); - if (pc == null) return null; - return new LinuxAARCH64CFrame(dbg, sp, fp, pc); + return LinuxAARCH64CFrame.getTopFrame(dbg, context); } else if (cpu.equals("riscv64")) { RISCV64ThreadContext context = (RISCV64ThreadContext) thread.getContext(); Address sp = context.getRegisterAsAddress(RISCV64ThreadContext.SP); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java index a53b8a0a282..c09af9881dd 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java @@ -33,12 +33,17 @@ import sun.jvm.hotspot.debugger.cdbg.*; by the architecture-specific subpackages. */ public interface LinuxDebugger extends JVMDebugger { - // SIGHANDLER_NAMES holds the name of signal handler. - public static final List SIGHANDLER_NAMES = List.of( + // SIGTRAMP_NAMES holds the name of signal trampoline. + public static final List SIGTRAMP_NAMES = List.of( // For AMD64 // - sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c in glibc // - gdb/amd64-linux-tdep.c in GDB - "__restore_rt" + "__restore_rt", + + // For AArch64 + // - arch/arm64/kernel/vdso/vdso.lds.S in Linux kernel + "__kernel_rt_sigreturn", + "VDSO_sigtramp" ); public String addressValueToString(long address) throws DebuggerException; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java index 9a75511e44d..856981bb73c 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java @@ -133,7 +133,7 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger { @Override public boolean isSignalTrampoline(Address pc) { var sym = lookup(getAddressValue(pc)); - return sym == null ? false : SIGHANDLER_NAMES.contains(sym.getName()); + return sym == null ? false : SIGTRAMP_NAMES.contains(sym.getName()); } // Note on Linux threads are really processes. When target process is diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java index 5f76e6308e9..c55aca2155c 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,73 +25,109 @@ package sun.jvm.hotspot.debugger.linux.aarch64; +import java.util.function.Function; + import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.aarch64.*; import sun.jvm.hotspot.debugger.linux.*; import sun.jvm.hotspot.debugger.cdbg.*; -import sun.jvm.hotspot.debugger.cdbg.basic.*; import sun.jvm.hotspot.code.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.runtime.aarch64.*; -public final class LinuxAARCH64CFrame extends BasicCFrame { - public LinuxAARCH64CFrame(LinuxDebugger dbg, Address sp, Address fp, Address pc) { - super(dbg.getCDebugger()); - this.sp = sp; - this.fp = fp; - this.pc = pc; - this.dbg = dbg; +public final class LinuxAARCH64CFrame extends DwarfCFrame { + + private Address lr; + + private static LinuxAARCH64CFrame getFrameFromReg(LinuxDebugger linuxDbg, Function getreg) { + Address pc = getreg.apply(AARCH64ThreadContext.PC); + Address sp = getreg.apply(AARCH64ThreadContext.SP); + Address fp = getreg.apply(AARCH64ThreadContext.FP); + Address lr = getreg.apply(AARCH64ThreadContext.LR); + Address cfa = null; + DwarfParser dwarf = createDwarfParser(linuxDbg, pc); + + if (dwarf != null) { // Native frame + cfa = getreg.apply(dwarf.getCFARegister()) + .addOffsetTo(dwarf.getCFAOffset()); + } + + return (fp == null && cfa == null) + ? null + : new LinuxAARCH64CFrame(linuxDbg, sp, fp, cfa, pc, lr, dwarf); } - // override base class impl to avoid ELF parsing - public ClosestSymbol closestSymbolToPC() { - // try native lookup in debugger. - return dbg.lookup(dbg.getAddressValue(pc())); + public static LinuxAARCH64CFrame getTopFrame(LinuxDebugger linuxDbg, ThreadContext context) { + return getFrameFromReg(linuxDbg, context::getRegisterAsAddress); } - public Address pc() { - return pc; + private LinuxAARCH64CFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, Address lr, DwarfParser dwarf) { + this(linuxDbg, sp, fp, cfa, pc, lr, dwarf, false); } - public Address localVariableBase() { - return fp; + private LinuxAARCH64CFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, DwarfParser dwarf) { + this(linuxDbg, sp, fp, cfa, pc, null, dwarf, false); } - @Override - public CFrame sender(ThreadProxy thread) { - return sender(thread, null, null, null); + private LinuxAARCH64CFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, DwarfParser dwarf, boolean use1ByteBeforeToLookup) { + this(linuxDbg, sp, fp, cfa, pc, null, dwarf, use1ByteBeforeToLookup); } - @Override - public CFrame sender(ThreadProxy thread, Address nextSP, Address nextFP, Address nextPC) { - // Check fp - // Skip if both nextFP and nextPC are given - do not need to load from fp. - if (nextFP == null && nextPC == null) { - if (fp == null) { - return null; + private LinuxAARCH64CFrame(LinuxDebugger linuxDbg, Address sp, Address fp, Address cfa, Address pc, Address lr, DwarfParser dwarf, boolean use1ByteBeforeToLookup) { + super(linuxDbg, sp, fp, cfa, pc, dwarf, use1ByteBeforeToLookup); + + if (dwarf != null) { + // Prioritize to use RA from DWARF instead of LR + var senderPCFromDwarf = getSenderPC(null); + if (senderPCFromDwarf != null) { + lr = senderPCFromDwarf; + } else if (lr != null) { + // We should set passed lr to LR of this frame, + // but throws DebuggerException if lr is not used for RA. + var raReg = dwarf.getRARegister(); + if (raReg != AARCH64ThreadContext.LR) { + throw new DebuggerException("Unexpected RA register: " + raReg); + } } + } - // Check alignment of fp - if (dbg.getAddressValue(fp) % (2 * ADDRESS_SIZE) != 0) { + this.lr = lr; + } + + private Address getSenderCFA(DwarfParser senderDwarf, Address senderSP, Address senderFP) { + if (senderDwarf == null) { // Sender frame is Java + // CFA is not available on Java frame + return null; + } + + // Sender frame is Native + int senderCFAReg = senderDwarf.getCFARegister(); + return switch(senderCFAReg){ + case AARCH64ThreadContext.FP -> senderFP.addOffsetTo(senderDwarf.getCFAOffset()); + case AARCH64ThreadContext.SP -> senderSP.addOffsetTo(senderDwarf.getCFAOffset()); + default -> throw new DebuggerException("Unsupported CFA register: " + senderCFAReg); + }; + } + + @Override + public CFrame sender(ThreadProxy thread, Address senderSP, Address senderFP, Address senderPC) { + if (linuxDbg().isSignalTrampoline(pc())) { + // SP points signal context + // https://github.com/torvalds/linux/blob/v6.17/arch/arm64/kernel/signal.c#L1357 + return getFrameFromReg(linuxDbg(), r -> LinuxAARCH64ThreadContext.getRegFromSignalTrampoline(sp(), r.intValue())); + } + + if (senderPC == null) { + // Use getSenderPC() if current frame is Java because we cannot rely on lr in this case. + senderPC = dwarf() == null ? getSenderPC(null) : lr; + if (senderPC == null) { return null; } } - if (nextFP == null) { - nextFP = fp.getAddressAt(0 * ADDRESS_SIZE); - } - if (nextFP == null) { - return null; - } + senderFP = getSenderFP(senderFP); - if (nextPC == null) { - nextPC = fp.getAddressAt(1 * ADDRESS_SIZE); - } - if (nextPC == null) { - return null; - } - - if (nextSP == null) { + if (senderSP == null) { CodeCache cc = VM.getVM().getCodeCache(); CodeBlob currentBlob = cc.findBlobUnsafe(pc()); @@ -99,29 +135,62 @@ public final class LinuxAARCH64CFrame extends BasicCFrame { if (currentBlob != null && (currentBlob.isContinuationStub() || currentBlob.isNativeMethod())) { // Use FP since it should always be valid for these cases. // TODO: These should be walked as Frames not CFrames. - nextSP = fp.addOffsetTo(2 * ADDRESS_SIZE); + senderSP = fp().addOffsetTo(2 * VM.getVM().getAddressSize()); } else { - CodeBlob codeBlob = cc.findBlobUnsafe(nextPC); + CodeBlob codeBlob = cc.findBlobUnsafe(senderPC); boolean useCodeBlob = codeBlob != null && codeBlob.getFrameSize() > 0; - nextSP = useCodeBlob ? nextFP.addOffsetTo((2 * ADDRESS_SIZE) - codeBlob.getFrameSize()) : nextFP; + senderSP = useCodeBlob ? senderFP.addOffsetTo((2 * VM.getVM().getAddressSize()) - codeBlob.getFrameSize()) : getSenderSP(null); } } - if (nextSP == null) { + if (senderSP == null) { return null; } - return new LinuxAARCH64CFrame(dbg, nextSP, nextFP, nextPC); + DwarfParser senderDwarf = null; + boolean fallback = false; + try { + senderDwarf = createDwarfParser(linuxDbg(), senderPC); + } catch (DebuggerException _) { + // Try again with PC-1 in case PC is just outside function bounds, + // due to function ending with a `call` instruction. + try { + senderDwarf = createDwarfParser(linuxDbg(), senderPC.addOffsetTo(-1)); + fallback = true; + } catch (DebuggerException _) { + if (linuxDbg().isSignalTrampoline(senderPC)) { + // We can use the caller frame if it is a signal trampoline. + // DWARF processing might fail because vdso.so .eh_frame is not required on aarch64. + return new LinuxAARCH64CFrame(linuxDbg(), senderSP, senderFP, null, senderPC, senderDwarf); + } + + // DWARF processing should succeed when the frame is native + // but it might fail if Common Information Entry (CIE) has language + // personality routine and/or Language Specific Data Area (LSDA). + return null; + } + } + + try { + Address senderCFA = getSenderCFA(senderDwarf, senderSP, senderFP); + return isValidFrame(senderCFA, senderFP) + ? new LinuxAARCH64CFrame(linuxDbg(), senderSP, senderFP, senderCFA, senderPC, senderDwarf, fallback) + : null; + } catch (DebuggerException e) { + if (linuxDbg().isSignalTrampoline(senderPC)) { + // We can use the caller frame if it is a signal trampoline. + // getSenderCFA() might fail because DwarfParser cannot find out CFA register. + return new LinuxAARCH64CFrame(linuxDbg(), senderSP, senderFP, null, senderPC, senderDwarf, fallback); + } + + // Rethrow the original exception if getSenderCFA() failed + // and the caller is not signal trampoline. + throw e; + } } @Override public Frame toFrame() { - return new AARCH64Frame(sp, fp, pc); + return new AARCH64Frame(sp(), fp(), pc()); } - // package/class internals only - private static final int ADDRESS_SIZE = 8; - private Address pc; - private Address sp; - private Address fp; - private LinuxDebugger dbg; } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java index 77003168671..422ca001624 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,6 +28,7 @@ package sun.jvm.hotspot.debugger.linux.aarch64; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.aarch64.*; import sun.jvm.hotspot.debugger.linux.*; +import sun.jvm.hotspot.runtime.*; public class LinuxAARCH64ThreadContext extends AARCH64ThreadContext { private LinuxDebugger debugger; @@ -44,4 +45,24 @@ public class LinuxAARCH64ThreadContext extends AARCH64ThreadContext { public Address getRegisterAsAddress(int index) { return debugger.newAddress(getRegister(index)); } + + public static Address getRegFromSignalTrampoline(Address sp, int index) { + // ucontext_t locates at 2nd element of rt_sigframe. + // See definition of rt_sigframe in arch/arm/kernel/signal.h + // in Linux Kernel. + Address addrUContext = sp.addOffsetTo(128); // sizeof(siginfo_t) = 128 + Address addrUCMContext = addrUContext.addOffsetTo(176); // offsetof(ucontext_t, uc_mcontext) = 176 + + Address ptrCallerSP = addrUCMContext.addOffsetTo(256); // offsetof(uc_mcontext, sp) = 256 + Address ptrCallerPC = addrUCMContext.addOffsetTo(264); // offsetof(uc_mcontext, pc) = 264 + Address ptrCallerRegs = addrUCMContext.addOffsetTo(8); // offsetof(uc_mcontext, regs) = 8 + + return switch(index) { + case AARCH64ThreadContext.FP -> ptrCallerRegs.getAddressAt(AARCH64ThreadContext.FP * VM.getVM().getAddressSize()); + case AARCH64ThreadContext.LR -> ptrCallerRegs.getAddressAt(AARCH64ThreadContext.LR * VM.getVM().getAddressSize()); + case AARCH64ThreadContext.SP -> ptrCallerSP.getAddressAt(0); + case AARCH64ThreadContext.PC -> ptrCallerPC.getAddressAt(0); + default -> throw new IllegalArgumentException("Unsupported register index: " + index); + }; + } } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java index 4d3d9d5998d..e58e2facdd7 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java @@ -29,181 +29,82 @@ import java.util.function.Function; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.linux.*; -import sun.jvm.hotspot.debugger.linux.amd64.*; import sun.jvm.hotspot.debugger.cdbg.*; -import sun.jvm.hotspot.debugger.cdbg.basic.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.runtime.amd64.*; -public final class LinuxAMD64CFrame extends BasicCFrame { +public final class LinuxAMD64CFrame extends DwarfCFrame { - private static LinuxAMD64CFrame getFrameFromReg(LinuxDebugger dbg, Function getreg) { + private static LinuxAMD64CFrame getFrameFromReg(LinuxDebugger linuxDbg, Function getreg) { Address rip = getreg.apply(AMD64ThreadContext.RIP); Address rsp = getreg.apply(AMD64ThreadContext.RSP); Address rbp = getreg.apply(AMD64ThreadContext.RBP); - Address libptr = dbg.findLibPtrByAddress(rip); Address cfa = null; - DwarfParser dwarf = null; - - if (libptr != null) { // Native frame - dwarf = new DwarfParser(libptr); - try { - dwarf.processDwarf(rip); - } catch (DebuggerException e) { - // DWARF processing should succeed when the frame is native - // but it might fail if Common Information Entry (CIE) has language - // personality routine and/or Language Specific Data Area (LSDA). - return new LinuxAMD64CFrame(dbg, rsp, rbp, cfa, rip, dwarf, true); - } + DwarfParser dwarf = createDwarfParser(linuxDbg, rip); + if (dwarf != null) { // Native frame cfa = getreg.apply(dwarf.getCFARegister()) .addOffsetTo(dwarf.getCFAOffset()); } return (rbp == null && cfa == null) ? null - : new LinuxAMD64CFrame(dbg, rsp, rbp, cfa, rip, dwarf); + : new LinuxAMD64CFrame(linuxDbg, rsp, rbp, cfa, rip, dwarf); } - public static LinuxAMD64CFrame getTopFrame(LinuxDebugger dbg, ThreadContext context) { - return getFrameFromReg(dbg, context::getRegisterAsAddress); + public static LinuxAMD64CFrame getTopFrame(LinuxDebugger linuxDbg, ThreadContext context) { + return getFrameFromReg(linuxDbg, context::getRegisterAsAddress); } - private LinuxAMD64CFrame(LinuxDebugger dbg, Address rsp, Address rbp, Address cfa, Address rip, DwarfParser dwarf) { - this(dbg, rsp, rbp, cfa, rip, dwarf, false); + private LinuxAMD64CFrame(LinuxDebugger linuxDbg, Address rsp, Address rbp, Address cfa, Address rip, DwarfParser dwarf) { + this(linuxDbg, rsp, rbp, cfa, rip, dwarf, false); } - private LinuxAMD64CFrame(LinuxDebugger dbg, Address rsp, Address rbp, Address cfa, Address rip, DwarfParser dwarf, boolean use1ByteBeforeToLookup) { - super(dbg.getCDebugger()); - this.rsp = rsp; - this.rbp = rbp; - this.cfa = cfa; - this.rip = rip; - this.dbg = dbg; - this.dwarf = dwarf; - this.use1ByteBeforeToLookup = use1ByteBeforeToLookup; + private LinuxAMD64CFrame(LinuxDebugger linuxDbg, Address rsp, Address rbp, Address cfa, Address rip, DwarfParser dwarf, boolean use1ByteBeforeToLookup) { + super(linuxDbg, rsp, rbp, cfa, rip, dwarf, use1ByteBeforeToLookup); } - // override base class impl to avoid ELF parsing - public ClosestSymbol closestSymbolToPC() { - Address symAddr = use1ByteBeforeToLookup ? pc().addOffsetTo(-1) : pc(); - var sym = dbg.lookup(dbg.getAddressValue(symAddr)); - - // Returns a special symbol if the address is signal handler, - // otherwise returns closest symbol generated by LinuxDebugger. - return dbg.isSignalTrampoline(symAddr) - ? new ClosestSymbol(sym.getName() + " ", 0) - : sym; - } - - public Address pc() { - return rip; - } - - public Address localVariableBase() { - return (dwarf != null && dwarf.isBPOffsetAvailable()) - ? cfa.addOffsetTo(dwarf.getBasePointerOffsetFromCFA()) - : rbp; - } - - private Address getNextPC() { - try { - return dwarf == null - ? rbp.getAddressAt(ADDRESS_SIZE) // Java frame - : cfa.getAddressAt(dwarf.getReturnAddressOffsetFromCFA()); // Native frame - } catch (UnmappedAddressException | UnalignedAddressException e) { - return null; - } - } - - private boolean isValidFrame(Address nextCFA, Address nextRBP) { - // Both CFA and RBP must not be null. - if (nextCFA == null && nextRBP == null) { - return false; - } - - // RBP must not be null if CFA is null - it happens between Java frame and Native frame. - // We cannot validate RBP value because it might be used as GPR. Thus returns true - // if RBP is not null. - if (nextCFA == null && nextRBP != null) { - return true; - } - - // nextCFA must be greater than current CFA. - if (nextCFA != null && nextCFA.greaterThanOrEqual(cfa)) { - return true; - } - - // Otherwise, the frame is not valid. - return false; - } - - private Address getNextRSP() { - return dwarf == null ? rbp.addOffsetTo(2 * ADDRESS_SIZE) // Java frame - skip saved BP and RA - : cfa.addOffsetTo(dwarf.getReturnAddressOffsetFromCFA()) - .addOffsetTo(ADDRESS_SIZE); // Native frame - } - - private Address getNextRBP(Address senderFP) { - if (senderFP != null) { - return senderFP; - } else if (dwarf == null) { // Current frame is Java - return rbp.getAddressAt(0); - } else { // Current frame is Native - return dwarf.isBPOffsetAvailable() - ? cfa.getAddressAt(dwarf.getBasePointerOffsetFromCFA()) - : rbp; - } - } - - private Address getNextCFA(DwarfParser nextDwarf, Address senderFP, Address senderPC) { - if (nextDwarf == null) { // Next frame is Java + private Address getSenderCFA(DwarfParser senderDwarf, Address senderSP, Address senderFP) { + if (senderDwarf == null) { // Sender frame is Java // CFA is not available on Java frame return null; } - // Next frame is Native - int nextCFAReg = nextDwarf.getCFARegister(); - return switch(nextCFAReg){ - case AMD64ThreadContext.RBP -> getNextRBP(senderFP).addOffsetTo(nextDwarf.getCFAOffset()); - case AMD64ThreadContext.RSP -> getNextRSP().addOffsetTo(nextDwarf.getCFAOffset()); - default -> throw new DebuggerException("Unsupported CFA register: " + nextCFAReg); + // Sender frame is Native + int senderCFAReg = senderDwarf.getCFARegister(); + return switch(senderCFAReg){ + case AMD64ThreadContext.RBP -> senderFP.addOffsetTo(senderDwarf.getCFAOffset()); + case AMD64ThreadContext.RSP -> senderSP.addOffsetTo(senderDwarf.getCFAOffset()); + default -> throw new DebuggerException("Unsupported CFA register: " + senderCFAReg); }; } @Override - public CFrame sender(ThreadProxy th) { - return sender(th, null, null, null); - } - - @Override - public CFrame sender(ThreadProxy th, Address sp, Address fp, Address pc) { - if (dbg.isSignalTrampoline(pc())) { + public CFrame sender(ThreadProxy th, Address senderSP, Address senderFP, Address senderPC) { + if (linuxDbg().isSignalTrampoline(pc())) { // RSP points signal context // https://github.com/torvalds/linux/blob/v6.17/arch/x86/kernel/signal.c#L94 - return getFrameFromReg(dbg, r -> LinuxAMD64ThreadContext.getRegFromSignalTrampoline(this.rsp, r.intValue())); + return getFrameFromReg(linuxDbg(), r -> LinuxAMD64ThreadContext.getRegFromSignalTrampoline(sp(), r.intValue())); } - ThreadContext context = th.getContext(); - - Address nextRSP = sp != null ? sp : getNextRSP(); - if (nextRSP == null) { + senderSP = getSenderSP(senderSP); + if (senderSP == null) { return null; } - Address nextPC = pc != null ? pc : getNextPC(); - if (nextPC == null) { + senderPC = getSenderPC(senderPC); + if (senderPC == null) { return null; } - DwarfParser nextDwarf = null; + DwarfParser senderDwarf = null; boolean fallback = false; try { - nextDwarf = createDwarfParser(nextPC); + senderDwarf = createDwarfParser(linuxDbg(), senderPC); } catch (DebuggerException _) { - // Try again with RIP-1 in case RIP is just outside function bounds, + // Try again with PC-1 in case PC is just outside function bounds, // due to function ending with a `call` instruction. try { - nextDwarf = createDwarfParser(nextPC.addOffsetTo(-1)); + senderDwarf = createDwarfParser(linuxDbg(), senderPC.addOffsetTo(-1)); fallback = true; } catch (DebuggerException _) { // DWARF processing should succeed when the frame is native @@ -213,56 +114,29 @@ public final class LinuxAMD64CFrame extends BasicCFrame { } } - Address nextRBP = getNextRBP(fp); + senderFP = getSenderFP(senderFP); try { - Address nextCFA = getNextCFA(nextDwarf, fp, nextPC); - return isValidFrame(nextCFA, nextRBP) - ? new LinuxAMD64CFrame(dbg, nextRSP, nextRBP, nextCFA, nextPC, nextDwarf, fallback) + Address senderCFA = getSenderCFA(senderDwarf, senderSP, senderFP); + return isValidFrame(senderCFA, senderFP) + ? new LinuxAMD64CFrame(linuxDbg(), senderSP, senderFP, senderCFA, senderPC, senderDwarf, fallback) : null; } catch (DebuggerException e) { - if (dbg.isSignalTrampoline(nextPC)) { - // We can through the caller frame if it is signal trampoline. - // getNextCFA() might fail because DwarfParser cannot find out CFA register. - return new LinuxAMD64CFrame(dbg, nextRSP, nextRBP, null, nextPC, nextDwarf, fallback); + if (linuxDbg().isSignalTrampoline(senderPC)) { + // We can use the caller frame if it is a signal trampoline. + // getSenderCFA() might fail because DwarfParser cannot find out CFA register. + return new LinuxAMD64CFrame(linuxDbg(), senderSP, senderFP, null, senderPC, senderDwarf, fallback); } - // Rethrow the original exception if getNextCFA() failed + // Rethrow the original exception if getSenderCFA() failed // and the caller is not signal trampoline. throw e; } } - private DwarfParser createDwarfParser(Address pc) throws DebuggerException { - DwarfParser nextDwarf = null; - Address libptr = dbg.findLibPtrByAddress(pc); - if (libptr != null) { - try { - nextDwarf = new DwarfParser(libptr); - } catch (DebuggerException _) { - // Bail out to Java frame - } - } - - if (nextDwarf != null) { - nextDwarf.processDwarf(pc); - } - - return nextDwarf; - } - @Override public Frame toFrame() { - return new AMD64Frame(rsp, localVariableBase(), rip); + return new AMD64Frame(sp(), localVariableBase(), pc()); } - // package/class internals only - private static final int ADDRESS_SIZE = 8; - private Address rsp; - private Address rbp; - private Address rip; - private Address cfa; - private LinuxDebugger dbg; - private DwarfParser dwarf; - private boolean use1ByteBeforeToLookup; } diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java index 3223ff9dccd..0280f7c33bb 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -1246,7 +1246,11 @@ class ZipFileSystem extends FileSystem { private LinkedHashMap inodes; final byte[] getBytes(String name) { - return zc.getBytes(name); + try { + return zc.getBytes(name); + } catch (IllegalArgumentException e) { + throw new InvalidPathException(name, "unmappable character in path name"); + } } final String getString(byte[] name) { diff --git a/src/utils/hsdis/capstone/hsdis-capstone.c b/src/utils/hsdis/capstone/hsdis-capstone.c index d8a8719778d..7a17d150f40 100644 --- a/src/utils/hsdis/capstone/hsdis-capstone.c +++ b/src/utils/hsdis/capstone/hsdis-capstone.c @@ -58,6 +58,7 @@ and that causes invalid macro expansion. */ #undef aarch64 +#undef arm #include #include "hsdis.h" @@ -163,9 +164,9 @@ void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, size_t count = cs_disasm(cs_handle, buffer, length, (uintptr_t) buffer, 0 , &insn); if (count) { for (unsigned int j = 0; j < count; j++) { - (*event_callback)(event_stream, "insn", (void*) insn[j].address); + (*event_callback)(event_stream, "insn", (void*)(uintptr_t) insn[j].address); print("%s\t\t%s", insn[j].mnemonic, insn[j].op_str); - (*event_callback)(event_stream, "/insn", (void*) (insn[j].address + insn[j].size)); + (*event_callback)(event_stream, "/insn", (void*)(uintptr_t) (insn[j].address + insn[j].size)); if (newline) { /* follow each complete insn by a nice newline */ print("\n"); diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index d4efaa7e631..b4f9efff830 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -56,7 +56,6 @@ compiler/c2/irTests/TestDuplicateBackedge.java 8318904 generic-all compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all -compiler/vectorapi/reshape/TestVectorReinterpret.java 8348519 linux-s390x compiler/vectorapi/VectorRebracket128Test.java 8330538 generic-all compiler/vectorization/TestVectorAlgorithms.java#noSuperWord 8376803 aix-ppc64,linux-s390x diff --git a/test/hotspot/jtreg/compiler/arraycopy/TestACNonEscapingSrcBadAddPBaseType.java b/test/hotspot/jtreg/compiler/arraycopy/TestACNonEscapingSrcBadAddPBaseType.java new file mode 100644 index 00000000000..251c053ff5d --- /dev/null +++ b/test/hotspot/jtreg/compiler/arraycopy/TestACNonEscapingSrcBadAddPBaseType.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2026 IBM Corporation. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact 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 8380158 + * @summary C2: compiler/c2/TestGVNCrash.java asserts with adr and adr_type must agree + * @run main/othervm -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:CompileOnly=compiler.arraycopy.TestACNonEscapingSrcBadAddPBaseType::test1 + * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=946074051 ${test.main.class} + * @run main/othervm -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:CompileOnly=compiler.arraycopy.TestACNonEscapingSrcBadAddPBaseType::test1 + * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN ${test.main.class} + * @run main ${test.main.class} + */ + +package compiler.arraycopy; + +public class TestACNonEscapingSrcBadAddPBaseType { + private static volatile int volatileField; + + public static void main(String[] args) { + int[] dst = new int[2]; + for (int i = 0; i < 20_000; i++) { + test1(dst); + } + } + + private static void test1(int[] dst) { + int[] array = new int[2]; + A a = new A(array); + volatileField = 42; + int[] src = a.src; + System.arraycopy(src, 0, dst, 0, src.length); + System.arraycopy(src, 0, dst, 0, src.length); + } + + private static class A { + private final int[] src; + + public A(int[] src) { + this.src = src; + } + } +} diff --git a/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java b/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java index 1cbaaf0f52d..c1638a27fd7 100644 --- a/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java +++ b/test/hotspot/jtreg/compiler/codecache/MHIntrinsicAllocFailureTest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2022 SAP SE. All rights reserved.ights reserved. + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025 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 @@ -28,6 +28,7 @@ * @requires vm.compMode == "Xmixed" * @requires vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true * @requires vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4 + * @requires vm.compiler2.enabled * @summary test allocation failure of method handle intrinsic in profiled/non-profiled space * @library /test/lib * @modules java.base/jdk.internal.misc @@ -39,6 +40,11 @@ * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* * -XX:ReservedCodeCacheSize=16m -XX:+SegmentedCodeCache * compiler.codecache.MHIntrinsicAllocFailureTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:ReservedCodeCacheSize=20m -XX:+SegmentedCodeCache + * -XX:+TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=4M + * compiler.codecache.MHIntrinsicAllocFailureTest */ package compiler.codecache; @@ -73,7 +79,7 @@ public class MHIntrinsicAllocFailureTest { // JIT compilers should be off, now. Asserts.assertNotEquals(WHITE_BOX.getCompilationActivityMode(), 1); System.out.println("Code cache segments for non-profiled and profiled nmethods are full."); - // Generate and use a MH itrinsic. Should not trigger one of the following: + // Generate and use a MH intrinsic. Should not trigger one of the following: // - VirtualMachineError: Out of space in CodeCache for method handle intrinsic // - InternalError: java.lang.NoSuchMethodException: no such method: // java.lang.invoke.MethodHandle.linkToStatic(int,int,Object,MemberName)int/invokeStatic diff --git a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java index cf993237a32..e0a45e4cba6 100644 --- a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java +++ b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,27 @@ * compiler.codecache.OverflowCodeCacheTest */ +/* + * @test OverflowCodeCacheTest + * @bug 8059550 8279356 8326205 + * @requires vm.compiler2.enabled + * @summary testing of code cache segments overflow + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M + * -Xmixed -XX:TieredStopAtLevel=4 + * compiler.codecache.OverflowCodeCacheTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M + * -Xmixed -XX:TieredStopAtLevel=4 + * compiler.codecache.OverflowCodeCacheTest + */ + package compiler.codecache; import jdk.test.lib.Asserts; @@ -85,6 +106,7 @@ public class OverflowCodeCacheTest { System.out.println("allocating till possible..."); ArrayList blobs = new ArrayList<>(); int compilationActivityMode = -1; + CodeCacheConstraints constraints = getCodeCacheConstraints(type); // Lock compilation to be able to better control code cache space WHITE_BOX.lockCompilation(); try { @@ -115,6 +137,7 @@ public class OverflowCodeCacheTest { } catch (VirtualMachineError e) { // Expected } + constraints.check(); // Free code cache space for (Long blob : blobs) { WHITE_BOX.freeCodeBlob(blob); @@ -143,4 +166,31 @@ public class OverflowCodeCacheTest { return bean.getUsage().getMax(); } + class CodeCacheConstraints { + void check() {} + } + + CodeCacheConstraints getCodeCacheConstraints(final BlobType type) { + if (Long.valueOf(0).equals(WHITE_BOX.getVMFlag("HotCodeHeapSize"))) { + return new CodeCacheConstraints(); + } else if (BlobType.MethodHot == type) { + // NonProfiledHeap is used when HotCodeHeap runs out of space. + return new CodeCacheConstraints() { + final int nonProfiledCount = WHITE_BOX.getCodeHeapEntries(BlobType.MethodNonProfiled.id).length; + @Override + void check() { + Asserts.assertLT(nonProfiledCount, WHITE_BOX.getCodeHeapEntries(BlobType.MethodNonProfiled.id).length); + } + }; + } else { + // HotCodeHeap should not be used when other heap runs out of space. + return new CodeCacheConstraints() { + final int hotCount = WHITE_BOX.getCodeHeapEntries(BlobType.MethodHot.id).length; + @Override + void check() { + Asserts.assertEQ(hotCount, WHITE_BOX.getCodeHeapEntries(BlobType.MethodHot.id).length); + } + }; + } + } } diff --git a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java index a5068b47454..e54fad3517e 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,10 +50,16 @@ public class TestSegmentedCodeCacheOption { private static final String USE_SEGMENTED_CODE_CACHE = CommandLineOptionTest.prepareBooleanFlag(SEGMENTED_CODE_CACHE, true); + private static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS + = CommandLineOptionTest.prepareBooleanFlag("UnlockExperimentalVMOptions", true); + private static final String HOT_CODE_HEAP + = CommandLineOptionTest.prepareBooleanFlag("HotCodeHeap", true); private static final long THRESHOLD_CC_SIZE_VALUE = CodeCacheOptions.mB(240); private static final long BELOW_THRESHOLD_CC_SIZE = THRESHOLD_CC_SIZE_VALUE - CodeCacheOptions.mB(1); + private static final long HOT_CODE_HEAP_SIZE + = CodeCacheOptions.mB(8); private static final String[] UNEXPECTED_MESSAGES = new String[] { ".*" + SEGMENTED_CODE_CACHE + ".*" }; @@ -104,7 +110,7 @@ public class TestSegmentedCodeCacheOption { public void run() throws Throwable { // SCC is disabled w/o TieredCompilation by default String errorMessage = SEGMENTED_CODE_CACHE - + " should be disabled by default when tiered " + + " should be disabled by default when tiered " + "compilation is disabled"; CommandLineOptionTest.verifyOptionValueForSameVM( @@ -162,6 +168,52 @@ public class TestSegmentedCodeCacheOption { CommandLineOptionTest.prepareBooleanFlag( TIERED_COMPILATION, true)); } + }, + OPTION_VALUES_HOT { + @Override + public boolean isApplicable() { + return Platform.isServer(); + } + + @Override + public void run() throws Throwable { + // SCC is enabled w hot code heap w/o TieredCompilation + String errorMessage = SEGMENTED_CODE_CACHE + + " should be enabled when the hot code heap " + + "is enabled"; + + CommandLineOptionTest.verifyOptionValueForSameVM( + SEGMENTED_CODE_CACHE, "true", errorMessage, + UNLOCK_EXPERIMENTAL_VM_OPTIONS, + HOT_CODE_HEAP, + CommandLineOptionTest.prepareNumericFlag( + BlobType.MethodHot.sizeOptionName, + HOT_CODE_HEAP_SIZE), + CommandLineOptionTest.prepareBooleanFlag( + TIERED_COMPILATION, false)); + + // Hot code heap could be explicitly enabled w/ SegmentedCodeCache + // and w/ ReservedCodeCacheSize value below the threshold + errorMessage = String.format("It should be possible to explicitly " + + "enable %s and %s with %s below threshold %d.", + BlobType.MethodHot.sizeOptionName, + SEGMENTED_CODE_CACHE, + BlobType.All.sizeOptionName, + THRESHOLD_CC_SIZE_VALUE); + + CommandLineOptionTest.verifyOptionValueForSameVM( + BlobType.MethodHot.sizeOptionName, String.valueOf(HOT_CODE_HEAP_SIZE), + errorMessage, + UNLOCK_EXPERIMENTAL_VM_OPTIONS, + HOT_CODE_HEAP, + CommandLineOptionTest.prepareNumericFlag( + BlobType.All.sizeOptionName, + BELOW_THRESHOLD_CC_SIZE), + CommandLineOptionTest.prepareNumericFlag( + BlobType.MethodHot.sizeOptionName, + HOT_CODE_HEAP_SIZE), + USE_SEGMENTED_CODE_CACHE); + } }; TestCase() { diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java index e7c68e71ab3..aa7e9e67f37 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,5 +69,13 @@ public class GenericCodeHeapSizeRunner implements CodeCacheCLITestCase.Runner { BlobType.MethodProfiled.sizeOptionName, expectedValues.profiled), testCaseDescription.getTestOptions(options)); + + CommandLineOptionTest.verifyOptionValueForSameVM( + BlobType.MethodHot.sizeOptionName, + Long.toString(expectedValues.hot), + String.format("%s should have value %d.", + BlobType.MethodHot.sizeOptionName, + expectedValues.hot), + testCaseDescription.getTestOptions(options)); } } diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java index 4d52f470645..b5ae98bc79f 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,13 +48,15 @@ import java.util.EnumSet; public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase { private static final CodeCacheCLITestCase JVM_STARTUP = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( - options -> options.segmented, + options -> options.segmented + && options.hot == 0, EnumSet.noneOf(BlobType.class)), new JVMStartupRunner()); private static final CodeCacheCLITestCase CODE_CACHE_FREE_SPACE = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( options -> options.segmented + && options.hot == 0 && Platform.isDebugBuild(), EnumSet.noneOf(BlobType.class)), new CodeCacheFreeSpaceRunner()); @@ -65,13 +67,19 @@ public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase { private TestCodeHeapSizeOptions() { super(CodeCacheCLITestBase.OPTIONS_SET, new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.NON_TIERED.description, + .CommonDescriptions.NON_TIERED_WO_HOT.description, GENERIC_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase .CommonDescriptions.TIERED_LEVEL_1.description, GENERIC_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.TIERED_LEVEL_4.description, + .CommonDescriptions.TIERED_LEVEL_4_WO_HOT.description, + GENERIC_RUNNER), + new CodeCacheCLITestCase(CodeCacheCLITestCase + .CommonDescriptions.NON_TIERED_W_HOT.description, + GENERIC_RUNNER), + new CodeCacheCLITestCase(CodeCacheCLITestCase + .CommonDescriptions.TIERED_LEVEL_4_W_HOT.description, GENERIC_RUNNER), JVM_STARTUP, CODE_CACHE_FREE_SPACE); diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestBase.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestBase.java index f1f18956f05..12a1a0c42cd 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestBase.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,13 @@ public class CodeCacheCLITestBase { CodeCacheOptions.mB(100)), new CodeCacheOptions(CodeCacheOptions.mB(60)), new CodeCacheOptions(CodeCacheOptions.mB(200)), - new CodeCacheOptions(CodeCacheOptions.mB(300)) + new CodeCacheOptions(CodeCacheOptions.mB(300)), + new CodeCacheOptions(CodeCacheOptions.mB(250), + CodeCacheOptions.mB(50), CodeCacheOptions.mB(75), + CodeCacheOptions.mB(75), CodeCacheOptions.mB(50)), + new CodeCacheOptions(CodeCacheOptions.mB(200), + CodeCacheOptions.mB(50), CodeCacheOptions.mB(100), + CodeCacheOptions.mB(0), CodeCacheOptions.mB(50)) }; private final CodeCacheCLITestCase[] testCases; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java index eca5c70e091..0f5af1c0a93 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,15 +39,24 @@ import java.util.function.Function; * description. */ public class CodeCacheCLITestCase { - private static final Function ONLY_SEGMENTED - = options -> options.segmented; - private static final Function SEGMENTED_SERVER - = ONLY_SEGMENTED.andThen(isSegmented -> isSegmented + private static final Function SEGMENTED_WO_HOT + = options -> options.segmented && options.hot == 0; + private static final Function SEGMENTED_SERVER_WO_HOT + = SEGMENTED_WO_HOT.andThen(isSegmented -> isSegmented && Platform.isServer() && Platform.isTieredSupported()); + private static final Function SEGMENTED_W_HOT + = options -> options.segmented && options.hot > 0 + && options.profiled > 0 && Platform.isTieredSupported(); + private static final Function SEGMENTED_W_HOT_WO_PROFILED + = options -> options.segmented && options.hot > 0 + && options.profiled == 0 && Platform.isTieredSupported(); + private static final String USE_INT_MODE = "-Xint"; private static final String SEGMENTED_CODE_CACHE = "SegmentedCodeCache"; private static final String TIERED_COMPILATION = "TieredCompilation"; private static final String TIERED_STOP_AT = "TieredStopAtLevel"; + private static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS = "UnlockExperimentalVMOptions"; + private static final String HOT_CODE_HEAP = "HotCodeHeap"; private final Description description; private final Runner runner; @@ -68,7 +77,7 @@ public class CodeCacheCLITestCase { * Verifies that in interpreted mode PrintCodeCache output contains * the whole code cache. Int mode disables SegmentedCodeCache with a warning. */ - INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.All), USE_INT_MODE), + INT_MODE(options -> options.hot == 0, EnumSet.of(BlobType.All), USE_INT_MODE), /** * Verifies that with disabled SegmentedCodeCache PrintCodeCache output * contains only CodeCache's entry. @@ -81,7 +90,7 @@ public class CodeCacheCLITestCase { * code cache PrintCodeCache output does not contain information about * profiled-nmethods heap and non-segmented CodeCache. */ - NON_TIERED(ONLY_SEGMENTED, + NON_TIERED_WO_HOT(SEGMENTED_WO_HOT, EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled), CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, false)), @@ -90,7 +99,7 @@ public class CodeCacheCLITestCase { * warn about SegmentedCodeCache and contain information about all * heaps only. */ - TIERED_LEVEL_0(SEGMENTED_SERVER, + TIERED_LEVEL_0(SEGMENTED_SERVER_WO_HOT, EnumSet.of(BlobType.All), CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, true), @@ -100,19 +109,44 @@ public class CodeCacheCLITestCase { * contain information about non-nmethods and non-profiled nmethods * heaps only. */ - TIERED_LEVEL_1(SEGMENTED_SERVER, + TIERED_LEVEL_1(SEGMENTED_SERVER_WO_HOT, EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled), CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, true), CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 1)), /** * Verifies that with TieredStopAtLevel=4 PrintCodeCache output will - * contain information about all three code heaps. + * contain information about non-nmethods, non-profiled nmethods + * and profiled nmethods heaps only. */ - TIERED_LEVEL_4(SEGMENTED_SERVER, - EnumSet.complementOf(EnumSet.of(BlobType.All)), + TIERED_LEVEL_4_WO_HOT(SEGMENTED_SERVER_WO_HOT, + EnumSet.complementOf(EnumSet.of(BlobType.MethodHot, BlobType.All)), CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, true), + CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 4)), + + /** + * Verifies that with disabled tiered compilation and enabled hot code + * cache PrintCodeCache output does not contain information about + * profiled-nmethods heap and non-segmented CodeCache. + */ + NON_TIERED_W_HOT(SEGMENTED_W_HOT_WO_PROFILED, + EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled, BlobType.MethodHot), + CommandLineOptionTest.prepareBooleanFlag(UNLOCK_EXPERIMENTAL_VM_OPTIONS, true), + CommandLineOptionTest.prepareBooleanFlag(HOT_CODE_HEAP, true), + CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, + false)), + + /** + * Verifies that with TieredStopAtLevel=4 and hot code heap + * PrintCodeCache output will contain information about non-nmethods, + * non-profiled nmethods, profiled nmethods, and hot code heaps only. + */ + TIERED_LEVEL_4_W_HOT(SEGMENTED_W_HOT, + EnumSet.complementOf(EnumSet.of(BlobType.All)), + CommandLineOptionTest.prepareBooleanFlag(UNLOCK_EXPERIMENTAL_VM_OPTIONS, true), + CommandLineOptionTest.prepareBooleanFlag(HOT_CODE_HEAP, true), + CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, true), CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 4)); CommonDescriptions(Function predicate, diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java index f5243aaa493..b8e386f4f7d 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,15 +37,20 @@ public class CodeCacheOptions { = EnumSet.of(BlobType.All); private static final EnumSet ALL_SEGMENTED_HEAPS = EnumSet.complementOf(NON_SEGMENTED_HEAPS); - private static final EnumSet SEGMENTED_HEAPS_WO_PROFILED + private static final EnumSet NON_NMETHOD_AND_NON_PROFILED_HEAPS = EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled); + private static final EnumSet SEGMENTED_HEAPS_WO_HOT + = EnumSet.of(BlobType.NonNMethod, BlobType.MethodProfiled, BlobType.MethodNonProfiled); private static final EnumSet ONLY_NON_METHODS_HEAP = EnumSet.of(BlobType.NonNMethod); + private static final EnumSet NON_NMETHOD_AND_NON_PROFILED_AND_HOT_HEAPS + = EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled, BlobType.MethodHot); public final long reserved; public final long nonNmethods; public final long nonProfiled; public final long profiled; + public final long hot; public final boolean segmented; public static long mB(long val) { @@ -61,6 +66,7 @@ public class CodeCacheOptions { this.nonNmethods = 0; this.nonProfiled = 0; this.profiled = 0; + this.hot = 0; this.segmented = false; } @@ -70,6 +76,17 @@ public class CodeCacheOptions { this.nonNmethods = nonNmethods; this.nonProfiled = nonProfiled; this.profiled = profiled; + this.hot = 0; + this.segmented = true; + } + + public CodeCacheOptions(long reserved, long nonNmethods, long nonProfiled, + long profiled, long hot) { + this.reserved = reserved; + this.nonNmethods = nonNmethods; + this.nonProfiled = nonProfiled; + this.profiled = profiled; + this.hot = hot; this.segmented = true; } @@ -83,6 +100,8 @@ public class CodeCacheOptions { return this.nonProfiled; case MethodProfiled: return this.profiled; + case MethodHot: + return this.hot; default: throw new Error("Unknown heap: " + heap.name()); } @@ -106,6 +125,11 @@ public class CodeCacheOptions { nonProfiled), CommandLineOptionTest.prepareNumericFlag( BlobType.MethodProfiled.sizeOptionName, profiled)); + if (hot > 0) { + Collections.addAll(options, + CommandLineOptionTest.prepareNumericFlag( + BlobType.MethodHot.sizeOptionName, hot)); + } } return options.toArray(new String[options.size()]); } @@ -113,9 +137,11 @@ public class CodeCacheOptions { public CodeCacheOptions mapOptions(EnumSet involvedCodeHeaps) { if (involvedCodeHeaps.isEmpty() || involvedCodeHeaps.equals(NON_SEGMENTED_HEAPS) - || involvedCodeHeaps.equals(ALL_SEGMENTED_HEAPS)) { + || involvedCodeHeaps.equals(SEGMENTED_HEAPS_WO_HOT) + || involvedCodeHeaps.equals(ALL_SEGMENTED_HEAPS) + || involvedCodeHeaps.equals(NON_NMETHOD_AND_NON_PROFILED_AND_HOT_HEAPS)) { return this; - } else if (involvedCodeHeaps.equals(SEGMENTED_HEAPS_WO_PROFILED)) { + } else if (involvedCodeHeaps.equals(NON_NMETHOD_AND_NON_PROFILED_HEAPS)) { return new CodeCacheOptions(reserved, nonNmethods, profiled + nonProfiled, 0L); } else if (involvedCodeHeaps.equals(ONLY_NON_METHODS_HEAP)) { diff --git a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java index c0d826e59ec..2e994336f54 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ import java.util.EnumSet; public class TestPrintCodeCacheOption extends CodeCacheCLITestBase { private static final CodeCacheCLITestCase DISABLED_PRINT_CODE_CACHE = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( - options -> true, EnumSet.noneOf(BlobType.class)), + options -> options.hot == 0, EnumSet.noneOf(BlobType.class)), new PrintCodeCacheRunner(false)); private static final CodeCacheCLITestCase.Runner DEFAULT_RUNNER @@ -61,7 +61,7 @@ public class TestPrintCodeCacheOption extends CodeCacheCLITestBase { .CommonDescriptions.NON_SEGMENTED.description, DEFAULT_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.NON_TIERED.description, + .CommonDescriptions.NON_TIERED_WO_HOT.description, DEFAULT_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase .CommonDescriptions.TIERED_LEVEL_0.description, @@ -70,7 +70,13 @@ public class TestPrintCodeCacheOption extends CodeCacheCLITestBase { .CommonDescriptions.TIERED_LEVEL_1.description, DEFAULT_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.TIERED_LEVEL_4.description, + .CommonDescriptions.TIERED_LEVEL_4_WO_HOT.description, + DEFAULT_RUNNER), + new CodeCacheCLITestCase(CodeCacheCLITestCase + .CommonDescriptions.NON_TIERED_W_HOT.description, + DEFAULT_RUNNER), + new CodeCacheCLITestCase(CodeCacheCLITestCase + .CommonDescriptions.TIERED_LEVEL_4_W_HOT.description, DEFAULT_RUNNER), DISABLED_PRINT_CODE_CACHE); } diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java index 5bc10071b4d..c669a7ece7d 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.BeanTypeTest */ +/** + * @test BeanTypeTest + * @requires vm.compiler2.enabled + * @summary verify types of code cache memory pool bean + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.BeanTypeTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.BeanTypeTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java index d379296d561..462d03ddcdf 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.CodeHeapBeanPresenceTest */ +/** + * @test CodeHeapBeanPresenceTest + * @requires vm.compiler2.enabled + * @summary verify CodeHeap bean presence + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.CodeHeapBeanPresenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.CodeHeapBeanPresenceTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java index 873b0494424..704236a3a85 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,28 @@ * compiler.codecache.jmx.GetUsageTest */ +/* + * @test GetUsageTest + * @requires vm.compiler2.enabled + * @summary testing of getUsage() for segmented code cache + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib / + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.GetUsageTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.GetUsageTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java index a2343c23694..ad12a828fef 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,28 @@ * compiler.codecache.jmx.InitialAndMaxUsageTest */ +/* + * @test InitialAndMaxUsageTest + * @requires vm.compiler2.enabled + * @summary testing of initial and max usage + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib / + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,null::* -XX:-UseLargePages + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.InitialAndMaxUsageTest + * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,null::* -XX:-UseLargePages + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.InitialAndMaxUsageTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java index b482cd4e559..f04cd695f4f 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.ManagerNamesTest */ +/** + * @test ManagerNamesTest + * @requires vm.compiler2.enabled + * @summary verify getMemoryManageNames calls in case of segmented code cache + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.ManagerNamesTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.ManagerNamesTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java index b91b7fa228d..83215bce8ad 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.MemoryPoolsPresenceTest */ +/** + * @test MemoryPoolsPresenceTest + * @requires vm.compiler2.enabled + * @summary verify that MemoryManagerMXBean exists for every code cache segment + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.MemoryPoolsPresenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.MemoryPoolsPresenceTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java index b808a661904..ecd9db3a6c4 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,8 @@ /* * @test PeakUsageTest + * @summary testing of getPeakUsage() and resetPeakUsage for + * segmented code cache * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management @@ -37,8 +39,27 @@ * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* * -XX:-SegmentedCodeCache * compiler.codecache.jmx.PeakUsageTest + */ + +/* + * @test PeakUsageTest + * @requires vm.compiler2.enabled * @summary testing of getPeakUsage() and resetPeakUsage for * segmented code cache + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.PeakUsageTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.PeakUsageTest */ package compiler.codecache.jmx; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java index 07a5ec94c87..98959f284a0 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.PoolsIndependenceTest */ +/* + * @test PoolsIndependenceTest + * @requires vm.compiler2.enabled + * @summary testing of getUsageThreshold() + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib / + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.PoolsIndependenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.PoolsIndependenceTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java index a71a01a555c..5c1624eeb18 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,26 @@ * compiler.codecache.jmx.ThresholdNotificationsTest */ +/* + * @test ThresholdNotificationsTest + * @requires vm.compiler2.enabled + * @summary testing of getUsageThreshold() + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.ThresholdNotificationsTest + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.ThresholdNotificationsTest + */ + package compiler.codecache.jmx; import jdk.test.lib.Asserts; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java index 6f3402848f8..cffe5cc8774 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,3 +42,26 @@ * -XX:-SegmentedCodeCache * compiler.codecache.jmx.UsageThresholdExceededTest */ + +/* + * @test UsageThresholdExceededSeveralTimesTest + * @requires vm.compiler2.enabled + * @summary verifying that getUsageThresholdCount() returns correct value + * after threshold has been hit several times + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10 + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10 + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdExceededTest + */ diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java index 1dae00b0035..7dd70bd0d04 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,17 +32,40 @@ * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* * -XX:+SegmentedCodeCache * compiler.codecache.jmx.UsageThresholdExceededTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* * -XX:-SegmentedCodeCache * compiler.codecache.jmx.UsageThresholdExceededTest */ +/* + * @test UsageThresholdExceededTest + * @requires vm.compiler2.enabled + * @summary verifying that getUsageThresholdCount() returns correct value + * after threshold has been hit + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdExceededTest + */ + package compiler.codecache.jmx; import jdk.test.whitebox.code.BlobType; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java index cb3f2c90364..a49a27a4d20 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,28 @@ * compiler.codecache.jmx.UsageThresholdIncreasedTest */ +/* + * @test UsageThresholdIncreasedTest + * @requires vm.compiler2.enabled + * @summary verifying that threshold hasn't been hit after allocation smaller + * than threshold value and that threshold value can be changed + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdIncreasedTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdIncreasedTest + */ + package compiler.codecache.jmx; import jdk.test.whitebox.code.BlobType; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java index 1c13c89884b..0d75beb78da 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,29 @@ * compiler.codecache.jmx.UsageThresholdNotExceededTest */ +/* + * @test UsageThresholdNotExceededTest + * @requires vm.compiler2.enabled + * @summary verifying that usage threshold not exceeded while allocating less + * than usage threshold + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdNotExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.jmx.UsageThresholdNotExceededTest + */ + package compiler.codecache.jmx; import jdk.test.whitebox.code.BlobType; diff --git a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java index 26d3556d10e..d1d2da8523b 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java @@ -43,6 +43,29 @@ * compiler.codecache.stress.RandomAllocationTest */ +/* + * @test RandomAllocationTest + * @key stress randomness + * @requires vm.compiler2.enabled + * @summary stressing code cache by allocating randomly sized "dummy" code blobs + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build jdk.test.whitebox.WhiteBox compiler.codecache.stress.Helper compiler.codecache.stress.TestCaseImpl + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:+TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.stress.RandomAllocationTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M -XX:-TieredCompilation -XX:TieredStopAtLevel=4 + * compiler.codecache.stress.RandomAllocationTest + */ + package compiler.codecache.stress; import jdk.test.whitebox.code.BlobType; diff --git a/test/hotspot/jtreg/compiler/cpuflags/CPUFeaturesClearTest.java b/test/hotspot/jtreg/compiler/cpuflags/CPUFeaturesClearTest.java index a0fb3525381..19768a8dc17 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/CPUFeaturesClearTest.java +++ b/test/hotspot/jtreg/compiler/cpuflags/CPUFeaturesClearTest.java @@ -123,12 +123,10 @@ public class CPUFeaturesClearTest { if (isCpuFeatureSupported("sve2")) { outputAnalyzer = ProcessTools.executeTestJava(generateArgs(prepareNumericFlag("UseSVE", 1))); outputAnalyzer.shouldNotMatch("[os,cpu] CPU: .* sve2.*"); - verifyOutput(null, new String[]{"sve2"}, null, outputAnalyzer); } if (isCpuFeatureSupported("sve")) { outputAnalyzer = ProcessTools.executeTestJava(generateArgs(prepareNumericFlag("UseSVE", 0))); outputAnalyzer.shouldNotMatch("[os,cpu] CPU: .* sve.*"); - verifyOutput(null, new String[]{"sve"}, null, outputAnalyzer); } } diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index 421307e85ca..b3aa0283fa5 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -26,7 +26,6 @@ * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @requires (vm.cpu.features ~= ".*aes.*" | vm.cpu.features ~= ".*zvkn.*") & !vm.graal.enabled * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=600 -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java index 50677f5197e..7fc6d7f86c1 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -81,7 +81,7 @@ public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase { /** * Test checks following situation:
- * UseAESIntrinsics flag is set to true, TestAESMain is executed
+ * UseAES flag is set to true, TestAESMain is executed
* Expected result: UseAES flag is set to false
* UseAES flag is set to false
* Output shouldn't contain intrinsics usage
diff --git a/test/hotspot/jtreg/compiler/exceptions/TestDebugDuringExceptionCatching.java b/test/hotspot/jtreg/compiler/exceptions/TestDebugDuringExceptionCatching.java index 999c73fb73a..9be192d1f55 100644 --- a/test/hotspot/jtreg/compiler/exceptions/TestDebugDuringExceptionCatching.java +++ b/test/hotspot/jtreg/compiler/exceptions/TestDebugDuringExceptionCatching.java @@ -22,6 +22,7 @@ */ package compiler.exceptions; +import compiler.lib.ir_framework.CompLevel; import compiler.lib.ir_framework.Run; import compiler.lib.ir_framework.Test; import compiler.lib.ir_framework.TestFramework; @@ -38,7 +39,7 @@ import test.java.lang.invoke.lib.InstructionHelper; /** * @test * @bug 8350208 - * @summary Safepoints added during the processing of exception handlers should never reexecute + * @summary Safepoints added during the processing of exception handlers need correct stack state * @library /test/lib /test/jdk/java/lang/invoke/common / * @build test.java.lang.invoke.lib.InstructionHelper * @@ -110,7 +111,7 @@ public class TestDebugDuringExceptionCatching { }); } - @Test + @Test(compLevel = CompLevel.C2) // see JDK-8381786 private static int testBackwardHandler(V v) throws Throwable { return (int) SNIPPET_HANDLE.invokeExact(v); } diff --git a/test/hotspot/jtreg/compiler/hotcode/HotCodeCollectorMoveFunction.java b/test/hotspot/jtreg/compiler/hotcode/HotCodeCollectorMoveFunction.java new file mode 100644 index 00000000000..dd02de66881 --- /dev/null +++ b/test/hotspot/jtreg/compiler/hotcode/HotCodeCollectorMoveFunction.java @@ -0,0 +1,88 @@ +/* + * 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 + * @library /test/lib / + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:-TieredCompilation -XX:+SegmentedCodeCache -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap + * -XX:+NMethodRelocation -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:HotCodeIntervalSeconds=0 -XX:HotCodeCallLevel=0 + * -XX:HotCodeSampleSeconds=5 -XX:HotCodeStablePercent=-1 -XX:HotCodeSamplePercent=100 -XX:HotCodeStartupDelaySeconds=0 + * -XX:CompileCommand=compileonly,compiler.hotcode.HotCodeCollectorMoveFunction::func + * compiler.hotcode.HotCodeCollectorMoveFunction + */ + +package compiler.hotcode; + +import java.lang.reflect.Method; + +import jdk.test.lib.Asserts; +import jdk.test.whitebox.WhiteBox; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.NMethod; + +public class HotCodeCollectorMoveFunction { + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + private static final Method method; + private static final int C2_LEVEL = 4; + private static final int FUNC_RUN_MILLIS = 60_000; + + static { + try { + method = HotCodeCollectorMoveFunction.class.getMethod("func"); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } + } + + public static void main(String[] args) throws Exception { + WHITE_BOX.testSetDontInlineMethod(method, true); + + compileFunc(); + + // Call function so collector samples and relocates + func(); + + // Function should now be in the Hot code heap after collector has had time to relocate + NMethod reloc_nm = NMethod.get(method, false); + Asserts.assertNotEquals(reloc_nm, null); + Asserts.assertEQ(reloc_nm.code_blob_type, BlobType.MethodHot); + } + + public static void compileFunc() { + WHITE_BOX.enqueueMethodForCompilation(method, C2_LEVEL); + + if (WHITE_BOX.getMethodCompilationLevel(method) != C2_LEVEL) { + throw new IllegalStateException("Method " + method + " is not compiled by C2."); + } + } + + public static void func() { + long start = System.currentTimeMillis(); + while (System.currentTimeMillis() - start < FUNC_RUN_MILLIS) {} + } + +} diff --git a/test/hotspot/jtreg/compiler/hotcode/StressHotCodeCollector.java b/test/hotspot/jtreg/compiler/hotcode/StressHotCodeCollector.java new file mode 100644 index 00000000000..4a7f9d2cc21 --- /dev/null +++ b/test/hotspot/jtreg/compiler/hotcode/StressHotCodeCollector.java @@ -0,0 +1,167 @@ +/* + * 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 + * @library /test/lib / + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -Xcomp -XX:-TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:+NMethodRelocation + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:HotCodeIntervalSeconds=0 -XX:HotCodeSampleSeconds=10 + * -XX:HotCodeStablePercent=-1 -XX:HotCodeSamplePercent=100 -XX:HotCodeStartupDelaySeconds=0 + * compiler.hotcode.StressHotCodeCollector + */ + +package compiler.hotcode; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Random; + +import jdk.test.lib.compiler.InMemoryJavaCompiler; +import jdk.test.whitebox.WhiteBox; + +public class StressHotCodeCollector { + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + private static final double RUN_MILLIS = 60_000; + + private static TestMethod[] methods = new TestMethod[100]; + + private static byte[] num1; + private static byte[] num2; + + private static byte[] genNum(Random random, int digitCount) { + byte[] num = new byte[digitCount]; + int d; + do { + d = random.nextInt(10); + } while (d == 0); + + num[0] = (byte)d; + for (int i = 1; i < digitCount; ++i) { + num[i] = (byte)random.nextInt(10); + } + return num; + } + + private static void initNums() { + final long seed = 8374592837465123L; + Random random = new Random(seed); + + final int digitCount = 40; + num1 = genNum(random, digitCount); + num2 = genNum(random, digitCount); + } + + private static void generateCode() throws Exception { + byte[] result = new byte[num1.length + 1]; + + for (int i = 0; i < methods.length; i++) { + methods[i] = new TestMethod(); + } + } + + public static void main(String[] args) throws Exception { + + initNums(); + generateCode(); + + long start = System.currentTimeMillis(); + Random random = new Random(); + + while (System.currentTimeMillis() - start < RUN_MILLIS) { + for (TestMethod m : methods) { + if (random.nextInt(100) < 10) { + m.deoptimize(); + } + + byte[] result = new byte[num1.length + 1]; + m.invoke(num1, num2, result); + } + } + } + + private static final class TestMethod { + private static final String CLASS_NAME = "A"; + private static final String METHOD_TO_COMPILE = "sum"; + private static final String JAVA_CODE = """ + public class A { + + public static void sum(byte[] n1, byte[] n2, byte[] out) { + long start = System.currentTimeMillis(); + while (System.currentTimeMillis() - start < 100) {} + + final int digitCount = n1.length; + int carry = 0; + for (int i = digitCount - 1; i >= 0; --i) { + int sum = n1[i] + n2[i] + carry; + out[i] = (byte)(sum % 10); + carry = sum / 10; + } + if (carry != 0) { + for (int i = digitCount; i > 0; --i) { + out[i] = out[i - 1]; + } + out[0] = (byte)carry; + } + } + }"""; + + private static final byte[] BYTE_CODE; + + static { + BYTE_CODE = InMemoryJavaCompiler.compile(CLASS_NAME, JAVA_CODE); + } + + private final Method method; + + private static ClassLoader createClassLoaderFor() { + return new ClassLoader() { + @Override + public Class loadClass(String name) throws ClassNotFoundException { + if (!name.equals(CLASS_NAME)) { + return super.loadClass(name); + } + + return defineClass(name, BYTE_CODE, 0, BYTE_CODE.length); + } + }; + } + + public TestMethod() throws Exception { + var cl = createClassLoaderFor().loadClass(CLASS_NAME); + method = cl.getMethod(METHOD_TO_COMPILE, byte[].class, byte[].class, byte[].class); + WHITE_BOX.testSetDontInlineMethod(method, true); + } + + public void invoke(byte[] num1, byte[] num2, byte[] result) throws Exception { + method.invoke(null, num1, num2, result); + } + + public void deoptimize() { + WHITE_BOX.deoptimizeMethod(method); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorDoubleExpandShrink.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorDoubleExpandShrink.java index 91b7113ac14..2d6ca8222a4 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorDoubleExpandShrink.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorDoubleExpandShrink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,7 @@ public class TestVectorDoubleExpandShrink { } @Test - @IR(counts = {REINTERPRET_NODE, "2"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "2"}) public static void testB128toB64(MemorySegment input, MemorySegment output) { vectorDoubleExpandShrink(BSPEC128, BSPEC64, input, output); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorExpandShrink.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorExpandShrink.java index bd3a8f6c12d..92755b96acb 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorExpandShrink.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorExpandShrink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static compiler.vectorapi.reshape.utils.VectorReshapeHelper.*; */ public class TestVectorExpandShrink { @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toB128(MemorySegment input, MemorySegment output) { vectorExpandShrink(BSPEC64, BSPEC128, input, output); } @@ -71,7 +71,7 @@ public class TestVectorExpandShrink { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB128toB64(MemorySegment input, MemorySegment output) { vectorExpandShrink(BSPEC128, BSPEC64, input, output); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorRebracket.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorRebracket.java index 2143eb3b500..d3283e991a4 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorRebracket.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorRebracket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import static compiler.vectorapi.reshape.utils.VectorReshapeHelper.*; */ public class TestVectorRebracket { @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toS64(byte[] input, short[] output) { vectorRebracket(BSPEC64, SSPEC64, input, output); } @@ -52,7 +52,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toI64(byte[] input, int[] output) { vectorRebracket(BSPEC64, ISPEC64, input, output); } @@ -63,7 +63,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toL64(byte[] input, long[] output) { vectorRebracket(BSPEC64, LSPEC64, input, output); } @@ -74,7 +74,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toF64(byte[] input, float[] output) { vectorRebracket(BSPEC64, FSPEC64, input, output); } @@ -85,7 +85,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testB64toD64(byte[] input, double[] output) { vectorRebracket(BSPEC64, DSPEC64, input, output); } @@ -96,7 +96,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testS64toB64(short[] input, byte[] output) { vectorRebracket(SSPEC64, BSPEC64, input, output); } @@ -107,7 +107,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testS64toI64(short[] input, int[] output) { vectorRebracket(SSPEC64, ISPEC64, input, output); } @@ -118,7 +118,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testS64toL64(short[] input, long[] output) { vectorRebracket(SSPEC64, LSPEC64, input, output); } @@ -129,7 +129,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testS64toF64(short[] input, float[] output) { vectorRebracket(SSPEC64, FSPEC64, input, output); } @@ -140,7 +140,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testS64toD64(short[] input, double[] output) { vectorRebracket(SSPEC64, DSPEC64, input, output); } @@ -151,7 +151,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testI64toB64(int[] input, byte[] output) { vectorRebracket(ISPEC64, BSPEC64, input, output); } @@ -162,7 +162,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testI64toS64(int[] input, short[] output) { vectorRebracket(ISPEC64, SSPEC64, input, output); } @@ -173,7 +173,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testI64toL64(int[] input, long[] output) { vectorRebracket(ISPEC64, LSPEC64, input, output); } @@ -184,7 +184,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testI64toF64(int[] input, float[] output) { vectorRebracket(ISPEC64, FSPEC64, input, output); } @@ -195,7 +195,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testI64toD64(int[] input, double[] output) { vectorRebracket(ISPEC64, DSPEC64, input, output); } @@ -206,7 +206,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testL64toB64(long[] input, byte[] output) { vectorRebracket(LSPEC64, BSPEC64, input, output); } @@ -217,7 +217,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testL64toS64(long[] input, short[] output) { vectorRebracket(LSPEC64, SSPEC64, input, output); } @@ -228,7 +228,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testL64toI64(long[] input, int[] output) { vectorRebracket(LSPEC64, ISPEC64, input, output); } @@ -239,7 +239,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testL64toF64(long[] input, float[] output) { vectorRebracket(LSPEC64, FSPEC64, input, output); } @@ -250,7 +250,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testL64toD64(long[] input, double[] output) { vectorRebracket(LSPEC64, DSPEC64, input, output); } @@ -261,7 +261,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testF64toB64(float[] input, byte[] output) { vectorRebracket(FSPEC64, BSPEC64, input, output); } @@ -272,7 +272,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testF64toS64(float[] input, short[] output) { vectorRebracket(FSPEC64, SSPEC64, input, output); } @@ -283,7 +283,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testF64toI64(float[] input, int[] output) { vectorRebracket(FSPEC64, ISPEC64, input, output); } @@ -294,7 +294,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testF64toL64(float[] input, long[] output) { vectorRebracket(FSPEC64, LSPEC64, input, output); } @@ -305,7 +305,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testF64toD64(float[] input, double[] output) { vectorRebracket(FSPEC64, DSPEC64, input, output); } @@ -316,7 +316,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testD64toB64(double[] input, byte[] output) { vectorRebracket(DSPEC64, BSPEC64, input, output); } @@ -327,7 +327,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testD64toS64(double[] input, short[] output) { vectorRebracket(DSPEC64, SSPEC64, input, output); } @@ -338,7 +338,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testD64toI64(double[] input, int[] output) { vectorRebracket(DSPEC64, ISPEC64, input, output); } @@ -349,7 +349,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testD64toL64(double[] input, long[] output) { vectorRebracket(DSPEC64, LSPEC64, input, output); } @@ -360,7 +360,7 @@ public class TestVectorRebracket { } @Test - @IR(counts = {REINTERPRET_NODE, "1"}) + @IR(applyIfPlatformOr = {"x64", "true", "aarch64", "true", "riscv64", "true"}, counts = {REINTERPRET_NODE, "1"}) public static void testD64toF64(double[] input, float[] output) { vectorRebracket(DSPEC64, FSPEC64, input, output); } diff --git a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java index 1ebf6c21a70..a3880bc9f0e 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java @@ -38,7 +38,7 @@ import jdk.test.lib.process.OutputAnalyzer; * @requires vm.hasSA * @requires vm.gc != "Z" * @requires os.family == "linux" - * @requires os.arch == "amd64" + * @requires (os.arch == "amd64") | (os.arch == "aarch64") * @library /test/lib * @run driver TestJhsdbJstackMixedWithXComp */ @@ -49,7 +49,7 @@ import jdk.test.lib.process.OutputAnalyzer; * @requires vm.hasSA * @requires vm.gc != "Z" * @requires os.family == "linux" - * @requires os.arch == "amd64" + * @requires (os.arch == "amd64") | (os.arch == "aarch64") * @library /test/lib * @run driver TestJhsdbJstackMixedWithXComp -XX:+PreserveFramePointer */ @@ -60,7 +60,7 @@ import jdk.test.lib.process.OutputAnalyzer; * @requires vm.hasSA * @requires vm.gc != "Z" * @requires os.family == "linux" - * @requires os.arch == "amd64" + * @requires (os.arch == "amd64") | (os.arch == "aarch64") * @library /test/lib * @run driver TestJhsdbJstackMixedWithXComp -XX:-TieredCompilation */ diff --git a/test/jdk/java/net/httpclient/ALPNFailureTest.java b/test/jdk/java/net/httpclient/ALPNFailureTest.java index 3d6013f557c..dbffec82e28 100644 --- a/test/jdk/java/net/httpclient/ALPNFailureTest.java +++ b/test/jdk/java/net/httpclient/ALPNFailureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ * @modules java.net.http * java.logging * @build ALPNFailureTest - * @run main/othervm -Djdk.internal.httpclient.debug=true ALPNFailureTest HTTP_1_1 - * @run main/othervm ALPNFailureTest HTTP_2 + * @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} HTTP_1_1 + * @run main/othervm ${test.main.class} HTTP_2 */ import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; diff --git a/test/jdk/java/net/httpclient/ALPNProxyFailureTest.java b/test/jdk/java/net/httpclient/ALPNProxyFailureTest.java index 4dedfed97b1..bae8d55c8cc 100644 --- a/test/jdk/java/net/httpclient/ALPNProxyFailureTest.java +++ b/test/jdk/java/net/httpclient/ALPNProxyFailureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer * jdk.httpclient.test.lib.common.HttpServerAdapters * ALPNFailureTest ALPNProxyFailureTest - * @run main/othervm -Djdk.internal.httpclient.debug=true -Dtest.nolinger=true ALPNProxyFailureTest HTTP_1_1 - * @run main/othervm -Dtest.nolinger=true ALPNProxyFailureTest HTTP_2 + * @run main/othervm -Djdk.internal.httpclient.debug=true -Dtest.nolinger=true ${test.main.class} HTTP_1_1 + * @run main/othervm -Dtest.nolinger=true ${test.main.class} HTTP_2 */ import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; diff --git a/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java b/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java index fb67cf02566..df6c9902cf9 100644 --- a/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java +++ b/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java @@ -29,7 +29,7 @@ * ReferenceTracker AggregateRequestBodyTest * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,headers,frames - * AggregateRequestBodyTest + * ${test.main.class} * @summary Tests HttpRequest.BodyPublishers::concat */ diff --git a/test/jdk/java/net/httpclient/AltServiceUsageTest.java b/test/jdk/java/net/httpclient/AltServiceUsageTest.java index 59ad2179b90..dd6f9b065b7 100644 --- a/test/jdk/java/net/httpclient/AltServiceUsageTest.java +++ b/test/jdk/java/net/httpclient/AltServiceUsageTest.java @@ -56,7 +56,7 @@ import org.junit.jupiter.api.Test; * * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * AltServiceUsageTest + * ${test.main.class} */ public class AltServiceUsageTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/AsFileDownloadTest.java b/test/jdk/java/net/httpclient/AsFileDownloadTest.java index 6e9c4e676cf..fca920cb13c 100644 --- a/test/jdk/java/net/httpclient/AsFileDownloadTest.java +++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.java @@ -87,7 +87,7 @@ import org.junit.jupiter.params.provider.MethodSource; * jdk.test.lib.Platform jdk.test.lib.util.FileUtils * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run junit/othervm/timeout=480 AsFileDownloadTest + * @run junit/othervm/timeout=480 ${test.main.class} */ public class AsFileDownloadTest { diff --git a/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java b/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java index 308288bb9bf..ed2482e80b5 100644 --- a/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java +++ b/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java @@ -32,7 +32,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * AsyncExecutorShutdown + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/AsyncShutdownNow.java b/test/jdk/java/net/httpclient/AsyncShutdownNow.java index 7dc13cf08e2..39e13b782c9 100644 --- a/test/jdk/java/net/httpclient/AsyncShutdownNow.java +++ b/test/jdk/java/net/httpclient/AsyncShutdownNow.java @@ -34,7 +34,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * AsyncShutdownNow + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/AuthFilterCacheTest.java b/test/jdk/java/net/httpclient/AuthFilterCacheTest.java index 0d87055ff51..9fb231de858 100644 --- a/test/jdk/java/net/httpclient/AuthFilterCacheTest.java +++ b/test/jdk/java/net/httpclient/AuthFilterCacheTest.java @@ -67,7 +67,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @run junit/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=requests,headers,errors,quic * -Djdk.internal.httpclient.debug=false - * AuthFilterCacheTest + * ${test.main.class} */ public class AuthFilterCacheTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/AuthSchemesTest.java b/test/jdk/java/net/httpclient/AuthSchemesTest.java index 8e0231c8eaf..128cae0ed20 100644 --- a/test/jdk/java/net/httpclient/AuthSchemesTest.java +++ b/test/jdk/java/net/httpclient/AuthSchemesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8217237 * @library /test/lib * @modules java.net.http - * @run main/othervm AuthSchemesTest + * @run main/othervm ${test.main.class} * @summary HttpClient does not deal well with multi-valued WWW-Authenticate challenge headers */ diff --git a/test/jdk/java/net/httpclient/BasicAuthTest.java b/test/jdk/java/net/httpclient/BasicAuthTest.java index fc1f1d4e5aa..f9458fff6a6 100644 --- a/test/jdk/java/net/httpclient/BasicAuthTest.java +++ b/test/jdk/java/net/httpclient/BasicAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8087112 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext - * @run main/othervm BasicAuthTest + * @run main/othervm ${test.main.class} * @summary Basic Authentication Test */ diff --git a/test/jdk/java/net/httpclient/BasicHTTP2Test.java b/test/jdk/java/net/httpclient/BasicHTTP2Test.java index 4175aceea3d..6f53dd1081c 100644 --- a/test/jdk/java/net/httpclient/BasicHTTP2Test.java +++ b/test/jdk/java/net/httpclient/BasicHTTP2Test.java @@ -29,7 +29,7 @@ * ReferenceTracker * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * BasicHTTP2Test + * ${test.main.class} * @summary Basic HTTP/2 test when HTTP/3 is requested */ diff --git a/test/jdk/java/net/httpclient/BasicHTTP3Test.java b/test/jdk/java/net/httpclient/BasicHTTP3Test.java index aec21e421f9..b3764016818 100644 --- a/test/jdk/java/net/httpclient/BasicHTTP3Test.java +++ b/test/jdk/java/net/httpclient/BasicHTTP3Test.java @@ -76,7 +76,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djavax.net.debug=all - * BasicHTTP3Test + * ${test.main.class} * @summary Basic HTTP/3 test */ public class BasicHTTP3Test implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/BasicRedirectTest.java b/test/jdk/java/net/httpclient/BasicRedirectTest.java index d873a64bb1b..44e3cadd8cd 100644 --- a/test/jdk/java/net/httpclient/BasicRedirectTest.java +++ b/test/jdk/java/net/httpclient/BasicRedirectTest.java @@ -29,7 +29,7 @@ * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests * -Djdk.internal.httpclient.debug=true - * BasicRedirectTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/BodyProcessorInputStreamTest.java b/test/jdk/java/net/httpclient/BodyProcessorInputStreamTest.java index 1f316c2a64d..c82910cc76b 100644 --- a/test/jdk/java/net/httpclient/BodyProcessorInputStreamTest.java +++ b/test/jdk/java/net/httpclient/BodyProcessorInputStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import static java.lang.System.err; * @test * @bug 8187503 * @summary An example on how to read a response body with InputStream. - * @run main/othervm/manual -Dtest.debug=true BodyProcessorInputStreamTest + * @run main/othervm/manual -Dtest.debug=true ${test.main.class} * @author daniel fuchs */ public class BodyProcessorInputStreamTest { diff --git a/test/jdk/java/net/httpclient/BodySubscribersTest.java b/test/jdk/java/net/httpclient/BodySubscribersTest.java index abd86693b83..f27642a47a6 100644 --- a/test/jdk/java/net/httpclient/BodySubscribersTest.java +++ b/test/jdk/java/net/httpclient/BodySubscribersTest.java @@ -25,7 +25,7 @@ * @test * @summary Basic test for the standard BodySubscribers default behavior * @bug 8225583 8334028 - * @run junit BodySubscribersTest + * @run junit ${test.main.class} */ import java.net.http.HttpResponse.BodySubscriber; diff --git a/test/jdk/java/net/httpclient/BufferSize1Test.java b/test/jdk/java/net/httpclient/BufferSize1Test.java index e4f2b998cc7..2d7f34f315a 100644 --- a/test/jdk/java/net/httpclient/BufferSize1Test.java +++ b/test/jdk/java/net/httpclient/BufferSize1Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * to its lowest possible value, 1, does not wedge the client * @library /test/jdk/java/net/httpclient/lib * /test/lib - * @run junit/othervm -Djdk.httpclient.bufsize=1 BufferSize1Test + * @run junit/othervm -Djdk.httpclient.bufsize=1 ${test.main.class} */ class BufferSize1Test implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/BufferSizePropertyClampTest.java b/test/jdk/java/net/httpclient/BufferSizePropertyClampTest.java index d9695dce3cb..f5f77bb4778 100644 --- a/test/jdk/java/net/httpclient/BufferSizePropertyClampTest.java +++ b/test/jdk/java/net/httpclient/BufferSizePropertyClampTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,15 +49,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors * -Djdk.httpclient.bufsize=-1 - * BufferSizePropertyClampTest + * ${test.main.class} * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors * -Djdk.httpclient.bufsize=0 - * BufferSizePropertyClampTest + * ${test.main.class} * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors * -Djdk.httpclient.bufsize=16385 - * BufferSizePropertyClampTest + * ${test.main.class} */ class BufferSizePropertyClampTest { diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java index 4d73ec31280..dbcfae4d476 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java @@ -46,7 +46,7 @@ import org.junit.jupiter.params.provider.MethodSource; /* * @test * @summary Direct test for HttpResponse.BodySubscriber.buffering() cancellation - * @run junit/othervm BufferingSubscriberCancelTest + * @run junit/othervm ${test.main.class} */ public class BufferingSubscriberCancelTest { diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java index 255946232be..5895df7d3dc 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java @@ -44,7 +44,7 @@ import org.junit.jupiter.params.provider.MethodSource; /* * @test * @summary Test for HttpResponse.BodySubscriber.buffering() onError/onComplete - * @run junit/othervm BufferingSubscriberErrorCompleteTest + * @run junit/othervm ${test.main.class} */ public class BufferingSubscriberErrorCompleteTest { diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberTest.java index bb33b18ed9c..7957c7ab6ae 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberTest.java @@ -55,7 +55,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @key randomness * @library /test/lib * @build jdk.test.lib.RandomFactory - * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.debug=true BufferingSubscriberTest + * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class BufferingSubscriberTest { diff --git a/test/jdk/java/net/httpclient/ByteArrayPublishers.java b/test/jdk/java/net/httpclient/ByteArrayPublishers.java index 114ebcd18a5..b42c2c4613e 100644 --- a/test/jdk/java/net/httpclient/ByteArrayPublishers.java +++ b/test/jdk/java/net/httpclient/ByteArrayPublishers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @bug 8222968 * @summary ByteArrayPublisher is not thread-safe resulting in broken re-use of HttpRequests - * @run main/othervm -Dsun.net.httpserver.idleInterval=50000 ByteArrayPublishers + * @run main/othervm -Dsun.net.httpserver.idleInterval=50000 ${test.main.class} */ import java.net.InetAddress; diff --git a/test/jdk/java/net/httpclient/CancelRequestTest.java b/test/jdk/java/net/httpclient/CancelRequestTest.java index dcb60a55061..f21d13d5e98 100644 --- a/test/jdk/java/net/httpclient/CancelRequestTest.java +++ b/test/jdk/java/net/httpclient/CancelRequestTest.java @@ -31,7 +31,7 @@ * ReferenceTracker CancelRequestTest * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * CancelRequestTest + * ${test.main.class} */ // * -Dseed=3582896013206826205L // * -Dseed=5784221742235559231L diff --git a/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java b/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java index 48f23ebf370..000602d3c0c 100644 --- a/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java +++ b/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java @@ -30,7 +30,7 @@ * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * ReferenceTracker CancelStreamedBodyTest * @run junit/othervm -Djdk.internal.httpclient.debug=true - * CancelStreamedBodyTest + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java b/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java index 33df36100ad..5b4d2bff1c2 100644 --- a/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java +++ b/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java @@ -29,7 +29,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm/timeout=40 -Djdk.internal.httpclient.debug=false -Djdk.httpclient.HttpClient.log=trace,errors,headers - * CancelledPartialResponseTest + * ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/CancelledResponse.java b/test/jdk/java/net/httpclient/CancelledResponse.java index 5449a68418a..d1ead0abad6 100644 --- a/test/jdk/java/net/httpclient/CancelledResponse.java +++ b/test/jdk/java/net/httpclient/CancelledResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * 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,8 +61,8 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; * @modules java.net.http/jdk.internal.net.http.common * @build jdk.test.lib.net.SimpleSSLContext * @build MockServer ReferenceTracker - * @run main/othervm/timeout=480 CancelledResponse - * @run main/othervm/timeout=480 CancelledResponse SSL + * @run main/othervm/timeout=480 ${test.main.class} + * @run main/othervm/timeout=480 ${test.main.class} SSL */ /** diff --git a/test/jdk/java/net/httpclient/CancelledResponse2.java b/test/jdk/java/net/httpclient/CancelledResponse2.java index 6604fadea20..d08fd027bb5 100644 --- a/test/jdk/java/net/httpclient/CancelledResponse2.java +++ b/test/jdk/java/net/httpclient/CancelledResponse2.java @@ -66,7 +66,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * @compile ReferenceTracker.java - * @run junit/othervm -Djdk.internal.httpclient.debug=true CancelledResponse2 + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ // -Djdk.internal.httpclient.debug=true public class CancelledResponse2 implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/ConcurrentResponses.java b/test/jdk/java/net/httpclient/ConcurrentResponses.java index 53c85b8e383..e1f48e1251b 100644 --- a/test/jdk/java/net/httpclient/ConcurrentResponses.java +++ b/test/jdk/java/net/httpclient/ConcurrentResponses.java @@ -31,7 +31,7 @@ * jdk.httpclient.test.lib.common.TestServerConfigurator * @run junit/othervm * -Djdk.internal.httpclient.debug=true - * ConcurrentResponses + * ${test.main.class} */ //* -Djdk.internal.httpclient.HttpClient.log=all diff --git a/test/jdk/java/net/httpclient/ConnectExceptionTest.java b/test/jdk/java/net/httpclient/ConnectExceptionTest.java index 0745e2af934..22ba26c3ac8 100644 --- a/test/jdk/java/net/httpclient/ConnectExceptionTest.java +++ b/test/jdk/java/net/httpclient/ConnectExceptionTest.java @@ -25,7 +25,7 @@ * @test * @summary Expect ConnectException for all non-security related connect errors * @bug 8204864 - * @run junit/othervm -Djdk.net.hosts.file=HostFileDoesNotExist ConnectExceptionTest + * @run junit/othervm -Djdk.net.hosts.file=HostFileDoesNotExist ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java index e1f4aee1d51..d91c73f97a1 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java +++ b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java @@ -33,7 +33,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @bug 8208391 * @library /test/lib * @build AbstractConnectTimeoutHandshake - * @run junit/othervm ConnectTimeoutHandshakeAsync + * @run junit/othervm ${test.main.class} */ public class ConnectTimeoutHandshakeAsync diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java index eb571b2d16c..fac007df8ad 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java +++ b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java @@ -33,7 +33,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @bug 8208391 * @library /test/lib * @build AbstractConnectTimeoutHandshake - * @run junit/othervm ConnectTimeoutHandshakeSync + * @run junit/othervm ${test.main.class} */ public class ConnectTimeoutHandshakeSync diff --git a/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java b/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java index 01c166dcb1b..c90ba1ffdf3 100644 --- a/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java +++ b/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java @@ -33,7 +33,7 @@ * @run junit/othervm * -Djdk.httpclient.allowRestrictedHeaders=content-length * -Djdk.internal.httpclient.debug=true - * ContentLengthHeaderTest + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/CookieHeaderTest.java b/test/jdk/java/net/httpclient/CookieHeaderTest.java index 62e62680e03..74faf8ec801 100644 --- a/test/jdk/java/net/httpclient/CookieHeaderTest.java +++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java @@ -30,7 +30,7 @@ * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * CookieHeaderTest + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/CustomRequestPublisher.java b/test/jdk/java/net/httpclient/CustomRequestPublisher.java index c8d22419852..58acfc4feac 100644 --- a/test/jdk/java/net/httpclient/CustomRequestPublisher.java +++ b/test/jdk/java/net/httpclient/CustomRequestPublisher.java @@ -26,7 +26,7 @@ * @summary Checks correct handling of Publishers that call onComplete without demand * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm CustomRequestPublisher + * @run junit/othervm ${test.main.class} */ import java.net.InetAddress; diff --git a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java index b2695271035..ef5d0a30552 100644 --- a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java +++ b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java @@ -27,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run junit/othervm CustomResponseSubscriber + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/DebugLoggerTest.java b/test/jdk/java/net/httpclient/DebugLoggerTest.java index 8d81e5cbe69..a5d16e65993 100644 --- a/test/jdk/java/net/httpclient/DebugLoggerTest.java +++ b/test/jdk/java/net/httpclient/DebugLoggerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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,17 +52,17 @@ import static java.nio.charset.StandardCharsets.UTF_8; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DebugLoggerTest - * @run main/othervm DebugLoggerTest - * @run main/othervm -Djdk.internal.httpclient.debug=errr DebugLoggerTest - * @run main/othervm -Djdk.internal.httpclient.debug=err DebugLoggerTest ERR - * @run main/othervm -Djdk.internal.httpclient.debug=out DebugLoggerTest OUT - * @run main/othervm -Djdk.internal.httpclient.debug=log DebugLoggerTest LOG - * @run main/othervm -Djdk.internal.httpclient.debug=true DebugLoggerTest ERR LOG - * @run main/othervm -Djdk.internal.httpclient.debug=err,OUT DebugLoggerTest ERR OUT - * @run main/othervm -Djdk.internal.httpclient.debug=err,out,log DebugLoggerTest ERR OUT LOG - * @run main/othervm -Djdk.internal.httpclient.debug=true,log DebugLoggerTest ERR LOG - * @run main/othervm -Djdk.internal.httpclient.debug=true,out DebugLoggerTest ERR OUT LOG - * @run main/othervm -Djdk.internal.httpclient.debug=err,OUT,foo DebugLoggerTest ERR OUT + * @run main/othervm ${test.main.class} + * @run main/othervm -Djdk.internal.httpclient.debug=errr ${test.main.class} + * @run main/othervm -Djdk.internal.httpclient.debug=err ${test.main.class} ERR + * @run main/othervm -Djdk.internal.httpclient.debug=out ${test.main.class} OUT + * @run main/othervm -Djdk.internal.httpclient.debug=log ${test.main.class} LOG + * @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} ERR LOG + * @run main/othervm -Djdk.internal.httpclient.debug=err,OUT ${test.main.class} ERR OUT + * @run main/othervm -Djdk.internal.httpclient.debug=err,out,log ${test.main.class} ERR OUT LOG + * @run main/othervm -Djdk.internal.httpclient.debug=true,log ${test.main.class} ERR LOG + * @run main/othervm -Djdk.internal.httpclient.debug=true,out ${test.main.class} ERR OUT LOG + * @run main/othervm -Djdk.internal.httpclient.debug=err,OUT,foo ${test.main.class} ERR OUT */ public class DebugLoggerTest { static final PrintStream stdErr = System.err; diff --git a/test/jdk/java/net/httpclient/DependentActionsTest.java b/test/jdk/java/net/httpclient/DependentActionsTest.java index fcfbb393e5a..571e124ca5d 100644 --- a/test/jdk/java/net/httpclient/DependentActionsTest.java +++ b/test/jdk/java/net/httpclient/DependentActionsTest.java @@ -31,7 +31,7 @@ * DependentActionsTest * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.quic.maxPtoBackoff=9 - * DependentActionsTest + * ${test.main.class} */ import java.io.BufferedReader; diff --git a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java index e045f4e22f1..42d2b509c1b 100644 --- a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java +++ b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java @@ -29,7 +29,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DependentPromiseActionsTest - * @run junit/othervm -Djdk.internal.httpclient.debug=true DependentPromiseActionsTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import java.io.BufferedReader; diff --git a/test/jdk/java/net/httpclient/DigestEchoClient.java b/test/jdk/java/net/httpclient/DigestEchoClient.java index 6df4ccac9fb..6fbffab95ea 100644 --- a/test/jdk/java/net/httpclient/DigestEchoClient.java +++ b/test/jdk/java/net/httpclient/DigestEchoClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,10 +72,10 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DigestEchoServer ReferenceTracker DigestEchoClient - * @run main/othervm DigestEchoClient + * @run main/othervm ${test.main.class} * @run main/othervm -Djdk.http.auth.proxying.disabledSchemes= * -Djdk.http.auth.tunneling.disabledSchemes= - * DigestEchoClient + * ${test.main.class} */ public class DigestEchoClient { diff --git a/test/jdk/java/net/httpclient/DigestEchoClientSSL.java b/test/jdk/java/net/httpclient/DigestEchoClientSSL.java index ecf043f58c8..25dfaf71fc0 100644 --- a/test/jdk/java/net/httpclient/DigestEchoClientSSL.java +++ b/test/jdk/java/net/httpclient/DigestEchoClientSSL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,17 +33,17 @@ * @run main/othervm/timeout=300 * -Djdk.internal.httpclient.debug=err * -Djdk.httpclient.HttpClient.log=headers - * DigestEchoClientSSL SSL SERVER307 + * ${test.main.class} SSL SERVER307 * @run main/othervm/timeout=300 * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.httpclient.HttpClient.log=headers - * DigestEchoClientSSL SSL SERVER PROXY + * ${test.main.class} SSL SERVER PROXY * @run main/othervm/timeout=300 * -Djdk.http.auth.proxying.disabledSchemes= * -Djdk.http.auth.tunneling.disabledSchemes= * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.httpclient.HttpClient.log=headers - * DigestEchoClientSSL SSL PROXY + * ${test.main.class} SSL PROXY * */ diff --git a/test/jdk/java/net/httpclient/DurationOverflowTest.java b/test/jdk/java/net/httpclient/DurationOverflowTest.java index 1beb31f74e5..12a852262a6 100644 --- a/test/jdk/java/net/httpclient/DurationOverflowTest.java +++ b/test/jdk/java/net/httpclient/DurationOverflowTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ import static jdk.httpclient.test.lib.common.HttpServerAdapters.createClientBuil * @library /test/jdk/java/net/httpclient/lib * /test/lib * - * @run junit DurationOverflowTest + * @run junit ${test.main.class} */ /* @@ -81,19 +81,19 @@ import static jdk.httpclient.test.lib.common.HttpServerAdapters.createClientBuil * * @run junit/othervm * -Djdk.httpclient.keepalive.timeout=9223372036854775807 - * DurationOverflowTest + * ${test.main.class} * * @comment `h3` infra is also enabled for this test since `j.h.k.timeout.h3` * defaults to `j.h.k.timeout.h2` * @run junit/othervm * -Djdk.httpclient.keepalive.timeout.h2=9223372036854775807 * -DallowedInfras=h2,h2s,h3 - * DurationOverflowTest + * ${test.main.class} * * @run junit/othervm * -Djdk.httpclient.keepalive.timeout.h3=9223372036854775807 * -DallowedInfras=h3 - * DurationOverflowTest + * ${test.main.class} */ public class DurationOverflowTest { diff --git a/test/jdk/java/net/httpclient/EmptyAuthenticate.java b/test/jdk/java/net/httpclient/EmptyAuthenticate.java index 81bbbf3ca5b..4da5592fb85 100644 --- a/test/jdk/java/net/httpclient/EmptyAuthenticate.java +++ b/test/jdk/java/net/httpclient/EmptyAuthenticate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * /test/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit EmptyAuthenticate + * @run junit ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/EncodedCharsInURI.java b/test/jdk/java/net/httpclient/EncodedCharsInURI.java index 19b0a1d651b..3c8483a4c6d 100644 --- a/test/jdk/java/net/httpclient/EncodedCharsInURI.java +++ b/test/jdk/java/net/httpclient/EncodedCharsInURI.java @@ -32,7 +32,7 @@ * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.internal.httpclient.debug=true - * -Djdk.httpclient.HttpClient.log=headers,errors EncodedCharsInURI + * -Djdk.httpclient.HttpClient.log=headers,errors ${test.main.class} */ //* -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java index 6ef71b7d22d..406f82501b1 100644 --- a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java +++ b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java @@ -29,7 +29,7 @@ * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * @run junit/othervm * -Djdk.httpclient.HttpClient.log=reqeusts,headers - * EscapedOctetsInURI + * ${test.main.class} */ import java.io.Closeable; diff --git a/test/jdk/java/net/httpclient/ExecutorShutdown.java b/test/jdk/java/net/httpclient/ExecutorShutdown.java index a46ea66f3ae..d12a9f3e5d7 100644 --- a/test/jdk/java/net/httpclient/ExecutorShutdown.java +++ b/test/jdk/java/net/httpclient/ExecutorShutdown.java @@ -32,7 +32,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * ExecutorShutdown + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/ExpectContinue.java b/test/jdk/java/net/httpclient/ExpectContinue.java index e9ae894f3e1..656a887002f 100644 --- a/test/jdk/java/net/httpclient/ExpectContinue.java +++ b/test/jdk/java/net/httpclient/ExpectContinue.java @@ -28,7 +28,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver - * @run junit/othervm ExpectContinue + * @run junit/othervm ${test.main.class} */ import com.sun.net.httpserver.HttpExchange; diff --git a/test/jdk/java/net/httpclient/ExpectContinueTest.java b/test/jdk/java/net/httpclient/ExpectContinueTest.java index 56fa363870a..0233ffb069c 100644 --- a/test/jdk/java/net/httpclient/ExpectContinueTest.java +++ b/test/jdk/java/net/httpclient/ExpectContinueTest.java @@ -27,7 +27,7 @@ * @bug 8286171 8307648 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=errors ExpectContinueTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=errors ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/FilePublisherTest.java b/test/jdk/java/net/httpclient/FilePublisherTest.java index 292f770fc30..dafb6e593b2 100644 --- a/test/jdk/java/net/httpclient/FilePublisherTest.java +++ b/test/jdk/java/net/httpclient/FilePublisherTest.java @@ -29,7 +29,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm FilePublisherTest + * @run junit/othervm ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java index 7fd3061aa3c..31dd6d560de 100644 --- a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java +++ b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java @@ -64,7 +64,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=err FlowAdapterPublisherTest + * @run junit/othervm -Djdk.internal.httpclient.debug=err ${test.main.class} */ public class FlowAdapterPublisherTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java index 32003023d7f..e85a752940c 100644 --- a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java +++ b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java @@ -74,7 +74,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true FlowAdapterSubscriberTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class FlowAdapterSubscriberTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/ForbiddenHeadTest.java b/test/jdk/java/net/httpclient/ForbiddenHeadTest.java index f2011766b2b..0a6824d289d 100644 --- a/test/jdk/java/net/httpclient/ForbiddenHeadTest.java +++ b/test/jdk/java/net/httpclient/ForbiddenHeadTest.java @@ -32,7 +32,7 @@ * -Djdk.http.auth.tunneling.disabledSchemes * -Djdk.httpclient.HttpClient.log=headers,requests * -Djdk.internal.httpclient.debug=true - * ForbiddenHeadTest + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/GZIPInputStreamTest.java b/test/jdk/java/net/httpclient/GZIPInputStreamTest.java index 1cbb24d81ce..8e34f100524 100644 --- a/test/jdk/java/net/httpclient/GZIPInputStreamTest.java +++ b/test/jdk/java/net/httpclient/GZIPInputStreamTest.java @@ -27,7 +27,7 @@ * @summary Tests that you can map an InputStream to a GZIPInputStream * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters ReferenceTracker - * @run junit/othervm GZIPInputStreamTest + * @run junit/othervm ${test.main.class} */ import com.sun.net.httpserver.HttpServer; diff --git a/test/jdk/java/net/httpclient/HandshakeFailureTest.java b/test/jdk/java/net/httpclient/HandshakeFailureTest.java index e07dfacbd85..e9e23753ed3 100644 --- a/test/jdk/java/net/httpclient/HandshakeFailureTest.java +++ b/test/jdk/java/net/httpclient/HandshakeFailureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,15 +50,15 @@ import javax.net.ssl.SSLSocket; /** * @test * @bug 8238990 8258951 - * @run main/othervm -Djdk.internal.httpclient.debug=true HandshakeFailureTest TLSv1.2 - * @run main/othervm -Djdk.internal.httpclient.debug=true HandshakeFailureTest TLSv1.3 + * @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} TLSv1.2 + * @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} TLSv1.3 * @summary Verify SSLHandshakeException is received when the handshake fails, * either because the server closes (EOF) the connection during handshaking, * or no cipher suite can be negotiated (TLSv1.2) or no available authentication * scheme (TLSv1.3). */ // To switch on debugging use: -// @run main/othervm -Djdk.internal.httpclient.debug=true HandshakeFailureTest +// @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} public class HandshakeFailureTest { // The number of iterations each testXXXClient performs. Can be increased diff --git a/test/jdk/java/net/httpclient/HeadTest.java b/test/jdk/java/net/httpclient/HeadTest.java index 3a52cd101b8..c0bef240520 100644 --- a/test/jdk/java/net/httpclient/HeadTest.java +++ b/test/jdk/java/net/httpclient/HeadTest.java @@ -27,7 +27,7 @@ * @summary Tests Client handles HEAD and 304 responses correctly. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.httpclient.HttpClient.log=trace,headers,requests HeadTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=trace,headers,requests ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java b/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java index 00a709a3387..b082f59dd23 100644 --- a/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java +++ b/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java @@ -60,7 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true HeadersLowerCaseTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class HeadersLowerCaseTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/HeadersTest1.java b/test/jdk/java/net/httpclient/HeadersTest1.java index 26733c1c928..220978b419c 100644 --- a/test/jdk/java/net/httpclient/HeadersTest1.java +++ b/test/jdk/java/net/httpclient/HeadersTest1.java @@ -26,7 +26,7 @@ * @bug 8153142 8195138 * @modules java.net.http * jdk.httpserver - * @run junit/othervm HeadersTest1 + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/Http1ChunkedTest.java b/test/jdk/java/net/httpclient/Http1ChunkedTest.java index f51ccf9fd38..23bcc541a18 100644 --- a/test/jdk/java/net/httpclient/Http1ChunkedTest.java +++ b/test/jdk/java/net/httpclient/Http1ChunkedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import java.util.concurrent.CompletableFuture; * @bug 8243246 * @summary Verifies that the HttpClient can accept extensions after * chunk length in a chunked response. - * @run main/othervm Http1ChunkedTest + * @run main/othervm ${test.main.class} */ public class Http1ChunkedTest { diff --git a/test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java b/test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java index 4cfee56e855..7a220c77fda 100644 --- a/test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java +++ b/test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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,10 +28,10 @@ * @summary Auth retry limit system property * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer - * @run junit HttpClientAuthRetryLimitTest - * @run junit/othervm -Djdk.httpclient.auth.retrylimit=1 HttpClientAuthRetryLimitTest - * @run junit/othervm -Djdk.httpclient.auth.retrylimit=0 HttpClientAuthRetryLimitTest - * @run junit/othervm -Djdk.httpclient.auth.retrylimit=-1 HttpClientAuthRetryLimitTest + * @run junit ${test.main.class} + * @run junit/othervm -Djdk.httpclient.auth.retrylimit=1 ${test.main.class} + * @run junit/othervm -Djdk.httpclient.auth.retrylimit=0 ${test.main.class} + * @run junit/othervm -Djdk.httpclient.auth.retrylimit=-1 ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java index a5fb1a39e66..7e5db68b8d3 100644 --- a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java @@ -62,7 +62,7 @@ import org.junit.jupiter.api.Test; * @summary HttpClient[.Builder] API and behaviour checks * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run junit HttpClientBuilderTest + * @run junit ${test.main.class} */ public class HttpClientBuilderTest { diff --git a/test/jdk/java/net/httpclient/HttpClientClose.java b/test/jdk/java/net/httpclient/HttpClientClose.java index 0a3fc03424a..aa1f399ba30 100644 --- a/test/jdk/java/net/httpclient/HttpClientClose.java +++ b/test/jdk/java/net/httpclient/HttpClientClose.java @@ -34,7 +34,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * HttpClientClose + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/HttpClientExceptionTest.java b/test/jdk/java/net/httpclient/HttpClientExceptionTest.java index dff7219c0c8..dc9f34868bd 100644 --- a/test/jdk/java/net/httpclient/HttpClientExceptionTest.java +++ b/test/jdk/java/net/httpclient/HttpClientExceptionTest.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test; * @summary The test checks if UncheckedIOException is thrown * @build HttpClientExceptionTest * @run junit/othervm -Djava.nio.channels.spi.SelectorProvider=HttpClientExceptionTest$CustomSelectorProvider - * HttpClientExceptionTest + * ${test.main.class} */ public class HttpClientExceptionTest { diff --git a/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java b/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java index f1e8aecbaa4..a98f180d082 100644 --- a/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java +++ b/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java @@ -65,7 +65,7 @@ import org.junit.jupiter.params.provider.MethodSource; * -Djdk.httpclient.HttpClient.log=frames,ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true * -Dsun.net.httpserver.idleInterval=50000 - * HttpClientLocalAddrTest + * ${test.main.class} * */ public class HttpClientLocalAddrTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/HttpClientSNITest.java b/test/jdk/java/net/httpclient/HttpClientSNITest.java index 1f7377f745d..08f725b0c52 100644 --- a/test/jdk/java/net/httpclient/HttpClientSNITest.java +++ b/test/jdk/java/net/httpclient/HttpClientSNITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.net.URIBuilder - * @run junit HttpClientSNITest + * @run junit ${test.main.class} */ public class HttpClientSNITest { private static final String RESP_BODY_TEXT = "hello world"; diff --git a/test/jdk/java/net/httpclient/HttpClientSendAsyncExceptionTest.java b/test/jdk/java/net/httpclient/HttpClientSendAsyncExceptionTest.java index f4a1f3cca82..27562ea2277 100644 --- a/test/jdk/java/net/httpclient/HttpClientSendAsyncExceptionTest.java +++ b/test/jdk/java/net/httpclient/HttpClientSendAsyncExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @bug 8368249 * @summary Verifies exceptions thrown by `HttpClient::sendAsync` * @library /test/jdk/java/net/httpclient/lib /test/lib - * @run junit HttpClientSendAsyncExceptionTest + * @run junit ${test.main.class} */ class HttpClientSendAsyncExceptionTest { diff --git a/test/jdk/java/net/httpclient/HttpClientShutdown.java b/test/jdk/java/net/httpclient/HttpClientShutdown.java index 8532146c1e2..36057a025db 100644 --- a/test/jdk/java/net/httpclient/HttpClientShutdown.java +++ b/test/jdk/java/net/httpclient/HttpClientShutdown.java @@ -35,7 +35,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * HttpClientShutdown + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/HttpGetInCancelledFuture.java b/test/jdk/java/net/httpclient/HttpGetInCancelledFuture.java index 80e49f20705..9ea47757402 100644 --- a/test/jdk/java/net/httpclient/HttpGetInCancelledFuture.java +++ b/test/jdk/java/net/httpclient/HttpGetInCancelledFuture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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,9 +74,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build HttpGetInCancelledFuture ReferenceTracker * @run junit/othervm -DuseReferenceTracker=false - * HttpGetInCancelledFuture + * ${test.main.class} * @run junit/othervm -DuseReferenceTracker=true - * HttpGetInCancelledFuture + * ${test.main.class} * @summary This test verifies that cancelling a future that * does an HTTP request using the HttpClient doesn't cause * HttpClient::close to block forever. diff --git a/test/jdk/java/net/httpclient/HttpHeadersOf.java b/test/jdk/java/net/httpclient/HttpHeadersOf.java index 77a800b7cf2..fbddcf3e4be 100644 --- a/test/jdk/java/net/httpclient/HttpHeadersOf.java +++ b/test/jdk/java/net/httpclient/HttpHeadersOf.java @@ -24,7 +24,7 @@ /* * @test * @summary Tests for HttpHeaders.of factory method - * @run junit HttpHeadersOf + * @run junit ${test.main.class} */ import java.net.http.HttpHeaders; diff --git a/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java b/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java index 99897a69a8c..395cb50d058 100644 --- a/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java +++ b/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java @@ -26,7 +26,7 @@ * @bug 8306040 * @summary HttpResponseInputStream.available() returns 1 on empty stream * @library /test/lib /test/jdk/java/net/httpclient/lib - * @run junit/othervm HttpInputStreamAvailableTest + * @run junit/othervm ${test.main.class} * */ import com.sun.net.httpserver.HttpExchange; diff --git a/test/jdk/java/net/httpclient/HttpInputStreamTest.java b/test/jdk/java/net/httpclient/HttpInputStreamTest.java index 2eb7899e1f0..1e04f592f31 100644 --- a/test/jdk/java/net/httpclient/HttpInputStreamTest.java +++ b/test/jdk/java/net/httpclient/HttpInputStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ import static java.lang.System.err; /* * @test * @summary An example on how to read a response body with InputStream. - * @run main/othervm/manual -Dtest.debug=true HttpInputStreamTest + * @run main/othervm/manual -Dtest.debug=true ${test.main.class} * @author daniel fuchs */ public class HttpInputStreamTest { diff --git a/test/jdk/java/net/httpclient/HttpRedirectTest.java b/test/jdk/java/net/httpclient/HttpRedirectTest.java index 2bf90bbe02c..d611a82967b 100644 --- a/test/jdk/java/net/httpclient/HttpRedirectTest.java +++ b/test/jdk/java/net/httpclient/HttpRedirectTest.java @@ -76,7 +76,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @run junit/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=false - * HttpRedirectTest + * ${test.main.class} * */ public class HttpRedirectTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java b/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java index 10784f7dbee..c12dd91e104 100644 --- a/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java +++ b/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java @@ -52,10 +52,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; * RecordingSubscriber * ReplayTestSupport * - * @run junit OfByteArraysTest + * @run junit ${test.main.class} * * @comment Using `main/othervm` to initiate tests that depend on a custom-configured JVM - * @run main/othervm -Xmx64m OfByteArraysTest testOOM + * @run main/othervm -Xmx64m ${test.main.class} testOOM */ public class OfByteArraysTest extends ReplayTestSupport { diff --git a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java index 19afbfbd99b..1558711d741 100644 --- a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java @@ -58,7 +58,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @test * @bug 8252304 8276559 * @summary HttpRequest.newBuilder(HttpRequest) API and behaviour checks -* @run junit/othervm HttpRequestNewBuilderTest +* @run junit/othervm ${test.main.class} */ public class HttpRequestNewBuilderTest { static final Class NPE = NullPointerException.class; diff --git a/test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java b/test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java index 29c4bcc8072..034144841a1 100644 --- a/test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseConnectionLabelTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ * @comment Use a higher idle timeout to increase the chances of * the same connection being used for sequential HTTP requests * @run junit/othervm -Djdk.httpclient.keepalive.timeout=120 - * HttpResponseConnectionLabelTest + * ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java b/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java index 3b955b8feb7..95f554b64e6 100644 --- a/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java @@ -25,7 +25,7 @@ * @test * @bug 8294047 * @library /test/lib - * @run junit HttpResponseInputStreamInterruptTest + * @run junit ${test.main.class} */ import com.sun.net.httpserver.HttpExchange; diff --git a/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java b/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java index 633c6877716..f7f9b38b7fc 100644 --- a/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java @@ -45,7 +45,7 @@ import org.junit.jupiter.api.Test; * @test * @bug 8197564 8228970 * @summary Simple smoke test for BodySubscriber.asInputStream(); - * @run junit/othervm HttpResponseInputStreamTest + * @run junit/othervm ${test.main.class} * @author daniel fuchs */ public class HttpResponseInputStreamTest { diff --git a/test/jdk/java/net/httpclient/HttpResponseLimitingTest.java b/test/jdk/java/net/httpclient/HttpResponseLimitingTest.java index 450fce35f54..c3471c7ccc0 100644 --- a/test/jdk/java/net/httpclient/HttpResponseLimitingTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseLimitingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.RandomFactory * jdk.test.lib.net.SimpleSSLContext - * @run junit HttpResponseLimitingTest + * @run junit ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/HttpSlowServerTest.java b/test/jdk/java/net/httpclient/HttpSlowServerTest.java index f62f6fa4978..2e56ef232c6 100644 --- a/test/jdk/java/net/httpclient/HttpSlowServerTest.java +++ b/test/jdk/java/net/httpclient/HttpSlowServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * -Djdk.httpclient.HttpClient.log=errors,headers,quic:hs * -Djdk.internal.httpclient.debug=false * -Djdk.httpclient.quic.maxInitialTimeout=60 - * HttpSlowServerTest + * ${test.main.class} * */ public class HttpSlowServerTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/HttpVersionsTest.java b/test/jdk/java/net/httpclient/HttpVersionsTest.java index f047e2902e8..17fed725590 100644 --- a/test/jdk/java/net/httpclient/HttpVersionsTest.java +++ b/test/jdk/java/net/httpclient/HttpVersionsTest.java @@ -28,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform - * @run junit/othervm HttpVersionsTest + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/HttpsTunnelAuthTest.java b/test/jdk/java/net/httpclient/HttpsTunnelAuthTest.java index c83abd9cf62..f127b552d2a 100644 --- a/test/jdk/java/net/httpclient/HttpsTunnelAuthTest.java +++ b/test/jdk/java/net/httpclient/HttpsTunnelAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ import static java.lang.System.out; * -Djdk.http.auth.tunneling.disabledSchemes * -Djdk.httpclient.allowRestrictedHeaders=connection * -Djdk.internal.httpclient.debug=true - * HttpsTunnelAuthTest + * ${test.main.class} * */ //-Djdk.internal.httpclient.debug=true -Dtest.debug=true diff --git a/test/jdk/java/net/httpclient/HttpsTunnelTest.java b/test/jdk/java/net/httpclient/HttpsTunnelTest.java index bb0afacaacb..86e09bcd669 100644 --- a/test/jdk/java/net/httpclient/HttpsTunnelTest.java +++ b/test/jdk/java/net/httpclient/HttpsTunnelTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ import static java.net.http.HttpClient.Version.HTTP_2; * DigestEchoServer HttpsTunnelTest * @run main/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers - * -Djdk.internal.httpclient.debug=true HttpsTunnelTest + * -Djdk.internal.httpclient.debug=true ${test.main.class} * @run main/othervm -Dtest.requiresHost=true * -Djdk.httpclient.allowRestrictedHeaders=host * -Djdk.httpclient.HttpClient.log=headers - * -Djdk.internal.httpclient.debug=true HttpsTunnelTest + * -Djdk.internal.httpclient.debug=true ${test.main.class} * */ diff --git a/test/jdk/java/net/httpclient/ISO_8859_1_Test.java b/test/jdk/java/net/httpclient/ISO_8859_1_Test.java index 103284c9d54..474b5866f76 100644 --- a/test/jdk/java/net/httpclient/ISO_8859_1_Test.java +++ b/test/jdk/java/net/httpclient/ISO_8859_1_Test.java @@ -29,7 +29,7 @@ * ReferenceTracker * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * ISO_8859_1_Test + * ${test.main.class} * @summary Tests that a client is able to receive ISO-8859-1 encoded header values. */ diff --git a/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java b/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java index be7e1db0033..8eaba1d4aa0 100644 --- a/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java +++ b/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java @@ -70,27 +70,27 @@ import org.junit.jupiter.api.Test; * jdk.httpclient.test.lib.http3.Http3TestServer * * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=1 - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=20 - * IdleConnectionTimeoutTest + * ${test.main.class} * * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=1 - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=20 - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=abc - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=-1 - * IdleConnectionTimeoutTest + * ${test.main.class} * * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=1 - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=20 - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=abc - * IdleConnectionTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=-1 - * IdleConnectionTimeoutTest + * ${test.main.class} */ public class IdleConnectionTimeoutTest { diff --git a/test/jdk/java/net/httpclient/ImmutableFlowItems.java b/test/jdk/java/net/httpclient/ImmutableFlowItems.java index e42e2e21a6e..a47c57a9230 100644 --- a/test/jdk/java/net/httpclient/ImmutableFlowItems.java +++ b/test/jdk/java/net/httpclient/ImmutableFlowItems.java @@ -28,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run junit/othervm ImmutableFlowItems + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/ImmutableHeaders.java b/test/jdk/java/net/httpclient/ImmutableHeaders.java index e8d2e5166bb..2ce2234132b 100644 --- a/test/jdk/java/net/httpclient/ImmutableHeaders.java +++ b/test/jdk/java/net/httpclient/ImmutableHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8087112 * @modules java.net.http * jdk.httpserver - * @run main/othervm ImmutableHeaders + * @run main/othervm ${test.main.class} * @summary ImmutableHeaders */ diff --git a/test/jdk/java/net/httpclient/ImmutableSSLSessionTest.java b/test/jdk/java/net/httpclient/ImmutableSSLSessionTest.java index 9b5c7961c2f..a7c9deddac7 100644 --- a/test/jdk/java/net/httpclient/ImmutableSSLSessionTest.java +++ b/test/jdk/java/net/httpclient/ImmutableSSLSessionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; * jdk.httpclient.test.lib.common.HttpServerAdapters * java.net.http/jdk.internal.net.http.common.ImmutableSSLSessionAccess * @run junit/othervm -Djdk.httpclient.HttpClient.log=request,response,headers,errors - * ImmutableSSLSessionTest + * ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class ImmutableSSLSessionTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/InterruptedBlockingSend.java b/test/jdk/java/net/httpclient/InterruptedBlockingSend.java index 0dcd2ca02c2..7605b627038 100644 --- a/test/jdk/java/net/httpclient/InterruptedBlockingSend.java +++ b/test/jdk/java/net/httpclient/InterruptedBlockingSend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static java.lang.System.out; * @test * @bug 8245462 * @summary Basic test for interrupted blocking send - * @run main/othervm InterruptedBlockingSend + * @run main/othervm ${test.main.class} */ public class InterruptedBlockingSend { diff --git a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java index c83d9d67528..83c09b356ed 100644 --- a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java +++ b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java @@ -31,7 +31,7 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Dtest.http.version=http3 * -Djdk.internal.httpclient.debug=true - * InvalidInputStreamSubscriptionRequest + * ${test.main.class} */ /* * @test id=http2 @@ -41,7 +41,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Dtest.http.version=http2 InvalidInputStreamSubscriptionRequest + * @run junit/othervm -Dtest.http.version=http2 ${test.main.class} */ /* * @test id=http1 @@ -51,7 +51,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Dtest.http.version=http1 InvalidInputStreamSubscriptionRequest + * @run junit/othervm -Dtest.http.version=http1 ${test.main.class} */ import com.sun.net.httpserver.HttpServer; diff --git a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java index bbbd1e486ca..418c55364b5 100644 --- a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java +++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java @@ -29,7 +29,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java index 692e4d0bea4..92914843044 100644 --- a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java +++ b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java @@ -30,7 +30,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm InvalidSubscriptionRequest + * @run junit/othervm ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/LargeHandshakeTest.java b/test/jdk/java/net/httpclient/LargeHandshakeTest.java index ff3981e8b3d..59cdad27cbc 100644 --- a/test/jdk/java/net/httpclient/LargeHandshakeTest.java +++ b/test/jdk/java/net/httpclient/LargeHandshakeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,7 +88,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=true * -Djdk.tls.maxHandshakeMessageSize=131072 - * LargeHandshakeTest + * ${test.main.class} * */ public class LargeHandshakeTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/LargeResponseContent.java b/test/jdk/java/net/httpclient/LargeResponseContent.java index 7a1bca73d13..e510f44c9e4 100644 --- a/test/jdk/java/net/httpclient/LargeResponseContent.java +++ b/test/jdk/java/net/httpclient/LargeResponseContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import jdk.test.lib.net.URIBuilder; * @bug 8212926 * @library /test/lib * @summary Basic tests for response timeouts - * @run main/othervm LargeResponseContent + * @run main/othervm ${test.main.class} */ public class LargeResponseContent { diff --git a/test/jdk/java/net/httpclient/LargeResponseTest.java b/test/jdk/java/net/httpclient/LargeResponseTest.java index 727cc1768df..f41a40f2960 100644 --- a/test/jdk/java/net/httpclient/LargeResponseTest.java +++ b/test/jdk/java/net/httpclient/LargeResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.quic.maxInitialTimeout=60 - * LargeResponseTest + * ${test.main.class} * */ public class LargeResponseTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java index ddca2e1f7d2..d18c3b170ee 100644 --- a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java +++ b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java @@ -82,7 +82,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build ReferenceTracker jdk.httpclient.test.lib.http2.Http2TestServer * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -XX:+UnlockDiagnosticVMOptions -XX:DiagnoseSyncOnValueBasedClasses=1 LineBodyHandlerTest + * @run junit/othervm -XX:+UnlockDiagnosticVMOptions -XX:DiagnoseSyncOnValueBasedClasses=1 ${test.main.class} */ public class LineBodyHandlerTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java b/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java index 01a7ee9fdbf..4dead447295 100644 --- a/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java +++ b/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java @@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test; * In particular tests that surrogate characters are handled * correctly. * @modules java.net.http java.logging - * @run junit/othervm LineStreamsAndSurrogatesTest + * @run junit/othervm ${test.main.class} */ public class LineStreamsAndSurrogatesTest { diff --git a/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java b/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java index 7932744a4db..fc51b1f7a4d 100644 --- a/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java +++ b/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java @@ -54,7 +54,7 @@ import org.junit.jupiter.api.Test; * In particular tests that surrogate characters are handled * correctly. * @modules java.net.http java.logging - * @run junit/othervm LineSubscribersAndSurrogatesTest + * @run junit/othervm ${test.main.class} */ public class LineSubscribersAndSurrogatesTest { diff --git a/test/jdk/java/net/httpclient/ManyRequests.java b/test/jdk/java/net/httpclient/ManyRequests.java index 3609aa8337a..e8bcfb76b1b 100644 --- a/test/jdk/java/net/httpclient/ManyRequests.java +++ b/test/jdk/java/net/httpclient/ManyRequests.java @@ -27,13 +27,13 @@ * @key intermittent * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests - * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true ManyRequests - * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.chunkSize=64 ManyRequests - * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests + * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=ssl,channel ${test.main.class} + * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true ${test.main.class} + * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.chunkSize=64 ${test.main.class} + * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true -Dtest.chunkSize=64 ${test.main.class} * @summary Send a large number of requests asynchronously */ - // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests + // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl,channel ${test.main.class} import java.io.IOException; import java.io.InputStream; diff --git a/test/jdk/java/net/httpclient/ManyRequests2.java b/test/jdk/java/net/httpclient/ManyRequests2.java index 09fdc18f687..5718e6958f7 100644 --- a/test/jdk/java/net/httpclient/ManyRequests2.java +++ b/test/jdk/java/net/httpclient/ManyRequests2.java @@ -28,15 +28,15 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * @build ManyRequests ManyRequests2 * @run main/othervm/timeout=400 -Dsun.net.httpserver.idleInterval=400 -Dtest.XFixed=true - * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 + * -Djdk.httpclient.HttpClient.log=channel ${test.main.class} * @run main/othervm/timeout=400 -Dsun.net.httpserver.idleInterval=400 -Dtest.XFixed=true -Dtest.insertDelay=true - * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 + * -Djdk.httpclient.HttpClient.log=channel ${test.main.class} * @run main/othervm/timeout=400 -Dsun.net.httpserver.idleInterval=400 -Dtest.XFixed=true -Dtest.chunkSize=64 - * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 + * -Djdk.httpclient.HttpClient.log=channel ${test.main.class} * @run main/othervm/timeout=400 -Dsun.net.httpserver.idleInterval=400 -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=channel * -Dtest.XFixed=true -Dtest.insertDelay=true - * -Dtest.chunkSize=64 ManyRequests2 + * -Dtest.chunkSize=64 ${test.main.class} * @summary Send a large number of requests asynchronously. * The server echoes back using known content length. */ diff --git a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java index f1c4f881058..b0f7ffdd4cb 100644 --- a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java +++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java @@ -25,11 +25,11 @@ * @test * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run main/othervm/timeout=80 -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy - * @run main/othervm/timeout=80 -Dtest.insertDelay=true -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy - * @run main/othervm/timeout=80 -Dtest.chunkSize=64 -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy + * @run main/othervm/timeout=80 -Dsun.net.httpserver.idleInterval=50000 ${test.main.class} + * @run main/othervm/timeout=80 -Dtest.insertDelay=true -Dsun.net.httpserver.idleInterval=50000 ${test.main.class} + * @run main/othervm/timeout=80 -Dtest.chunkSize=64 -Dsun.net.httpserver.idleInterval=50000 ${test.main.class} * @run main/othervm/timeout=80 -Dtest.insertDelay=true -Dsun.net.httpserver.idleInterval=50000 - * -Dtest.chunkSize=64 ManyRequestsLegacy + * -Dtest.chunkSize=64 ${test.main.class} * @summary Send a large number of requests asynchronously using the legacy * URL.openConnection(), to help sanitize results of the test * ManyRequest.java. diff --git a/test/jdk/java/net/httpclient/MaxStreams.java b/test/jdk/java/net/httpclient/MaxStreams.java index 00875aceb6f..b3fc38e11f3 100644 --- a/test/jdk/java/net/httpclient/MaxStreams.java +++ b/test/jdk/java/net/httpclient/MaxStreams.java @@ -27,7 +27,7 @@ * @summary Should HttpClient support SETTINGS_MAX_CONCURRENT_STREAMS from the server * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm MaxStreams + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/MessageHeadersTest.java b/test/jdk/java/net/httpclient/MessageHeadersTest.java index b0a5130e2b6..ab6ed2e5f94 100644 --- a/test/jdk/java/net/httpclient/MessageHeadersTest.java +++ b/test/jdk/java/net/httpclient/MessageHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @modules java.net.http * jdk.httpserver * java.base/sun.net.www - * @run main MessageHeadersTest + * @run main ${test.main.class} * @summary Tests expected behavior of MessageHeader. This test * cannot be used to verify 8164704 - it simply verifies * the assumptions on which the fix is based. diff --git a/test/jdk/java/net/httpclient/MultiAuthTest.java b/test/jdk/java/net/httpclient/MultiAuthTest.java index c434591c894..bdf18ee7238 100644 --- a/test/jdk/java/net/httpclient/MultiAuthTest.java +++ b/test/jdk/java/net/httpclient/MultiAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @modules java.net.http * jdk.httpserver - * @run main/othervm MultiAuthTest + * @run main/othervm ${test.main.class} * @summary Basic Authentication test with multiple clients issuing * multiple requests. Includes password changes * on server and client side. diff --git a/test/jdk/java/net/httpclient/NoBodyPartOne.java b/test/jdk/java/net/httpclient/NoBodyPartOne.java index 980f4d8d100..6fc4cf02e07 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartOne.java +++ b/test/jdk/java/net/httpclient/NoBodyPartOne.java @@ -30,7 +30,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all - * NoBodyPartOne + * ${test.main.class} */ import java.nio.file.Files; diff --git a/test/jdk/java/net/httpclient/NoBodyPartThree.java b/test/jdk/java/net/httpclient/NoBodyPartThree.java index 7020f7e2c25..ab9b3822263 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartThree.java +++ b/test/jdk/java/net/httpclient/NoBodyPartThree.java @@ -30,7 +30,7 @@ * @run junit/othervm * -Djdk.httpclient.HttpClient.log=quic,errors * -Djdk.httpclient.HttpClient.log=all - * NoBodyPartThree + * ${test.main.class} */ import java.io.InputStream; diff --git a/test/jdk/java/net/httpclient/NoBodyPartTwo.java b/test/jdk/java/net/httpclient/NoBodyPartTwo.java index 9e7ceb11c55..c59bc5e9b08 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartTwo.java +++ b/test/jdk/java/net/httpclient/NoBodyPartTwo.java @@ -30,7 +30,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all - * NoBodyPartTwo + * ${test.main.class} */ import java.io.InputStream; diff --git a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java index 2e53479a6ee..2bde0c8bd9a 100644 --- a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java +++ b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java @@ -31,7 +31,7 @@ * @compile -encoding utf-8 NonAsciiCharsInURI.java * @run junit/othervm * -Djdk.httpclient.HttpClient.log=requests,headers,errors,quic - * NonAsciiCharsInURI + * ${test.main.class} */ import java.io.Closeable; diff --git a/test/jdk/java/net/httpclient/OriginTest.java b/test/jdk/java/net/httpclient/OriginTest.java index 58310ecd9ad..838f8f36df2 100644 --- a/test/jdk/java/net/httpclient/OriginTest.java +++ b/test/jdk/java/net/httpclient/OriginTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.fail; * @test * @summary verify the behaviour of jdk.internal.net.http.Origin * @modules java.net.http/jdk.internal.net.http - * @run junit OriginTest + * @run junit ${test.main.class} */ class OriginTest { diff --git a/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileDownloadTest.java b/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileDownloadTest.java index 92d359e32c6..93f1b36dfd1 100644 --- a/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileDownloadTest.java +++ b/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileDownloadTest.java @@ -37,7 +37,7 @@ * jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform * jdk.test.lib.util.FileUtils - * @run junit/othervm BodyHandlerOfFileDownloadTest + * @run junit/othervm ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileTest.java b/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileTest.java index 53b8607f294..b0977efe69e 100644 --- a/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileTest.java +++ b/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileTest.java @@ -36,7 +36,7 @@ * jdk.httpclient.test.lib.http2.Queue * jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform jdk.test.lib.util.FileUtils - * @run junit/othervm BodyHandlerOfFileTest + * @run junit/othervm ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/PathSubscriber/BodySubscriberOfFileTest.java b/test/jdk/java/net/httpclient/PathSubscriber/BodySubscriberOfFileTest.java index da0c7220b6b..665bf280aca 100644 --- a/test/jdk/java/net/httpclient/PathSubscriber/BodySubscriberOfFileTest.java +++ b/test/jdk/java/net/httpclient/PathSubscriber/BodySubscriberOfFileTest.java @@ -35,7 +35,7 @@ * jdk.httpclient.test.lib.http2.OutgoingPushPromise * jdk.httpclient.test.lib.http2.Queue jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform jdk.test.lib.util.FileUtils - * @run junit/othervm BodySubscriberOfFileTest + * @run junit/othervm ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index cd7049285f1..91a59019355 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -62,7 +62,7 @@ import static java.net.Proxy.NO_PROXY; * /test/jdk/java/net/httpclient/lib * @run main/othervm -Djdk.httpclient.HttpClient.log=headers,requests,trace * -Djdk.internal.httpclient.debug=true - * PlainProxyConnectionTest + * ${test.main.class} */ public class PlainProxyConnectionTest { diff --git a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java index 84b29449d67..92f1360d1e2 100644 --- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java +++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,13 +34,13 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run main/othervm -Djdk.http.auth.proxying.disabledSchemes=Basic,Digest * -Djdk.http.auth.tunneling.disabledSchemes=Digest,Basic - * ProxyAuthDisabledSchemes + * ${test.main.class} * @run main/othervm -Djdk.http.auth.proxying.disabledSchemes=Basic * -Djdk.http.auth.tunneling.disabledSchemes=Basic - * ProxyAuthDisabledSchemes CLEAR PROXY + * ${test.main.class} CLEAR PROXY * @run main/othervm -Djdk.http.auth.proxying.disabledSchemes=Digest * -Djdk.http.auth.tunneling.disabledSchemes=Digest - * ProxyAuthDisabledSchemes CLEAR PROXY + * ${test.main.class} CLEAR PROXY */ public class ProxyAuthDisabledSchemes { diff --git a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java index 6d9d7e4f11b..e02cbef658b 100644 --- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java +++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,27 +38,27 @@ * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.internal.httpclient.debug=err * -Djdk.httpclient.HttpClient.log=headers - * ProxyAuthDisabledSchemesSSL SSL SERVER307 + * ${test.main.class} SSL SERVER307 * @run main/othervm/timeout=300 * -Djdk.http.auth.proxying.disabledSchemes=Basic,Digest * -Djdk.http.auth.tunneling.disabledSchemes=Digest,Basic * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.httpclient.HttpClient.log=headers - * ProxyAuthDisabledSchemesSSL SSL SERVER PROXY + * ${test.main.class} SSL SERVER PROXY * @run main/othervm/timeout=300 * -Djdk.http.auth.proxying.disabledSchemes=Basic * -Djdk.http.auth.tunneling.disabledSchemes=Basic * -Dtest.requiresHost=true * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.httpclient.HttpClient.log=headers - * ProxyAuthDisabledSchemesSSL SSL PROXY + * ${test.main.class} SSL PROXY * @run main/othervm/timeout=300 * -Djdk.http.auth.proxying.disabledSchemes=Digest * -Djdk.http.auth.tunneling.disabledSchemes=Digest * -Dtest.requiresHost=true * -Djdk.httpclient.http3.maxDirectConnectionTimeout=100 * -Djdk.httpclient.HttpClient.log=headers - * ProxyAuthDisabledSchemesSSL SSL PROXY + * ${test.main.class} SSL PROXY */ public class ProxyAuthDisabledSchemesSSL { diff --git a/test/jdk/java/net/httpclient/ProxyAuthTest.java b/test/jdk/java/net/httpclient/ProxyAuthTest.java index a147e8944d2..63004289934 100644 --- a/test/jdk/java/net/httpclient/ProxyAuthTest.java +++ b/test/jdk/java/net/httpclient/ProxyAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8163561 * @library /test/lib * @summary Verify that Proxy-Authenticate header is correctly handled - * @run main/othervm ProxyAuthTest + * @run main/othervm ${test.main.class} */ import java.io.BufferedWriter; diff --git a/test/jdk/java/net/httpclient/ProxySelectorTest.java b/test/jdk/java/net/httpclient/ProxySelectorTest.java index bb339e91bdc..3920906d03a 100644 --- a/test/jdk/java/net/httpclient/ProxySelectorTest.java +++ b/test/jdk/java/net/httpclient/ProxySelectorTest.java @@ -33,7 +33,7 @@ * -Djdk.http.auth.tunneling.disabledSchemes * -Djdk.httpclient.HttpClient.log=headers,requests * -Djdk.internal.httpclient.debug=true - * ProxySelectorTest + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/ProxyTest.java b/test/jdk/java/net/httpclient/ProxyTest.java index d8abea188bd..45000f54f45 100644 --- a/test/jdk/java/net/httpclient/ProxyTest.java +++ b/test/jdk/java/net/httpclient/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,7 +74,7 @@ import static java.net.Proxy.NO_PROXY; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ProxyTest * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run main/othervm ProxyTest + * @run main/othervm ${test.main.class} * @author danielfuchs */ public class ProxyTest { diff --git a/test/jdk/java/net/httpclient/RedirectMethodChange.java b/test/jdk/java/net/httpclient/RedirectMethodChange.java index 73e27f6efff..545d049d0d5 100644 --- a/test/jdk/java/net/httpclient/RedirectMethodChange.java +++ b/test/jdk/java/net/httpclient/RedirectMethodChange.java @@ -26,7 +26,7 @@ * @summary Method change during redirection * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm RedirectMethodChange + * @run junit/othervm ${test.main.class} */ import javax.net.ssl.SSLContext; diff --git a/test/jdk/java/net/httpclient/RedirectTimeoutTest.java b/test/jdk/java/net/httpclient/RedirectTimeoutTest.java index 8c2fa8707ae..eac97e4f73e 100644 --- a/test/jdk/java/net/httpclient/RedirectTimeoutTest.java +++ b/test/jdk/java/net/httpclient/RedirectTimeoutTest.java @@ -29,7 +29,7 @@ * an HttpTimeoutException during the redirected request. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.httpclient.HttpClient.log=errors,trace -Djdk.internal.httpclient.debug=false RedirectTimeoutTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=errors,trace -Djdk.internal.httpclient.debug=false ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; @@ -203,4 +203,4 @@ public class RedirectTimeoutTest implements HttpServerAdapters { } } } -} \ No newline at end of file +} diff --git a/test/jdk/java/net/httpclient/RedirectWithCookie.java b/test/jdk/java/net/httpclient/RedirectWithCookie.java index ad94b124132..d9ebf9e1faf 100644 --- a/test/jdk/java/net/httpclient/RedirectWithCookie.java +++ b/test/jdk/java/net/httpclient/RedirectWithCookie.java @@ -28,7 +28,7 @@ * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * RedirectWithCookie + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/RequestBodyTest.java b/test/jdk/java/net/httpclient/RequestBodyTest.java index e87cbc694c7..0c65a81c3ed 100644 --- a/test/jdk/java/net/httpclient/RequestBodyTest.java +++ b/test/jdk/java/net/httpclient/RequestBodyTest.java @@ -62,7 +62,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @build LightWeightHttpServer * @build jdk.test.lib.Platform * @build jdk.test.lib.util.FileUtils - * @run junit/othervm RequestBodyTest + * @run junit/othervm ${test.main.class} */ public class RequestBodyTest { diff --git a/test/jdk/java/net/httpclient/RequestBuilderTest.java b/test/jdk/java/net/httpclient/RequestBuilderTest.java index 12af908457b..6ba00fcd10f 100644 --- a/test/jdk/java/net/httpclient/RequestBuilderTest.java +++ b/test/jdk/java/net/httpclient/RequestBuilderTest.java @@ -25,7 +25,7 @@ * @test * @bug 8276559 * @summary HttpRequest[.Builder] API and behaviour checks - * @run junit RequestBuilderTest + * @run junit ${test.main.class} */ import java.net.URI; diff --git a/test/jdk/java/net/httpclient/Response1xxTest.java b/test/jdk/java/net/httpclient/Response1xxTest.java index 9b54f852510..d7e975fa7dc 100644 --- a/test/jdk/java/net/httpclient/Response1xxTest.java +++ b/test/jdk/java/net/httpclient/Response1xxTest.java @@ -63,7 +63,7 @@ import org.junit.jupiter.api.Test; * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm -Djdk.internal.httpclient.debug=true - * -Djdk.httpclient.HttpClient.log=headers,requests,responses,errors Response1xxTest + * -Djdk.httpclient.HttpClient.log=headers,requests,responses,errors ${test.main.class} */ public class Response1xxTest implements HttpServerAdapters { private static final String EXPECTED_RSP_BODY = "Hello World"; diff --git a/test/jdk/java/net/httpclient/Response204.java b/test/jdk/java/net/httpclient/Response204.java index e68be645ff9..5ee880655b1 100644 --- a/test/jdk/java/net/httpclient/Response204.java +++ b/test/jdk/java/net/httpclient/Response204.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /** * @test * @bug 8211437 8216974 8218662 - * @run main/othervm -Djdk.httpclient.HttpClient.log=headers,requests Response204 + * @run main/othervm -Djdk.httpclient.HttpClient.log=headers,requests ${test.main.class} * @summary */ diff --git a/test/jdk/java/net/httpclient/Response204V2Test.java b/test/jdk/java/net/httpclient/Response204V2Test.java index 835f7aa65f7..517f6b0c5c6 100644 --- a/test/jdk/java/net/httpclient/Response204V2Test.java +++ b/test/jdk/java/net/httpclient/Response204V2Test.java @@ -29,7 +29,7 @@ * ReferenceTracker jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * Response204V2Test + * ${test.main.class} * @summary Tests that streams are closed after receiving a 204 response. * This test uses the OperationsTracker and will fail in * teardown if the tracker reports that some HTTP/2 streams diff --git a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java index 19393d99ee9..562176b596a 100644 --- a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java +++ b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java @@ -28,7 +28,7 @@ * @modules java.net.http/jdk.internal.net.http.common * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm/timeout=480 ResponseBodyBeforeError + * @run junit/othervm/timeout=480 ${test.main.class} */ import java.io.Closeable; diff --git a/test/jdk/java/net/httpclient/ResponsePublisher.java b/test/jdk/java/net/httpclient/ResponsePublisher.java index be135e84b31..b436e6e6b18 100644 --- a/test/jdk/java/net/httpclient/ResponsePublisher.java +++ b/test/jdk/java/net/httpclient/ResponsePublisher.java @@ -28,7 +28,7 @@ * immediately with a Publisher> * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm/timeout=480 ResponsePublisher + * @run junit/othervm/timeout=480 ${test.main.class} */ import jdk.internal.net.http.common.OperationTrackers; diff --git a/test/jdk/java/net/httpclient/RestrictedHeadersTest.java b/test/jdk/java/net/httpclient/RestrictedHeadersTest.java index f2ddf85b3f5..108ecb6259a 100644 --- a/test/jdk/java/net/httpclient/RestrictedHeadersTest.java +++ b/test/jdk/java/net/httpclient/RestrictedHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ * @test * @bug 8178699 * @modules java.net.http - * @run main/othervm RestrictedHeadersTest - * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=content-length,connection RestrictedHeadersTest content-length connection - * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=host,upgrade RestrictedHeadersTest host upgrade - * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=via RestrictedHeadersTest via + * @run main/othervm ${test.main.class} + * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=content-length,connection ${test.main.class} content-length connection + * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=host,upgrade ${test.main.class} host upgrade + * @run main/othervm -Djdk.httpclient.allowRestrictedHeaders=via ${test.main.class} via */ import java.net.URI; diff --git a/test/jdk/java/net/httpclient/RetryPost.java b/test/jdk/java/net/httpclient/RetryPost.java index 67969306acc..a943b92aeea 100644 --- a/test/jdk/java/net/httpclient/RetryPost.java +++ b/test/jdk/java/net/httpclient/RetryPost.java @@ -24,8 +24,8 @@ /* * @test * @summary Ensure that the POST method is retied when the property is set. - * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry RetryPost - * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry=true RetryPost + * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry ${test.main.class} + * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry=true ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/RetryWithCookie.java b/test/jdk/java/net/httpclient/RetryWithCookie.java index 8638693b50d..b90f9bb6809 100644 --- a/test/jdk/java/net/httpclient/RetryWithCookie.java +++ b/test/jdk/java/net/httpclient/RetryWithCookie.java @@ -31,7 +31,7 @@ * ReferenceTracker * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * RetryWithCookie + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/SSLExceptionTest.java b/test/jdk/java/net/httpclient/SSLExceptionTest.java index cf94d1b50f7..e6c234fb9e8 100644 --- a/test/jdk/java/net/httpclient/SSLExceptionTest.java +++ b/test/jdk/java/net/httpclient/SSLExceptionTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; * SSLcontext used by HttpClient are not available * @build SSLExceptionTest * @run junit/othervm -Djdk.tls.client.protocols="InvalidTLSv1.4" - * SSLExceptionTest + * ${test.main.class} */ public class SSLExceptionTest { diff --git a/test/jdk/java/net/httpclient/SendResponseHeadersTest.java b/test/jdk/java/net/httpclient/SendResponseHeadersTest.java index 2998522616f..600a4a1f295 100644 --- a/test/jdk/java/net/httpclient/SendResponseHeadersTest.java +++ b/test/jdk/java/net/httpclient/SendResponseHeadersTest.java @@ -27,7 +27,7 @@ * @library /test/lib * @summary Check that sendResponseHeaders throws an IOException when headers * have already been sent - * @run junit/othervm SendResponseHeadersTest + * @run junit/othervm ${test.main.class} */ import com.sun.net.httpserver.HttpExchange; diff --git a/test/jdk/java/net/httpclient/ServerCloseTest.java b/test/jdk/java/net/httpclient/ServerCloseTest.java index d5e762b15a4..715a7b9f4a3 100644 --- a/test/jdk/java/net/httpclient/ServerCloseTest.java +++ b/test/jdk/java/net/httpclient/ServerCloseTest.java @@ -28,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.tls.acknowledgeCloseNotify=true ServerCloseTest + * @run junit/othervm -Djdk.tls.acknowledgeCloseNotify=true ${test.main.class} */ //* -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/ShortRequestBody.java b/test/jdk/java/net/httpclient/ShortRequestBody.java index ffebdeec5ce..274a129c320 100644 --- a/test/jdk/java/net/httpclient/ShortRequestBody.java +++ b/test/jdk/java/net/httpclient/ShortRequestBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; * @bug 8151441 * @summary Request body of incorrect (larger or smaller) sizes than that * reported by the body publisher - * @run main/othervm ShortRequestBody + * @run main/othervm ${test.main.class} */ public class ShortRequestBody { diff --git a/test/jdk/java/net/httpclient/ShortResponseBodyGet.java b/test/jdk/java/net/httpclient/ShortResponseBodyGet.java index 47be508c8c1..f5393fe940b 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBodyGet.java +++ b/test/jdk/java/net/httpclient/ShortResponseBodyGet.java @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext ShortResponseBody ShortResponseBodyGet * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel - * ShortResponseBodyGet + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/ShortResponseBodyPost.java b/test/jdk/java/net/httpclient/ShortResponseBodyPost.java index 60d2796b34f..5a88455fc54 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBodyPost.java +++ b/test/jdk/java/net/httpclient/ShortResponseBodyPost.java @@ -31,7 +31,7 @@ * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel * -Djdk.internal.httpclient.debug=true - * ShortResponseBodyPost + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/ShutdownNow.java b/test/jdk/java/net/httpclient/ShutdownNow.java index e48667d2c69..0fdc7b2acc3 100644 --- a/test/jdk/java/net/httpclient/ShutdownNow.java +++ b/test/jdk/java/net/httpclient/ShutdownNow.java @@ -35,7 +35,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * ShutdownNow + * ${test.main.class} */ // -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/SmallTimeout.java b/test/jdk/java/net/httpclient/SmallTimeout.java index 76117ef3075..8ca08b9b65d 100644 --- a/test/jdk/java/net/httpclient/SmallTimeout.java +++ b/test/jdk/java/net/httpclient/SmallTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * 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,12 +46,12 @@ import static java.lang.System.out; * @bug 8178147 * @modules java.net.http/jdk.internal.net.http.common * @summary Ensures that small timeouts do not cause hangs due to race conditions - * @run main/othervm -Djdk.internal.httpclient.debug=true SmallTimeout + * @run main/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ // To enable logging use. Not enabled by default as it changes the dynamics // of the test. -// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all SmallTimeout +// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all ${test.main.class} public class SmallTimeout { diff --git a/test/jdk/java/net/httpclient/SmokeTest.java b/test/jdk/java/net/httpclient/SmokeTest.java index f87cc462fac..487e6cbe21a 100644 --- a/test/jdk/java/net/httpclient/SmokeTest.java +++ b/test/jdk/java/net/httpclient/SmokeTest.java @@ -30,7 +30,7 @@ * @run main/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,ssl,trace - * SmokeTest + * ${test.main.class} */ import java.net.InetAddress; diff --git a/test/jdk/java/net/httpclient/SpecialHeadersTest.java b/test/jdk/java/net/httpclient/SpecialHeadersTest.java index d4d5f2a85e2..4e022c5b273 100644 --- a/test/jdk/java/net/httpclient/SpecialHeadersTest.java +++ b/test/jdk/java/net/httpclient/SpecialHeadersTest.java @@ -33,10 +33,10 @@ * @requires (vm.compMode != "Xcomp") * @run junit/othervm/timeout=480 * -Djdk.httpclient.HttpClient.log=requests,headers,errors - * SpecialHeadersTest + * ${test.main.class} * @run junit/othervm/timeout=480 -Djdk.httpclient.allowRestrictedHeaders=Host * -Djdk.httpclient.HttpClient.log=requests,headers,errors - * SpecialHeadersTest + * ${test.main.class} */ import jdk.internal.net.http.common.OperationTrackers.Tracker; diff --git a/test/jdk/java/net/httpclient/SplitResponse.java b/test/jdk/java/net/httpclient/SplitResponse.java index abc972fd591..4e0c6b2ba6c 100644 --- a/test/jdk/java/net/httpclient/SplitResponse.java +++ b/test/jdk/java/net/httpclient/SplitResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ import static java.net.http.HttpResponse.BodyHandlers.ofString; * @run main/othervm/timeout=480 * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all - * SplitResponse HTTP connection:CLOSE mode:SYNC + * ${test.main.class} HTTP connection:CLOSE mode:SYNC */ /** diff --git a/test/jdk/java/net/httpclient/StreamCloseTest.java b/test/jdk/java/net/httpclient/StreamCloseTest.java index 7b228e69de2..49e03a54c59 100644 --- a/test/jdk/java/net/httpclient/StreamCloseTest.java +++ b/test/jdk/java/net/httpclient/StreamCloseTest.java @@ -30,7 +30,7 @@ * @library /test/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer - * @run junit/othervm StreamCloseTest + * @run junit/othervm ${test.main.class} */ import java.io.InputStream; diff --git a/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java b/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java index 93f55d066e9..1902abb4a26 100644 --- a/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java +++ b/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java @@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test; * @test * @summary Basic tests for API specified exceptions from Handler, * and Subscriber convenience static factory methods. - * @run junit SubscriberAPIExceptions + * @run junit ${test.main.class} */ public class SubscriberAPIExceptions { diff --git a/test/jdk/java/net/httpclient/TestKitTest.java b/test/jdk/java/net/httpclient/TestKitTest.java index 2aba794426f..28a1bab5a69 100644 --- a/test/jdk/java/net/httpclient/TestKitTest.java +++ b/test/jdk/java/net/httpclient/TestKitTest.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test; /* * @test * @compile TestKit.java - * @run junit TestKitTest + * @run junit ${test.main.class} */ public final class TestKitTest { diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java b/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java index 2c1aa2fd9b4..43d3bebf2e4 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersCustomAfterCancel + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java b/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java index ba734185464..e0ff3e2e42a 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersCustomBeforeCancel + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java b/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java index a5e819942b4..023a2281bce 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersIOAfterCancel + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java b/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java index e68f83052bd..54ddbebdd82 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersIOBeforeCancel + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java b/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java index 62d06fd6019..d690a2bbb3b 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersInNextRequest + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java b/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java index f863f3598ed..c8255ba5fff 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersInRequest + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java b/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java index ce1ad89dc05..400e28e17fc 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersInSubscribe + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java b/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java index eee2f9ab7fb..e14ced23514 100644 --- a/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java +++ b/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true - * ThrowingPublishersSanity + * ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java index 797507ac7ad..a70f8f1b3f3 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamCustom * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsInputStreamCustom + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java index 309f60c0f22..04fd641f66a 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamIO * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsInputStreamIO + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java index 77c87151e19..59cae941d6d 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesCustom * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsLinesCustom + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java index 69deeec533a..f346829fe19 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesIO * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsLinesIO + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java index de38cf4f782..7180784c553 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringCustom * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsStringCustom + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java index ec4d682d73f..ea56f30e11f 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringIO * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesAsStringIO + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java b/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java index 92f2ab3726d..aeaec438ec4 100644 --- a/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java +++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesSanity * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingPushPromisesSanity + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java index a4c0fc72004..77d1992e948 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsInputStream AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsInputStream + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java index aec4641917c..68df5a2b8b3 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsInputStreamAsync AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsInputStreamAsync + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimiting.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimiting.java index 603a8558856..1a9ffe9c182 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimiting.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimiting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ * ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsLimiting + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java index e45c6d6487e..31b807beea0 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ * ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsLimitingAsync + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java index ba594166b72..9915b921b1f 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsLines AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsLines + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java index a76ff882463..4fd41b987d0 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsLinesAsync AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsLinesAsync + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java index ba550675096..4fe15f99448 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsString AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsString + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java b/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java index 304d98e6939..879f0fad5a3 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersAsStringAsync AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersAsStringAsync + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java b/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java index 296e9151c9e..9481d64e195 100644 --- a/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java +++ b/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker ThrowingSubscribersSanity AbstractThrowingSubscribers * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm -Djdk.internal.httpclient.debug=true ThrowingSubscribersSanity + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import org.junit.jupiter.params.ParameterizedTest; diff --git a/test/jdk/java/net/httpclient/TimeoutBasic.java b/test/jdk/java/net/httpclient/TimeoutBasic.java index cae1cda7ade..ba986bbc0d2 100644 --- a/test/jdk/java/net/httpclient/TimeoutBasic.java +++ b/test/jdk/java/net/httpclient/TimeoutBasic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext * @summary Basic tests for response timeouts - * @run main/othervm TimeoutBasic + * @run main/othervm ${test.main.class} */ public class TimeoutBasic { diff --git a/test/jdk/java/net/httpclient/TimeoutOrdering.java b/test/jdk/java/net/httpclient/TimeoutOrdering.java index a39242c871a..ebe8cb3324e 100644 --- a/test/jdk/java/net/httpclient/TimeoutOrdering.java +++ b/test/jdk/java/net/httpclient/TimeoutOrdering.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,11 +41,11 @@ import static java.lang.System.out; /** * @test * @summary Ensures that timeouts of multiple requests are handled in correct order - * @run main/othervm TimeoutOrdering + * @run main/othervm ${test.main.class} */ // To enable logging use -// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all TimeoutOrdering +// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all ${test.main.class} public class TimeoutOrdering { diff --git a/test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java b/test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java index 093885a6ba0..9a09b5acf90 100644 --- a/test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java +++ b/test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.fail; * -Djdk.httpclient.disableRetryConnect * -Djdk.httpclient.redirects.retrylimit=0 * -Dtest.requestTimeoutMillis=1000 - * TimeoutResponseBodyTest + * ${test.main.class} */ /* @@ -79,7 +79,7 @@ import static org.junit.jupiter.api.Assertions.fail; * -Djdk.httpclient.redirects.retrylimit=3 * -Dtest.requestTimeoutMillis=1000 * -Dtest.responseFailureWaitDurationMillis=600 - * TimeoutResponseBodyTest + * ${test.main.class} */ /** diff --git a/test/jdk/java/net/httpclient/TimeoutResponseHeaderTest.java b/test/jdk/java/net/httpclient/TimeoutResponseHeaderTest.java index ab562f8eab8..6ea2da4c21e 100644 --- a/test/jdk/java/net/httpclient/TimeoutResponseHeaderTest.java +++ b/test/jdk/java/net/httpclient/TimeoutResponseHeaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; * -Djdk.httpclient.disableRetryConnect * -Djdk.httpclient.redirects.retrylimit=0 * -Dtest.requestTimeoutMillis=1000 - * TimeoutResponseHeaderTest + * ${test.main.class} */ /* @@ -76,7 +76,7 @@ import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; * -Djdk.httpclient.redirects.retrylimit=3 * -Dtest.requestTimeoutMillis=1000 * -Dtest.responseFailureWaitDurationMillis=600 - * TimeoutResponseHeaderTest + * ${test.main.class} */ /** diff --git a/test/jdk/java/net/httpclient/TlsContextTest.java b/test/jdk/java/net/httpclient/TlsContextTest.java index 95cb501d24c..052b20f94eb 100644 --- a/test/jdk/java/net/httpclient/TlsContextTest.java +++ b/test/jdk/java/net/httpclient/TlsContextTest.java @@ -63,7 +63,7 @@ import org.junit.jupiter.params.provider.MethodSource; * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.disableHostnameVerification * -Djdk.internal.httpclient.debug=false - * TlsContextTest + * ${test.main.class} */ public class TlsContextTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/UnauthorizedTest.java b/test/jdk/java/net/httpclient/UnauthorizedTest.java index 1c72bac6cc9..931b9681559 100644 --- a/test/jdk/java/net/httpclient/UnauthorizedTest.java +++ b/test/jdk/java/net/httpclient/UnauthorizedTest.java @@ -34,7 +34,7 @@ * jdk.test.lib.net.SimpleSSLContext ReferenceTracker * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers - * UnauthorizedTest + * ${test.main.class} */ import jdk.test.lib.net.SimpleSSLContext; diff --git a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java index 6c7fabb7f00..4b92eb83fdd 100644 --- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java +++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,13 +47,13 @@ import jdk.test.lib.net.SimpleSSLContext; * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext * @run main/othervm -Djdk.httpclient.enableAllMethodRetry - * -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain false + * -Djdk.tls.acknowledgeCloseNotify=true ${test.main.class} plain false * @run main/othervm -Djdk.httpclient.enableAllMethodRetry - * -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL false + * -Djdk.tls.acknowledgeCloseNotify=true ${test.main.class} SSL false * @run main/othervm -Djdk.httpclient.enableAllMethodRetry - * -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain true + * -Djdk.tls.acknowledgeCloseNotify=true ${test.main.class} plain true * @run main/othervm -Djdk.httpclient.enableAllMethodRetry - * -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL true + * -Djdk.tls.acknowledgeCloseNotify=true ${test.main.class} SSL true */ public class UnknownBodyLengthTest { diff --git a/test/jdk/java/net/httpclient/UserAuthWithAuthenticator.java b/test/jdk/java/net/httpclient/UserAuthWithAuthenticator.java index 6062fcd9448..3f5f004738a 100644 --- a/test/jdk/java/net/httpclient/UserAuthWithAuthenticator.java +++ b/test/jdk/java/net/httpclient/UserAuthWithAuthenticator.java @@ -74,7 +74,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer * jdk.test.lib.net.IPSupport - * @run junit UserAuthWithAuthenticator + * @run junit ${test.main.class} */ class UserAuthWithAuthenticator { diff --git a/test/jdk/java/net/httpclient/UserCookieTest.java b/test/jdk/java/net/httpclient/UserCookieTest.java index f49f44c157c..664565f6bd7 100644 --- a/test/jdk/java/net/httpclient/UserCookieTest.java +++ b/test/jdk/java/net/httpclient/UserCookieTest.java @@ -31,7 +31,7 @@ * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests - * UserCookieTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/VersionTest.java b/test/jdk/java/net/httpclient/VersionTest.java index ff864202a9a..546c0933ec5 100644 --- a/test/jdk/java/net/httpclient/VersionTest.java +++ b/test/jdk/java/net/httpclient/VersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @modules java.net.http java.logging jdk.httpserver * @library /lib/testlibrary/ / * @build ProxyServer - * @run main/othervm -Djdk.httpclient.HttpClient.log=errors,requests,headers,trace VersionTest + * @run main/othervm -Djdk.httpclient.HttpClient.log=errors,requests,headers,trace ${test.main.class} */ import com.sun.net.httpserver.Headers; diff --git a/test/jdk/java/net/httpclient/ZeroRedirects.java b/test/jdk/java/net/httpclient/ZeroRedirects.java index a842ea57930..fe62cc9e77f 100644 --- a/test/jdk/java/net/httpclient/ZeroRedirects.java +++ b/test/jdk/java/net/httpclient/ZeroRedirects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @bug 8164941 * @modules java.net.http java.logging jdk.httpserver - * @run main/othervm ZeroRedirects + * @run main/othervm ${test.main.class} */ import com.sun.net.httpserver.HttpContext; diff --git a/test/jdk/java/net/httpclient/altsvc/AltServiceReasonableAssurance.java b/test/jdk/java/net/httpclient/altsvc/AltServiceReasonableAssurance.java index 0da1b238f60..fab27463d90 100644 --- a/test/jdk/java/net/httpclient/altsvc/AltServiceReasonableAssurance.java +++ b/test/jdk/java/net/httpclient/altsvc/AltServiceReasonableAssurance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,7 +98,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @run junit/othervm -Djdk.net.hosts.file=${test.src}/altsvc-dns-hosts.txt * -Djdk.internal.httpclient.debug=true -Djavax.net.debug=all * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * AltServiceReasonableAssurance + * ${test.main.class} */ public class AltServiceReasonableAssurance implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http2/BadHeadersTest.java b/test/jdk/java/net/httpclient/http2/BadHeadersTest.java index 3bb80031178..01ff090cba7 100644 --- a/test/jdk/java/net/httpclient/http2/BadHeadersTest.java +++ b/test/jdk/java/net/httpclient/http2/BadHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * with bad header fields. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true BadHeadersTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import jdk.internal.net.http.common.HttpHeadersBuilder; diff --git a/test/jdk/java/net/httpclient/http2/BadPushPromiseTest.java b/test/jdk/java/net/httpclient/http2/BadPushPromiseTest.java index 8eed173409b..8febbb8a12a 100644 --- a/test/jdk/java/net/httpclient/http2/BadPushPromiseTest.java +++ b/test/jdk/java/net/httpclient/http2/BadPushPromiseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace - * BadPushPromiseTest + * ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/http2/BasicTest.java b/test/jdk/java/net/httpclient/http2/BasicTest.java index ddcf707e875..b76179f2e71 100644 --- a/test/jdk/java/net/httpclient/http2/BasicTest.java +++ b/test/jdk/java/net/httpclient/http2/BasicTest.java @@ -30,7 +30,7 @@ * jdk.test.lib.Asserts * jdk.test.lib.Utils * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors BasicTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java b/test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java index 1b9396effbb..36c46ed3aba 100644 --- a/test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java +++ b/test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * @run junit/othervm -Djdk.internal.httpclient.debug=err * -Djdk.httpclient.connectionWindowSize=65535 * -Djdk.httpclient.windowsize=16384 - * ConnectionFlowControlTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http2/ConnectionReuseTest.java b/test/jdk/java/net/httpclient/http2/ConnectionReuseTest.java index 360eabaee2b..9396ccd169f 100644 --- a/test/jdk/java/net/httpclient/http2/ConnectionReuseTest.java +++ b/test/jdk/java/net/httpclient/http2/ConnectionReuseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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,9 +62,9 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * jdk.test.lib.net.IPSupport * jdk.httpclient.test.lib.common.HttpServerAdapters * - * @run junit ConnectionReuseTest + * @run junit ${test.main.class} * @run junit/othervm -Djava.net.preferIPv6Addresses=true - * -Djdk.internal.httpclient.debug=true ConnectionReuseTest + * -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class ConnectionReuseTest { diff --git a/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java b/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java index c72beb04d56..cd788db6c7d 100644 --- a/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java +++ b/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * @compile ../ReferenceTracker.java - * @run junit/othervm ContinuationFrameTest + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http2/ErrorTest.java b/test/jdk/java/net/httpclient/http2/ErrorTest.java index 0f3bafa571d..3e3ce97b582 100644 --- a/test/jdk/java/net/httpclient/http2/ErrorTest.java +++ b/test/jdk/java/net/httpclient/http2/ErrorTest.java @@ -45,7 +45,7 @@ * java.net.http/jdk.internal.net.http.qpack.writers * java.security.jgss * @modules java.base/jdk.internal.util - * @run junit/othervm/timeout=60 -Djavax.net.debug=ssl -Djdk.httpclient.HttpClient.log=all ErrorTest + * @run junit/othervm/timeout=60 -Djavax.net.debug=ssl -Djdk.httpclient.HttpClient.log=all ${test.main.class} * @summary check exception thrown when bad TLS parameters selected */ diff --git a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java index d788d39b441..883e14e7d58 100644 --- a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java +++ b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java @@ -30,7 +30,7 @@ * jdk.test.lib.Asserts * jdk.test.lib.Utils * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors FixedThreadPoolTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors ${test.main.class} */ import java.net.*; diff --git a/test/jdk/java/net/httpclient/http2/H2GoAwayTest.java b/test/jdk/java/net/httpclient/http2/H2GoAwayTest.java index 08c32171d16..f656d72f244 100644 --- a/test/jdk/java/net/httpclient/http2/H2GoAwayTest.java +++ b/test/jdk/java/net/httpclient/http2/H2GoAwayTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ import static org.junit.jupiter.api.Assertions.fail; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run junit H2GoAwayTest + * @run junit ${test.main.class} */ public class H2GoAwayTest { private static final String REQ_PATH = "/test"; diff --git a/test/jdk/java/net/httpclient/http2/H2SelectorVTTest.java b/test/jdk/java/net/httpclient/http2/H2SelectorVTTest.java index 7adfd57319c..552e91473d5 100644 --- a/test/jdk/java/net/httpclient/http2/H2SelectorVTTest.java +++ b/test/jdk/java/net/httpclient/http2/H2SelectorVTTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors - * H2SelectorVTTest + * ${test.main.class} */ /* * @test id=never @@ -66,7 +66,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * @run junit/othervm * -Djdk.internal.httpclient.tcp.selector.useVirtualThreads=never * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors - * H2SelectorVTTest + * ${test.main.class} */ /* * @test id=always @@ -79,7 +79,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * @run junit/othervm * -Djdk.internal.httpclient.tcp.selector.useVirtualThreads=always * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors - * H2SelectorVTTest + * ${test.main.class} */ /* * @test id=explicit-default @@ -92,7 +92,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * @run junit/othervm * -Djdk.internal.httpclient.tcp.selector.useVirtualThreads=default * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors - * H2SelectorVTTest + * ${test.main.class} */ /* * @test id=garbage @@ -105,7 +105,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * @run junit/othervm * -Djdk.internal.httpclient.tcp.selector.useVirtualThreads=garbage * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors - * H2SelectorVTTest + * ${test.main.class} */ // -Djava.security.debug=all class H2SelectorVTTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http2/IdlePooledConnectionTest.java b/test/jdk/java/net/httpclient/http2/IdlePooledConnectionTest.java index 907afc28fa6..71eb483793f 100644 --- a/test/jdk/java/net/httpclient/http2/IdlePooledConnectionTest.java +++ b/test/jdk/java/net/httpclient/http2/IdlePooledConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * jdk.test.lib.Asserts * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.keepalive.timeout.h2=3 - * IdlePooledConnectionTest + * ${test.main.class} */ public class IdlePooledConnectionTest { diff --git a/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java b/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java index 5bcaf95c6fc..c273415ca63 100644 --- a/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java +++ b/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java @@ -28,7 +28,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace - * ImplicitPushCancel + * ${test.main.class} */ import java.io.ByteArrayInputStream; diff --git a/test/jdk/java/net/httpclient/http2/NoBodyTest.java b/test/jdk/java/net/httpclient/http2/NoBodyTest.java index 2459c8eba4b..a67d2cd250c 100644 --- a/test/jdk/java/net/httpclient/http2/NoBodyTest.java +++ b/test/jdk/java/net/httpclient/http2/NoBodyTest.java @@ -28,7 +28,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true - * NoBodyTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http2/PostPutTest.java b/test/jdk/java/net/httpclient/http2/PostPutTest.java index 84e86b556ca..132d6936039 100644 --- a/test/jdk/java/net/httpclient/http2/PostPutTest.java +++ b/test/jdk/java/net/httpclient/http2/PostPutTest.java @@ -29,7 +29,7 @@ * @library /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=50 -Djdk.httpclient.HttpClient.log=all - * PostPutTest + * ${test.main.class} */ import jdk.httpclient.test.lib.http2.Http2Handler; @@ -168,4 +168,4 @@ public class PostPutTest { exchange.sendResponseHeaders(200, 0); } } -} \ No newline at end of file +} diff --git a/test/jdk/java/net/httpclient/http2/ProxyTest2.java b/test/jdk/java/net/httpclient/http2/ProxyTest2.java index 762a70b95fd..75b48cb251b 100644 --- a/test/jdk/java/net/httpclient/http2/ProxyTest2.java +++ b/test/jdk/java/net/httpclient/http2/ProxyTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ import java.util.concurrent.*; * tunnelling through an HTTP/1.1 proxy. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer - * @run main/othervm ProxyTest2 + * @run main/othervm ${test.main.class} * @author danielfuchs */ public class ProxyTest2 { diff --git a/test/jdk/java/net/httpclient/http2/PushPromiseContinuation.java b/test/jdk/java/net/httpclient/http2/PushPromiseContinuation.java index 2d5b5dd4f4e..5d0bfe844f4 100644 --- a/test/jdk/java/net/httpclient/http2/PushPromiseContinuation.java +++ b/test/jdk/java/net/httpclient/http2/PushPromiseContinuation.java @@ -31,7 +31,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.http2.BodyOutputStream * jdk.httpclient.test.lib.http2.OutgoingPushPromise - * @run junit/othervm PushPromiseContinuation + * @run junit/othervm ${test.main.class} */ import javax.net.ssl.SSLSession; diff --git a/test/jdk/java/net/httpclient/http2/RedirectTest.java b/test/jdk/java/net/httpclient/http2/RedirectTest.java index 201b56513f6..b5b1ca2f1d5 100644 --- a/test/jdk/java/net/httpclient/http2/RedirectTest.java +++ b/test/jdk/java/net/httpclient/http2/RedirectTest.java @@ -33,7 +33,7 @@ * @run junit/othervm * -Djdk.httpclient.HttpClient.log=frames,ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true - * RedirectTest + * ${test.main.class} */ import java.net.InetSocketAddress; diff --git a/test/jdk/java/net/httpclient/http2/ServerPush.java b/test/jdk/java/net/httpclient/http2/ServerPush.java index d38b867132b..41200bf8949 100644 --- a/test/jdk/java/net/httpclient/http2/ServerPush.java +++ b/test/jdk/java/net/httpclient/http2/ServerPush.java @@ -31,7 +31,7 @@ * jdk.test.lib.Utils * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors,requests,responses - * ServerPush + * ${test.main.class} */ import java.io.*; diff --git a/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java b/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java index 9cf2a3f7ae2..c77e258f3c5 100644 --- a/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java +++ b/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java @@ -28,7 +28,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses - * ServerPushWithDiffTypes + * ${test.main.class} */ import java.io.*; diff --git a/test/jdk/java/net/httpclient/http2/SimpleGet.java b/test/jdk/java/net/httpclient/http2/SimpleGet.java index 5df3174f820..1bc7e0974c7 100644 --- a/test/jdk/java/net/httpclient/http2/SimpleGet.java +++ b/test/jdk/java/net/httpclient/http2/SimpleGet.java @@ -27,17 +27,17 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.http2.Http2TestServer - * @run junit/othervm -XX:+CrashOnOutOfMemoryError SimpleGet + * @run junit/othervm -XX:+CrashOnOutOfMemoryError ${test.main.class} * @run junit/othervm -XX:+CrashOnOutOfMemoryError * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * SimpleGet + * ${test.main.class} * @run junit/othervm -Dsimpleget.requests=150 * -Dsimpleget.chunks=16384 * -Djdk.httpclient.redirects.retrylimit=5 * -Djdk.httpclient.HttpClient.log=errors * -XX:+CrashOnOutOfMemoryError * -XX:+HeapDumpOnOutOfMemoryError - * SimpleGet + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http2/TLSConnection.java b/test/jdk/java/net/httpclient/http2/TLSConnection.java index e4009219bca..698a8c59ebe 100644 --- a/test/jdk/java/net/httpclient/http2/TLSConnection.java +++ b/test/jdk/java/net/httpclient/http2/TLSConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,7 @@ import jdk.httpclient.test.lib.http2.Http2Handler; * @run main/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all - * TLSConnection + * ${test.main.class} */ public class TLSConnection { diff --git a/test/jdk/java/net/httpclient/http2/Timeout.java b/test/jdk/java/net/httpclient/http2/Timeout.java index 42a51f56fab..c2f0dfdd5a1 100644 --- a/test/jdk/java/net/httpclient/http2/Timeout.java +++ b/test/jdk/java/net/httpclient/http2/Timeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import javax.net.ssl.SSLSocket; * @test * @bug 8156710 * @summary Check if HttpTimeoutException is thrown if a server doesn't reply - * @run main/othervm Timeout + * @run main/othervm ${test.main.class} */ public class Timeout { diff --git a/test/jdk/java/net/httpclient/http2/TrailingHeadersTest.java b/test/jdk/java/net/httpclient/http2/TrailingHeadersTest.java index 9ea331d2d84..bff009131a8 100644 --- a/test/jdk/java/net/httpclient/http2/TrailingHeadersTest.java +++ b/test/jdk/java/net/httpclient/http2/TrailingHeadersTest.java @@ -28,7 +28,7 @@ * @bug 8296410 * @library /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer - * @run junit/othervm -Djdk.httpclient.HttpClient.log=all TrailingHeadersTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all ${test.main.class} */ import jdk.httpclient.test.lib.http2.OutgoingPushPromise; @@ -321,4 +321,4 @@ public class TrailingHeadersTest { testLog.println("PushPromiseTrailersHandler: Push Promise complete"); } } -} \ No newline at end of file +} diff --git a/test/jdk/java/net/httpclient/http2/UserInfoTest.java b/test/jdk/java/net/httpclient/http2/UserInfoTest.java index 3cea2d92570..53d9dbe3c2b 100644 --- a/test/jdk/java/net/httpclient/http2/UserInfoTest.java +++ b/test/jdk/java/net/httpclient/http2/UserInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.assertEquals; * jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.http2.Http2TestExchange * @compile ../ReferenceTracker.java - * @run junit UserInfoTest + * @run junit ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/test/jdk/java/net/httpclient/http3/BadCipherSuiteErrorTest.java b/test/jdk/java/net/httpclient/http3/BadCipherSuiteErrorTest.java index fdfc498b21e..2c38a4a47f4 100644 --- a/test/jdk/java/net/httpclient/http3/BadCipherSuiteErrorTest.java +++ b/test/jdk/java/net/httpclient/http3/BadCipherSuiteErrorTest.java @@ -26,7 +26,7 @@ * @bug 8157105 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run junit/othervm/timeout=60 -Djavax.net.debug=ssl -Djdk.httpclient.HttpClient.log=all BadCipherSuiteErrorTest + * @run junit/othervm/timeout=60 -Djavax.net.debug=ssl -Djdk.httpclient.HttpClient.log=all ${test.main.class} * @summary check exception thrown when bad TLS parameters selected */ diff --git a/test/jdk/java/net/httpclient/http3/FramesDecoderTest.java b/test/jdk/java/net/httpclient/http3/FramesDecoderTest.java index d406ee491cb..584acb9ef49 100644 --- a/test/jdk/java/net/httpclient/http3/FramesDecoderTest.java +++ b/test/jdk/java/net/httpclient/http3/FramesDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.*; * @modules java.net.http/jdk.internal.net.http.http3 * @modules java.net.http/jdk.internal.net.http.http3.frames * @modules java.net.http/jdk.internal.net.http.quic.streams - * @run junit/othervm FramesDecoderTest + * @run junit/othervm ${test.main.class} * @summary Tests to check HTTP3 methods decode frames correctly */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java b/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java index 800a02eb2c4..fd0bdb3c294 100644 --- a/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java +++ b/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java @@ -79,7 +79,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @compile ../ReferenceTracker.java * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * GetHTTP3Test + * ${test.main.class} * @summary Basic HTTP/3 GET test */ // -Djdk.httpclient.http3.maxDirectConnectionTimeout=2500 diff --git a/test/jdk/java/net/httpclient/http3/H3BadHeadersTest.java b/test/jdk/java/net/httpclient/http3/H3BadHeadersTest.java index fff11f4ceb4..adc4c4c7240 100644 --- a/test/jdk/java/net/httpclient/http3/H3BadHeadersTest.java +++ b/test/jdk/java/net/httpclient/http3/H3BadHeadersTest.java @@ -27,7 +27,7 @@ * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext * @compile ../ReferenceTracker.java - * @run junit/othervm -Djdk.internal.httpclient.debug=true H3BadHeadersTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} * @summary this test verifies the behaviour of the HttpClient when presented * with bad headers */ diff --git a/test/jdk/java/net/httpclient/http3/H3BasicTest.java b/test/jdk/java/net/httpclient/http3/H3BasicTest.java index bddb9879ae9..982aa88b3bc 100644 --- a/test/jdk/java/net/httpclient/http3/H3BasicTest.java +++ b/test/jdk/java/net/httpclient/http3/H3BasicTest.java @@ -33,7 +33,7 @@ * jdk.test.lib.net.SimpleSSLContext * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true - * H3BasicTest + * ${test.main.class} */ // -Dseed=-163464189156654174 diff --git a/test/jdk/java/net/httpclient/http3/H3ConcurrentPush.java b/test/jdk/java/net/httpclient/http3/H3ConcurrentPush.java index 4392f829258..e15a6bbfc4d 100644 --- a/test/jdk/java/net/httpclient/http3/H3ConcurrentPush.java +++ b/test/jdk/java/net/httpclient/http3/H3ConcurrentPush.java @@ -29,7 +29,7 @@ * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace * -Djdk.httpclient.http3.maxConcurrentPushStreams=45 - * H3ConcurrentPush + * ${test.main.class} * @summary This test exercises some of the HTTP/3 specifities for PushPromises. * It sends several concurrent requests, and the server sends a bunch of * identical push promise frames to all of them. That is, there will be diff --git a/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java b/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java index 12956604484..21ab06f8a5c 100644 --- a/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java @@ -32,7 +32,7 @@ * -Djdk.httpclient.keepalive.timeout.h3=480 * -Djdk.httpclient.quic.idleTimeout=480 * -Djdk.test.server.quic.idleTimeout=480 - * H3ConnectionPoolTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java b/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java index 8a83b51a174..51c30ccfe95 100644 --- a/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java +++ b/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java @@ -70,7 +70,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djavax.net.debug=all - * H3DataLimitsTest + * ${test.main.class} * @summary Verify handling of MAX_DATA / MAX_STREAM_DATA frames */ public class H3DataLimitsTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java b/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java index 8e20eac95fa..07e086f0676 100644 --- a/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java @@ -84,7 +84,7 @@ import static org.junit.jupiter.api.Assertions.*; * @build java.net.http/jdk.internal.net.http.Http3ConnectionAccess * @run junit/othervm * -Djdk.internal.httpclient.debug=true - * -Djdk.httpclient.HttpClient.log=requests,responses,errors H3ErrorHandlingTest + * -Djdk.httpclient.HttpClient.log=requests,responses,errors ${test.main.class} */ public class H3ErrorHandlingTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3GoAwayTest.java b/test/jdk/java/net/httpclient/http3/H3GoAwayTest.java index b9d50ce2939..03d1f8b4ea4 100644 --- a/test/jdk/java/net/httpclient/http3/H3GoAwayTest.java +++ b/test/jdk/java/net/httpclient/http3/H3GoAwayTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * @build jdk.test.lib.net.SimpleSSLContext * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors,headers,quic:hs,http3 - * H3GoAwayTest + * ${test.main.class} */ public class H3GoAwayTest { diff --git a/test/jdk/java/net/httpclient/http3/H3HeaderSizeLimitTest.java b/test/jdk/java/net/httpclient/http3/H3HeaderSizeLimitTest.java index d5864989436..d4cf941b007 100644 --- a/test/jdk/java/net/httpclient/http3/H3HeaderSizeLimitTest.java +++ b/test/jdk/java/net/httpclient/http3/H3HeaderSizeLimitTest.java @@ -58,7 +58,7 @@ import org.junit.jupiter.api.Test; * @build java.net.http/jdk.internal.net.http.Http3ConnectionAccess * @run junit/othervm * -Djdk.internal.httpclient.debug=true - * -Djdk.httpclient.HttpClient.log=requests,responses,errors H3HeaderSizeLimitTest + * -Djdk.httpclient.HttpClient.log=requests,responses,errors ${test.main.class} */ public class H3HeaderSizeLimitTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3HeadersEncoding.java b/test/jdk/java/net/httpclient/http3/H3HeadersEncoding.java index 6b7b24f049d..142856596e6 100644 --- a/test/jdk/java/net/httpclient/http3/H3HeadersEncoding.java +++ b/test/jdk/java/net/httpclient/http3/H3HeadersEncoding.java @@ -33,7 +33,7 @@ * -Dhttp3.test.server.decoderMaxTableCapacity=4096 * -Dhttp3.test.server.encoderTableCapacityLimit=4096 * -Djdk.internal.httpclient.qpack.log.level=NORMAL - * H3HeadersEncoding + * ${test.main.class} * @summary this test verifies that when QPACK dynamic table is enabled multiple * random headers can be encoded/decoded correctly */ diff --git a/test/jdk/java/net/httpclient/http3/H3ImplicitPushCancel.java b/test/jdk/java/net/httpclient/http3/H3ImplicitPushCancel.java index 570f84ad620..d9746d496f3 100644 --- a/test/jdk/java/net/httpclient/http3/H3ImplicitPushCancel.java +++ b/test/jdk/java/net/httpclient/http3/H3ImplicitPushCancel.java @@ -28,7 +28,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace - * H3ImplicitPushCancel + * ${test.main.class} * @summary This is a clone of http2/ImplicitPushCancel but for HTTP/3 */ diff --git a/test/jdk/java/net/httpclient/http3/H3InsertionsLimitTest.java b/test/jdk/java/net/httpclient/http3/H3InsertionsLimitTest.java index 6eabc23677a..35e5e56bc16 100644 --- a/test/jdk/java/net/httpclient/http3/H3InsertionsLimitTest.java +++ b/test/jdk/java/net/httpclient/http3/H3InsertionsLimitTest.java @@ -67,7 +67,7 @@ import org.junit.jupiter.api.Test; * -Dhttp3.test.server.encoderTableCapacityLimit=4096 * -Djdk.httpclient.maxLiteralWithIndexing=32 * -Djdk.internal.httpclient.qpack.log.level=EXTRA - * H3InsertionsLimitTest + * ${test.main.class} */ public class H3InsertionsLimitTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3LogHandshakeErrors.java b/test/jdk/java/net/httpclient/http3/H3LogHandshakeErrors.java index 85a4b6113f0..a69028ca701 100644 --- a/test/jdk/java/net/httpclient/http3/H3LogHandshakeErrors.java +++ b/test/jdk/java/net/httpclient/http3/H3LogHandshakeErrors.java @@ -63,7 +63,7 @@ import org.junit.jupiter.api.Test; * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm * -Djdk.httpclient.HttpClient.log=errors - * H3LogHandshakeErrors + * ${test.main.class} */ // -Djava.security.debug=all public class H3LogHandshakeErrors implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java b/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java index a93c6a37594..33d8c1db994 100644 --- a/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java +++ b/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java @@ -75,15 +75,15 @@ import org.junit.jupiter.params.provider.MethodSource; * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=1 - * H3MaxInitialTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=2 - * H3MaxInitialTimeoutTest + * ${test.main.class} * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=2147483647 - * H3MaxInitialTimeoutTest + * ${test.main.class} */ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3MemoryHandlingTest.java b/test/jdk/java/net/httpclient/http3/H3MemoryHandlingTest.java index 0d107486fcd..548bd546dab 100644 --- a/test/jdk/java/net/httpclient/http3/H3MemoryHandlingTest.java +++ b/test/jdk/java/net/httpclient/http3/H3MemoryHandlingTest.java @@ -67,7 +67,7 @@ import org.junit.jupiter.api.Test; * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djdk.httpclient.quic.maxStreamInitialData=16384 - * -Djdk.httpclient.quic.streamBufferSize=2048 H3MemoryHandlingTest + * -Djdk.httpclient.quic.streamBufferSize=2048 ${test.main.class} */ public class H3MemoryHandlingTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3MultipleConnectionsToSameHost.java b/test/jdk/java/net/httpclient/http3/H3MultipleConnectionsToSameHost.java index f9ba35359bc..c38671e65b8 100644 --- a/test/jdk/java/net/httpclient/http3/H3MultipleConnectionsToSameHost.java +++ b/test/jdk/java/net/httpclient/http3/H3MultipleConnectionsToSameHost.java @@ -44,7 +44,7 @@ * -Djdk.httpclient.retryOnStreamlimit=50 * -Djdk.httpclient.HttpClient.log=errors,http3,quic:retransmit * -Dsimpleget.requests=100 - * H3MultipleConnectionsToSameHost + * ${test.main.class} * @summary test multiple connections and concurrent requests with blocking IO and virtual threads */ /* @@ -71,7 +71,7 @@ * -Djdk.httpclient.retryOnStreamlimit=50 * -Djdk.httpclient.HttpClient.log=errors,http3,quic:retransmit * -Dsimpleget.requests=100 - * H3MultipleConnectionsToSameHost + * ${test.main.class} * @summary test multiple connections and concurrent requests with blocking IO and virtual threads * on windows 10 and windows 2016 - but with -XX:-VMContinuations */ @@ -95,7 +95,7 @@ * -Djdk.httpclient.retryOnStreamlimit=50 * -Djdk.httpclient.HttpClient.log=errors,http3,quic:hs:retransmit * -Dsimpleget.requests=100 - * H3MultipleConnectionsToSameHost + * ${test.main.class} * @summary Send 100 large concurrent requests, with connections whose max stream * limit is artificially low, in order to cause concurrent connections * to the same host to be created, with non-blocking IO and selector @@ -120,7 +120,7 @@ * -Djdk.httpclient.HttpClient.log=errors,http3,quic:hs:retransmit * -Dsimpleget.requests=100 * -Djdk.internal.httpclient.quic.congestionController=reno - * H3MultipleConnectionsToSameHost + * ${test.main.class} * @summary Send 100 large concurrent requests, with connections whose max stream * limit is artificially low, in order to cause concurrent connections * to the same host to be created, with Reno congestion controller diff --git a/test/jdk/java/net/httpclient/http3/H3ProxyTest.java b/test/jdk/java/net/httpclient/http3/H3ProxyTest.java index 58deeec1982..fbb4e07fd60 100644 --- a/test/jdk/java/net/httpclient/http3/H3ProxyTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * if HTTP3_ONLY is specified * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run main/othervm H3ProxyTest + * @run main/othervm ${test.main.class} * @author danielfuchs */ public class H3ProxyTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3PushCancel.java b/test/jdk/java/net/httpclient/http3/H3PushCancel.java index b9e15b7d8e5..969297a50ba 100644 --- a/test/jdk/java/net/httpclient/http3/H3PushCancel.java +++ b/test/jdk/java/net/httpclient/http3/H3PushCancel.java @@ -29,7 +29,7 @@ * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace * -Djdk.httpclient.http3.maxConcurrentPushStreams=5 - * H3PushCancel + * ${test.main.class} * @summary This test checks that not accepting one of the push promise * will cancel it. It also verifies that receiving a pushId bigger * than the max push ID allowed on the connection will cause diff --git a/test/jdk/java/net/httpclient/http3/H3QuicTLSConnection.java b/test/jdk/java/net/httpclient/http3/H3QuicTLSConnection.java index 6086c26729b..b66744d9f0d 100644 --- a/test/jdk/java/net/httpclient/http3/H3QuicTLSConnection.java +++ b/test/jdk/java/net/httpclient/http3/H3QuicTLSConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * @run main/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all - * H3QuicTLSConnection + * ${test.main.class} */ public class H3QuicTLSConnection { diff --git a/test/jdk/java/net/httpclient/http3/H3QuicVTTest.java b/test/jdk/java/net/httpclient/http3/H3QuicVTTest.java index 7ea24d81ded..b982528b5e3 100644 --- a/test/jdk/java/net/httpclient/http3/H3QuicVTTest.java +++ b/test/jdk/java/net/httpclient/http3/H3QuicVTTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors,http3 - * H3QuicVTTest + * ${test.main.class} */ /* * @test id=never @@ -70,7 +70,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * @run junit/othervm * -Djdk.internal.httpclient.quic.selector.useVirtualThreads=never * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors,http3 - * H3QuicVTTest + * ${test.main.class} */ /* * @test id=always @@ -83,7 +83,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * @run junit/othervm * -Djdk.internal.httpclient.quic.selector.useVirtualThreads=always * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors,http3 - * H3QuicVTTest + * ${test.main.class} */ /* * @test id=explicit-default @@ -96,7 +96,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * @run junit/othervm * -Djdk.internal.httpclient.quic.selector.useVirtualThreads=default * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors,http3 - * H3QuicVTTest + * ${test.main.class} */ /* * @test id=garbage @@ -109,7 +109,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; * @run junit/othervm * -Djdk.internal.httpclient.quic.selector.useVirtualThreads=garbage * -Djdk.httpclient.HttpClient.log=requests,responses,headers,errors,http3 - * H3QuicVTTest + * ${test.main.class} */ // -Djava.security.debug=all class H3QuicVTTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3RedirectTest.java b/test/jdk/java/net/httpclient/http3/H3RedirectTest.java index 67a7d99fa71..4f6c80dc3a2 100644 --- a/test/jdk/java/net/httpclient/http3/H3RedirectTest.java +++ b/test/jdk/java/net/httpclient/http3/H3RedirectTest.java @@ -31,7 +31,7 @@ * @run junit/othervm * -Djdk.httpclient.HttpClient.log=frames,ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true - * H3RedirectTest + * ${test.main.class} */ import java.net.InetSocketAddress; diff --git a/test/jdk/java/net/httpclient/http3/H3ServerPush.java b/test/jdk/java/net/httpclient/http3/H3ServerPush.java index 50aa817b155..c53828b189d 100644 --- a/test/jdk/java/net/httpclient/http3/H3ServerPush.java +++ b/test/jdk/java/net/httpclient/http3/H3ServerPush.java @@ -32,7 +32,7 @@ * @run junit/othervm/timeout=960 * -Djdk.httpclient.HttpClient.log=errors,requests,headers * -Djdk.internal.httpclient.debug=false - * H3ServerPush + * ${test.main.class} * @summary This is a clone of http2/ServerPush but for HTTP/3 */ diff --git a/test/jdk/java/net/httpclient/http3/H3ServerPushCancel.java b/test/jdk/java/net/httpclient/http3/H3ServerPushCancel.java index b34e2a1567e..955023599d3 100644 --- a/test/jdk/java/net/httpclient/http3/H3ServerPushCancel.java +++ b/test/jdk/java/net/httpclient/http3/H3ServerPushCancel.java @@ -29,7 +29,7 @@ * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses,trace * -Djdk.httpclient.http3.maxConcurrentPushStreams=45 - * H3ServerPushCancel + * ${test.main.class} * @summary This test checks that the client deals correctly with a * CANCEL_PUSH frame sent by the server */ diff --git a/test/jdk/java/net/httpclient/http3/H3ServerPushTest.java b/test/jdk/java/net/httpclient/http3/H3ServerPushTest.java index 00fe651c9cf..018e7c2f11d 100644 --- a/test/jdk/java/net/httpclient/http3/H3ServerPushTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ServerPushTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.fail; * /test/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm/timeout=240 H3ServerPushTest + * @run junit/othervm/timeout=240 ${test.main.class} */ /** diff --git a/test/jdk/java/net/httpclient/http3/H3ServerPushWithDiffTypes.java b/test/jdk/java/net/httpclient/http3/H3ServerPushWithDiffTypes.java index a863db43c29..ecc3c828abf 100644 --- a/test/jdk/java/net/httpclient/http3/H3ServerPushWithDiffTypes.java +++ b/test/jdk/java/net/httpclient/http3/H3ServerPushWithDiffTypes.java @@ -28,7 +28,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,responses - * H3ServerPushWithDiffTypes + * ${test.main.class} * @summary This is a clone of http2/ServerPushWithDiffTypes but for HTTP/3 */ diff --git a/test/jdk/java/net/httpclient/http3/H3SimpleGet.java b/test/jdk/java/net/httpclient/http3/H3SimpleGet.java index ae113322cd3..4d58f7094b1 100644 --- a/test/jdk/java/net/httpclient/http3/H3SimpleGet.java +++ b/test/jdk/java/net/httpclient/http3/H3SimpleGet.java @@ -31,19 +31,19 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.httpclient.retryOnStreamlimit=20 * -Djdk.httpclient.redirects.retrylimit=21 * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Dsimpleget.requests=150 * -Dsimpleget.chunks=16384 * -Djdk.httpclient.retryOnStreamlimit=5 * -Djdk.httpclient.redirects.retrylimit=6 * -Djdk.httpclient.quic.defaultMTU=16336 - * H3SimpleGet + * ${test.main.class} */ /* @@ -54,19 +54,19 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.httpclient.retryOnStreamlimit=20 * -Djdk.httpclient.redirects.retrylimit=21 * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Dsimpleget.requests=150 * -Dsimpleget.chunks=16384 * -Djdk.httpclient.retryOnStreamlimit=5 * -Djdk.httpclient.redirects.retrylimit=6 * -Djdk.httpclient.quic.defaultMTU=8192 - * H3SimpleGet + * ${test.main.class} */ /* @@ -79,13 +79,13 @@ * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations * -Djdk.httpclient.retryOnStreamlimit=20 * -Djdk.httpclient.redirects.retrylimit=21 * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations * -Dsimpleget.requests=150 @@ -93,7 +93,7 @@ * -Djdk.httpclient.retryOnStreamlimit=5 * -Djdk.httpclient.redirects.retrylimit=6 * -Djdk.httpclient.quic.defaultMTU=16336 - * H3SimpleGet + * ${test.main.class} */ /* @@ -105,13 +105,13 @@ * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true * -Djdk.httpclient.retryOnStreamlimit=20 * -Djdk.httpclient.redirects.retrylimit=21 * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true * -Dsimpleget.requests=150 @@ -119,7 +119,7 @@ * -Djdk.httpclient.retryOnStreamlimit=5 * -Djdk.httpclient.redirects.retrylimit=6 * -Djdk.httpclient.quic.defaultMTU=16336 - * H3SimpleGet + * ${test.main.class} */ /* @@ -131,13 +131,13 @@ * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true * -Djdk.httpclient.retryOnStreamlimit=20 * -Djdk.httpclient.redirects.retrylimit=21 * -Dsimpleget.repeat=1 -Dsimpleget.chunks=1 -Dsimpleget.requests=1000 - * H3SimpleGet + * ${test.main.class} * @run junit/othervm/timeout=480 -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError * -Djdk.internal.httpclient.quic.useNioSelector=true * -Dsimpleget.requests=150 @@ -145,7 +145,7 @@ * -Djdk.httpclient.retryOnStreamlimit=5 * -Djdk.httpclient.redirects.retrylimit=6 * -Djdk.httpclient.quic.defaultMTU=8192 - * H3SimpleGet + * ${test.main.class} */ /* @@ -155,7 +155,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.http2.Http2TestServer * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.quic.congestionController=reno - * H3SimpleGet + * ${test.main.class} * @summary send multiple GET requests using Reno congestion controller */ diff --git a/test/jdk/java/net/httpclient/http3/H3SimplePost.java b/test/jdk/java/net/httpclient/http3/H3SimplePost.java index 0294f2f69da..6444f2ca90c 100644 --- a/test/jdk/java/net/httpclient/http3/H3SimplePost.java +++ b/test/jdk/java/net/httpclient/http3/H3SimplePost.java @@ -27,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.http2.Http2TestServer - * @run junit/othervm/timeout=480 H3SimplePost + * @run junit/othervm/timeout=480 ${test.main.class} */ // -Djdk.httpclient.HttpClient.log=requests,errors,quic // -Djdk.httpclient.quic.defaultMTU=64000 diff --git a/test/jdk/java/net/httpclient/http3/H3SimpleTest.java b/test/jdk/java/net/httpclient/http3/H3SimpleTest.java index 4258f3bac73..78a1b55fda6 100644 --- a/test/jdk/java/net/httpclient/http3/H3SimpleTest.java +++ b/test/jdk/java/net/httpclient/http3/H3SimpleTest.java @@ -54,22 +54,22 @@ import org.junit.jupiter.api.Test; * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * H3SimpleTest + * ${test.main.class} * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djava.net.preferIPv6Addresses=true - * H3SimpleTest + * ${test.main.class} * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djava.net.preferIPv4Stack=true - * H3SimpleTest + * ${test.main.class} * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djdk.internal.httpclient.quic.congestionController=reno - * H3SimpleTest + * ${test.main.class} */ // -Djava.security.debug=all public class H3SimpleTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3StopSendingTest.java b/test/jdk/java/net/httpclient/http3/H3StopSendingTest.java index 86b12a1dae6..3eb88c88f9e 100644 --- a/test/jdk/java/net/httpclient/http3/H3StopSendingTest.java +++ b/test/jdk/java/net/httpclient/http3/H3StopSendingTest.java @@ -27,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm/timeout=40 -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=trace,errors,headers - * H3StopSendingTest + * ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/http3/H3StreamLimitReachedTest.java b/test/jdk/java/net/httpclient/http3/H3StreamLimitReachedTest.java index 1ac4a750d77..aa14087862b 100644 --- a/test/jdk/java/net/httpclient/http3/H3StreamLimitReachedTest.java +++ b/test/jdk/java/net/httpclient/http3/H3StreamLimitReachedTest.java @@ -49,7 +49,7 @@ * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors,http3,quic:control * -Djdk.internal.httpclient.debug=false * -Djdk.internal.httpclient.quic.maxBidiStreams=1 - * H3StreamLimitReachedTest + * ${test.main.class} */ /* @@ -82,7 +82,7 @@ * -Djdk.internal.httpclient.quic.maxBidiStreams=1 * -Djdk.httpclient.http3.maxStreamLimitTimeout=0 * -Djdk.httpclient.retryOnStreamlimit=9 - * H3StreamLimitReachedTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/http3/H3Timeout.java b/test/jdk/java/net/httpclient/http3/H3Timeout.java index fedb4d46952..befc8e5d159 100644 --- a/test/jdk/java/net/httpclient/http3/H3Timeout.java +++ b/test/jdk/java/net/httpclient/http3/H3Timeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ import static java.net.http.HttpOption.H3_DISCOVERY; * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.common.HttpServerAdapters * @compile ../ReferenceTracker.java - * @run main/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors H3Timeout + * @run main/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors ${test.main.class} */ public class H3Timeout implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/H3UnsupportedSSLParametersTest.java b/test/jdk/java/net/httpclient/http3/H3UnsupportedSSLParametersTest.java index 790af245db8..2a490884927 100644 --- a/test/jdk/java/net/httpclient/http3/H3UnsupportedSSLParametersTest.java +++ b/test/jdk/java/net/httpclient/http3/H3UnsupportedSSLParametersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @summary Tests that a HttpClient configured with SSLParameters that doesn't include TLSv1.3 * cannot be used for HTTP3 * @library /test/lib /test/jdk/java/net/httpclient/lib - * @run junit H3UnsupportedSSLParametersTest + * @run junit ${test.main.class} */ public class H3UnsupportedSSLParametersTest { diff --git a/test/jdk/java/net/httpclient/http3/H3UserInfoTest.java b/test/jdk/java/net/httpclient/http3/H3UserInfoTest.java index 8eaad2ce4de..ad5db51f48b 100644 --- a/test/jdk/java/net/httpclient/http3/H3UserInfoTest.java +++ b/test/jdk/java/net/httpclient/http3/H3UserInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ import static org.junit.jupiter.api.Assertions.fail; * @compile ../ReferenceTracker.java * @run junit/othervm -Djdk.httpclient.HttpClient.log=quic,errors * -Djdk.httpclient.http3.maxDirectConnectionTimeout=4000 - * -Djdk.internal.httpclient.debug=true H3UserInfoTest + * -Djdk.internal.httpclient.debug=true ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/test/jdk/java/net/httpclient/http3/HTTP3NoBodyTest.java b/test/jdk/java/net/httpclient/http3/HTTP3NoBodyTest.java index b43ce8dcf79..fcd5b1eadb7 100644 --- a/test/jdk/java/net/httpclient/http3/HTTP3NoBodyTest.java +++ b/test/jdk/java/net/httpclient/http3/HTTP3NoBodyTest.java @@ -31,7 +31,7 @@ * @compile ../ReferenceTracker.java * @run junit/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true - * HTTP3NoBodyTest + * ${test.main.class} * @summary this is a copy of http2/NoBodyTest over HTTP/3 */ diff --git a/test/jdk/java/net/httpclient/http3/Http3ExpectContinueTest.java b/test/jdk/java/net/httpclient/http3/Http3ExpectContinueTest.java index 1cf6900ed5d..0d34c197d1a 100644 --- a/test/jdk/java/net/httpclient/http3/Http3ExpectContinueTest.java +++ b/test/jdk/java/net/httpclient/http3/Http3ExpectContinueTest.java @@ -29,7 +29,7 @@ * @build jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,headers - * Http3ExpectContinueTest + * ${test.main.class} */ import jdk.httpclient.test.lib.common.HttpServerAdapters; diff --git a/test/jdk/java/net/httpclient/http3/PeerUniStreamDispatcherTest.java b/test/jdk/java/net/httpclient/http3/PeerUniStreamDispatcherTest.java index fc6d43bb472..7404a3cb1e9 100644 --- a/test/jdk/java/net/httpclient/http3/PeerUniStreamDispatcherTest.java +++ b/test/jdk/java/net/httpclient/http3/PeerUniStreamDispatcherTest.java @@ -25,7 +25,7 @@ * @test * @run junit/othervm * -Djdk.internal.httpclient.debug=out - * PeerUniStreamDispatcherTest + * ${test.main.class} * @summary Unit test for the PeerUniStreamDispatcher */ diff --git a/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java b/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java index 1f109e27ebc..c783da4a10b 100644 --- a/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java +++ b/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java @@ -85,7 +85,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @compile ../ReferenceTracker.java * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors - * PostHTTP3Test + * ${test.main.class} * @summary Basic HTTP/3 POST test */ // -Djdk.httpclient.http3.maxDirectConnectionTimeout=2500 diff --git a/test/jdk/java/net/httpclient/http3/StopSendingTest.java b/test/jdk/java/net/httpclient/http3/StopSendingTest.java index 8c9a6f84b65..e13568740bb 100644 --- a/test/jdk/java/net/httpclient/http3/StopSendingTest.java +++ b/test/jdk/java/net/httpclient/http3/StopSendingTest.java @@ -61,7 +61,7 @@ import org.junit.jupiter.api.Test; * jdk.httpclient.test.lib.common.HttpServerAdapters * @compile ../ReferenceTracker.java * @run junit/othervm -Djdk.internal.httpclient.debug=true - * -Djdk.httpclient.HttpClient.log=requests,responses,errors StopSendingTest + * -Djdk.httpclient.HttpClient.log=requests,responses,errors ${test.main.class} */ public class StopSendingTest implements HttpServerAdapters { diff --git a/test/jdk/java/net/httpclient/http3/StreamLimitTest.java b/test/jdk/java/net/httpclient/http3/StreamLimitTest.java index 9e15db9ceb9..6505a542e8c 100644 --- a/test/jdk/java/net/httpclient/http3/StreamLimitTest.java +++ b/test/jdk/java/net/httpclient/http3/StreamLimitTest.java @@ -65,7 +65,7 @@ import org.junit.jupiter.api.Test; * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http3.Http3TestServer - * @run junit/othervm -Djdk.internal.httpclient.debug=true StreamLimitTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class StreamLimitTest { diff --git a/test/jdk/java/net/httpclient/offline/OfflineTesting.java b/test/jdk/java/net/httpclient/offline/OfflineTesting.java index f36a457022e..754a4233f3f 100644 --- a/test/jdk/java/net/httpclient/offline/OfflineTesting.java +++ b/test/jdk/java/net/httpclient/offline/OfflineTesting.java @@ -25,7 +25,7 @@ * @test * @summary Demonstrates how to achieve testing without network connections * @build DelegatingHttpClient FixedHttpResponse FixedResponseHttpClient - * @run junit/othervm OfflineTesting + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/qpack/BlockingDecodingTest.java b/test/jdk/java/net/httpclient/qpack/BlockingDecodingTest.java index 778783ad64c..afa61c0e582 100644 --- a/test/jdk/java/net/httpclient/qpack/BlockingDecodingTest.java +++ b/test/jdk/java/net/httpclient/qpack/BlockingDecodingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ import org.junit.jupiter.api.Test; * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA BlockingDecodingTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/qpack/DecoderInstructionsReaderTest.java b/test/jdk/java/net/httpclient/qpack/DecoderInstructionsReaderTest.java index e231d0dded3..ea945b76f83 100644 --- a/test/jdk/java/net/httpclient/qpack/DecoderInstructionsReaderTest.java +++ b/test/jdk/java/net/httpclient/qpack/DecoderInstructionsReaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @key randomness * @library /test/lib - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL DecoderInstructionsReaderTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ import jdk.internal.net.http.qpack.QPACK; diff --git a/test/jdk/java/net/httpclient/qpack/DecoderInstructionsWriterTest.java b/test/jdk/java/net/httpclient/qpack/DecoderInstructionsWriterTest.java index 275dec34927..539eb47dc53 100644 --- a/test/jdk/java/net/httpclient/qpack/DecoderInstructionsWriterTest.java +++ b/test/jdk/java/net/httpclient/qpack/DecoderInstructionsWriterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL DecoderInstructionsWriterTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ import jdk.internal.net.http.qpack.DynamicTable; diff --git a/test/jdk/java/net/httpclient/qpack/DecoderSectionSizeLimitTest.java b/test/jdk/java/net/httpclient/qpack/DecoderSectionSizeLimitTest.java index 1ad094916d4..372554e824f 100644 --- a/test/jdk/java/net/httpclient/qpack/DecoderSectionSizeLimitTest.java +++ b/test/jdk/java/net/httpclient/qpack/DecoderSectionSizeLimitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL - * DecoderSectionSizeLimitTest + * ${test.main.class} */ import jdk.internal.net.http.http3.ConnectionSettings; diff --git a/test/jdk/java/net/httpclient/qpack/DecoderTest.java b/test/jdk/java/net/httpclient/qpack/DecoderTest.java index 15d4bef7cc9..799ea13d45f 100644 --- a/test/jdk/java/net/httpclient/qpack/DecoderTest.java +++ b/test/jdk/java/net/httpclient/qpack/DecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit/othervm DecoderTest + * @run junit/othervm ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class DecoderTest { diff --git a/test/jdk/java/net/httpclient/qpack/DynamicTableFieldLineRepresentationTest.java b/test/jdk/java/net/httpclient/qpack/DynamicTableFieldLineRepresentationTest.java index c314688ab52..0a93a2ed594 100644 --- a/test/jdk/java/net/httpclient/qpack/DynamicTableFieldLineRepresentationTest.java +++ b/test/jdk/java/net/httpclient/qpack/DynamicTableFieldLineRepresentationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ import org.junit.jupiter.api.Test; * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA * -Djdk.http.qpack.allowBlockingEncoding=true * -Djdk.http.qpack.decoderBlockedStreams=4 - * DynamicTableFieldLineRepresentationTest + * ${test.main.class} */ public class DynamicTableFieldLineRepresentationTest { diff --git a/test/jdk/java/net/httpclient/qpack/DynamicTableTest.java b/test/jdk/java/net/httpclient/qpack/DynamicTableTest.java index c340a25088a..d87532329e5 100644 --- a/test/jdk/java/net/httpclient/qpack/DynamicTableTest.java +++ b/test/jdk/java/net/httpclient/qpack/DynamicTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @library /test/lib * @modules java.net.http/jdk.internal.net.http.qpack:+open * java.net.http/jdk.internal.net.http.qpack.readers - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL DynamicTableTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ import jdk.internal.net.http.qpack.DynamicTable; diff --git a/test/jdk/java/net/httpclient/qpack/EncoderDecoderConnectionTest.java b/test/jdk/java/net/httpclient/qpack/EncoderDecoderConnectionTest.java index c2bed98bc3c..99680608db8 100644 --- a/test/jdk/java/net/httpclient/qpack/EncoderDecoderConnectionTest.java +++ b/test/jdk/java/net/httpclient/qpack/EncoderDecoderConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test; * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA - * EncoderDecoderConnectionTest + * ${test.main.class} */ public class EncoderDecoderConnectionTest { diff --git a/test/jdk/java/net/httpclient/qpack/EncoderDecoderTest.java b/test/jdk/java/net/httpclient/qpack/EncoderDecoderTest.java index 7dc1bf73960..9b277c87c3c 100644 --- a/test/jdk/java/net/httpclient/qpack/EncoderDecoderTest.java +++ b/test/jdk/java/net/httpclient/qpack/EncoderDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector - * @run junit/othervm EncoderDecoderTest + * @run junit/othervm ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class EncoderDecoderTest { diff --git a/test/jdk/java/net/httpclient/qpack/EncoderInstructionsReaderTest.java b/test/jdk/java/net/httpclient/qpack/EncoderInstructionsReaderTest.java index 5c31762cdb3..3a816f4203e 100644 --- a/test/jdk/java/net/httpclient/qpack/EncoderInstructionsReaderTest.java +++ b/test/jdk/java/net/httpclient/qpack/EncoderInstructionsReaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test * @key randomness * @library /test/lib - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL EncoderInstructionsReaderTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ import jdk.internal.net.http.hpack.QuickHuffman; diff --git a/test/jdk/java/net/httpclient/qpack/EncoderInstructionsWriterTest.java b/test/jdk/java/net/httpclient/qpack/EncoderInstructionsWriterTest.java index fd1fc41d8f7..cbfe4c15cc8 100644 --- a/test/jdk/java/net/httpclient/qpack/EncoderInstructionsWriterTest.java +++ b/test/jdk/java/net/httpclient/qpack/EncoderInstructionsWriterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.*; * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL EncoderInstructionsWriterTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/test/jdk/java/net/httpclient/qpack/EncoderTest.java b/test/jdk/java/net/httpclient/qpack/EncoderTest.java index b721fa3d27a..3612e027b79 100644 --- a/test/jdk/java/net/httpclient/qpack/EncoderTest.java +++ b/test/jdk/java/net/httpclient/qpack/EncoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,7 +85,7 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit/othervm EncoderTest + * @run junit/othervm ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class EncoderTest { diff --git a/test/jdk/java/net/httpclient/qpack/EntriesEvictionTest.java b/test/jdk/java/net/httpclient/qpack/EntriesEvictionTest.java index 76d15d0ace9..b5b2348b7ab 100644 --- a/test/jdk/java/net/httpclient/qpack/EntriesEvictionTest.java +++ b/test/jdk/java/net/httpclient/qpack/EntriesEvictionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA EntriesEvictionTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA ${test.main.class} */ import java.util.ArrayList; diff --git a/test/jdk/java/net/httpclient/qpack/FieldSectionPrefixTest.java b/test/jdk/java/net/httpclient/qpack/FieldSectionPrefixTest.java index b6fac8291f8..12b1ca60bb4 100644 --- a/test/jdk/java/net/httpclient/qpack/FieldSectionPrefixTest.java +++ b/test/jdk/java/net/httpclient/qpack/FieldSectionPrefixTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * java.net.http/jdk.internal.net.http.http3.streams * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 - * @run junit FieldSectionPrefixTest + * @run junit ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/qpack/IntegerReaderMaxValuesTest.java b/test/jdk/java/net/httpclient/qpack/IntegerReaderMaxValuesTest.java index ac156e2b547..0005c96df88 100644 --- a/test/jdk/java/net/httpclient/qpack/IntegerReaderMaxValuesTest.java +++ b/test/jdk/java/net/httpclient/qpack/IntegerReaderMaxValuesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.qpack.readers * java.net.http/jdk.internal.net.http.qpack.writers * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=INFO - * IntegerReaderMaxValuesTest + * ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class IntegerReaderMaxValuesTest { diff --git a/test/jdk/java/net/httpclient/qpack/StaticTableFieldsTest.java b/test/jdk/java/net/httpclient/qpack/StaticTableFieldsTest.java index eea9b31e932..fcee35df53e 100644 --- a/test/jdk/java/net/httpclient/qpack/StaticTableFieldsTest.java +++ b/test/jdk/java/net/httpclient/qpack/StaticTableFieldsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /* * @test * @modules java.net.http/jdk.internal.net.http.qpack - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL StaticTableFieldsTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=NORMAL ${test.main.class} */ import jdk.internal.net.http.qpack.StaticTable; diff --git a/test/jdk/java/net/httpclient/qpack/StringLengthLimitsTest.java b/test/jdk/java/net/httpclient/qpack/StringLengthLimitsTest.java index 7c94abf1504..56d26db31e4 100644 --- a/test/jdk/java/net/httpclient/qpack/StringLengthLimitsTest.java +++ b/test/jdk/java/net/httpclient/qpack/StringLengthLimitsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector * @run junit/othervm -Djdk.http.qpack.allowBlockingEncoding=true - * StringLengthLimitsTest + * ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class StringLengthLimitsTest { diff --git a/test/jdk/java/net/httpclient/qpack/TablesIndexerTest.java b/test/jdk/java/net/httpclient/qpack/TablesIndexerTest.java index 1a175342c6b..10b5b58b0e4 100644 --- a/test/jdk/java/net/httpclient/qpack/TablesIndexerTest.java +++ b/test/jdk/java/net/httpclient/qpack/TablesIndexerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /* * @test * @modules java.net.http/jdk.internal.net.http.qpack - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=INFO TablesIndexerTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=INFO ${test.main.class} */ import jdk.internal.net.http.qpack.DynamicTable; diff --git a/test/jdk/java/net/httpclient/qpack/UnacknowledgedInsertionTest.java b/test/jdk/java/net/httpclient/qpack/UnacknowledgedInsertionTest.java index 5d0129234f3..24a2195cdbd 100644 --- a/test/jdk/java/net/httpclient/qpack/UnacknowledgedInsertionTest.java +++ b/test/jdk/java/net/httpclient/qpack/UnacknowledgedInsertionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import org.junit.jupiter.params.provider.MethodSource; * java.net.http/jdk.internal.net.http.http3.frames * java.net.http/jdk.internal.net.http.http3 * @build EncoderDecoderConnector - * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA UnacknowledgedInsertionTest + * @run junit/othervm -Djdk.internal.httpclient.qpack.log.level=EXTRA ${test.main.class} */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class UnacknowledgedInsertionTest { diff --git a/test/jdk/java/net/httpclient/quic/AckElicitingTest.java b/test/jdk/java/net/httpclient/quic/AckElicitingTest.java index 7fbc00f9148..97da68c1031 100644 --- a/test/jdk/java/net/httpclient/quic/AckElicitingTest.java +++ b/test/jdk/java/net/httpclient/quic/AckElicitingTest.java @@ -89,8 +89,8 @@ import org.junit.jupiter.params.provider.MethodSource; * @summary tests the logic to decide whether a packet or * a frame is ACK-eliciting. * @library /test/lib - * @run junit AckElicitingTest - * @run junit/othervm -Dseed=-7997973196290088038 AckElicitingTest + * @run junit ${test.main.class} + * @run junit/othervm -Dseed=-7997973196290088038 ${test.main.class} */ public class AckElicitingTest { diff --git a/test/jdk/java/net/httpclient/quic/AckFrameTest.java b/test/jdk/java/net/httpclient/quic/AckFrameTest.java index 3c8c027e73b..51326628521 100644 --- a/test/jdk/java/net/httpclient/quic/AckFrameTest.java +++ b/test/jdk/java/net/httpclient/quic/AckFrameTest.java @@ -46,7 +46,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @test * @summary tests the logic to build an AckFrame * @library /test/lib - * @run junit AckFrameTest + * @run junit ${test.main.class} */ public class AckFrameTest { diff --git a/test/jdk/java/net/httpclient/quic/BuffersReaderTest.java b/test/jdk/java/net/httpclient/quic/BuffersReaderTest.java index 8d03f4265b3..d73178a88ec 100644 --- a/test/jdk/java/net/httpclient/quic/BuffersReaderTest.java +++ b/test/jdk/java/net/httpclient/quic/BuffersReaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.*; * @test * @library /test/lib * @modules java.net.http/jdk.internal.net.http.quic - * @run junit/othervm BuffersReaderTest + * @run junit/othervm ${test.main.class} * @summary Tests various BuffersReader methods * work as expected. */ diff --git a/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java b/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java index 100a6112de5..dc2c4a986c3 100644 --- a/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java +++ b/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java @@ -39,7 +39,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @test * @library /test/lib * @modules java.net.http/jdk.internal.net.http.quic - * @run junit/othervm BuffersReaderVLTest + * @run junit/othervm ${test.main.class} * @summary Tests to check quic/util methods encode/decodeVariableLength methods * work as expected. */ diff --git a/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java b/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java index 96aeace0898..a54662f4f87 100644 --- a/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java +++ b/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; /* * @test - * @run junit/othervm ConnectionIDSTest + * @run junit/othervm ${test.main.class} */ public class ConnectionIDSTest { diff --git a/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java b/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java index 422d71ca964..6a87d859170 100644 --- a/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java +++ b/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; * @summary Tests jdk.internal.net.http.quic.streams,CryptoWriterQueue * @modules java.net.http/jdk.internal.net.http.quic.streams * java.net.http/jdk.internal.net.http.quic.frames - * @run junit CryptoWriterQueueTest + * @run junit ${test.main.class} */ public class CryptoWriterQueueTest { diff --git a/test/jdk/java/net/httpclient/quic/CubicTest.java b/test/jdk/java/net/httpclient/quic/CubicTest.java index f4b08e6d9b7..711be0700fa 100644 --- a/test/jdk/java/net/httpclient/quic/CubicTest.java +++ b/test/jdk/java/net/httpclient/quic/CubicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static org.junit.jupiter.api.Assertions.assertEquals; /* * @test - * @run junit/othervm -Djdk.httpclient.HttpClient.log=trace,quic:cc CubicTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=trace,quic:cc ${test.main.class} */ public class CubicTest { static class TimeSource implements TimeLine { diff --git a/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java b/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java index eaec0bc8b95..23b667d3953 100644 --- a/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java +++ b/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java @@ -83,7 +83,7 @@ import org.junit.jupiter.api.Test; * @run junit/othervm -Djava.security.properties=${test.src}/quic-tls-keylimits-java.security * -Djdk.internal.httpclient.debug=true * -Djavax.net.debug=all - * KeyUpdateTest + * ${test.main.class} */ public class KeyUpdateTest { diff --git a/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java b/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java index a1fafba8760..f5f742d9226 100644 --- a/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java +++ b/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java @@ -50,11 +50,11 @@ import org.junit.jupiter.params.provider.MethodSource; * @summary tests the reordering logic implemented by OrderedFlow * and its two concrete subclasses * @library /test/lib - * @run junit OrderedFlowTest - * @run junit/othervm -Dseed=-2680947227866359853 OrderedFlowTest - * @run junit/othervm -Dseed=-273117134353023275 OrderedFlowTest - * @run junit/othervm -Dseed=3649132517916066643 OrderedFlowTest - * @run junit/othervm -Dseed=4568737726943220431 OrderedFlowTest + * @run junit ${test.main.class} + * @run junit/othervm -Dseed=-2680947227866359853 ${test.main.class} + * @run junit/othervm -Dseed=-273117134353023275 ${test.main.class} + * @run junit/othervm -Dseed=3649132517916066643 ${test.main.class} + * @run junit/othervm -Dseed=4568737726943220431 ${test.main.class} */ public class OrderedFlowTest { diff --git a/test/jdk/java/net/httpclient/quic/PacerTest.java b/test/jdk/java/net/httpclient/quic/PacerTest.java index aebbbce34d3..a624817bd4e 100644 --- a/test/jdk/java/net/httpclient/quic/PacerTest.java +++ b/test/jdk/java/net/httpclient/quic/PacerTest.java @@ -40,7 +40,7 @@ import org.junit.jupiter.params.provider.MethodSource; /* * @test - * @run junit/othervm -Djdk.httpclient.quic.timerFrequency=1000 PacerTest + * @run junit/othervm -Djdk.httpclient.quic.timerFrequency=1000 ${test.main.class} */ public class PacerTest { diff --git a/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java b/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java index a96904c8410..fa43baa853f 100644 --- a/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java @@ -80,17 +80,17 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib * @summary test packet encoding and decoding in unencrypted form and without * any network involvement. - * @run junit/othervm -Dseed=2646683818688275736 PacketEncodingTest - * @run junit/othervm -Dseed=-3723256402256409075 PacketEncodingTest - * @run junit/othervm -Dseed=-3689060484817342283 PacketEncodingTest - * @run junit/othervm -Dseed=2425718686525936108 PacketEncodingTest - * @run junit/othervm -Dseed=-2996954753243104355 PacketEncodingTest - * @run junit/othervm -Dseed=8750823652999067800 PacketEncodingTest - * @run junit/othervm -Dseed=2906555779406889127 PacketEncodingTest - * @run junit/othervm -Dseed=902801756808168822 PacketEncodingTest - * @run junit/othervm -Dseed=5643545543196691308 PacketEncodingTest - * @run junit/othervm -Dseed=2646683818688275736 PacketEncodingTest - * @run junit/othervm -Djdk.internal.httpclient.debug=true PacketEncodingTest + * @run junit/othervm -Dseed=2646683818688275736 ${test.main.class} + * @run junit/othervm -Dseed=-3723256402256409075 ${test.main.class} + * @run junit/othervm -Dseed=-3689060484817342283 ${test.main.class} + * @run junit/othervm -Dseed=2425718686525936108 ${test.main.class} + * @run junit/othervm -Dseed=-2996954753243104355 ${test.main.class} + * @run junit/othervm -Dseed=8750823652999067800 ${test.main.class} + * @run junit/othervm -Dseed=2906555779406889127 ${test.main.class} + * @run junit/othervm -Dseed=902801756808168822 ${test.main.class} + * @run junit/othervm -Dseed=5643545543196691308 ${test.main.class} + * @run junit/othervm -Dseed=2646683818688275736 ${test.main.class} + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class PacketEncodingTest { diff --git a/test/jdk/java/net/httpclient/quic/PacketLossTest.java b/test/jdk/java/net/httpclient/quic/PacketLossTest.java index a597c826e73..9ecb3444060 100644 --- a/test/jdk/java/net/httpclient/quic/PacketLossTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketLossTest.java @@ -63,7 +63,7 @@ import org.junit.jupiter.api.Test; * -Djdk.httpclient.quic.minPtoBackoffTime=60 * -Djdk.httpclient.quic.maxPtoBackoffTime=10 * -Djdk.httpclient.quic.maxPtoBackoff=9 - * -Djdk.httpclient.HttpClient.log=quic,errors PacketLossTest + * -Djdk.httpclient.HttpClient.log=quic,errors ${test.main.class} */ public class PacketLossTest { diff --git a/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java b/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java index c018079ea4e..7c19e8b414e 100644 --- a/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.params.provider.MethodSource; /* * @test - * @run junit PacketNumbersTest + * @run junit ${test.main.class} */ public class PacketNumbersTest { diff --git a/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java b/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java index fe3b748a2fa..0a363e104ae 100644 --- a/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java @@ -94,14 +94,14 @@ import org.junit.jupiter.params.provider.MethodSource; * @library /test/lib * @library ../debug * @build java.net.http/jdk.internal.net.http.common.TestLoggerUtil - * @run junit/othervm PacketSpaceManagerTest - * @run junit/othervm -Dseed=-7947549564260911920 PacketSpaceManagerTest - * @run junit/othervm -Dseed=-5413111674202728207 PacketSpaceManagerTest - * @run junit/othervm -Dseed=-176652423987357212 PacketSpaceManagerTest - * @run junit/othervm -Dseed=6550551791799910315 PacketSpaceManagerTest - * @run junit/othervm -Dseed=-4159871071396382784 PacketSpaceManagerTest - * @run junit/othervm -Dseed=2252276218459363615 PacketSpaceManagerTest - * @run junit/othervm -Dseed=-5130588140709404919 PacketSpaceManagerTest + * @run junit/othervm ${test.main.class} + * @run junit/othervm -Dseed=-7947549564260911920 ${test.main.class} + * @run junit/othervm -Dseed=-5413111674202728207 ${test.main.class} + * @run junit/othervm -Dseed=-176652423987357212 ${test.main.class} + * @run junit/othervm -Dseed=6550551791799910315 ${test.main.class} + * @run junit/othervm -Dseed=-4159871071396382784 ${test.main.class} + * @run junit/othervm -Dseed=2252276218459363615 ${test.main.class} + * @run junit/othervm -Dseed=-5130588140709404919 ${test.main.class} */ // -Djdk.internal.httpclient.debug=true public class PacketSpaceManagerTest { diff --git a/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java b/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java index ef0801e6c18..d6eeda32cad 100644 --- a/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java +++ b/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.params.provider.MethodSource; * @test * @library /test/lib * @summary Tests to check QUIC frame decoding errors are handled correctly - * @run junit/othervm QuicFramesDecoderTest + * @run junit/othervm ${test.main.class} */ public class QuicFramesDecoderTest { diff --git a/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java b/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java index 2393ac7df12..d70b5ac8443 100644 --- a/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java +++ b/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java @@ -55,7 +55,7 @@ import org.junit.jupiter.api.Test; * jdk.httpclient.test.lib.quic.ClientConnection * jdk.httpclient.test.lib.common.TestUtil * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true QuicRequestResponseTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class QuicRequestResponseTest { diff --git a/test/jdk/java/net/httpclient/quic/StatelessResetReceiptTest.java b/test/jdk/java/net/httpclient/quic/StatelessResetReceiptTest.java index 9f7852740b4..bed76c9b0a2 100644 --- a/test/jdk/java/net/httpclient/quic/StatelessResetReceiptTest.java +++ b/test/jdk/java/net/httpclient/quic/StatelessResetReceiptTest.java @@ -71,7 +71,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.quic.QuicStandaloneServer * jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestUtil - * @run junit/othervm -Djdk.internal.httpclient.debug=true StatelessResetReceiptTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class StatelessResetReceiptTest { diff --git a/test/jdk/java/net/httpclient/quic/VariableLengthTest.java b/test/jdk/java/net/httpclient/quic/VariableLengthTest.java index 6d805fbad5a..f5dbb8f159c 100644 --- a/test/jdk/java/net/httpclient/quic/VariableLengthTest.java +++ b/test/jdk/java/net/httpclient/quic/VariableLengthTest.java @@ -38,7 +38,7 @@ import org.opentest4j.TestAbortedException; * @test * @library /test/lib * @modules java.net.http/jdk.internal.net.http.quic - * @run junit/othervm VariableLengthTest + * @run junit/othervm ${test.main.class} * @summary Tests to check quic/util methods encode/decodeVariableLength methods * work as expected. */ diff --git a/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java b/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java index 6b40bf84a8e..bee9bfc7d2c 100644 --- a/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java +++ b/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java @@ -59,7 +59,7 @@ import org.junit.jupiter.api.Test; * jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.quic.ClientConnection * jdk.test.lib.net.SimpleSSLContext - * @run junit/othervm -Djdk.internal.httpclient.debug=true VersionNegotiationTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ public class VersionNegotiationTest { diff --git a/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java b/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java index d80e473696a..bb69e377860 100644 --- a/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java @@ -52,7 +52,7 @@ import org.junit.jupiter.api.Test; * java.base/jdk.internal.net.quic * @build java.base/sun.security.ssl.QuicTLSEngineImplAccessor * @summary known-answer test for packet encryption and decryption - * @run junit/othervm PacketEncryptionTest + * @run junit/othervm ${test.main.class} */ public class PacketEncryptionTest { diff --git a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineBadParametersTest.java b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineBadParametersTest.java index 0b7e6875b96..5a10136470b 100644 --- a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineBadParametersTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineBadParametersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.*; * @build jdk.test.lib.net.SimpleSSLContext * @summary Verify that QuicTransportExceptions thrown by transport parameter consumer * are propagated to the QuicTLSEngine user - * @run junit/othervm QuicTLSEngineBadParametersTest + * @run junit/othervm ${test.main.class} */ public class QuicTLSEngineBadParametersTest { diff --git a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineFailedALPNTest.java b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineFailedALPNTest.java index 5767d81cc83..1fd37e32eaa 100644 --- a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineFailedALPNTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineFailedALPNTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.*; * java.base/jdk.internal.net.quic * @build jdk.test.lib.net.SimpleSSLContext * @summary Verify that a missing ALPN extension results in no_application_protocol alert - * @run junit/othervm QuicTLSEngineFailedALPNTest + * @run junit/othervm ${test.main.class} */ public class QuicTLSEngineFailedALPNTest { diff --git a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineMissingParametersTest.java b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineMissingParametersTest.java index 933d258f912..f5c882a074d 100644 --- a/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineMissingParametersTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/QuicTLSEngineMissingParametersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.*; * java.base/jdk.internal.net.quic * @build jdk.test.lib.net.SimpleSSLContext * @summary Verify that a missing transport parameters extension results in missing_extension alert - * @run junit/othervm QuicTLSEngineMissingParametersTest + * @run junit/othervm ${test.main.class} */ public class QuicTLSEngineMissingParametersTest { diff --git a/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java b/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java index 285fa2e4cd4..6205c8f3c7b 100644 --- a/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java @@ -52,7 +52,7 @@ import org.junit.jupiter.api.Test; * java.base/jdk.internal.net.quic * @build java.base/sun.security.ssl.QuicTLSEngineImplAccessor * @summary known-answer test for packet encryption and decryption with Quic v2 - * @run junit/othervm Quicv2PacketEncryptionTest + * @run junit/othervm ${test.main.class} */ public class Quicv2PacketEncryptionTest { diff --git a/test/jdk/java/net/httpclient/security/filePerms/FileProcessorPermissionTest.java b/test/jdk/java/net/httpclient/security/filePerms/FileProcessorPermissionTest.java index 361b053fe43..d703907c2eb 100644 --- a/test/jdk/java/net/httpclient/security/filePerms/FileProcessorPermissionTest.java +++ b/test/jdk/java/net/httpclient/security/filePerms/FileProcessorPermissionTest.java @@ -24,7 +24,7 @@ /* * @test * @summary Basic checks for File Processors - * @run junit/othervm FileProcessorPermissionTest + * @run junit/othervm ${test.main.class} */ import java.nio.file.Path; diff --git a/test/jdk/java/net/httpclient/security/filePerms/SecurityBeforeFile.java b/test/jdk/java/net/httpclient/security/filePerms/SecurityBeforeFile.java index c8d7bb64b36..ab03ee08d64 100644 --- a/test/jdk/java/net/httpclient/security/filePerms/SecurityBeforeFile.java +++ b/test/jdk/java/net/httpclient/security/filePerms/SecurityBeforeFile.java @@ -25,7 +25,7 @@ * @test * @summary Verifies security checks are performed before existence checks * in pre-defined body processors APIs - * @run junit/othervm SecurityBeforeFile + * @run junit/othervm ${test.main.class} */ import java.io.FileNotFoundException; diff --git a/test/jdk/java/net/httpclient/ssltest/CertificateTest.java b/test/jdk/java/net/httpclient/ssltest/CertificateTest.java index 1d0502c9ce3..23f7aebf9fc 100644 --- a/test/jdk/java/net/httpclient/ssltest/CertificateTest.java +++ b/test/jdk/java/net/httpclient/ssltest/CertificateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * 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,21 +42,21 @@ import jdk.test.lib.security.SSLContextBuilder; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build Server CertificateTest jdk.httpclient.test.lib.common.TestServerConfigurator * @modules java.net.http/jdk.internal.net.http.common - * @run main/othervm CertificateTest GOOD_CERT expectSuccess - * @run main/othervm CertificateTest BAD_CERT expectFailure + * @run main/othervm ${test.main.class} GOOD_CERT expectSuccess + * @run main/othervm ${test.main.class} BAD_CERT expectFailure * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification - * CertificateTest BAD_CERT expectSuccess + * ${test.main.class} BAD_CERT expectSuccess * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=true - * CertificateTest BAD_CERT expectSuccess + * ${test.main.class} BAD_CERT expectSuccess * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=false - * CertificateTest BAD_CERT expectFailure + * ${test.main.class} BAD_CERT expectFailure * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=xxyyzz - * CertificateTest BAD_CERT expectFailure - * @run main/othervm CertificateTest LOOPBACK_CERT expectSuccess + * ${test.main.class} BAD_CERT expectFailure + * @run main/othervm ${test.main.class} LOOPBACK_CERT expectSuccess */ /** diff --git a/test/jdk/java/net/httpclient/ssltest/TlsVersionTest.java b/test/jdk/java/net/httpclient/ssltest/TlsVersionTest.java index 2e364461793..0916022e89a 100644 --- a/test/jdk/java/net/httpclient/ssltest/TlsVersionTest.java +++ b/test/jdk/java/net/httpclient/ssltest/TlsVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ import static java.net.http.HttpClient.Builder.NO_PROXY; * @modules java.net.http/jdk.internal.net.http.common * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification - * TlsVersionTest false + * ${test.main.class} false * * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification * -Djdk.tls.client.protocols="TLSv1.2" - * TlsVersionTest true + * ${test.main.class} true */ /** diff --git a/test/jdk/java/net/httpclient/websocket/Abort.java b/test/jdk/java/net/httpclient/websocket/Abort.java index a6088f8cce2..6a388878db2 100644 --- a/test/jdk/java/net/httpclient/websocket/Abort.java +++ b/test/jdk/java/net/httpclient/websocket/Abort.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.internal.httpclient.websocket.debug=true - * Abort + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/websocket/AutomaticPong.java b/test/jdk/java/net/httpclient/websocket/AutomaticPong.java index b438cb8e728..a590790c29a 100644 --- a/test/jdk/java/net/httpclient/websocket/AutomaticPong.java +++ b/test/jdk/java/net/httpclient/websocket/AutomaticPong.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.internal.httpclient.websocket.debug=true - * AutomaticPong + * ${test.main.class} */ import jdk.internal.net.http.websocket.Frame; diff --git a/test/jdk/java/net/httpclient/websocket/BlowupOutputQueue.java b/test/jdk/java/net/httpclient/websocket/BlowupOutputQueue.java index 1865ca05e4f..191fd4bcb37 100644 --- a/test/jdk/java/net/httpclient/websocket/BlowupOutputQueue.java +++ b/test/jdk/java/net/httpclient/websocket/BlowupOutputQueue.java @@ -27,7 +27,7 @@ * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.internal.httpclient.websocket.debug=true - * BlowupOutputQueue + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/websocket/ConnectionHandoverTest.java b/test/jdk/java/net/httpclient/websocket/ConnectionHandoverTest.java index 30569fa80d7..0633fe9c20f 100644 --- a/test/jdk/java/net/httpclient/websocket/ConnectionHandoverTest.java +++ b/test/jdk/java/net/httpclient/websocket/ConnectionHandoverTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8164625 * @summary Verifies HttpClient yields the connection to the WebSocket * @build DummyWebSocketServer - * @run main/othervm -Djdk.httpclient.HttpClient.log=trace ConnectionHandoverTest + * @run main/othervm -Djdk.httpclient.HttpClient.log=trace ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java b/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java index 6854cacbcc2..344e6fbc086 100644 --- a/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java +++ b/test/jdk/java/net/httpclient/websocket/HandshakeUrlEncodingTest.java @@ -29,7 +29,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver - * @run junit/othervm -Djdk.internal.httpclient.debug=true HandshakeUrlEncodingTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import com.sun.net.httpserver.HttpHandler; diff --git a/test/jdk/java/net/httpclient/websocket/PendingBinaryPingClose.java b/test/jdk/java/net/httpclient/websocket/PendingBinaryPingClose.java index 4a5ae315e91..67d53eafd31 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingBinaryPingClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingBinaryPingClose.java @@ -28,7 +28,7 @@ * -Djdk.httpclient.sendBufferSize=8192 * -Djdk.internal.httpclient.debug=true * -Djdk.internal.httpclient.websocket.debug=true - * PendingBinaryPingClose + * ${test.main.class} */ import java.net.http.WebSocket; diff --git a/test/jdk/java/net/httpclient/websocket/PendingBinaryPongClose.java b/test/jdk/java/net/httpclient/websocket/PendingBinaryPongClose.java index a8330faeb3f..f634fe8bd45 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingBinaryPongClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingBinaryPongClose.java @@ -28,7 +28,7 @@ * -Djdk.httpclient.sendBufferSize=8192 * -Djdk.internal.httpclient.debug=true * -Djdk.internal.httpclient.websocket.debug=true - * PendingBinaryPongClose + * ${test.main.class} */ import java.net.http.WebSocket; diff --git a/test/jdk/java/net/httpclient/websocket/PendingPingBinaryClose.java b/test/jdk/java/net/httpclient/websocket/PendingPingBinaryClose.java index e07ebe0d03a..1f5263368f1 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingPingBinaryClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingPingBinaryClose.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.httpclient.sendBufferSize=8192 - * PendingPingBinaryClose + * ${test.main.class} */ // This test produce huge logs (14Mb+) so disable logging by default diff --git a/test/jdk/java/net/httpclient/websocket/PendingPingTextClose.java b/test/jdk/java/net/httpclient/websocket/PendingPingTextClose.java index eae01f804a4..ab7f3b0be87 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingPingTextClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingPingTextClose.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.httpclient.sendBufferSize=8192 - * PendingPingTextClose + * ${test.main.class} */ // This test produce huge logs (14Mb+) so disable logging by default diff --git a/test/jdk/java/net/httpclient/websocket/PendingPongBinaryClose.java b/test/jdk/java/net/httpclient/websocket/PendingPongBinaryClose.java index 32640853b00..2c631c798e0 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingPongBinaryClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingPongBinaryClose.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.httpclient.sendBufferSize=8192 - * PendingPongBinaryClose + * ${test.main.class} */ // This test produce huge logs (14Mb+) so disable logging by default diff --git a/test/jdk/java/net/httpclient/websocket/PendingPongTextClose.java b/test/jdk/java/net/httpclient/websocket/PendingPongTextClose.java index f4d6c84c2f5..33b0ade39e3 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingPongTextClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingPongTextClose.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.httpclient.sendBufferSize=8192 - * PendingPongTextClose + * ${test.main.class} */ // This test produce huge logs (14Mb+) so disable logging by default diff --git a/test/jdk/java/net/httpclient/websocket/PendingTextPingClose.java b/test/jdk/java/net/httpclient/websocket/PendingTextPingClose.java index 76f12430804..a35f27f4b16 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingTextPingClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingTextPingClose.java @@ -28,7 +28,7 @@ * -Djdk.internal.httpclient.debug=true * -Djdk.internal.httpclient.websocket.debug=true * -Djdk.httpclient.sendBufferSize=8192 - * PendingTextPingClose + * ${test.main.class} */ import java.net.http.WebSocket; diff --git a/test/jdk/java/net/httpclient/websocket/PendingTextPongClose.java b/test/jdk/java/net/httpclient/websocket/PendingTextPongClose.java index a2a41a73d7b..80c72297e43 100644 --- a/test/jdk/java/net/httpclient/websocket/PendingTextPongClose.java +++ b/test/jdk/java/net/httpclient/websocket/PendingTextPongClose.java @@ -28,7 +28,7 @@ * -Djdk.internal.httpclient.debug=true * -Djdk.internal.httpclient.websocket.debug=true * -Djdk.httpclient.sendBufferSize=8192 - * PendingTextPongClose + * ${test.main.class} */ import java.net.http.WebSocket; diff --git a/test/jdk/java/net/httpclient/websocket/SendTest.java b/test/jdk/java/net/httpclient/websocket/SendTest.java index b3a433b5c29..124d15e1cc0 100644 --- a/test/jdk/java/net/httpclient/websocket/SendTest.java +++ b/test/jdk/java/net/httpclient/websocket/SendTest.java @@ -26,7 +26,7 @@ * @build DummyWebSocketServer * @run junit/othervm * -Djdk.internal.httpclient.websocket.debug=true - * SendTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java b/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java index f28d84b2f20..cf77c66e7c7 100644 --- a/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java +++ b/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java @@ -29,7 +29,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver - * @run junit/othervm -Djdk.internal.httpclient.debug=true WSHandshakeExceptionTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true ${test.main.class} */ import com.sun.net.httpserver.HttpHandler; diff --git a/test/jdk/java/net/httpclient/websocket/WebSocketBuilderTest.java b/test/jdk/java/net/httpclient/websocket/WebSocketBuilderTest.java index beef8cb42a4..a5b5f73077c 100644 --- a/test/jdk/java/net/httpclient/websocket/WebSocketBuilderTest.java +++ b/test/jdk/java/net/httpclient/websocket/WebSocketBuilderTest.java @@ -26,7 +26,7 @@ * @bug 8159053 * @build DummyWebSocketServer * Support - * @run junit/othervm WebSocketBuilderTest + * @run junit/othervm ${test.main.class} */ import java.net.URI; diff --git a/test/jdk/java/net/httpclient/websocket/WebSocketEndiannessTest.java b/test/jdk/java/net/httpclient/websocket/WebSocketEndiannessTest.java index 0d532669a10..dc28c5a33c2 100644 --- a/test/jdk/java/net/httpclient/websocket/WebSocketEndiannessTest.java +++ b/test/jdk/java/net/httpclient/websocket/WebSocketEndiannessTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @library /test/lib * @build DummyWebSocketServer * jdk.test.lib.Asserts - * @run main WebSocketEndiannessTest + * @run main ${test.main.class} */ import jdk.internal.net.http.websocket.Frame; diff --git a/test/jdk/java/net/httpclient/websocket/WebSocketExtendedTest.java b/test/jdk/java/net/httpclient/websocket/WebSocketExtendedTest.java index 56474555235..e0096a55297 100644 --- a/test/jdk/java/net/httpclient/websocket/WebSocketExtendedTest.java +++ b/test/jdk/java/net/httpclient/websocket/WebSocketExtendedTest.java @@ -28,7 +28,7 @@ * -Djdk.internal.httpclient.websocket.debug=true * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.websocket.writeBufferSize=1024 - * -Djdk.httpclient.websocket.intermediateBufferSize=2048 WebSocketExtendedTest + * -Djdk.httpclient.websocket.intermediateBufferSize=2048 ${test.main.class} */ import jdk.internal.net.http.websocket.Frame; diff --git a/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java b/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java index a410aa9fe75..d3aa4d96866 100644 --- a/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java +++ b/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java @@ -33,7 +33,7 @@ * -Djdk.internal.httpclient.websocket.debug=true * -Djdk.httpclient.HttpClient.log=errors,requests,headers * -Djdk.http.auth.tunneling.disabledSchemes= - * WebSocketProxyTest + * ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/websocket/WebSocketTest.java b/test/jdk/java/net/httpclient/websocket/WebSocketTest.java index 2b1df3d7e87..4d395d9195e 100644 --- a/test/jdk/java/net/httpclient/websocket/WebSocketTest.java +++ b/test/jdk/java/net/httpclient/websocket/WebSocketTest.java @@ -28,7 +28,7 @@ * @build DummyWebSocketServer * java.net.http/jdk.internal.net.http.HttpClientTimerAccess * @run junit/othervm - * WebSocketTest + * ${test.main.class} */ diff --git a/test/jdk/java/net/httpclient/websocket/security/WSSanityTest.java b/test/jdk/java/net/httpclient/websocket/security/WSSanityTest.java index c8e4faa1ad3..7e9e296aa9d 100644 --- a/test/jdk/java/net/httpclient/websocket/security/WSSanityTest.java +++ b/test/jdk/java/net/httpclient/websocket/security/WSSanityTest.java @@ -25,7 +25,7 @@ * @test * @summary Basic sanity checks for WebSocket URI from the Builder * @compile ../DummyWebSocketServer.java ../../ProxyServer.java - * @run junit/othervm WSSanityTest + * @run junit/othervm ${test.main.class} */ import java.io.IOException; diff --git a/test/jdk/java/net/httpclient/whitebox/AltSvcFrameTest.java b/test/jdk/java/net/httpclient/whitebox/AltSvcFrameTest.java index b9e5f2d58fe..e4c3aeffac3 100644 --- a/test/jdk/java/net/httpclient/whitebox/AltSvcFrameTest.java +++ b/test/jdk/java/net/httpclient/whitebox/AltSvcFrameTest.java @@ -89,7 +89,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.disableHostnameVerification * -Djdk.internal.httpclient.debug=true - * AltSvcFrameTest + * ${test.main.class} */ public class AltSvcFrameTest { diff --git a/test/jdk/java/net/httpclient/whitebox/AltSvcRegistryTest.java b/test/jdk/java/net/httpclient/whitebox/AltSvcRegistryTest.java index 682082ba9f8..7e7b2ba6bf3 100644 --- a/test/jdk/java/net/httpclient/whitebox/AltSvcRegistryTest.java +++ b/test/jdk/java/net/httpclient/whitebox/AltSvcRegistryTest.java @@ -80,7 +80,7 @@ import org.junit.jupiter.api.Test; * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.disableHostnameVerification * -Djdk.internal.httpclient.debug=true - * AltSvcRegistryTest + * ${test.main.class} */ public class AltSvcRegistryTest implements HttpServerAdapters { diff --git a/test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java b/test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java index a9b35220de3..d2ab41cb831 100644 --- a/test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java +++ b/test/jdk/java/util/jar/JarEntry/GetMethodsReturnClones.java @@ -21,72 +21,163 @@ * questions. */ +import java.io.IOException; +import java.io.InputStream; +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.Certificate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarOutputStream; +import java.util.zip.ZipFile; + +import jdk.security.jarsigner.JarSigner; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; +import static java.nio.charset.StandardCharsets.US_ASCII; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + /* * @test * @bug 6337925 * @summary Ensure that callers cannot modify the internal JarEntry cert and * codesigner arrays. + * @modules java.base/sun.security.tools.keytool + * java.base/sun.security.x509 * @run junit GetMethodsReturnClones */ -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +class GetMethodsReturnClones { -import java.io.IOException; -import java.io.InputStream; -import java.security.CodeSigner; -import java.security.cert.Certificate; -import java.util.*; -import java.util.jar.*; -import static org.junit.jupiter.api.Assertions.assertNotNull; + private static final String ENTRY_NAME = "foobar.txt"; + private static final String SIGNER_NAME = "DUMMY"; + private static final String DIGEST_ALGORITHM = "SHA-256"; + private static final String SIGNATURE_ALGORITHM = "SHA256withRSA"; + private static final String KEY_TYPE = "RSA"; -public class GetMethodsReturnClones { - - private static final String BASE = System.getProperty("test.src", ".") + - System.getProperty("file.separator"); private static List jarEntries; + /* + * Creates a signed JAR file and initializes the "jarEntries" + */ @BeforeAll() - static void setupEntries() throws IOException { + static void setupJarEntries() throws Exception { + Path unsigned = createJar(); + Path signed = signJar(unsigned); + System.err.println("created signed JAR file at " + signed.toAbsolutePath()); List entries = new ArrayList<>(); - try (JarFile jf = new JarFile(BASE + "test.jar", true)) { - byte[] buffer = new byte[8192]; + try (JarFile jf = new JarFile(signed.toFile(), true)) { Enumeration e = jf.entries(); while (e.hasMoreElements()) { JarEntry je = e.nextElement(); entries.add(je); try (InputStream is = jf.getInputStream(je)) { - while (is.read(buffer, 0, buffer.length) != -1) { - // we just read. this will throw a SecurityException - // if a signature/digest check fails. - } + // we just read. this will throw a SecurityException + // if a signature/digest check fails. + var _ = is.readAllBytes(); } } } jarEntries = entries; } + /* + * For entries in the signed JAR file, this test verifies that if a non-null + * array is returned by the JarEntry.getCertificates() method, then any subsequent + * updates to that returned array do not propagate back to the original array. + */ @Test - void certsTest() { + void testCertificatesArray() { for (JarEntry je : jarEntries) { Certificate[] certs = je.getCertificates(); - if (certs != null) { - certs[0] = null; - certs = je.getCertificates(); - assertNotNull(certs[0], "Modified internal certs array"); + System.err.println("Certificates for " + je.getName() + " " + Arrays.toString(certs)); + if (isSignatureRelated(je)) { + // we don't expect this entry to be signed + assertNull(certs, "JarEntry.getCertificates() returned non-null for " + je.getName()); + continue; } + assertNotNull(certs, "JarEntry.getCertificates() returned null for " + je.getName()); + assertNotNull(certs[0], "Certificate is null"); + + certs[0] = null; // intentionally update the returned array + certs = je.getCertificates(); // now get the certs again + assertNotNull(certs, "JarEntry.getCertificates() returned null for " + je.getName()); + // verify that the newly returned array doesn't have the overwritten value + assertNotNull(certs[0], "Internal certificates array was modified"); } } + /* + * For entries in the signed JAR file, this test verifies that if a non-null + * array is returned by the JarEntry.getCodeSigners() method, then any subsequent + * updates to that returned array do not propagate back to the original array. + */ @Test - void signersTest() { + void testCodeSignersArray() { for (JarEntry je : jarEntries) { CodeSigner[] signers = je.getCodeSigners(); - if (signers != null) { - signers[0] = null; - signers = je.getCodeSigners(); - assertNotNull(signers[0], "Modified internal codesigners array"); + System.err.println("CodeSigners for " + je.getName() + " " + Arrays.toString(signers)); + if (isSignatureRelated(je)) { + // we don't expect this entry to be signed + assertNull(signers, "JarEntry.getCodeSigners() returned non-null for " + je.getName()); + continue; } + assertNotNull(signers, "JarEntry.getCodeSigners() returned null for " + je.getName()); + assertNotNull(signers[0], "CodeSigner is null"); + + signers[0] = null; // intentionally update the array + signers = je.getCodeSigners(); // now get the codesigners again + assertNotNull(signers, "JarEntry.getCodeSigners() returned null for " + je.getName()); + // verify that the newly returned array doesn't have the overwritten value + assertNotNull(signers[0], "CodeSigner is null"); } } + + private static Path createJar() throws IOException { + final Path unsigned = Path.of("unsigned.jar"); + try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(unsigned))) { + out.putNextEntry(new JarEntry(ENTRY_NAME)); + out.write("hello world".getBytes(US_ASCII)); + } + return unsigned; + } + + private static Path signJar(final Path unsigned) throws Exception { + final Path signed = Path.of("signed.jar"); + final JarSigner signer = new JarSigner.Builder(privateKeyEntry()) + .signerName(SIGNER_NAME) + .digestAlgorithm(DIGEST_ALGORITHM) + .signatureAlgorithm(SIGNATURE_ALGORITHM) + .build(); + try (ZipFile zip = new ZipFile(unsigned.toFile()); + OutputStream out = Files.newOutputStream(signed)) { + signer.sign(zip, out); + } + return signed; + } + + private static KeyStore.PrivateKeyEntry privateKeyEntry() throws Exception { + final CertAndKeyGen gen = new CertAndKeyGen(KEY_TYPE, SIGNATURE_ALGORITHM); + gen.generate(4096); + final long oneDayInSecs = TimeUnit.SECONDS.convert(1, TimeUnit.DAYS); + Certificate cert = gen.getSelfCertificate(new X500Name("cn=duke"), oneDayInSecs); + return new KeyStore.PrivateKeyEntry(gen.getPrivateKey(), new Certificate[] {cert}); + } + + private static boolean isSignatureRelated(final JarEntry entry) { + final String entryName = entry.getName(); + return entryName.equals("META-INF/" + SIGNER_NAME + ".SF") + || entryName.equals("META-INF/" + SIGNER_NAME + ".RSA"); + } } diff --git a/test/jdk/java/util/jar/JarEntry/test.jar b/test/jdk/java/util/jar/JarEntry/test.jar deleted file mode 100644 index fb9e4c17349..00000000000 Binary files a/test/jdk/java/util/jar/JarEntry/test.jar and /dev/null differ diff --git a/test/jdk/java/util/zip/ZipOutputStream/UnmappableZipFileComment.java b/test/jdk/java/util/zip/ZipOutputStream/UnmappableZipFileComment.java new file mode 100644 index 00000000000..5879ae1497a --- /dev/null +++ b/test/jdk/java/util/zip/ZipOutputStream/UnmappableZipFileComment.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.zip.ZipOutputStream; + +import static java.io.OutputStream.nullOutputStream; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/* @test + * @bug 8380542 + * @summary ZipOutputStream.setComment should throw IllegalArgumentException for unmappable characters in comment + * @run junit ${test.main.class} + */ +public class UnmappableZipFileComment { + /** + * Verify that calling ZipOutputStream.setComment with an unmappable + * comment is rejected with a IllegalArgumentException. + * + * @throws IOException if an unexpected IO error occurs + */ + @Test + void rejectUnmappableZipFileComment() throws IOException { + // Charset used when creating the ZIP file + Charset charset = StandardCharsets.US_ASCII; + // 'ø' is an unmappable character in US_ASCII + String comment = "\u00f8"; + try (var out = new ZipOutputStream(nullOutputStream(), charset)) { + assertThrows(IllegalArgumentException.class, () -> out.setComment(comment)); + } + } +} diff --git a/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java b/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java index 3d9cd083204..12c9d6c40fa 100644 --- a/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java +++ b/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java @@ -50,6 +50,12 @@ import jdk.test.whitebox.code.BlobType; * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-SegmentedCodeCache jdk.jfr.event.compiler.TestCodeCacheFull + * @run main/othervm -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M jdk.jfr.event.compiler.TestCodeCacheFull + * @run main/othervm -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+HotCodeHeap -XX:HotCodeHeapSize=8M jdk.jfr.event.compiler.TestCodeCacheFull */ public class TestCodeCacheFull { diff --git a/test/jdk/jdk/jfr/event/os/TestCPULoad.java b/test/jdk/jdk/jfr/event/os/TestCPULoad.java index 09ceb0a79b7..f3f30f15b2b 100644 --- a/test/jdk/jdk/jfr/event/os/TestCPULoad.java +++ b/test/jdk/jdk/jfr/event/os/TestCPULoad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,12 @@ package jdk.jfr.event.os; -import java.util.List; +import java.time.Duration; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; -import jdk.jfr.Recording; import jdk.jfr.consumer.RecordedEvent; +import jdk.jfr.consumer.RecordingStream; import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; @@ -40,56 +42,18 @@ import jdk.test.lib.jfr.Events; public class TestCPULoad { private final static String EVENT_NAME = EventNames.CPULoad; - public static boolean isPrime(int num) { - if (num <= 1) return false; - for (int i = 2; i <= Math.sqrt(num); i++) { - if (num % i == 0) return false; - } - return true; - } - - public static int burnCpuCycles(int limit) { - int primeCount = 0; - for (int i = 2; i < limit; i++) { - if (isPrime(i)) { - primeCount++; - } - } - return primeCount; - } - - public static void main(String[] args) throws Throwable { - Recording recording = new Recording(); - recording.enable(EVENT_NAME); - recording.start(); - // burn some cycles to check increase of CPU related counters - int pn = burnCpuCycles(2500000); - recording.stop(); - System.out.println("Found " + pn + " primes while burning cycles"); - - List events = Events.fromRecording(recording); - if (events.isEmpty()) { - // CPU Load events are unreliable on Windows because - // the way processes are identified with perf. counters. - // See BUG 8010378. - // Workaround is to detect Windows and allow - // test to pass if events are missing. - if (isWindows()) { - return; - } - throw new AssertionError("Expected at least one event"); - } - for (RecordedEvent event : events) { - System.out.println("Event: " + event); - for (String loadName : loadNames) { - Events.assertField(event, loadName).atLeast(0.0f).atMost(1.0f); - } + public static void main(String... args) throws Exception { + try (RecordingStream rs = new RecordingStream()) { + BlockingQueue cpuEvent = new ArrayBlockingQueue<>(1); + rs.setReuse(false); + rs.enable(EVENT_NAME).withPeriod(Duration.ofMillis(100)); + rs.onEvent(cpuEvent::offer); + rs.startAsync(); + RecordedEvent event = cpuEvent.take(); + System.out.println(event); + Events.assertField(event, "jvmUser").atLeast(0.0f).atMost(1.0f); + Events.assertField(event, "jvmSystem").atLeast(0.0f).atMost(1.0f); + Events.assertField(event, "machineTotal").atLeast(0.0f).atMost(1.0f); } } - - private static final String[] loadNames = {"jvmUser", "jvmSystem", "machineTotal"}; - - private static boolean isWindows() { - return System.getProperty("os.name").startsWith("Windows"); - } -} +} \ No newline at end of file diff --git a/test/jdk/jdk/nio/zipfs/UnmappablePathName.java b/test/jdk/jdk/nio/zipfs/UnmappablePathName.java new file mode 100644 index 00000000000..3fe915734eb --- /dev/null +++ b/test/jdk/jdk/nio/zipfs/UnmappablePathName.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.net.URI; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +/* @test + * @bug 8380450 + * @summary Unmappable characters in ZipFileSystem path names should be rejected with InvalidPathException + * @run junit ${test.main.class} + */ +public class UnmappablePathName { + + // Charset used when creating the ZipFileSystem used in this test + static final Charset CHARSET = StandardCharsets.US_ASCII; + // 'ø' is an unmappable character in US_ASCII + static final String UNMAPPABLE = "\u00f8"; + // ZIP file created in this test + static final Path ZIP = Paths.get("unmappable-path.zip"); + + /** + * Verify that calling ZipFileSystem.getPath with an unmappable path + * name is rejected with an InvalidPathException. + * + * @throws IOException if an unexpected IO error occurs + */ + @Test + void unmappableGetPath() throws IOException { + try (FileSystem fs = createFileSystem(ZIP, CHARSET)) { + assertThrows(InvalidPathException.class, () -> fs.getPath(UNMAPPABLE)); + } + } + + /** + * Verify that calling ZipFileSystem.getPath with a partially unmappable path + * name is rejected with an InvalidPathException. + * + * @throws IOException if an unexpected IO error occurs + */ + @Test + void unmappableGetPathPartial() throws IOException { + try (FileSystem fs = createFileSystem(ZIP, CHARSET)) { + assertThrows(InvalidPathException.class, () -> fs.getPath("mappable", UNMAPPABLE)); + } + } + + /** + * Verify that calling ZipPath::resolve with an unmappable path + * name is rejected with an InvalidPathException. + * + * @throws IOException if an unexpected IO error occurs + */ + @Test + void unmappableResolve() throws IOException { + try (FileSystem fs = createFileSystem(ZIP, CHARSET)) { + Path path = fs.getPath("mappable"); + assertThrows(InvalidPathException.class, () -> path.resolve(UNMAPPABLE)); + } + } + + /** + * Verify that calling ZipPath::resolve with a partially unmappable path + * name is rejected with an InvalidPathException. + * + * @throws IOException if an unexpected IO error occurs + */ + @Test + void unmappableResolvePartial() throws IOException { + try (FileSystem fs = createFileSystem(ZIP, CHARSET)) { + Path path = fs.getPath("mappable"); + assertThrows(InvalidPathException.class, () -> path.resolve("mappable", UNMAPPABLE)); + } + } + + @AfterEach + void cleanup() throws IOException { + Files.deleteIfExists(ZIP); + } + + // Create a ZipFileSystem using the specified charset + private FileSystem createFileSystem(Path path, Charset charset) throws IOException { + URI uri = URI.create("jar:" + path.toUri()); + Map env = new HashMap(); + env.put("create", "true"); + env.put("encoding", charset.name()); + return FileSystems.newFileSystem(uri, env); + } +} diff --git a/test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java b/test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java index 6d21cd5613a..4d9b7500d87 100644 --- a/test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java +++ b/test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8181157 8202537 8234347 8236548 8261279 8322647 8174269 8346948 - * 8354548 + * 8354548 8381379 * @modules jdk.localedata * @summary Checks CLDR time zone names are generated correctly at * either build or runtime @@ -32,15 +32,21 @@ */ import java.text.DateFormatSymbols; +import java.text.SimpleDateFormat; import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.time.format.TextStyle; import java.util.Arrays; +import java.util.Date; import java.util.Locale; import java.util.Objects; import java.util.TimeZone; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -217,6 +223,18 @@ public class TimeZoneNamesTest { }; } + private static Stream explicitDstOffsets() { + return Stream.of( + Arguments.of(ZonedDateTime.of(2026, 4, 5, 0, 0, 0, 0, ZoneId.of("Europe/Dublin")), "Irish Standard Time"), + Arguments.of(ZonedDateTime.of(2026, 12, 5, 0, 0, 0, 0, ZoneId.of("Europe/Dublin")), "Greenwich Mean Time"), + Arguments.of(ZonedDateTime.of(2026, 4, 5, 0, 0, 0, 0, ZoneId.of("Eire")), "Irish Standard Time"), + Arguments.of(ZonedDateTime.of(2026, 12, 5, 0, 0, 0, 0, ZoneId.of("Eire")), "Greenwich Mean Time"), + Arguments.of(ZonedDateTime.of(2026, 4, 5, 0, 0, 0, 0, ZoneId.of("America/Vancouver")), "Pacific Daylight Time"), + // This needs to change once TZDB adopts -7 offset year round, and CLDR uses explicit dst offset + // namely, "Pacific Standard Time" -> "Pacific Daylight Time" + Arguments.of(ZonedDateTime.of(2026, 12, 5, 0, 0, 0, 0, ZoneId.of("America/Vancouver")), "Pacific Standard Time") + ); + } @ParameterizedTest @MethodSource("sampleTZs") @@ -248,4 +266,19 @@ public class TimeZoneNamesTest { .anyMatch(name -> Objects.isNull(name) || name.isEmpty()), "getZoneStrings() returned array containing non-empty string element(s)"); } + + // Explicit metazone dst offset test. As of CLDR v48, only Europe/Dublin utilizes + // this attribute, but will be used for America/Vancouver once CLDR adopts the + // explicit offset for that zone, which warrants the test data modification. + @ParameterizedTest + @MethodSource("explicitDstOffsets") + public void test_ExplicitMetazoneOffsets(ZonedDateTime zdt, String expected) { + // java.time + assertEquals(expected, DateTimeFormatter.ofPattern("zzzz").format(zdt)); + + // java.text/util + var sdf = new SimpleDateFormat("zzzz"); + sdf.setTimeZone(TimeZone.getTimeZone(zdt.getZone())); + assertEquals(expected, sdf.format(Date.from(zdt.toInstant()))); + } } diff --git a/test/lib/jdk/test/whitebox/code/BlobType.java b/test/lib/jdk/test/whitebox/code/BlobType.java index a2290acc7b6..e2d57f79484 100644 --- a/test/lib/jdk/test/whitebox/code/BlobType.java +++ b/test/lib/jdk/test/whitebox/code/BlobType.java @@ -46,8 +46,16 @@ public enum BlobType { || type == BlobType.MethodNonProfiled; } }, + MethodHot(2, "CodeHeap 'hot nmethods'", "HotCodeHeapSize") { + @Override + public boolean allowTypeWhenOverflow(BlobType type) { + return super.allowTypeWhenOverflow(type) + || type == BlobType.MethodNonProfiled + || type == BlobType.MethodProfiled; + } + }, // Non-nmethods like Buffers, Adapters and Runtime Stubs - NonNMethod(2, "CodeHeap 'non-nmethods'", "NonNMethodCodeHeapSize") { + NonNMethod(3, "CodeHeap 'non-nmethods'", "NonNMethodCodeHeapSize") { @Override public boolean allowTypeWhenOverflow(BlobType type) { return super.allowTypeWhenOverflow(type) @@ -56,7 +64,7 @@ public enum BlobType { } }, // All types (No code cache segmentation) - All(3, "CodeCache", "ReservedCodeCacheSize"); + All(4, "CodeCache", "ReservedCodeCacheSize"); public final int id; public final String sizeOptionName; @@ -99,6 +107,10 @@ public enum BlobType { // there is no MethodProfiled in non tiered world or pure C1 result.remove(MethodProfiled); } + + if (Long.valueOf(0).equals(whiteBox.getVMFlag("HotCodeHeapSize"))) { + result.remove(MethodHot); + } return result; }