Affects PMD Version:
6.21+
7.0.0
Rule: UnnecessaryImport
Description:
When an on-demand import is only used in a JavaDoc @link
, @see
or similar tag, the import is flagged.
This rule requires type-resolution to match the on-demand import, which isn't performed for JavaDoc content (I think...)
I already played around with this a little bit, but my solution seems like a hack, as I'm not sure, if the internal APIs were meant to be used that way and I feel that this might break easily if the code-resolution logic changes: kris-scheibe/pmd@3b19532
Do you guys have any ideas or comments?
Code Sample demonstrating the issue:
import java.util.*; public class Foo { /** * {@link ArrayList arraylist} */ public void test() {} }
Running PMD through: Other
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4