Hi, I found a false positive about the rule RSPEC-2974, see the code below. SonarQube should not report a warning because the annotation @Value can generate a new public constructor in the class. Hence, this is a false positive.
import lombok.Value;
@Value
public class C {
private C() {
// ...
}
public static int magic(){
return 42;
}
}
Since SonarQube v9.2.3 is almost a year old (and has been EOL since v9.3 came out), I would suggest upgrading to v9.7 to see if the issue persists. If it does, let us know!
Somehow 3 days ago one of our developers must have seen this post and created SONARJAVA-4614 with your example! Not sure how that happened since this post wasn’t flagged for them
In any case, thanks for the report. You can track that ticket.