iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

Missing break statement in switch case

Open anukalp2804 opened this issue 7 months ago • 3 comments

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

anukalp2804 avatar May 03 '26 13:05 anukalp2804

Hi @HTHou , I would like to work on this issue. Could you please assign this to me?. Thank you.

anukalp2804 avatar May 03 '26 13:05 anukalp2804

Hi @HTHou , I would like to work on this issue. Could you please assign this to me?. Thank you.

No problem, assigned.

HTHou avatar May 04 '26 01:05 HTHou

Hi @HTHou , I have raise pr regarding java:S128 so can you please review and let me know that if there is any changes needed from my side. I really appreciate your help and guidance.

Thank you

anukalp2804 avatar May 06 '26 16:05 anukalp2804