On Mon, 3 Jun 2024 22:08:46 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> Leonid Mesnik has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   fixed try/finally
>
> test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java line 201:
> 
>> 199:         try {
>> 200:             int exitCode = waitForDebugee();
>> 201:             return exitCode;
> 
> I don't think I've ever run across a try block with a return statement 
> before, especially when there is also a finally block. The reader is likely 
> to miss the fact that before the return is done the finally block is 
> executed. It's also odd because now there is no return statement at the end 
> of the method. Although the compiler is smart enough to recognize that this 
> is ok, it is another point of confusion for the reader. Any reason not to 
> just instead do the return at the end of the method?

Yes, the code become too unreadable. Moved return out of try/catch.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19505#discussion_r1625141478

Reply via email to