From fb4cf1cc3ce5957378516f4f6090d4c5d0f53e61 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Tue, 16 Apr 2024 22:53:54 +0000 Subject: [PATCH] 8329636: Deprecate -XX:+PreserveAllAnnotations Reviewed-by: coleenp, dholmes --- src/hotspot/share/runtime/arguments.cpp | 1 + src/hotspot/share/runtime/globals.hpp | 2 +- test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 3b0916f46fc..f8e9629d94a 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -501,6 +501,7 @@ static SpecialFlag const special_jvm_flags[] = { { "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "RegisterFinalizersAtInit", JDK_Version::jdk(22), JDK_Version::jdk(23), JDK_Version::jdk(24) }, + { "PreserveAllAnnotations", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) }, #if defined(X86) { "UseRTMLocking", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) }, { "UseRTMDeopt", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 5da2c0b80c5..ef6c0dcd9f6 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -799,7 +799,7 @@ const int ObjectAlignmentInBytes = 8; "at this time") \ \ product(bool, PreserveAllAnnotations, false, \ - "Preserve RuntimeInvisibleAnnotations as well " \ + "(Deprecated) Preserve RuntimeInvisibleAnnotations as well " \ "as RuntimeVisibleAnnotations") \ \ develop(uintx, PreallocatedOutOfMemoryErrorCount, 4, \ diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index 62c5ef411da..0f93ee0f43a 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -56,6 +56,7 @@ public class VMDeprecatedOptions { ArrayList deprecated = new ArrayList( Arrays.asList(new String[][] { // deprecated non-alias flags: + {"PreserveAllAnnotations", "true"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, // deprecated alias flags (see also aliased_jvm_flags):