0
votes

IntelliJ IDEA Ultimate 2019.3 on macOS Catalina (10.15.2) is showing the fully qualified for annotations that I import...

For example, after creating a Spring Boot Project with the Web dependency from Spring Initializr and then importing the unzipped file into IntelliJ IDEA as a Maven project, I tried to add the @RestController annotation to my class:

@RestController
public class RestController {
}

IntelliJ IDEA automatically completes it with the fully qualified name (which is not what I prefer):

@org.springframework.web.bind.annotation.RestController
public class RestController {

}

Went to Preferences -> Editor -> Code Style -> Java and the Use fully qualifed class names is unchecked.

How can I get rid of this annoying code completion?

Just want it to look like this (it was working but something happened and I even tried File -> Invalidate Caches.../Restart

It used to be that if I put @RestController, it would import the class and look like this:

import org.springframework.web.bind.annotation.RestController;

@RestController
public class RestController {

}

This is what I am seeking to revert back to...

Any assistance is much appreciated.

1
Are you using custom code style format?? or default one or google guava??Vishwa Ratna
@VishwaRatna - No and thank you for asking... Like I mentioned in the post, something just broke in IntelliJ IDEA's settings, behind-the-scenes.PacificNW_Lover
redownload the intellij then, If you know that binaries are broke.Vishwa Ratna
@VishwaRatna - I already tried uninstalling and re-downloaded and its the same issue.PacificNW_Lover

1 Answers

0
votes

Figured it out - I was trying to be very generic so I named my class RestController... That's why IntelliJ IDEA had decided to include the fully qualified package name for the annotation because it was doing me a favor by not letting the compiler know that the class name and the annotation are different pieces of code.

Indeed, IntelliJ IDEA is truly intelligent!