You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Markus Jelsma (JIRA)" <ji...@apache.org> on 2019/02/14 14:29:00 UTC

[jira] [Created] (SOLR-13249) ByteArrayUtf8CharSequence.getStringOrNull returns null

Markus Jelsma created SOLR-13249:
------------------------------------

             Summary: ByteArrayUtf8CharSequence.getStringOrNull returns null 
                 Key: SOLR-13249
                 URL: https://issues.apache.org/jira/browse/SOLR-13249
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
    Affects Versions: 7.7
            Reporter: Markus Jelsma
             Fix For: 8.0


I have an URP that, in processAdd(), gets a field value via SolrInputField.getValue(). In a normal unit test this yields me a String. But in a distributed test i get a ByteArrayUtf8CharSequence.

If it is a ByteArrayUtf8CharSequence the getStringOrNull() method always returns null unless some internal method called _getStr first.

This is either by design or a mistake. If it is a mistake, then the fix is to use toString() and the getStringOrNull() method can be removed (it would become a duplicate for toString(). If it is by design, then nothing is obvious from the JavaDoc and it should clarify.

This is since 7.7.0.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org