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
Affects PMD Version:
6.21+
7.0.0
Rule: UnnecessaryImport
Description:
When an on-demand import is only used in a JavaDoc
@link,@seeor 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:
Running PMD through: Other