Sometimes I put the class name in the comments of methods or class just for referencing. But eclipse does the import automatically and leaves an import statement in the file which causes "unused import" checkstyle errors later. Is there some configuration I can change to avoid eclipse automatically importing when I type the class name in the comments?
views:
59answers:
2
A:
In my case eclipse never imports anything if I type a class name in a comment. Maybe you have enabled this behaviour through a setting change yourself? Normally eclipse would only react to same event you triggered (pressing ctrl+space or strl+1 or something like that) and would not generate an import if you just type in a name.
Arne
2010-09-06 07:27:03
He means Javadoc comments. If you include e.g. `{@link File}` and use _Organize imports_ Eclipse will add an import.
musiKk
2010-09-06 07:36:41
+2
A:
People don't agree whether this is a bug or not. Javadoc needs the imports to create appropriate links. I'd say checkstyle should provide an option (and Eclipse maybe too) to change change the warning.
There are two relevant bug reports:
musiKk
2010-09-06 07:42:49