Search code examples
javaspringspring-bootannotationsspring-annotations

IntelliJ Passes the Full Import Path of an Annotation Above Class


Has anyone had something like this before? The @Service annotation gets the full import path above the class and there's no way to fix it. I wrote the import path manually but it doesn't get recognised by IntelliJ. It's not a big thing I know, just for display purposes.

Thank you...

Full annotation path


Solution

  • As @Sweeper has mentioned in his comment, the class name must be different from the name of the annotation. Thus if a class gets a name Service, the Spring Framework will provide the full path of the omonymous annotation.