NPE generated during a property set of a static SDO
---------------------------------------------------
Key: TUSCANY-958
URL: http://issues.apache.org/jira/browse/TUSCANY-958
Project: Tuscany
Issue Type: Bug
Components: Java SDO Implementation
Affects Versions: Java-Mx
Environment: N/A
Reporter: David T. Adcox
When a property is set on a static SDO object, a Null Pointer Exception is
thrown. This will only occur if the property is being set for the second time,
the initial set of the property works. The problem is caused by some erroneous
code in the DataObjectImpl class.
In the inverseAdd(Object,int,ChangeContext) method, the local variable,
changeContextImpl is retrieved from a local method
initializeChangeContext(ChangeContext). Then, immediately following this line
of code, the same variable is set again by way of a cast of a parameter to the
method. In some instances, the value being passed is null, so when the value
is used later, an NPE will occur. It seems the cast-set is possibly an old
remnant of code from before the creation of the InitializeChangeContext method.
This method properly handles the creation of the ChangeContext and works fine,
we simply need to comment out the cast-set line of code.
A similar behavior is found in inverseRemove(Object,Object,int,Class,
ChangeContext), so it should be fixed, as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]