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

Oli Gillespie ogillespie at openjdk.org
Fri Feb 27 14:51:51 UTC 2026


On Fri, 27 Feb 2026 14:41:54 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> I agree it's a bit convoluted, I think it's meant to be an args.length == 0 check. In practice it never hits anyway because even with no explicit args the test runner adds a bunch. Even with vm.flagless I get a few. I could add the assert but feels a bit misleading if we don't have any case that will actually exercise it.
>
> 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.

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

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


More information about the serviceability-dev mailing list