Hi,

I'll apply the patch to get the null input going. Meanwhile, it seems that there is some room for discussion in the sdo impl of XMLStreamHelper.

1) Should the methods on XMLStreamHelper accept null data ojbect?
2) In the case of an XMLDocument with null root, should we return an XMLStreamReader corresponding to the following XML (assuming {http://ns1}root is the root element qname)?

a) <p:root xmlns:p="http://ns1"/>

b) <p:root xmlns:p="http://ns1"; xis:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

Maybe we could check if the root element is nilable.

What do you think, Kelvin/Frank?

Thanks,
Raymond

----- Original Message ----- From: "Scott Kurz (JIRA)" <tuscany-dev@ws.apache.org>
To: <tuscany-dev@ws.apache.org>
Sent: Monday, November 05, 2007 10:48 AM
Subject: [jira] Updated: (TUSCANY-1681) DataObject2XMLStreamReader can't handle a null (or could this be an SDO bug??)



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

Scott Kurz updated TUSCANY-1681:
--------------------------------

   Attachment: 1681.patch

Well, let me push the issue a bit by at least submitting a patch to return null from each of the transformers:
   XMLStreamReader2DataObject   and     DataObject2XMLStreamReader
upon passing a null 'source' as input.

I'm not sure if an alternative solution would be to, say, have DataObject2XMLStreamReader pass back a XMLStreamReader upon receiving a 'null' DataObject as input, in which case we could probably remove this change to XMLStreamReader2DataObject .

And it's conceivable the SDO impl should be changed to handle passing a null SDO into XMLHelper.createDocument() and to pass back such a non-null XMLStreamReader in such a case.

DataObject2XMLStreamReader can't handle a null (or could this be an SDO bug??)
------------------------------------------------------------------------------

                Key: TUSCANY-1681
                URL: https://issues.apache.org/jira/browse/TUSCANY-1681
            Project: Tuscany
         Issue Type: Bug
         Components: Java SCA Data Binding Runtime
           Reporter: Scott Kurz
            Fix For: Java-SCA-Next

        Attachments: 1681.patch


When passing a null object into DataObject2XMLStreamReader I hit a NPE:
java.lang.NullPointerException
at org.apache.tuscany.sdo.util.resource.DataObjectXMLStreamReader.populateProperties(DataObjectXMLStreamReader.java:277) at org.apache.tuscany.sdo.util.resource.DataObjectXMLStreamReader.<init>(DataObjectXMLStreamReader.java:116) at org.apache.tuscany.sdo.util.resource.DataObjectXMLStreamReader.<init>(DataObjectXMLStreamReader.java:104) at org.apache.tuscany.sdo.helper.XMLStreamHelperImpl.createXMLStreamReader(XMLStreamHelperImpl.java:80) at org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader.transform(DataObject2XMLStreamReader.java:48) at org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader.transform(DataObject2XMLStreamReader.java:37) at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:77)
This is either:
* a bug in this specific transformer (my guess)
* a bug in SDO (I'm guessing not)
* a bug in the Tuscany databinding framework which should special case nulls (I'd think we might want to let transforms decide on their own how to handle null?)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to