On Mon, 27 Nov 2023 02:02:08 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> test/hotspot/jtreg/runtime/Monitor/MonitorWithDeadObjectTest.java line 75: >> >>> 73: private static void testDetachThread() { >>> 74: // Create an ObjectMonitor with a dead object from an >>> 75: // attached thread. >> >> Unclear what the "Detach" in the method name has to do with anything. ?? > > And why add these wrapper methods that simply call one other method? > Unclear what the "Detach" in the method name has to do with anything. ?? This test case provokes the assert we hit when the monitor is visited inside DetachCurrentThread. I updated the comment to state that. > And why add these wrapper methods that simply call one other method? Because I find this structure more cohesive and better structured. I have four functions representing the four tests. The fact that two of them in turn only call one function is an implementation detail. I don't want to push the call to `createMonitorWithDeadObject` down into the main function, because then I also have to move the comment there, and suddenly the main function becomes more then just a super simple dispatch function. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16783#discussion_r1405871913