Custom Spring Controllers marked as unused by IntelliJ

Hi,

I am writing some custom controllers, both rest Oauth2 protected ones, and normal web dispatch controllers. The problem is that IntelliJ doesnt see these as being used, making it hard to see “real” unused variables and such, see screenshot.

Not only is the method “unused”, so is the @Injected createUserService

Anyone has an idea on how to fix this?

Hi,
This IntelliJ inspection is customizable.
You can specify in the settings the list of the annotations. If one of annotations is present on the field, the inspection will ignore that field.

see answers for this question: java - “Variable is never assigned” warning in IntelliJ IDEA can be suppressed only "partially" - Stack Overflow