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