lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <j...@apache.org>
Subject [jira] Created: (SOLR-2027) SolrJ FacetField should never return null from getValues()
Date Wed, 04 Aug 2010 19:13:18 GMT
SolrJ FacetField should never return null from getValues()
----------------------------------------------------------

                 Key: SOLR-2027
                 URL: https://issues.apache.org/jira/browse/SOLR-2027
             Project: Solr
          Issue Type: Improvement
          Components: clients - java
    Affects Versions: 1.4.1
            Reporter: David Smiley
            Priority: Minor


In some circumstances, FacetField.getValues() will return null.  I'd like for my iteration
code to simply be:
{code:java}
for (c : ff.getValues() { 
  // ...
}
{code}
However this will throw an NPE if I don't wrap this in either a null check or this check:
ff.getValueCount() > 0

I propose that getValues() return a Collections.EMPTY_LIST if the internal value is null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message