Affects PMD Version:
Rule:
UnusedImports
Description:
When a derived class refers to a type in a @see #method(ImportedType)
Javadoc tag, the ImportedType
is flagged as being unused.
Code Sample demonstrating the issue:
public class Base { void method(java.io.File file) {} }
import java.io.File; public class Derived extends Base { /** @see #method(File) */ void main() {} }
Running PMD through: doesn't matter
Suggested fix: In UnusedImportsRule.java
, change SEE_PATTERN
:
- "@see\\s+(\\p{Alpha}\\w*)(?:#\\w*(?:\\(([\\w\\s,]*)\\))?)?" + "@see\\s+(\\p{Alpha}?+\\w*)(?:#\\w*(?:\\(([\\w\\s,]*)\\))?)?"
This makes the type name optional. The regular expression should now match:
Typename#method(Typename)
(already worked before)#method(Typename)
(new)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