Václav Haisman created LANG-1726:
------------------------------------

             Summary: 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


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)

Reply via email to