View Javadoc
1   /*
2   NestedForDepth
3   max = (default)1
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.coding.nestedfordepth;
9   
10  public class InputNestedForDepthCheckDefaultMaxLevel {
11  
12    public void method() {
13      for (int i = 1; i < 5; i++) {
14        for (int j = i; j < 5; j++) {
15        }
16      }
17    }
18  
19    public void method2() {
20      for (int i = 1; i < 5; i++) {
21      }
22    }
23  
24    public void method3() {
25      for (int i = 1; i < 5; i++) {
26        for (int j = 4; j < 5; j++) {
27          for (int k = 3; k < 5; k++) {
28        // violation above 'Nested for depth is 2 (max allowed is 1)'
29          }
30        }
31      }
32    }
33  }