-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #13345: Enabled MutableExceptionCheckExamplesTest
- Loading branch information
1 parent
8c27c6d
commit 0707dd5
Showing
7 changed files
with
117 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...es/resources/com/puppycrawl/tools/checkstyle/checks/design/mutableexception/Example1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="TreeWalker"> | ||
<module name="MutableException"/> | ||
</module> | ||
</module> | ||
*/ | ||
|
||
|
||
|
||
package com.puppycrawl.tools.checkstyle.checks.design.mutableexception; | ||
|
||
// xdoc section -- start | ||
class Example1 extends Exception { | ||
private int code; // OK, class name doesn't match with default pattern | ||
|
||
public Example1() { | ||
code = 1; | ||
} | ||
} | ||
|
||
class FirstException extends Exception { | ||
private int code; // violation | ||
|
||
public FirstException() { | ||
code = 2; | ||
} | ||
} | ||
|
||
class FirstThrowable extends Throwable { | ||
final int code; // OK | ||
String message; // violation | ||
|
||
public FirstThrowable(int code, String message) { | ||
this.code = code; | ||
this.message = message; | ||
} | ||
} | ||
|
||
class FirstBadException extends java.lang.Exception { | ||
int code; // violation | ||
|
||
public FirstBadException(int code) { | ||
this.code = code; | ||
} | ||
} | ||
// xdoc section -- end |
43 changes: 0 additions & 43 deletions
43
...les/resources/com/puppycrawl/tools/checkstyle/checks/design/mutableexception/Example1.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.