1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.coding.illegalcatch;
9
10
11 class Example1 {
12 void exampleMethod1() {
13 try {
14
15 } catch (Exception e) {
16
17 }
18 }
19
20 void exampleMethod2() {
21 try {
22
23 } catch (ArithmeticException e) {
24
25 } catch (Exception e) {
26
27 }
28 }
29
30 void exampleMethod3() {
31 try {
32
33 } catch (NullPointerException e) {
34 } catch (OutOfMemoryError e) {
35
36 }
37 }
38
39 void exampleMethod4() {
40 try {
41
42 } catch (ArithmeticException | NullPointerException e) {
43
44 }
45 }
46
47 void exampleMethod5() {
48 try {
49
50 } catch (OutOfMemoryError e) {
51
52 }
53 }
54 }
55