[
https://issues.apache.org/jira/browse/LANG-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17807378#comment-17807378
]
Václav Haisman commented on LANG-1726:
--------------------------------------
[~ggregory] The {{@return}} javadoc is still wrong:
{code:java}
* @return Never actually returned, this generic type matches any type
* which the calling site requires. "Returning" the results of this
* method, as done in the propagateExample above, will satisfy the
* Java compiler requirement that all code paths return a value. {code}
Honestly, I think the entire {{asRuntimeException()}} method should be removed.
It is useless and it will only confuse people when {{rethrow()}} is there as
well with better interface.
I understand that would be a breaking change but if anyone has used it, they
must have scratched their head as well as I did.
> ExceptionUtils.asRuntimeException is not a good replacement for deprecated
> ExceptionUtils.rethrow
> -------------------------------------------------------------------------------------------------
>
> Key: LANG-1726
> URL: https://issues.apache.org/jira/browse/LANG-1726
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Affects Versions: 3.14.0
> Reporter: Václav Haisman
> Priority: Major
> Fix For: 3.15.0
>
>
> I have been doing pass over deprecated warning in our code and one of them is
> that {{org.apache.commons.lang3.exception.ExceptionUtils#rethrow}} is
> deprecated. Its comment says "Use asRuntimeException(Throwable)." However,
> {{asRuntimeException()}} is not a good replacement. It lacks the generic type
> parameter R that the rethrow method has. In fact, the comment that says...
> {noformat}
> Returns:
> Never actually returned, this generic type matches any type which the calling
> site requires. [..]
> {noformat}
> ...is lying.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)