Skip to content

I20210418-1800

tagged this 18 Apr 14:07
Directly checks boolean values instead of comparing them with
true/false:
 - The operator can be equals, not equals or XOR,
 - The constants can be a literal or a java.lang.Boolean constant,
 - One operand should be primitive so no new null pointer exceptions may
occur.

Given:
        if (isValid == true) {
            int i = 0;
        }

When:
Applying "Boolean value rather than comparison" clean up...

Then:
        if (isValid) {
            int i = 0;
        }

Change-Id: If40bd448d4654c66c10587a5c75d1358f385e59d
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/179318
Reviewed-by: Holger Voormann <eclipse@voormann.de>
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Assets 2
Loading