S6829 when constructor to be injected has no arguments

Consider a case where a class annotated with Component has two constructors like this:

class MyClass {

  MyClass(int someValue) {
      // omitted

  public MyClass() {

Even though this works fine at runtime and the result of the correct no-args constructor is injected, this results in a finding of S6829 that one of the constructors should have the Autowired annotation.
However, I cannot annotate the public no-args constructor as I then get an inspection error: “Autowired constructor without parameters”.

Now I am wondering: should the sonar rule be “smarter” and recognize that he no-args constructor is correct without needing the Autowired annotation or is the IntelliJ warning incorrect here? Should I suppress the Sonar finding or the IntelliJ inspection?

Hey there.

I’ve moved your post to the section on reporting FPs / FNs.

Can you tell us what version of which product(s) you’re using?

We’re using SonarQube Developer EditionVersion 10.4.1 (build 88267) and SonarLint

Hi @MelvinFrohike,

I tried reproducing the issue from the IDE, but without success.
Can you please tell me which version of IntelliJ are you using?
Additionally, I couldn’t find any references that constructors without parameters shouldn’t be annotated with @Autowired.

All the best,


I am using IntelliJ Ultimate Edition 2023.3.6

Thank you.

Can you please provide me with some more details about this?
A screenshot could be useful.
The inspection error I get, when I remove the @Autowired annotation is:

Add @Autowired to one of the constructors.

All the best,