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