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

Useless imports should not raise issues on lombok import

    Details

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

      Description

      Some lombok import might be considered as unused given the recent evolution of java language that collides with some of its functionality (especially the "var" case).

       

      import lombok.val;
      import lombok.var; // false positive
      
      class Foo {
          public void test() {
              var foo1 = "hello, ";
              val foo2 = 5;
      
              System.out.println(foo1 + foo2);
          }
      } 

      Given this, all unused import issues regarding lombok import should be filtered out and not reported in order to avoid false positives.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                nicolas.peru Nicolas Peru
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: