# FP: S1105 on generic record whose component list spans several lines

**URL:** <https://community.sonarsource.com/t/fp-s1105-on-generic-record-whose-component-list-spans-several-lines/190806>\
**Category:** Report False-positive / False-negative...\
**Tags:** false-positive, java\
**Created:** [November 3, 2026, 9:15am UTC](https://community.sonarsource.com/t/fp-s1105-on-generic-record-whose-component-list-spans-several-lines/190806 "2026-11-03T09:15:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrozenblyum](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/lrozenblyum/32/11922_2.png) [@lrozenblyum](https://community.sonarsource.com/u/lrozenblyum)\
**Post date:** [November 3, 2026, 9:15am UTC](https://community.sonarsource.com/t/fp-s1105-on-generic-record-whose-component-list-spans-several-lines/190806/1 "2026-11-03T09:15:08Z")

</div>

- What language is this for? Java
- Which rule? java:S1105 (Move this left curly brace to the end of previous line of code)
- Why do you believe it’s a false-positive/false-negative?  
The left curly brace is already in the end of line
- Are you using
  - SonarQube Cloud? yes
  - SonarQube for IDE? SonarQube for Eclipse 13.2.0
    - in connected mode with SonarQube Cloud? yes

- How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)

```auto
// False positive: the brace already ends the line of the closing parenthesis
record Pair<T>(T first,
        T second) { // Noncompliant
}

// Same layout without a type parameter: no issue, as expected
record NamedPair(String first,
        String second) {
}

```

S1105 is raised on the `{` of `Pair`, although it is on the same line as the `)` that closes the record header. `NamedPair` has the same layout and gets no issue.

Likely cause: `LeftCurlyBraceBaseTreeVisitor.getLastTokenFromSignature(ClassTree)` checks `typeParameters()` before `recordCloseParenToken()`. For a generic record, the closing `>` of the type parameters becomes the reference token, and any record header that spans several lines is reported. Checking `recordCloseParenToken()` before `typeParameters()` should fix it. `LeftCurlyBraceEndLineCheck_record.java` has no generic record case yet.

Thanks,  
Leib

---

<div class="post-metadata">

**Author:** ![aurelien.coet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aurelien.coet/32/76605_2.png) [@aurelien.coet](https://community.sonarsource.com/u/aurelien.coet)\
**Post date:** [November 12, 2026, 10:17am UTC](https://community.sonarsource.com/t/fp-s1105-on-generic-record-whose-component-list-spans-several-lines/190806/4 "2026-11-12T10:17:48Z")

</div>

Hello @lrozenblyum,

Thank you for your report. I was able to reproduce the issue and have created [a ticket](https://sonarsource.atlassian.net/browse/SONARJAVA-7333) for us to fix this.

Best regards,  
Aurélien
