1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.design.mutableexception;
12
13
14 class Example2 extends Exception {
15 private int code;
16
17 public Example2() {
18 code = 1;
19 }
20 }
21
22 class SecondException extends Exception {
23 private int code;
24
25 public SecondException() {
26 code = 2;
27 }
28 }
29
30 class SecondThrowable extends Throwable {
31 final int code;
32 String message;
33
34 public SecondThrowable(int code, String message) {
35 this.code = code;
36 this.message = message;
37 }
38 }
39
40 class SecondBadException extends java.lang.Exception {
41 int code;
42
43 public SecondBadException(int code) {
44 this.code = code;
45 }
46 }
47