This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javadoc: What to document if one exception is caught and another is throwed?
 
Similar Threads
RuntimeException confusion in SCJD book
JavaCaps mock 1 Q:9
Javadoc and coding conventions
throws question
Reg. Exception : Valiverus' exam