[ https://issues.apache.org/jira/browse/LUCENE-7796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980077#comment-15980077 ]
Dawid Weiss commented on LUCENE-7796: ------------------------------------- I agree: the rethrow-checked hack is essentially an abuse of the type erasure system. It is based on JVM spec knowledge, not Java spec and it can lead to surprising code paths. I'll file a separate issue to remove sneaky throws from the core codebase. bq. wait ... am i missing something? aren't those 2 impls identical????? They are (now); I think it's a remnant from times when they weren't. > 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) > > > 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org