On Tue, 26 Jul 2022 21:14:58 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
> - replaced with exact functional equivalent (in the presence of exceptions, > for example) It seems there is disagreement on the utility of doing this. I don't care as much about silencing the warning in Eclipse as I do about making it clear to a reader that the assignment was intended. For everything except boolean assignments, Java already provides that, since unlike C/C++, `if (ival = integerFunc(...))` will not compile. If you meant to do the assignment, as opposed to an equality test, you need to test the return value explicitly. So the question we should ask for boolean vars, where Java is as prone to this confusion as C/C++: is using the same "test explicitly" pattern sufficient? And if not, would a comment help? ------------- PR: https://git.openjdk.org/jfx/pull/851