8316445: Mark com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java as vm.flagless

Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
Leonid Mesnik 2023-09-28 17:15:40 +00:00
parent 060db1b2a2
commit ca5eee2fe3
3 changed files with 12 additions and 6 deletions

View File

@ -53,6 +53,7 @@ requires.extraPropDefns.vmOpts = \
requires.properties= \
sun.arch.data.model \
java.runtime.name \
vm.flagless \
vm.gc.G1 \
vm.gc.Serial \
vm.gc.Parallel \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
* @test
* @bug 8028994
* @author Staffan Larsen
* @requires vm.flagless
* @library /test/lib
* @modules jdk.attach/sun.tools.attach
* jdk.management

View File

@ -689,15 +689,19 @@ public class VMProps implements Callable<Map<String, String>> {
// check -X flags
var ignoredXFlags = Set.of(
// default, yet still seen to be explicitly set
"mixed"
"mixed",
// -XmxmNNNm added by run-test framework for non-hotspot tests
"mx"
);
result &= allFlags.stream()
.filter(s -> s.startsWith("-X") && !s.startsWith("-XX:"))
// map to names:
// remove -X
.map(s -> s.substring(2))
// remove :.* from flags with values
.map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s)
// remove -X
.map(s -> s.substring(2))
// remove :.* from flags with values
.map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s)
// remove size like 4G, 768m which might be set for non-hotspot tests
.map(s -> s.replaceAll("(\\d+)[mMgGkK]", ""))
// skip known-to-be-there flags
.filter(s -> !ignoredXFlags.contains(s))
.findAny()