On Fri, 26 Jan 2024 09:36:49 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

>> Volker Simonis has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Made the flag experimental and added an assertion to 
>> set_can_hotswap_or_post_breakpoint()
>
> src/hotspot/share/prims/jvmtiExport.hpp line 159:
> 
>> 157:     // recorded from that point on.
>> 158:     assert(!_can_hotswap_or_post_breakpoint || on, "sanity check");
>> 159:     _can_hotswap_or_post_breakpoint = (on != 0);
> 
> Pre-existing: wild that this code checks `!= 0` against `bool`, when it could 
> have just used the bool directly, like the new assert does. I see no reason 
> to keep `!= 0` here.

I wondered myself about this strange style. But it's there since the first 
OpenJDK commit (probably it was written by a C programmer where `bool` isn't a 
builtin type and he wanted to make sure that all non-zero values get mapped to 
1).

But as this style is used throughout the entire file, I prefer to keep it as is 
and not change a single occurrence only.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17509#discussion_r1467632151

Reply via email to