[
https://issues.apache.org/jira/browse/POOL-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14100926#comment-14100926
]
Michael Osipov edited comment on POOL-268 at 8/18/14 5:46 PM:
--------------------------------------------------------------
Sebb, not a good example to cite. First of all, this API is old. Many errors
have been made in the JDK API design. You won't find such code in newer JDK
APIs. Sine NFE is a IAE, it is imperative not to declare {{throws}}.
The call is not recoverable. Unrecoverable means that the programmer failed to
adhere to the contract and you can repeat the call as often as you want the
outcome won't change. Changing the input is a change of state. While a network
exception is checked because you have no control over that.
was (Author: michael-o):
Sebb, not a good example to cite. First of all, this API is old. Many errors
have been made in the JDK API design. You won't find such code in newer JDK
APIs. Sine NFE is a IAE, it is imperative not to declare {{throws}}.
The call is not recoverable. Unrecoverable means that the programmer failed to
adhere to the contract and you can repeat the cal as often as you want the
outcome won't change. Changing the input is a change of state. While a network
exception is checked because you have no control over that.
> Remove throws <RuntimeException> from all method signatures
> -----------------------------------------------------------
>
> Key: POOL-268
> URL: https://issues.apache.org/jira/browse/POOL-268
> Project: Commons Pool
> Issue Type: Improvement
> Affects Versions: 2.2
> Reporter: Michael Osipov
>
> Unfortunately, many signatures carry a {{throws <RuntimeException>}} like
> {{IllegalStateException}}, etc. This is incorrect. A runtime exception never
> appears in the signature but only in the Javadocs because runtime exception
> indicate a programming error.
> This violates against Java programming rules and Joshua Bloch's Effective
> Java.
--
This message was sent by Atlassian JIRA
(v6.2#6252)