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

FP on S2160: Classes annotated with lombok's @EqualsAndHashCode should be ignored

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.12
    • Component/s: Rules
    • Labels:
      None

      Description

      Classes annotated with lombok's annotation @lombok.EqualsAndHashCode, @lombok.Data or @lombok.Value should be ignored, as the equals and hashCode methods will be generated.

      import lombok.EqualsAndHashCode;
      
      @EqualsAndHashCode(callSuper=true)
      class Child extends Parent { // Should be compliant
        int foo;
        // ...
      }
      
      @EqualsAndHashCode
      class GrandChild extends Child { // Should be compliant
        int bar;
        // ...
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                michael.gumowski Michael Gumowski
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: