1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.sizes.anoninnerlength;
9
10 import java.awt.event.MouseEvent;
11 import java.awt.event.MouseAdapter;
12 import javax.swing.JButton;
13
14
15
16
17
18
19 public class InputAnonInnerLength
20 {
21
22
23
24 private JButton mButton = new JButton();
25
26 private class MyInner
27 {
28 private MyInner(int[] anArray)
29 {
30 }
31 }
32
33
34
35
36
37
38 private MyInner myInner = new MyInner(new int[]{
39
40 1,
41 2,
42 3,
43 4,
44 5,
45 6,
46 7,
47 }
48 );
49
50
51
52
53 private Runnable mRunnable1 = new Runnable() {
54 public void run()
55 {
56 System.identityHashCode("running");
57 System.identityHashCode("running");
58 System.identityHashCode("running");
59 System.identityHashCode("running");
60 System.identityHashCode("running");
61 System.identityHashCode("running");
62 System.identityHashCode("running");
63 System.identityHashCode("running");
64 System.identityHashCode("running");
65 System.identityHashCode("running");
66 System.identityHashCode("running");
67 System.identityHashCode("running");
68 System.identityHashCode("running");
69 System.identityHashCode("running");
70 System.identityHashCode("running");
71 System.identityHashCode("running");
72 }
73 };
74
75
76
77
78 private Runnable mRunnable2 = new Runnable() {
79 public void run()
80 {
81 System.identityHashCode("running");
82 System.identityHashCode("running");
83 System.identityHashCode("running");
84 System.identityHashCode("running");
85 System.identityHashCode("running");
86 System.identityHashCode("running");
87 System.identityHashCode("running");
88 System.identityHashCode("running");
89 System.identityHashCode("running");
90 System.identityHashCode("running");
91 System.identityHashCode("running");
92 System.identityHashCode("running");
93 System.identityHashCode("running");
94 System.identityHashCode("running");
95 System.identityHashCode("running");
96 }
97 };
98
99
100
101
102 InputAnonInnerLength()
103 {
104 mButton.addMouseListener( new MouseAdapter()
105 {
106 public void mouseClicked( MouseEvent aEv )
107 {
108 System.identityHashCode("click");
109 }
110 } );
111 }
112
113
114
115
116 public void addInputAnonInner()
117 {
118 mButton.addMouseListener( new MouseAdapter()
119 {
120 public void mouseClicked( MouseEvent aEv )
121 {
122 System.identityHashCode("click");
123 }
124 } );
125 }
126 }