Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have multiple exception in a single throw java docs tag?

I am trying to add a JavaDoc in my code. I need to add multiple exception in a single throw. When I add below, it only recognizes NullPointerException not the IllegalArgumentException. Is there any way to provide multiple exception in a single throw tag so that it can recognize both, when I place my mouse on the method?

@throws NullPointerException, IllegalArgumentException when invalid userId, timeout is passed

Or I need to do it like this? By this, I am repeating same comment twice.

@throws NullPointerException when invalid userId, timeout is passed
@throws IllegalArgumentException when invalid userId, timeout is passed
like image 318
john Avatar asked Apr 18 '15 18:04

john


1 Answers

You cannot specify 2 exceptions with 1 @throws tag


You need a @throws tag for each exception you have. This allows you to give a description for each exception you are throwing.

like image 112
Vince Avatar answered Oct 01 '22 20:10

Vince