I am starting a new project and I need to Use SonarQube
, and I want to use Lombok
, I already configured it within Eclipse and everything works fine except the static analysis.
- Unusued private fields: When I have a
@Data
class, all the fields are reported asUnused private field
. @Getter(lazy=true)
: When I use this annotation I get theRedundant nullcheck of value known to be non-null
see @Getter(lazy=true) (this is related to compiled code).
I think a possible solution is delombok
the project, compile and run Sonar.
Similar issues in SonarQube Jira
:
- [CodeGen - Lombok] false warning hint (Unused Private Field)
- Provide a new java rule to check for unused private field and which would support bytecode generation (cd Lombok)
- [CodeGen - Lombok] false warning hint
(The @SuppressWarnings("PMD.UnusedPrivateField")
solution don't work with latest SonarQube 4.2
)
How can I solve this problem?