Update rule to prevent UnusedImport when using JavaDoc with array type
This commit is contained in:
@ -44,7 +44,7 @@ public class UnusedImportsRule extends AbstractJavaRule {
|
||||
.compile("@see\\s+(\\p{Alpha}?+\\w*)(?:#\\w*(?:\\(([\\w\\s,]*)\\))?)?");
|
||||
|
||||
private static final Pattern LINK_PATTERNS = Pattern
|
||||
.compile("\\{@link(?:plain)?\\s+(\\p{Alpha}\\w*)(?:#\\w*(?:\\(([.\\w\\s,]*)\\))?)?[\\s\\}]");
|
||||
.compile("\\{@link(?:plain)?\\s+(\\p{Alpha}\\w*)(?:#\\w*(?:\\(([.\\w\\s,\\[\\]]*)\\))?)?[\\s\\}]");
|
||||
|
||||
private static final Pattern VALUE_PATTERN = Pattern.compile("\\{@value\\s+(\\p{Alpha}\\w*)[\\s#\\}]");
|
||||
|
||||
|
@ -241,6 +241,22 @@ public class Foo {
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#1720 False Positive in UnusedImports for Javadoc link with array type</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import some.pack.SomeUtility;
|
||||
|
||||
public class Foo {
|
||||
/**
|
||||
* The {@link SomeUtility#someHelperMethod(String, SomeObjectArray[])} method does something.
|
||||
*/
|
||||
public void someMethod() {
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
Bug 2606609 : False "UnusedImports" positive in package-info.java
|
||||
|
Reference in New Issue
Block a user