Skip to content

Commit ca6d8c5

Browse files
Praveen7294romani
authored andcommitted
Issue #1041: Rename CatchParameterName in sevntu-checks
1 parent f01cb81 commit ca6d8c5

20 files changed

+71
-71
lines changed

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/CustomDeclarationOrderCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,8 @@ private void updateRegexp(final String newFormat, final int compileFlags) {
13011301
regExp = Pattern.compile(newFormat, compileFlags);
13021302
format = newFormat;
13031303
}
1304-
catch (final PatternSyntaxException ex) {
1305-
throw new IllegalArgumentException("unable to parse " + newFormat, ex);
1304+
catch (final PatternSyntaxException exc) {
1305+
throw new IllegalArgumentException("unable to parse " + newFormat, exc);
13061306
}
13071307
}
13081308

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/sizes/LineLengthExtendedCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ public final void setIgnorePattern(String format) {
268268
try {
269269
ignorePattern = Pattern.compile(format);
270270
}
271-
catch (final PatternSyntaxException ex) {
272-
throw new IllegalArgumentException("unable to parse " + format, ex);
271+
catch (final PatternSyntaxException exc) {
272+
throw new IllegalArgumentException("unable to parse " + format, exc);
273273
}
274274
}
275275

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/SevntuUtilTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public void testReportInvalidToken() {
4141
SevntuUtil.reportInvalidToken(TokenTypes.CLASS_DEF);
4242
fail("exception expected");
4343
}
44-
catch (IllegalArgumentException ex) {
45-
Assertions.assertEquals("Found unsupported token: CLASS_DEF", ex.getMessage());
44+
catch (IllegalArgumentException exc) {
45+
Assertions.assertEquals("Found unsupported token: CLASS_DEF", exc.getMessage());
4646
}
4747
}
4848

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/AvoidModifiersForTypesCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ public void testUnsupportedModifier() {
313313
check.visitToken(node);
314314
fail("exception expected");
315315
}
316-
catch (IllegalArgumentException ex) {
316+
catch (IllegalArgumentException exc) {
317317
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
318-
ex.getMessage());
318+
exc.getMessage());
319319
}
320320
}
321321

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/EmptyPublicCtorInClassCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ public void testUnsupportedNode() {
185185

186186
fail("exception expected");
187187
}
188-
catch (IllegalArgumentException ex) {
188+
catch (IllegalArgumentException exc) {
189189
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
190-
ex.getMessage());
190+
exc.getMessage());
191191
}
192192
}
193193

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/ForbidCertainImportsCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ public void testUnsupportedNode() {
205205

206206
fail("exception expected");
207207
}
208-
catch (IllegalArgumentException ex) {
208+
catch (IllegalArgumentException exc) {
209209
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
210-
ex.getMessage());
210+
exc.getMessage());
211211
}
212212
}
213213

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/ForbidCertainMethodCheckTest.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ public void testWithEmptyArgumentCount() throws Exception {
6565
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
6666
Assertions.fail("Expecting CheckstyleException");
6767
}
68-
catch (CheckstyleException ex) {
68+
catch (CheckstyleException exc) {
6969
Assertions.assertEquals(
7070
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
7171
+ "cannot initialize module"
7272
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
7373
+ " Cannot set property 'argumentCount' to ''",
74-
ex.getMessage(), "Exception did not have correct error message.");
74+
exc.getMessage(), "Exception did not have correct error message.");
7575
}
7676
}
7777

@@ -85,13 +85,13 @@ public void testWithSpacesForArgumentCount() throws Exception {
8585
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
8686
Assertions.fail("Expecting CheckstyleException");
8787
}
88-
catch (CheckstyleException ex) {
88+
catch (CheckstyleException exc) {
8989
Assertions.assertEquals(
9090
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
9191
+ "cannot initialize module"
9292
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
9393
+ " Cannot set property 'argumentCount' to ' '",
94-
ex.getMessage(), "Exception did not have correct error message.");
94+
exc.getMessage(), "Exception did not have correct error message.");
9595
}
9696
}
9797

@@ -105,13 +105,13 @@ public void testWithSpacesAndCommaForArgumentCount() throws Exception {
105105
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
106106
Assertions.fail("Expecting CheckstyleException");
107107
}
108-
catch (CheckstyleException ex) {
108+
catch (CheckstyleException exc) {
109109
Assertions.assertEquals(
110110
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
111111
+ "cannot initialize module"
112112
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
113113
+ " Cannot set property 'argumentCount' to ' , '",
114-
ex.getMessage(), "Exception did not have correct error message.");
114+
exc.getMessage(), "Exception did not have correct error message.");
115115
}
116116
}
117117

@@ -125,13 +125,13 @@ public void testWithNullArgumentCount() throws Exception {
125125
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
126126
Assertions.fail("Expecting CheckstyleException");
127127
}
128-
catch (CheckstyleException ex) {
128+
catch (CheckstyleException exc) {
129129
Assertions.assertEquals(
130130
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
131131
+ "cannot initialize module"
132132
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
133133
+ " Cannot set property 'argumentCount' to 'null'",
134-
ex.getMessage(), "Exception did not have correct error message.");
134+
exc.getMessage(), "Exception did not have correct error message.");
135135
}
136136
}
137137

@@ -158,9 +158,9 @@ public void testUnsupportedToken() {
158158
check.visitToken(sync);
159159
Assertions.fail("Expecting IllegalArgumentException");
160160
}
161-
catch (IllegalArgumentException ex) {
161+
catch (IllegalArgumentException exc) {
162162
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
163-
ex.getMessage());
163+
exc.getMessage());
164164
}
165165
}
166166

@@ -173,13 +173,13 @@ public void testNullMethodNameRegex() throws Exception {
173173
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
174174
Assertions.fail("Expecting CheckstyleException");
175175
}
176-
catch (CheckstyleException ex) {
176+
catch (CheckstyleException exc) {
177177
Assertions.assertEquals(
178178
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
179179
+ "cannot initialize module"
180180
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
181181
+ " Cannot set property 'methodName' to 'null'",
182-
ex.getMessage(), "Exception did not have correct error message.");
182+
exc.getMessage(), "Exception did not have correct error message.");
183183
}
184184
}
185185

@@ -200,13 +200,13 @@ public void testBadMethodNameRegex() throws Exception {
200200
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"));
201201
Assertions.fail("Expecting CheckstyleException");
202202
}
203-
catch (CheckstyleException ex) {
203+
catch (CheckstyleException exc) {
204204
Assertions.assertEquals(
205205
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
206206
+ "cannot initialize module"
207207
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
208208
+ " Cannot set property 'methodName' to '[exit'",
209-
ex.getMessage(), "Exception did not have correct error message.");
209+
exc.getMessage(), "Exception did not have correct error message.");
210210
}
211211
}
212212

@@ -222,13 +222,13 @@ public void testBadRangeForArgumentCount() throws Exception {
222222
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
223223
Assertions.fail("Expecting CheckstyleException");
224224
}
225-
catch (CheckstyleException ex) {
225+
catch (CheckstyleException exc) {
226226
Assertions.assertEquals(
227227
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
228228
+ "cannot initialize module"
229229
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
230230
+ " Cannot set property 'argumentCount' to 'badArgCount'",
231-
ex.getMessage(), "Exception did not have correct error message.");
231+
exc.getMessage(), "Exception did not have correct error message.");
232232
}
233233
}
234234

@@ -244,13 +244,13 @@ public void testBadRange2ForArgumentCount() throws Exception {
244244
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
245245
Assertions.fail("Expecting CheckstyleException");
246246
}
247-
catch (CheckstyleException ex) {
247+
catch (CheckstyleException exc) {
248248
Assertions.assertEquals(
249249
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
250250
+ "cannot initialize module"
251251
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
252252
+ " Cannot set property 'argumentCount' to 'badStart-badEnd'",
253-
ex.getMessage(), "Exception did not have correct error message.");
253+
exc.getMessage(), "Exception did not have correct error message.");
254254
}
255255
}
256256

@@ -266,13 +266,13 @@ public void testBadRange3ForArgumentCount() throws Exception {
266266
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
267267
Assertions.fail("Expecting CheckstyleException");
268268
}
269-
catch (CheckstyleException ex) {
269+
catch (CheckstyleException exc) {
270270
Assertions.assertEquals(
271271
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
272272
+ "cannot initialize module"
273273
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
274274
+ " Cannot set property 'argumentCount' to '2, badStart-badEnd'",
275-
ex.getMessage(), "Exception did not have correct error message.");
275+
exc.getMessage(), "Exception did not have correct error message.");
276276
}
277277
}
278278

@@ -288,13 +288,13 @@ public void testBadRange4ForArgumentCount() throws Exception {
288288
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
289289
Assertions.fail("Expecting CheckstyleException");
290290
}
291-
catch (CheckstyleException ex) {
291+
catch (CheckstyleException exc) {
292292
Assertions.assertEquals(
293293
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
294294
+ "cannot initialize module"
295295
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
296296
+ " Cannot set property 'argumentCount' to ' , 1-4 '",
297-
ex.getMessage(), "Exception did not have correct error message.");
297+
exc.getMessage(), "Exception did not have correct error message.");
298298
}
299299
}
300300

@@ -310,13 +310,13 @@ public void testUnboundedRangeForArgumentCount() throws Exception {
310310
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
311311
Assertions.fail("Expecting CheckstyleException");
312312
}
313-
catch (CheckstyleException ex) {
313+
catch (CheckstyleException exc) {
314314
Assertions.assertEquals(
315315
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
316316
+ "cannot initialize module"
317317
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
318318
+ " Cannot set property 'argumentCount' to ' - '",
319-
ex.getMessage(), "Exception did not have correct error message.");
319+
exc.getMessage(), "Exception did not have correct error message.");
320320
}
321321
}
322322

@@ -332,13 +332,13 @@ public void testRangeWithBadBoundsForArgumentCount() throws Exception {
332332
verify(checkConfig, getPath("InputForbidCertainMethodCheck.java"), expected);
333333
Assertions.fail("Expecting CheckstyleException");
334334
}
335-
catch (CheckstyleException ex) {
335+
catch (CheckstyleException exc) {
336336
Assertions.assertEquals(
337337
"cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
338338
+ "cannot initialize module"
339339
+ " com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck -"
340340
+ " Cannot set property 'argumentCount' to '10-1'",
341-
ex.getMessage(), "Exception did not have correct error message.");
341+
exc.getMessage(), "Exception did not have correct error message.");
342342
}
343343
}
344344

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/ForbidInstantiationCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public void testUnsupportedNode() {
131131

132132
fail("exception expected");
133133
}
134-
catch (IllegalArgumentException ex) {
134+
catch (IllegalArgumentException exc) {
135135
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
136-
ex.getMessage());
136+
exc.getMessage());
137137
}
138138
}
139139

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/RedundantReturnCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ public void testUnsupportedNode() {
158158

159159
fail("exception expected");
160160
}
161-
catch (IllegalArgumentException ex) {
161+
catch (IllegalArgumentException exc) {
162162
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
163-
ex.getMessage());
163+
exc.getMessage());
164164
}
165165
}
166166

sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks/coding/RequireFailForTryCatchInJunitCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ public void testUnsupportedNode() {
182182

183183
fail("exception expected");
184184
}
185-
catch (IllegalArgumentException ex) {
185+
catch (IllegalArgumentException exc) {
186186
Assertions.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED",
187-
ex.getMessage());
187+
exc.getMessage());
188188
}
189189
}
190190
}

0 commit comments

Comments
 (0)