Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3320

S1165/S2039: Fix false positives for Lombok's field modifier annotations

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.3
    • Component/s: Rules

      Description

      We have to update Lombok issue filter to avoid FP in the following situations:

      S1165

      S1165 explicitly ask to make a field final, despite the fact that Lombok add a final modifier to fields when:

      • the class is annotated with @Value and not @NonFinal.
      • Or with @FieldDefaults(makeFinal=true)
      • unless the field itself is annotated with @NonFinal

      S2039

      Lombok adds a private modifier when:

      • the class is annotated with @Value
      • or @FieldDefaults(level = Lombok.AccessLevel.PRIVATE)
      • unless the field is annotated with @PackagePrivate

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              quentin.jaquier Quentin Jaquier
              Reporter:
              quentin.jaquier Quentin Jaquier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: