Java

Java

Made by DeepSource

Repeated conditional test on the same variable detected JAVA-S0034

Bug risk
Major

The code contains a conditional test that is performed twice, one right after the other.

Example

Bad Practice

x == 0 || x == 0

Perhaps the second occurrence is intended to be something else.

Recommended

x == 0 || y == 0

Double check if this was intended; it likely wasn't.

References