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