On Tue, 26 Jul 2022 22:59:26 GMT, Andy Goryachev <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/util/Utils.java line 
>> 875:
>> 
>>> 873:     public static boolean assertionEnabled() {
>>> 874:         boolean assertsEnabled = false;
>>> 875:         assert (assertsEnabled = true) == true;
>> 
>> Is it worth leaving the "Intentional side-effect" comment?
>
> i think *now* the code is clear without the comment!
> (and the comment does not explain *why* it is intentional or what is the 
> intention)

I would probably leave it as before. I found that code already when working on 
the OpenJFX project and while it looks strange at first glance, it was clear 
afterwards. And the comment makes this clear as well.

The `== true` might confuse more now.

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

PR: https://git.openjdk.org/jfx/pull/851

Reply via email to