1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.checks.metrics.javancss;
13
14 import java.awt.event.ItemEvent;
15 import java.awt.event.ItemListener;
16
17
18
19 public class InputJavaNCSS2 {
20
21 private Object mObject;
22
23
24 private void testMethod1() {
25
26
27 int x = 1, y = 2;
28 }
29
30
31 private void testMethod2() {
32
33 int abc = 0;
34
35
36 testLabel: abc = 1;
37 }
38
39
40 private void testMethod3() {
41
42 int a = 0;
43 switch (a) {
44 case 1:
45 case 2: System.identityHashCode("Hello"); break;
46 default: break;
47 }
48
49 ItemListener lis = new ItemListener() {
50
51
52 public void itemStateChanged(ItemEvent e) {
53 System.identityHashCode("Hello");
54 }
55 };
56 }
57
58
59 private class TestInnerClass {
60
61 private Object test;
62 }
63 }
64
65
66 class TestTopLevelNestedClass2 {
67
68 private Object mObject;
69
70
71 private void testMethod() {
72
73 for (int i=0; i<10; i++) {
74
75 if (i==0) {
76
77
78 int x = 1, y = 2;
79 }
80 else {
81 int abc = 0;
82
83
84 testLabel: abc = 1;
85 }
86 }
87 }
88 }
89
90 class Input02 {
91 static { }
92 { }
93 public Input02() { }
94 }