1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.design.mutableexception;
10
11 public class InputMutableException3 {
12 public class FooException extends Exception {
13 private final int finalErrorCode;
14 private int errorCode = 1;
15
16 public FooException() {
17 finalErrorCode = 1;
18 }
19
20 public class FooExceptionThisIsNot extends RuntimeException {
21 private final int finalErrorCode;
22 private int errorCode = 1;
23
24 public FooExceptionThisIsNot() {
25 finalErrorCode = 1;
26 }
27 }
28 }
29
30 public class BarError extends Throwable {
31 private int errorCode;
32 }
33
34 public class BazDoesNotExtendError {
35 private int errorCode;
36 }
37
38 public class CustomProblem extends ThreadDeath {
39 private int errorCode;
40
41 public class CustomFailure extends ThreadDeath {
42 private int errorCode;
43 public void someMethod() {
44 if(true) {
45 final int i = 0;
46 }
47 }
48 }
49 }
50
51 class CustomException extends Exception {}
52
53 class CustomMutableException extends Exception {
54 int errorCode;
55 }
56
57 class ExampleException extends Exception {
58 public void test() {
59 Throwable cause = super.getCause();
60 if (!(cause instanceof java.io.IOException))
61 throw new IllegalStateException("Test");
62 }
63 }
64 }