TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Basic20Checked automatically with code checker

This rule is Obsolete
Synopsis:These nested if statements could be combined
Language:Java
Severity Level:6
Category:Basic


Description:
Sometimes two 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.
public class Foo {
 void bar() {
  if (x) {
   if (y) {
    // do stuff
   }
  }
 }
}