[ 
https://issues.apache.org/jira/browse/LUCENE-7796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984622#comment-15984622
 ] 

Robert Muir commented on LUCENE-7796:
-------------------------------------

I think we both agree to the end goal, my problem is how you get there.

Are you really sure exceptions are never null in all these places? That is my 
problem. Sure in some places its totally obvious because it has a comment like 
that, maybe those places should be fixed first, but I am worried about bugs.

Why not add the new method, and deprecate the old one? Then the old lenient 
method is discouraged for any new code, and old code can be migrated more 
carefully.

Is there a strong technical reason to remove the deprecated method from master 
or is it just "but that doesnt seem right to have one there"? Its a million 
times more important to not introduce bugs in exception handling.

> Make reThrow idiom declare RuntimeException return type so callers may use it 
> in a way that compiler knows subsequent code is unreachable
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7796
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7796
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Trivial
>             Fix For: 6.x, master (7.0)
>
>         Attachments: LUCENE-7796.patch
>
>
> A spinoff from LUCENE-7792: reThrow can be declared to return an unchecked 
> exception so that callers can choose to use {{throw reThrow(...)}} as an 
> idiom to let the compiler know any subsequent code will be unreachable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to