Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349932

Summary: [builder] built resources registered twice with ResourceDescriptionsData
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: All   
OS: All   
Whiteboard:

Description Knut Wannheden CLA 2011-06-21 06:50:59 EDT
In the following piece of code from ClusteringBuilderState#doUpdate() the newDelta is registered with the newState and then also directly removed from / added to the newData. The latter is however already done in CurrentDescriptions#register() (i.e. in the call newState.register(newDelta)). So it seems like those lines could be removed. I.e. replace:

        if (newDelta != null) {
            newDeltas.add(newDelta);
            if (newDelta.haveEObjectDescriptionsChanged())
                changedDeltas.add(newDelta);
            // Make the new resource description known and update the map.
            newState.register(newDelta);
            if (newDelta.getNew() == null) {
                newData.removeDescription(changedURI);
            } else {
              newData.addDescription(changedURI, newDelta.getNew());
            }
        }

with:


        if (newDelta != null) {
            newDeltas.add(newDelta);
            if (newDelta.haveEObjectDescriptionsChanged())
                changedDeltas.add(newDelta);
            // Make the new resource description known and update the map.
            newState.register(newDelta);
        }
Comment 1 Sebastian Zarnekow CLA 2011-07-12 04:25:01 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:32:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:43:44 EDT
Closing all bugs that were set to RESOLVED before Neon.0