Skip to content

Commit 90551df

Browse files
SONARJAVA-5782 Improve message in S112 (#5307)
1 parent 4a68496 commit 90551df

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

java-checks-test-sources/default/src/main/java/checks/RawExceptionCheckSample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void throws_Error() {
2424
// ^^^^^
2525
}
2626

27-
public void throws_Exception() throws Exception { // Noncompliant {{Define and throw a dedicated exception instead of using a generic one.}}
27+
public void throws_Exception() throws Exception { // Noncompliant {{Replace generic exceptions with specific library exceptions or a custom exception.}}
2828
throw new Exception(); // Noncompliant
2929
}
3030

@@ -63,7 +63,7 @@ public void exception() {
6363
public RawExceptionCheckSample() throws
6464
Throwable, // Noncompliant
6565
Error, // Noncompliant
66-
Exception { // Noncompliant {{Define and throw a dedicated exception instead of using a generic one.}}
66+
Exception { // Noncompliant {{Replace generic exceptions with specific library exceptions or a custom exception.}}
6767
throw new
6868
Throwable(); // Noncompliant
6969

java-checks/src/main/java/org/sonar/java/checks/RawExceptionCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private void reportIssue(Tree tree) {
9090
context.newIssue()
9191
.forRule(this)
9292
.onTree(tree)
93-
.withMessage("Define and throw a dedicated exception instead of using a generic one.")
93+
.withMessage("Replace generic exceptions with specific library exceptions or a custom exception.")
9494
.report();
9595
}
9696

0 commit comments

Comments
 (0)