False positive from java:S1105 in record containing class or interface


  • What language is this for? Java
  • Which rule? S1105
  • Why do you believe it’s a false-positive/false-negative? formatting is OK
  • Are you using
    • SonarCloud? No
    • SonarQube - which version? Yes, 9.9.1
    • SonarLint - which IDE/version? Yes, 7.13 in Eclipse
      • in connected mode with SonarQube or SonarCloud? yes
  • How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
record S1105FalsePositive(Object o) {

    public String first() {
        return o.toString();

    public String second() {
        return o.toString();

    public interface Inner {

If Inner is removed, or moved before the methods, then no issue is reported.


Hi @vtintillier,
Thank you for reporting this FP. I can reproduce it locally.
So far, the FP shows up whenever the second method is followed by an interface, a class or a static field.

I have created a ticket to keep track of the issue.