Rule Definition
There is no dispute that these comments contribute to a developer's understanding and help a developer write reliable applications more quickly. Without documenting exception thrown it is dififcult for anyone else than the author to guess its purpose and consequences except by looking at the code that is throwing it.
Remediation
Add a @throws or @exception tag with a description for each method.
Violation Code Sample
public void f() throws IOException { // body }
Fixed Code Sample
#Remediation Sample with @throws tag: /** * @throws IOException If an input or output * exception occurred */ public void f() throws IOException { // body } #Remediation Sample with @exception tag: /** * @exception StringIndexOutOfRangeException * if the index is not in the range <code>0</code> * to <code>length()-1</code>. */ public char charAt(int index) { ... }
Reference
https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#throws https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#exception
Related Technologies
JEE
Technical Criterion
Documentation - Automated Documentation
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.