Florent Guillaume wrote:
On 13 Apr 2008, at 19:10, Jean-Marc Orliaguet wrote:

in nuxeo-platform/nuxeo-platform-syndication/src/main/java/org/nuxeo/ecm/platform/syndication/FeedItemAdapter.java I read:

      // List<String> contributors = Arrays.asList((String[])
      // doc.getProperty("dublincore", "contributors"));
// direct cast fails for some ResultDocuments returned by search service Object[] contribs = (Object[]) doc.getProperty("dublincore", "contributors");

Any idea why it fails?

No idea. Anyway this comment was written a long time ago, and by an intern that has since left us, so I wouldn't pay too much attention to it. The right thing would be to have chased down the unknown behavior at that time.

Have you witnessed anything strange with this?


yes indeed, I have had the same problem with a string array on a schema (similar to "dublincore:contributors"):

 <xs:simpleType name="stringArray">
   <xs:list itemType="xs:string" />
 </xs:simpleType>

 <xs:element name="roles" type="nxs:stringArray"/>

this line works in nuxeo-5.1.4:

 Object[] roleObjects = (Object[]) doc.getProperty("person", "roles");


but these always fail raising a class cast exception:

 String[] roleObjects = (String[]) doc.getProperty("person", "roles");

List<String> roleObjects = (List<String>) doc.getProperty("person", "roles");


it is a difficult bug to track further down in the code because it works fine otherwise with DocumentModels *not* returned by the search service.


/JM
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to