Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent IntelliJ from importing classes used in JavaDocs when I call optimize imports?

IntelliJ is importing classes declared with {@link ...} inside JavaDoc when I call "Optimize imports ..." on my project.

How do I prevent that behaviour?

like image 717
Leonardo Cruz Avatar asked Sep 18 '15 15:09

Leonardo Cruz


People also ask

How do I stop IntelliJ optimizing imports?

Disable File | Settings | Editor | General | Auto Import | Optimize imports on the fly. Normally you don't need to add imports manually, IDEA does it for you.

What does IntelliJ optimize imports do?

Quickly remove any unused imports and more. With the Optimize imports action (Ctrl+Alt+O), you can quickly remove any unused imports, merge imports from the same module, and optionally sort the import statements.

How do I automatically import classes in IntelliJ?

Use Alt + Enter for importing a single package or use Alt + Shift + Enter to auto import all the unambiguous packages in the current file.

Are Java wildcard imports bad?

Using wildcard imports in Java would not affect runtime performance of a Java program at all, but compile-time performance may be affected a little.


1 Answers

Go to Settings/Editor/Code Style/Java/Imports and select If not already imported for the Use fully qualified names in JavaDoc option.

That way fully qualified names should be preferred for links to classes in JavaDoc which are not already imported in the current file.

like image 140
Bohuslav Burghardt Avatar answered Oct 03 '22 00:10

Bohuslav Burghardt