On Mon, 27 Apr 2026 04:17:05 GMT, David Holmes <[email protected]> wrote:
>> Anton Artemov has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> 8382088: Addressed reviewer's comments.
>
> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorTimedWait/SuspendWithObjectMonitorTimedWait.java
> line 59:
>
>> 57:
>> 58: public static void main(String args[]) {
>> 59: int result = new SuspendWithObjectMonitorTimedWait().runIt();
>
> You don't really need to create an instance and call `runit` - all the logic
> in `runit` could go directly into `main`.
Right, moved it out to `main` as suggested. Then we don't need to extend the
`DebugeeClass`, as its `Failure` cannot be used in `main` and is replaced with
`RuntimeException`.
> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorTimedWait/SuspendWithObjectMonitorTimedWait.java
> line 140:
>
>> 138: throw new RuntimeException("Grabbed the monitor in total "
>> + failureCounter + " times out of " + usefulRun + " useful runs, which is
>> more than 0.");
>> 139: }
>> 140: return status;
>
> If you throw on failure then you don't need a `status`.
Removed the status now, in case of failure a `RuntimeException` is thrown.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30709#discussion_r3145718566
PR Review Comment: https://git.openjdk.org/jdk/pull/30709#discussion_r3145718998