You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Frank Wesemann <f....@fotofinder.net> on 2010/03/12 21:37:18 UTC

XMLWriter

Hello,
I don't want to roll up all the XMLWriter issues, but stumpled upon this:
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 any key to a String. ( There is even a comment 
on this in the source !?).
Is there a reason not to use String.valueOf( entry.getKey() ) or such?

-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky




Re: XMLWriter

Posted by Frank Wesemann <f....@fotofinder.net>.
Created SOLR-1823.
I attached a patch for this particular problem.

>> Any other places we missed this?
None, that I could spot,
there are so many warnings about unchecked castings rsp. not using Generics.

-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky




Re: XMLWriter

Posted by Frank Wesemann <f....@fotofinder.net>.
> Yeah, seems like the right approach.
Good, I feared I missed sth. obvious. :-)

> Any other places we missed this?
>   
I'll have a look at it.
I'll also open an JIRA issue and add patches etc, if you don't mind.

-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky




Re: XMLWriter

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Fri, Mar 12, 2010 at 3:37 PM, Frank Wesemann
<f....@fotofinder.net> wrote:
> Hello,
> I don't want to roll up all the XMLWriter issues, but stumpled upon this:
> 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 any key to a String. ( There is even a comment on
> this in the source !?).
> Is there a reason not to use String.valueOf( entry.getKey() ) or such?

Yeah, seems like the right approach.
Any other places we missed this?

-Yonik
http://www.lucidimagination.com