[ 
https://issues.apache.org/jira/browse/SOLR-7765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-7765:
---------------------------
    Attachment: SOLR-7765.patch

bq. I'll add a test to my PR.

Thanks!

I missunderstood what you ment before, but with the testcase you provided it 
all makes sense.

In my opinion, the root bug here is that TokenizerChain should be more explicit 
about what is allowed in it's construtor, and more resilient to null args when 
things are optional -- that way callers like LukeAdminHandler don't have to 
constantly do null checks.

The attached path fixes what i consider the root of the bug and gets your test 
to pass w/o modifying LukeAdminHandler.  It also adds more randomization to 
your test to cover more permutations of options, and updates MultiTermTest to 
account for the improved behavior of getCharFilterFactories() (which you can 
see from looking at that test was annoying inconsistent before depending on 
what analyzer was used and where it came from)

I'm going to do a quick audit of all TokenizerChain clients to see where else 
null checks are currently be doing that can be optimized away with this fix and 
post an updated patch.



> TokenizerChain without char filters cause NPE in luke request handler
> ---------------------------------------------------------------------
>
>                 Key: SOLR-7765
>                 URL: https://issues.apache.org/jira/browse/SOLR-7765
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.2.1
>            Reporter: Konstantin Gribov
>            Assignee: Hoss Man
>            Priority: Minor
>         Attachments: SOLR-7765.patch, SOLR-7765.patch
>
>
> {{TokenizerChain}} created using 2-arg constructor has {{null}} in 
> {{charFilters}}, so {{LukeRequestHandler}} throws NPE on iterating it.
> Will create PR in a couple of minutes.



--
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