01: package com.puppycrawl.tools.checkstyle;
02:
03: public class ComplexityCheckTestInput {
04: public void foo() {
05: while (true) {
06: Runnable runnable = new Runnable() {
07: public void run() {
08: while (true) {
09: }
10: }
11: };
12:
13: new Thread(runnable).start();
14: }
15: }
16:
17: public void bar() {
18: if (System.currentTimeMillis() == 0) {
19: if (System.currentTimeMillis() == 0
20: && System.currentTimeMillis() == 0) {
21: }
22:
23: if (System.currentTimeMillis() == 0
24: || System.currentTimeMillis() == 0) {
25: }
26: }
27: }
28:
29: public void simpleElseIf() {
30: if (System.currentTimeMillis() == 0) {
31: } else if (System.currentTimeMillis() == 0) {
32: } else {
33: }
34: }
35:
36: public void stupidElseIf() {
37: if (System.currentTimeMillis() == 0) {
38: } else {
39: if (System.currentTimeMillis() == 0) {
40: } else {
41: if (System.currentTimeMillis() == 0) {
42: }
43: }
44:
45: if (System.currentTimeMillis() == 0) {
46: }
47: }
48: }
49:
50: public ComplexityCheckTestInput() {
51: int i = 1;
52: if (System.currentTimeMillis() == 0) {
53: } else if (System.currentTimeMillis() == 0) {
54: } else {
55: }
56: }
57:
58: // STATIC_INIT
59: static {
60: int i = 1;
61: if (System.currentTimeMillis() == 0) {
62: } else if (System.currentTimeMillis() == 0) {
63: } else {
64: }
65: }
66:
67: // INSTANCE_INIT
68: {
69: int i = 1;
70: if (System.currentTimeMillis() == 0) {
71: } else if (System.currentTimeMillis() == 0) {
72: } else {
73: }
74: }
75:
76: /** Inner */
77: public ComplexityCheckTestInput(int aParam) {
78: Runnable runnable = new Runnable() {
79: public void run() {
80: while (true) {
81: }
82: }
83: };
84: new Thread(runnable).start();
85: }
86: }
|