Parent issue: #19807
Coverage table
Chapter link
Content
Image
Text
@throws (@exception was the original tag) (reference page)
A @throws tag should be included for any checked exceptions (declared in the throws clause), as illustrated below, and also for any unchecked exceptions that the caller might reasonably want to catch, with the exception of NullPointerException. Errors should not be documented as they are unpredictable. For more details, please see Documenting Exceptions with the @throws Tag.
/**
* @throws IOException If an input or output
* exception occurred
*/
public void f() throws IOException {
// body
}
See the Exceptions chapter of the Java Language Specification, Second Edition for more on exceptions. Also see order of multiple @throws tags.
Guidelines
A @throws tag should be included for any checked exceptions (declared in the throws clause)
This chapter is covered by JavadocMethod, using its property validateThrows. Proposal:
| Documentation Comments Rule |
Checkstyle Checks Used |
Sample files |
@throws |
✅JavadocMethod |
|

Parent issue: #19807
Coverage table
Chapter link
Content
Image
Text
@throws (@exception was the original tag) (reference page)
A @throws tag should be included for any checked exceptions (declared in the throws clause), as illustrated below, and also for any unchecked exceptions that the caller might reasonably want to catch, with the exception of NullPointerException. Errors should not be documented as they are unpredictable. For more details, please see Documenting Exceptions with the @throws Tag.
See the Exceptions chapter of the Java Language Specification, Second Edition for more on exceptions. Also see order of multiple @throws tags.
Guidelines
This chapter is covered by JavadocMethod, using its property
validateThrows. Proposal:@throws