Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2027

SolrJ FacetField should never return null from getValues()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4.1
    • 4.0-ALPHA
    • clients - java
    • None

    Description

      In some circumstances, FacetField.getValues() will return null. I'd like for my iteration code to simply be:

      for (c : ff.getValues() { 
        // ...
      }
      

      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.

      Attachments

        1. SOLR-2027.patch
          2 kB
          Chris Male

        Activity

          People

            cmale Chris Male
            dsmiley David Smiley
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: