1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.coding.onestatementperline;
9
10 public class InputOneStatementPerLineSingleLineForDeclarations {
11
12
13
14 private int one = 0;
15
16
17
18
19 private int two = 0;
20
21
22
23
24 private void foo3() {
25 do {
26 one++;
27 if (two > 4) {
28 break;
29 }
30 one++;
31 two++;
32 } while (two < 7);
33
34
35
36
37 for (int i = 0; i < 10; i++) one = 5;
38
39
40
41
42
43 for (int i = 0; i < 10;) one = 5;
44
45
46
47
48
49
50 for (int i = 0;;) one = 5;
51 }
52
53 public void foo4() {
54
55
56
57 for(;;){}
58 }
59
60 public void foo5() {
61
62
63
64 for (;;) { one = 5; }
65 }
66
67 public void foo6() {
68 bar(() -> {
69 return;}, () -> {return;});
70 }
71
72 void bar(Runnable r1, Runnable r2) { }
73 }