This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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?