1 package com.google.checkstyle.test.chapter4formatting.rule462horizontalwhitespace;
2
3
4 public class InputFormattedWhitespaceAfterGood {
5
6 int xyz;
7 int abc;
8 int pqr;
9
10
11 public void check1(int x, int y) {
12
13 for (int a = 1, b = 2; a < 5; a++, b--)
14 ;
15 while (x == 0) {
16 int a = 0;
17 int b = 1;
18 }
19 do {
20 System.out.println("Testing");
21 } while (x == 0 || y == 2);
22 }
23
24
25 public void check2(final int a, final int b) {
26 if ((float) a == 0.0) {
27 System.out.println("true");
28 } else {
29 System.out.println("false");
30 }
31 }
32
33
34 public void check3(int... a) {
35 Runnable r2 = () -> String.valueOf("Hello world two!");
36 switch (a[0]) {
37 default:
38 break;
39 }
40 }
41
42
43 public void check4() throws java.io.IOException {
44 try (java.io.InputStream ignored = System.in) {
45
46 }
47 try {
48
49 } catch (Exception e) {
50
51 }
52 }
53
54
55 public void check5() {
56
57 try {
58
59 } catch (Exception e) {
60
61 }
62 }
63
64
65 public void check6() {
66 try {
67
68 } catch (Exception e) {
69
70 }
71 }
72
73
74 public void check7() {
75 synchronized (this) {
76 }
77 }
78
79
80 public String check8() {
81 return ("a" + "b");
82 }
83 }