#1280 False Positive in UnusedImports when import used in javadoc

This commit is contained in:
Andreas Dangel
2014-11-18 22:27:07 +01:00
parent 7d262036c6
commit 8ab9f3ed5d
3 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,7 @@ public class UnusedImportsRule extends AbstractJavaRule {
"@see\\s+(\\p{Alpha}\\p{Alnum}*)(?:#\\p{Alnum}*\\(([\\w\\s,]*)\\))?");
private static final Pattern LINK_PATTERNS = Pattern.compile(
"\\{@link(?:plain)?\\s+(\\p{Alpha}\\p{Alnum}*)(?:#\\p{Alnum}*\\(([\\w\\s,]*)\\))?[\\s\\}]");
"\\{@link(?:plain)?\\s+(\\p{Alpha}\\p{Alnum}*)(?:#\\p{Alnum}*\\(([.\\w\\s,]*)\\))?[\\s\\}]");
private static final Pattern VALUE_PATTERN = Pattern.compile(
"\\{@value\\s+(\\p{Alpha}\\p{Alnum}*)[\\s#\\}]");

View File

@ -264,7 +264,7 @@ import some.pack.SomeUtility;
public class Foo {
/**
* The {@link SomeUtility#someHelperMethod(String, SomeObject)} method does something.
* The {@link SomeUtility#someHelperMethod(String, test.SomeObject)} method does something.
*/
public void someMethod() {
}

View File

@ -12,5 +12,6 @@
* [#1254](https://sourceforge.net/p/pmd/bugs/1254/): CPD run that worked in 5.1.2 fails in 5.1.3 with OOM
* [#1276](https://sourceforge.net/p/pmd/bugs/1276/): False positive in UnusedPrivateMethod with inner enum
* [#1280](https://sourceforge.net/p/pmd/bugs/1280/): False Positive in UnusedImports when import used in javadoc
* [#1281](https://sourceforge.net/p/pmd/bugs/1281/): UnusedPrivateMethod incorrectly flagged for methods nested private classes
* [#1282](https://sourceforge.net/p/pmd/bugs/1282/): False Positive with implicit String.valuesOf() (Java)