Rule java:S122 (multiple statements on one line) shows this example here ( SonarQube ):
if (someCondition) doSomething(); // Noncompliant
Braces are included in the compliant replacement, leading one of our devs to ask if the problem was the missing braces (but that’s a different rule). The difference between the compliant and non-compliant examples should only relate to the rule being violated. In this case, the problem was the then clause being on the same line as the conditional, but the compliant code added curlies. It would be more clear if you either removed the curlies from the compliant code or added them to the non-compliant code.
The C# and PHP versions of this rule have the same problem. The other languages seem to use a more simple case of two independent statements, which is probably a better case anyway as that is more clear about what the problem is.
(This principle should apply everywhere: the change from non-compliant code to compliant code should be the absolute minimum to make the code comply with the one specific rule being illustrated. I can’t recall any other examples off the top of my head but if I see any, I’ll post them here.)