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