1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.coding.variabledeclarationusagedistance;
12
13 public class InputVariableDeclarationUsageDistanceCloseToBlock {
14 void method() {
15 int a = 3;
16 int b = 2;
17
18 run();
19 run();
20 run();
21 run();
22 run();
23 run();
24 run();
25 run();
26 run();
27 run();
28 run();
29 run();
30
31 for (int i = 0; i < 10; i++) {
32 a = a + b;
33 }
34 }
35
36 void method2() {
37 run();
38 run();
39 run();
40 run();
41 run();
42 run();
43 run();
44 run();
45 run();
46 run();
47 run();
48 run();
49
50 int a = 3;
51 int b = 2;
52
53 for (int i = 0; i < 10; i++) {
54 a = a + b;
55 }
56 }
57
58 public void run() {};
59 }