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