Back to Error Prone

InvalidThrowsLink

docs/bugpattern/javadoc/InvalidThrowsLink.md

2.49.0449 B
Original Source

@throws does not require @linking the target exception.

java
/**
 * Validates {@code n}.
 *
 * @throws {@link Exception} if n is negative.
 */
void validate(int n) throws Exception {
  ...
}
java
/**
 * Validates {@code n}.
 *
 * @throws Exception if n is negative.
 */
void validate(int n) throws Exception {
  ...
}

Suppression

Suppress by applying @SuppressWarnings("InvalidThrowsLink") to the element being documented.