1 /*
2 CatchParameterName
3 format = (default)^(e|t|ex|[a-z][a-z][a-zA-Z]+|_)$
4
5
6 */
7
8 package com.puppycrawl.tools.checkstyle.checks.naming.catchparametername;
9
10 public class InputCatchParameterName {
11 {
12 try {
13 } catch (Exception e) {
14 }
15 try {
16 } catch (Exception ex) {
17 }
18 try {
19 } catch (Error | Exception err) {
20 }
21 try {
22 } catch (Exception exception) {
23 }
24 try {
25 } catch (Exception exception1) { // violation, 'Name 'exception1' must match pattern'
26 }
27 try {
28 } catch (Exception noWorries) {
29 }
30 try {
31 } catch (Throwable t) {
32 }
33 try {
34 throw new InterruptedException("interruptedException");
35 } catch (InterruptedException ie) { // violation, 'Name 'ie' must match pattern'
36 }
37 try {
38 } catch (Exception iException) { // violation, 'Name 'iException' must match pattern'
39 }
40 try {
41 } catch (Exception ok) { // violation, 'Name 'ok' must match pattern'
42 // appropriate to take no action here
43 }
44 try {
45 } catch (Exception e1) { // violation, 'Name 'e1' must match pattern'
46 try {
47 } catch (Exception e2) { // violation, 'Name 'e2' must match pattern'
48 }
49 }
50 try {
51 } catch (Throwable t1) { // violation, 'Name 't1' must match pattern'
52 try {
53 } catch (Throwable t2) { // violation, 'Name 't2' must match pattern'
54 }
55 }
56 }
57 }