RFR: 8251999: remove usage of PropertyResolvingWrapper in vmTestbase/nsk/aod
Igor Ignatyev
iignatyev at openjdk.java.net
Thu Sep 24 01:36:03 UTC 2020
On Wed, 23 Sep 2020 05:31:19 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> the patch
>> - removes `PropertyResolvingWrapper` from `vmTestbase/nsk/aod` tests
>> - updates `AODRunnerArgParser` to remove surrounding `"` symbols from `javaOpts` option values
>> - updates vmTestbase/nsk/aod test descriptions to have `"` in `javaOpts` values (as opposed of around `-javaOpts=$value`
>> as it's now)
>> - mechanically reformats/cleans up the tests (whitespaces, imports, etc)
>>
>> testing:
>> * [x] vmTestbase/nsk/aod on {macosx,windows,linux}-x64
>> * [x] vmTestbase/nsk/aod on macosx-x64 w/ `VM_OPTIONS`, `JAVA_OPTIONS` being empty and having value
>
> test/hotspot/jtreg/vmTestbase/nsk/aod/VirtualMachine/VirtualMachine03/VirtualMachine03.java line 78:
>
>> 76: } finally {
>> 77: vm2.detach();
>> 78: }
>
> Is nesting needed here because `vm1`/`vm2` can be `null` at `finally`? Then it is cleaner IMO to just do:
>
> } finally {
> if (vm1 != null) vm1.detach();
> if (vm2 != null) vm2.detach();
> }
nested try-finally isn't semantically equivalent with the snippet you suggested, `VirtualMachine::detach` can throw
IOE, so I'd prefer to two finally blocks to guarantee that we at least to detach from both vm-s.
-------------
PR: https://git.openjdk.java.net/jdk/pull/311
More information about the serviceability-dev
mailing list