Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
/** Matches misuse of link tags within throws tags. */
@BugPattern(
summary =
"Javadoc links to exceptions in @throws without a @link tag (@throws Exception, not"
+ " @throws {@link Exception}).",
"Don't use {@link} or {@code} in @throws tags; mention the exception name directly (e.g.,"
+ " @throws IOException, not @throws {@link IOException}).",
severity = WARNING,
tags = StandardTags.STYLE,
documentSuppression = false)
Expand Down Expand Up @@ -79,5 +79,5 @@ public Void visitErroneous(ErroneousTree node, Void unused) {
}
}

private static final Pattern THROWS_LINK = Pattern.compile("^@throws \\{@link ([^}]+)}");
private static final Pattern THROWS_LINK = Pattern.compile("^@throws \\{@(?:link|code) ([^}]+)}");
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void positive() {
interface Test {
/**
* @throws {@link IOException} when failed
* @throws {@code IllegalArgumentException} if a < 0
*/
void foo(int a, int b) throws IOException;
}
Expand All @@ -52,6 +53,7 @@ interface Test {
interface Test {
/**
* @throws IOException when failed
* @throws IllegalArgumentException if a < 0
*/
void foo(int a, int b) throws IOException;
}
Expand Down
Loading