SonarQube server Developer Edition v2025.1 (102418)
Hello Sonar team, we have some false positives on Lombok generated methods from With and EqualsAndHashCode class annotations.
For With annotation, it returns the rule ID findbugs:RC_REF_COMPARISON on the withxxx generated methods.
For EqualsAndHashCode, it returns the rule ID
fb-contrib:USBR_UNNECESSARY_STORE_BEFORE_RETURN
We add the configuration in SonarQube to ignore Generated from Lombok, it works well for coverage but not for issues detection.
import lombok.With;
@With
public record Instance(
Integer order
) {
}
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@EqualsAndHashCode
@AllArgsConstructor
@ToString
public class AdditionalInformation {
private final String key;
private final String keyType;
}