org.sonar.l10n.java.rules.squid.S2178.html Maven / Gradle / Ivy
The newest version!
The use of non-short-circuit logic in a boolean context is likely a mistake - one that could cause serious program errors as conditions are evaluated under the wrong circumstances.
Noncompliant Code Example
if(getTrue() | getFalse()) { ... } // Noncompliant; both sides evaluated
Compliant Solution
if(getTrue() || getFalse()) { ... } // true short-circuit logic
© 2015 - 2025 Weber Informatics LLC | Privacy Policy