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