RFR: 8289397: Fix warnings: Possible accidental assignment in place of a comparison. A condition expression should not be reduced to an assignment

Andy Goryachev angorya at openjdk.org
Tue Jul 26 22:42:20 UTC 2022


On Tue, 26 Jul 2022 21:14:58 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

> - replaced with exact functional equivalent (in the presence of exceptions, for example)

> ```java
>     // old:
>     if(isSame = fname.equals(container.fname)) {
> 
>    // new:
>    isSame = fname.equals(container.fname);
>    if (isSame) {
> ```

that was my first choice, but for some inexplicable reason i thought it would produce a different result in case of an exception (i.e. fname = null).  it won't.

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

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


More information about the openjfx-dev mailing list