Inspectopedia Help

Incorrect dependency injection place

Reports incorrect injection points: fields, methods, and parameters annotated with @Inject that violate the CDI specification.

Requirements for fields:

  • Cannot be static or final

  • Cannot be annotated with @Produces

Requirements for methods with injection:

  • Cannot be static or abstract

  • Cannot have parameters with @Disposes and @Observes annotations

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Jakarta EE: Contexts and Dependency Injection (CDI), 241.16690

Last modified: 29 April 2024