You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2013/01/05 23:12:12 UTC
[jira] [Updated] (SOLR-4275) TrieTokenizer causes StringIOOBE when
input is empty instead of returning no token
[ https://issues.apache.org/jira/browse/SOLR-4275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uwe Schindler updated SOLR-4275:
--------------------------------
Attachment: SOLR-4275.patch
Simle patch. It also corrects the read logic so it also works with unbuffered input readers.
> TrieTokenizer causes StringIOOBE when input is empty instead of returning no token
> ----------------------------------------------------------------------------------
>
> Key: SOLR-4275
> URL: https://issues.apache.org/jira/browse/SOLR-4275
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.0
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: 4.1, 5.0
>
> Attachments: SOLR-4275.patch
>
>
> When you use the admin interface and select a trie field (e.g. tint) and enter nothing into the field, the tokenizer should normally return no tokens. TrieTokenizer instead gets and SIOOBE because read() into the charbuffer returns -1 (end of stream). This is used to initialize the string's length...
> The fix is to modify the tokenizer to behave like a real tokenizer:
> - after reading the input, check if empty (read < 0) and then use 0 as length
> - if the resulting string is empty (total len == 0), set a boolean to false and make the incrementToken/end methods not delegate and return false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org