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)

I think the main purpose of compiler warning is to avoid bugs.  Because of 
that, I'd rather enable this warning and fix the code.

An argument could also be made to limit ourselves to one statement per line, 
and in


if(a = func())


we have two.

Before NPE started to have a better diagnostic messages, the following code 
could not be diagnosed in the field (from a customer log file):

Integer a;
if(a = b.func()) // if NPE gets thrown, is it because a==null or b==null?

- added space after 'if'
- went back to Michael's suggestion of spatially separating assignment and 
conditional

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

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

Reply via email to