Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349932 - [builder] built resources registered twice with ResourceDescriptionsData
Summary: [builder] built resources registered twice with ResourceDescriptionsData
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 06:50 EDT by Knut Wannheden CLA
Modified: 2017-09-19 17:43 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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