lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (SOLR-1823) XMLWriter throws ClassCastException on writing maps other than <String,?>
Date Thu, 18 Mar 2010 22:42:27 GMT

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

Hoss Man resolved SOLR-1823.
----------------------------

       Resolution: Fixed
    Fix Version/s: 1.5
         Assignee: Hoss Man

Nice catch Frank.

FWIW: the original intent was that any of those types of objects could be used as the *value*
of a Map, not the key -- but that's still no excuse to just cast the key instead of using
stringification (i could have sworn it was already doing that)

The one subtlety that your patch broke however is that if someone uses null as a key in the
Map, that has always been written out as an entry w/o a key -- but by using String.valueOf
your patch allways produces a non-null string value (ie: the 4 character string "null") so
i modified your patch to just use toString() with an explicit null check.

Committed revision 925031.

> XMLWriter throws ClassCastException on writing maps other than <String,?>
> -------------------------------------------------------------------------
>
>                 Key: SOLR-1823
>                 URL: https://issues.apache.org/jira/browse/SOLR-1823
>             Project: Solr
>          Issue Type: Improvement
>          Components: documentation, Response Writers
>            Reporter: Frank Wesemann
>            Assignee: Hoss Man
>             Fix For: 1.5
>
>         Attachments: SOLR-1823.patch
>
>
> http://lucene.apache.org/solr/api/org/apache/solr/response/SolrQueryResponse.html#returnable_data
says that a Map "containing any of the items in this list" may be contained in a SolrQueryResponse
and will be handled by QueryResponseWriters.
> This is not true for (at least) Keys in Maps.
> XMLWriter tries to cast keys to Strings. 

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


Mime
View raw message