Skip to content

add missing default case to switch in McpController [Fix] - #2102

Closed
abhaygoudannavar wants to merge 1 commit into
microcks:masterfrom
abhaygoudannavar:fix/sonar-s131-mcp-switch
Closed

abhaygoudannavar wants to merge 1 commit into
microcks:masterfrom
abhaygoudannavar:fix/sonar-s131-mcp-switch

Conversation

@abhaygoudannavar

Copy link
Copy Markdown
Contributor

Summary

Add a missing default case to the switch statement in McpController.java, addressing the maintainability finding raised by SonarCloud and aggregated under #2058.

Sites changed

  • McpController#handleMcpRequest

Notes

This rule (java:S131 - switch statements should have a default case) flagged the request.method() switch block. I added a default -> { } block with an inline comment explaining that unrecognized methods fall through safely. This intentionally leaves result null, which correctly triggers the existing -32601 Method not found JSON RPC error response below it.

@kishore08-07 kishore08-07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@abhaygoudannavar i had already addressed all the 18 SonarQube maintainability and security issues in McpController.java earlier in pr: #2069.

@abhaygoudannavar

Copy link
Copy Markdown
Contributor Author

Hi @kishore08-07 i totally missed your PR while I was working my way through the umbrella issue (#2058). Awesome job knocking out all 18 of those McpController issues in one go! I'll go ahead and close this PR to keep the maintainers' queue clean and avoid stepping on your changes.

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.

2 participants