Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-958

NPE generated during a property set of a static SDO

    XMLWordPrintableJSON

Details

    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.

      Attachments

        1. tuscany958.diff
          1 kB
          David T. Adcox

        Activity

          People

            Unassigned Unassigned
            dtadcox David T. Adcox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: