1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.finalparameters;
11
12 import java.awt.event.ActionEvent;
13
14 import javax.swing.AbstractAction;
15 import javax.swing.Action;
16
17
18
19
20
21 class InputFinalParameters2
22 {
23
24 InputFinalParameters2()
25 {
26 }
27
28
29 InputFinalParameters2(String s)
30 {
31 }
32
33
34 InputFinalParameters2(final Integer i)
35 {
36 }
37
38
39 InputFinalParameters2(final @MyAnnotation33 Class<Object> i)
40 {
41 }
42
43
44 InputFinalParameters2(@MyAnnotation33 Boolean i)
45 {
46 }
47
48
49 InputFinalParameters2(String s, final Integer i)
50 {
51 }
52
53
54 void method()
55 {
56 }
57
58
59 void method(String s)
60 {
61 }
62
63
64 void method(final Integer i)
65 {
66 }
67
68
69 void method(@MyAnnotation33 final Object s)
70 {
71
72 }
73
74
75 void method(@MyAnnotation33 Class<Object> s)
76 {
77
78 }
79
80
81 void method(String s, final Integer i)
82 {
83 }
84
85
86 interface TestInterface
87 {
88 void method(String s);
89 }
90
91
92 void holder()
93 {
94 Action a = new AbstractAction()
95 {
96 public void actionPerformed(ActionEvent e)
97 {
98 }
99 void somethingElse(@MyAnnotation33 ActionEvent e)
100 {
101 }
102 };
103
104 Action b = new AbstractAction()
105 {
106 public void actionPerformed(final ActionEvent e)
107 {
108 }
109 void somethingElse(@MyAnnotation33 final ActionEvent e)
110 {
111 }
112 };
113 }
114
115
116 void methodA(String aParam) {
117 }
118
119 void methodB(String[] args) {
120 }
121
122 void methodC(String[] args) {
123 }
124
125
126 void method1()
127 {
128 try {
129 String.CASE_INSENSITIVE_ORDER.equals("");
130 }
131 catch (NullPointerException npe) {
132 npe.getMessage();
133 }
134 catch (@MyAnnotation32 final ClassCastException e) {
135 e.getMessage();
136 }
137 catch (RuntimeException e) {
138 e.getMessage();
139 }
140 catch (@MyAnnotation32 NoClassDefFoundError e) {
141 e.getMessage();
142 }
143 }
144
145 native void method(int i);
146 }
147
148 abstract class AbstractClass2
149 {
150 public abstract void abstractMethod(int aParam);
151 }
152
153 class Foo2
154 {
155
156 public void Bar()
157 {
158 for(String s : someExpression())
159 {
160
161 }
162 for(final String s : someExpression())
163 {
164
165 }
166 for(@MyAnnotation32 String s : someExpression())
167 {
168
169 }
170 for(@MyAnnotation32 final String s : someExpression())
171 {
172
173 }
174 }
175
176 private String[] someExpression()
177 {
178 return null;
179 }
180 }
181
182 @interface MyAnnotation32 {
183 }