I finally got around to looking at why short field values are returned as 
"java.lang.Short:<value>".

Both XMLWriter.writeVal() and TextResponseWriter.writeVal() are missing the 
check for (val instanceof Short), and thus this bit of code is used:

      // default... for debugging only
      writeStr(name, val.getClass().getName() + ':' + val.toString(), true);

The same thing happens when you have a binary field, since val in that case is 
byte[], so you get "[B:[B@<address of byte array>"

Has anybody else run into this? Seems odd that it's not a known issue, so I'm 
wondering if there's something odd about my schema.

This is especially true since BinaryField has write methods for both XML and 
JSON (via TextResponseWriter) that handle Base64-encoding the data. So I'm 
wondering how normally the BinaryField.write() methods would get used, and 
whether the actual problem lies elsewhere.

-- Ken

PS - any good reason why XMLWriter is a final class? I created my own fixed 
version of JSONResponseWriter w/o much effort because I could subclass it, but 
XMLWriter being final makes it hard (impossible?) to do the same, since there 
are numerous internal methods that take an explicit XMLWriter object as a 
parameter.

--------------------------
Ken Krugler
http://www.scaleunlimited.com
custom big data solutions & training
Hadoop, Cascading, Mahout & Solr




Reply via email to