View Javadoc
1   /*
2   VariableDeclarationUsageDistance
3   allowedDistance = 1
4   ignoreVariablePattern = (default)
5   validateBetweenScopes = true
6   ignoreFinal = false
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.coding.variabledeclarationusagedistance;
12  
13  public class InputVariableDeclarationUsageDistance1 {
14      private void foo() {
15          int i = 0;
16          // violation above 'Distance between variable .* and its first usage is 2, but allowed 1'
17          String[][] x = { {"foo"} };
18          for (int first = 0; first < 5; first++) {}
19          int j = 0;
20          while (j == 1) {}
21          do {} while (i == 1);
22      }
23  }