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

Uwe Schindler commented on LUCENE-6193:
---------------------------------------

Hi,
FYI: If you had in the past the multiple catch statements around reflection 
errors, all those exceptions have new superclass in Java 7: 
ReflectiveOperationException. This can sometimes simplify the code more! This 
applies in most cases around where you have stuff like ClassNotFoundException, 
IllegalAccessException, InstantiationException, InvocationTargetException, 
NoSuchFieldException, NoSuchMethodException, all handled by identical catch.

Just catching ReflectiveOperationException around reflection access is in most 
cases all you need now.

> Collapse identical catch branches in try-catch statements
> ---------------------------------------------------------
>
>                 Key: LUCENE-6193
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6193
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>            Priority: Trivial
>             Fix For: Trunk, 5.1
>
>         Attachments: LUCENE-6193.patch
>
>
> We are on Java 7+ so we can reduce verbosity by collapsing identical catch 
> statements into one. We did the same for solr in SOLR-7014.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to