False positive "The constructor is undefined" in Enums with AllArgsConstructor

When analyzing a Java project in a GitHub Actions workflow, enums using Lombok’s AllArgsConstructor annotation incorrectly trigger the warnings:

“Unresolved imports/types have been detected during analysis.”

"The constructor (…) is undefined”

This occurs despite the constructor being defined by Lombok, but other issues in the respective files are not affected by this and are reported correctly. The issue in question does not occur:

• During local analysis using SonarLint 10.12.

• When analyzing the project directly via the SonarQube Server on a web interface.

Manually delomboking the affected files prevents these messages from being reported.

Below is an example of the affected code:

@AllArgsConstructor
@Getter
public enum ArithmeticOperator {
  ADD(" add ", "%s add %s"),
  SUB(" sub ", "%s sub %s"),
  MUL(" mul ", "%s mul %s"),
  DIV(" div ", "%s div %s"),
  MOD(" mod ", "%s mod %s"),
  EQ(" eq ", " eq %s");

  private final String value;
  private final String formatValue;
}

During workflow execution, this triggers: “The constructor ArithmeticOperator(String, String) is undefined”

Versions:

  • IntelliJ IDEA 2024.3 (Ultimate Edition) Build #IU-243.21565.193
  • SonarQube * Developer Edition v10.6 (92116)
  • SonarLint 10.12
  • lombok 1.18.34

Hey there.

I’ve moved your post to the section on reporting false-positives.

Can you please update your post with the specific rule keys that are involved? Even better if your code sample has comments indicating where the issues are raised.