View Javadoc
1   /*
2   NestedForDepth
3   max = 4
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.coding.nestedfordepth;
9   
10  /**
11   * This Class contains no logic, but serves as test-input for the unit tests for the
12   * <code>NestedForDepthCheck</code>-checkstyle enhancement.
13   * @author Alexander Jesse
14   * @see com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck
15   */
16  public class InputNestedForDepthCheckCustomMaxLevelFour {
17  
18    /**
19     * Dummy method containing 5 layers of for-statements.
20     */
21    public void nestedForFiveLevel() {
22      int i = 0;
23      int i1 = 0;
24      int i2 = 0;
25      int i3 = 0;
26      int i4 = 0;
27      int i5 = 0;
28  
29      for (i1 = 0; i1 < 10; i1++) {
30        for (i2 = 0; i2 < 10; i2++) {
31          for (i3 = 0; i3 < 10; i3++) {
32            for (i4 = 0; i4 < 10; i4++) {
33              for (i5 = 0; i5 < 10; i5++) {
34                i += 1;
35              }
36              for (int i5a = 0; i5a < 10; i5a++) {
37                  i += 1;
38                }
39            }
40          }
41        }
42      }
43    }
44  }