Two false positives about the rule RSPEC-2974

Hi, I found two false positives about the rule RSPEC-2974, see the code below. SonarQube should not report a warning because the annotation @NoArgsConstructor and @AllArgsConstructor can generate a new public constructor in the class. Hence, I think they are false positive.

import lombok.NoArgsConstructor;
@NoArgsConstructor
public class C {
  private C() {
    // ...
  }

  public static int magic(){
    return 42;
  }
}
import lombok.AllArgsConstructor;
@AllArgsConstructor
public class C {
  private C() {
    // ...
  }

  public static int magic(){
    return 42;
  }
}

Hi,

What version of SonarQube are you on? You can find it in the page footer if you’re not sure.

 
Ann

Hi Ann, I use SonarQube 9.2.3.

Hi,

Would you mind upgrading to the latest version, 9.7.1 (9.8 is due on Monday…) to see if you can replicate the FPs there, please?

 
Thx!
Ann