lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6961) Improve Exception handling in AnalysisFactory/SPI loader
Date Tue, 05 Jan 2016 08:12:39 GMT

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

ASF subversion and git services commented on LUCENE-6961:
---------------------------------------------------------

Commit 1723013 from [~thetaphi] in branch 'dev/trunk'
[ https://svn.apache.org/r1723013 ]

LUCENE-6961: Add exception message; make method private

> Improve Exception handling in AnalysisFactory/SPI loader
> --------------------------------------------------------
>
>                 Key: LUCENE-6961
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6961
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>    Affects Versions: 5.4
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.5, Trunk
>
>         Attachments: LUCENE-6961.patch
>
>
> Currently the AnalysisSPILoader used by AbstractAnalysisFactory uses a {{catch Exception}}
block when invoking the constructor. If the constructor throws stuff like IllegalArgumentExceptions
or similar, this is hidden inside InvocationTargetException, which gets wrapped in IllegalArgumentException.
This is not useful.
> This patch will:
> - Only catch ReflectiveOperationException
> - If it is InvocationTargetException it will rethrow the cause, if it is unchecked. Otherwise
it will wrap in RuntimeException
> - If the constructor cannot be called at all (reflective access denied, method not found,...)
UOE is thrown with explaining message.
> This patch will be required by next version of LUCENE-6958.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message