Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
N/A
Description
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.