Skip to content

Fix switch case warning related unconditional break, return or throw statement.#17611

Open
anukalp2804 wants to merge 1 commit intoapache:masterfrom
anukalp2804:fix/switch_case_warning
Open

Fix switch case warning related unconditional break, return or throw statement.#17611
anukalp2804 wants to merge 1 commit intoapache:masterfrom
anukalp2804:fix/switch_case_warning

Conversation

@anukalp2804
Copy link
Copy Markdown
Contributor

@anukalp2804 anukalp2804 commented May 6, 2026

Summary

This PR resolves SonarCloud rule java:S128, switch cases should end with an unconditional break, return or throw statement. For that we have done some changes like :

  • Added break statements where execution could fall through to the next case
  • Removed unnecessary {} blocks from cases that already had unconditional return statements
  • Added {} blocks in a few places to make the case scope clearer for static analysis tools

Addressed : #17594
This PR has:

  • been self-reviewed.
  • been built locally with mvn spotless:apply.
  • been built locally with mvn clean package -DskipTests.
  • been built locally with mvn -pl iotdb-core -am test -DskipTests.

Resolves : https://sonarcloud.io/project/issues?impactSeverities=BLOCKER&issueStatuses=OPEN%2CCONFIRMED&id=apache_iotdb
End this switch case with an unconditional break, return or throw statement.

@HTHou HTHou requested a review from JackieTien97 May 7, 2026 01:24
@JackieTien97
Copy link
Copy Markdown
Contributor

@CRZbulabula @Caideyipi plz review related classes

Copy link
Copy Markdown
Contributor

@CRZbulabula CRZbulabula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants