Does java:S122 count a curly brace?

SQ 8.6 Community

We get the following error about 2 statements in a line:

I’m not sure what the issue is. It’s not the case label and the assignment being on the same line, because it isn’t flagged for case 2 or 3. It’s not the curly being on the same line as the case label, because when I put a line break after the colon in SonarLint, the issue goes away (the flag on “switch” is for a missing default case):


Can you explain?

Hey there.

I’ve moved your post to the section dedicated for reporting false-positives.

Please make sure that:

  • You provide a text-based snippet of code that reproduces the issue, rather than a screenshot
  • The issue can be reproduced either on the latest version of SonarQube, or on the latest version of SonarLint (not in connected mode)