Hoss Man created LUCENE-5926:
--------------------------------
Summary: ResourceLoaderAware classes should probably throw
IllegalStateException if you attempt to use them w/o calling inform()
Key: LUCENE-5926
URL: https://issues.apache.org/jira/browse/LUCENE-5926
Project: Lucene - Core
Issue Type: Improvement
Reporter: Hoss Man
Mailing list user reported an NPE from SnowballPorterFilterFactory.create that
was ultimately caused by not realizing that they had to call
SnowballPorterFilterFactory.inform.
We should consider updating all ResourceLoaderAware classes so that if you
attempt to use them w/o calling inform, you consistently get an
IllegalStateException w/meaningful error.
ie, in the case of SnowballPorterFilterFactory, something like...
{noformat}
@Override
public TokenFilter create(TokenStream input) {
if (null == stemClass) {
throw new IllegalStateException("inform(ResourceLoader) method must be
called before using this factory");
}
...
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]