You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Shad Storhaug (Jira)" <ji...@apache.org> on 2019/12/03 14:09:00 UTC

[jira] [Commented] (LUCENENET-615) PerFieldAnalyzerWrapper.GetTokenStream throws NullReferenceException when first arg is null. It does not default.

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

Shad Storhaug commented on LUCENENET-615:
-----------------------------------------

The documentation has now been updated to inform end users that the dictionary implementation chosen will provide the desired behavior. This issue can be closed after the next release after beta00006.

> PerFieldAnalyzerWrapper.GetTokenStream throws NullReferenceException when first arg is null. It does not default.
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENENET-615
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-615
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net.Analysis.Common
>    Affects Versions: Lucene.Net 4.8.0
>            Reporter: Emil Müller
>            Priority: Major
>
> var english = new EnglishAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);
> var whitespace = new WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);
> var pf = new PerFieldAnalyzerWrapper(english, new Dictionary<string, Analyzer>() \{ { "foo", whitespace }});
> var test1 = english.GetTokenStream(null, "test"); // Does not throw
> var test2 = pf.GetTokenStream("", "test"); // works
> var test3 = pf.GetTokenStream(null, "test"); // Throws NullReferenceException
>  
> I don't think I'm doing anything wrong, but the last line crashes with the abovementioned exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)