Skip to content

Missing break statement in switch case #17594

@anukalp2804

Description

@anukalp2804

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

case HANDSHAKE_DATANODE_V1:{
  try {
    ......
  } finally {
    ..........
  }
  break;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions