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= \ requires.properties= \
sun.arch.data.model \ sun.arch.data.model \
java.runtime.name \ java.runtime.name \
vm.flagless \
vm.gc.G1 \ vm.gc.G1 \
vm.gc.Serial \ vm.gc.Serial \
vm.gc.Parallel \ 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
* @test * @test
* @bug 8028994 * @bug 8028994
* @author Staffan Larsen * @author Staffan Larsen
* @requires vm.flagless
* @library /test/lib * @library /test/lib
* @modules jdk.attach/sun.tools.attach * @modules jdk.attach/sun.tools.attach
* jdk.management * jdk.management

View file

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