Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue #3157: Javadoc value tag can reference import (#3158)
  • Loading branch information
lutovich authored and romani committed May 5, 2016
1 parent 2677654 commit 7e10071
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Expand Up @@ -142,6 +142,7 @@ public boolean isInheritDocTag() {
public boolean canReferenceImports() {
return tagInfo == JavadocTagInfo.SEE
|| tagInfo == JavadocTagInfo.LINK
|| tagInfo == JavadocTagInfo.VALUE
|| tagInfo == JavadocTagInfo.LINKPLAIN
|| tagInfo == JavadocTagInfo.THROWS
|| tagInfo == JavadocTagInfo.EXCEPTION;
Expand Down
Expand Up @@ -104,6 +104,13 @@ public void testProcessJavadoc() throws Exception {
verify(checkConfig, getPath("InputUnusedImports.java"), expected);
}

@Test
public void testProcessJavadocWithLinkTag() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(UnusedImportsCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputUnusedImportWithValueTag.java"), expected);
}

@Test
public void testAnnotations() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(UnusedImportsCheck.class);
Expand Down
@@ -0,0 +1,15 @@
package com.puppycrawl.tools.checkstyle.checks.imports;

import java.util.Calendar;

public class InputUnusedImportWithValueTag {

/**
* Method determines current month as for {@value Calendar#MONTH}.
*
* @return index of the current month.
*/
public int currentMonth() {
return 1;
}
}

0 comments on commit 7e10071

Please sign in to comment.