1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.checks.descendanttoken;
13
14
15 class Example9 {
16 void testMethod1() {
17 int var1 = 1;
18 }
19 void testMethod2() {
20 int var1 = 1;
21 int var2 = 2;
22 }
23
24 int testMethod3(int x) {
25 if (x == -1) {
26 return -1;
27 }
28 else if (x == 0) {
29 return 0;
30 }
31 return -1;
32 }
33 int testMethod4(int x) {
34 if (x == -1) {
35 return -1;
36 }
37 else if (x == 0) {
38 return 0;
39 }
40 else {
41 return x;
42 }
43 }
44 }
45
46