Missing break statement in switch case
Offen
#17,594
3 Kommentare
1 Reaktion
1 zugewiesene Person
Beansprucht von @anukalp2804
Auf GitHub ansehen
- Vorherrschende Sprache
- Java
- Sterne
- 6.4k
- Forks
- 1.2k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 115
Beschreibung
## Description
SonarCloud reports a violation of rule `java:S128` , A case block in the switch statement does not end with a `break`, `return`, or `throw`. This can cause the execution to continue into the next case unintentionally.
## Sonar Issue
https://sonarcloud.io/project/issues?open=AZGODvhLNLTUq8J6Y65s&id=apache_iotdb
## How to fix
To fix this, add a `break` at the end of the case block.
## Example
```tsx
case HANDSHAKE_DATANODE_V1:{
try {
......
} finally {
..........
}
break;
}
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.