False Negative: Unused imports for lombok-related code

SonarCloud doesn’t report unused imports for lombok-related imports.
The obvious reason is that https://jira.sonarsource.com/browse/SONARJAVA-3154 implementation was too wide and completely ignores all Lombok-related imports.
It’s pretty annoying because more often than not the unused lombok imports should be reported as issues.

Example of a class that should report 3 issues but it doesn’t

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

public class LombokClass {
	private int x;
}

The original problem of SONARJAVA-3154 should be fixed more specifically, by filtering out lombok.var etc…

Hey @lrozenblyum,

Thanks for raising this. Last time we worked on filtering out issues from Lombok, we indeed went a bit too far. Since then, we reworked our semantic engine, and we should, therefore, adjust this behavior, as we should be today much more efficient at resolving imports.

I created the following ticket to handle it: SONARJAVA-3501

Cheers,
Michael

Thanks @Michael!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.