문제

Can I use multiple @throws javadoc tags if my application throws the same exception for multiple reasons? For example:

@throws UserException if issue 1 happened
@throws UserException if issue 2 happened
@throws UserException if issue 3 happened

Is it prohibited by JavaDoc standard?

도움이 되었습니까?

해결책

It is valid in java 6,7 and 8. See the docs:

Multiple @throws tags can be used in a given doc comment for the same or different exceptions.

(emph. mine)

다른 팁

Just tested this the generated JavaDoc contains all 3 @throws.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top