apache / apache/iotdb

Missing break statement in switch case

Open
#17,594 3 comments 1 reaction 1 assignee Claimed by @anukalp2804 View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

## 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;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.