aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Javadoc: What to document if one exception is caught and another is throwed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Javadoc: What to document if one exception is caught and another is throwed?" Watch "Javadoc: What to document if one exception is caught and another is throwed?" New topic
Author

Javadoc: What to document if one exception is caught and another is throwed?

Olena Golub
Ranch Hand

Joined: Jan 17, 2005
Posts: 113
Hello,

I am a little bit confused about correct documenting of the exception with javadoc.
If I have one method that catches one exception and throws another one, what is correct way to document it with javadoc?


Is it correct to document with @throws only RecordNotFoundException :


Thanks a lot for your help!
Regards,
Olena.


SCJP 1.4<br />SCJD 1.4 (in progress)
Lara McCarver
Ranch Hand

Joined: Dec 09, 2003
Posts: 118
That is how I would document it, but I would specifically mention that the RecordNotFoundException can be thrown due to an IOException.
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Hi Olena,

I only provide a javadoc comment for the exception this method throws. As it is RecordNotFoundException in your case.

Regards,
Darya


SCJP, SCJD, SCWCD, SCBCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Javadoc: What to document if one exception is caught and another is throwed?
 
Similar Threads
RuntimeException confusion in SCJD book
throws question
JavaCaps mock 1 Q:9
Javadoc and coding conventions
Reg. Exception : Valiverus' exam