RFR: 8282690: runtime/CommandLine/VMDeprecatedOptions.java fails after JDK-8281181 [v2]

Ioi Lam iklam at openjdk.java.net
Mon Mar 7 17:35:05 UTC 2022


On Sat, 5 Mar 2022 14:36:15 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java line 66:
>> 
>>> 64:         DEPRECATED_OPTIONS = deprecated.toArray(new String[][]{});
>>> 65: 
>>> 66:         ArrayList<String[]> deprecated_linux = new ArrayList(
>> 
>> Seems simpler to just add these to `deprecated` before line 64.
>
> So move the `Platform.isLinux()` check up here and optionally
> ArrayList.add() the needed strings? That does sound simpler.

I changed the code as David suggested.

I also added a comment to explain why we use the clumsy-looking  `new ArrayList(Arrays.asList(new String[][] {...}))` construct. A simple `new String[][] {...}` would suffice if we didn't need to add optional checks for specific platforms.

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

PR: https://git.openjdk.java.net/jdk/pull/7712


More information about the hotspot-runtime-dev mailing list