Skip to content

Commit 9fe804f

Browse files
SONARJAVA-5436 Suggest to add comment in message for S108 (#5124)
1 parent aed4840 commit 9fe804f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@Rule(key = "S108")
3131
public class EmptyBlockCheck extends IssuableSubscriptionVisitor {
3232

33-
private static final String MESSAGE = "Either remove or fill this block of code.";
33+
private static final String MESSAGE = "Remove this block of code, fill it in, or add a comment explaining why it is empty.";
3434
private boolean isMethodBlock;
3535

3636
@Override

java-checks/src/test/files/checks/EmptyBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void method() {
4242
}
4343

4444

45-
switch (1) { // Noncompliant {{Either remove or fill this block of code.}}
45+
switch (1) { // Noncompliant {{Remove this block of code, fill it in, or add a comment explaining why it is empty.}}
4646
// ^
4747
}
4848

0 commit comments

Comments
 (0)