Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Fix for Bug#218785: SDO - NPE message in DataObject.set(path, value) is too generic

All,

Please review the fix for the following bug and provide any feedback you may have:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=218785

Bug summary:
For the following SDO set data value call:
--------------------
varDObj.set(simpleXPath,srcObj);
--------------------
srcObj = "300"
simpleXPath = "dooTaskInstancesView1/TaskId"

The NPE will be encountered in some cases:
-----------------------------------
java.lang.NullPointerException
       at oracle.sdo.helper.XPathEngine.setIsSetUnSet(XPathEngine.java:156)
       at oracle.sdo.helper.XPathEngine.processPath(XPathEngine.java:126)
       at oracle.sdo.helper.XPathEngine.set(XPathEngine.java:69)
       at oracle.sdo.SDODataObject.set(SDODataObject.java:188)
-----------------------------------

It is a negative case of SDO usage.  The full form of the XPath is:
"/ns2:createDooTaskInstancesView1/ns2:dooTaskInstancesView1/ns1:TaskId"

"dooTaskInstancesView1" is actually a child complex DataObject which is not
initialized under "createDooTaskInstancesView1".

A more meaningful Exception message:  To catch this problem pro-actively, instead of relying on JVM, and use the other constructor in NullPointerException(String s) to put a more meaningful error message. E.g.: "'dooTaskInstancesView1' child object is not initialized"


Oracle
David McCann | Principal Software Engineer | TopLink Product
Oracle Corporation Canada
45 O'Connor Street, Suite 400
Ottawa, Ontario K1P 1A4
Canada
613.288.4636
613.238.2818 (fax)


Back to the top