lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LUCENE-5926) ResourceLoaderAware classes should probably throw IllegalStateException if you attempt to use them w/o calling inform()
Date Fri, 05 Sep 2014 18:07:29 GMT
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message