RFR: 8378110: Add -XX: prefix to settings-file flags in RuntimeMXBean.getInputArguments() [v2]

Kevin Walls kevinw at openjdk.org
Fri Feb 27 14:56:36 UTC 2026


On Fri, 27 Feb 2026 14:49:29 GMT, Oli Gillespie <ogillespie at openjdk.org> wrote:

>> OK sure yes.  Some of these older tests are showing their age.    If you have time, could we just make it do:
>> if (args.length > 0) {
>>     vmOptions = args;
>> } else {
>>     return ...
>> }
>> ..so it's just trivial to read.  Looks like a trap right now, again an existing problem. 8-)
>
> Fine by me. I could also just remove it, like I said it never triggers anyway, and it seems a bit strange to explicitly handle it. If it does happen, we'll get an implicit null check later on when we try to iterate `rm.getInputArguments()`, which is arguably better.

Either is usable.  The else might be best as it could even throw a SkippedException or just throw a failure as a misconfigred/specified test.
As you mention we probably can't reliably test for empty getInputArguments(), unless we specifically start a new process, but think we don't need to go that far right now.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29793#discussion_r2864724078


More information about the serviceability-dev mailing list