Lombok - Remove this unused "name" private field. (java:S1068)

Hi,

We’re using SonarQube 2025.1 LTA to analyze a Java project that uses Lombok. Our project is on Java 21, and we run the analysis using the SonarQube Scanner CLI.

SonarQube is reporting the issue “Remove this unused ‘name’ private field” in a class annotated with Lombok annotations (the field is actually being used through Lombok’s generated methods).

Here’s an example of the class causing the issue:

java

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Project {
    private String name;
}

Are there any configurations we might be missing to properly handle Lombok-annotated fields?

Hi,

What version of SonarQube are you using? This one looks relevant, and it was resolved in April:

SONARJAVA-4933 FP on S1068 with lombok @Data, @Getter, @Setter annotations

 
Ann

we are using SonarQube v2025.1.3

Hi,

So you don’t have that fix. Once you upgrade, this should go away. In the meantime, your best bet is to mark the issue a False Positive.

 
HTH,
Ann

Thanks you for your reply