Community
Participate
Working Groups
Created attachment 107486 [details] Patch Seeing an issue where reference counts are out of sync after generating a deployment descriptor for a project and them attempting to cancel an edit. The problem is that when the generated deployment descriptor is created and saved the code path for creating the file goes thru EMF2DOMSSERenderer.createDocument() When initializing the xml model in this method it does the following call: initializeXMLModel(file, true); It hardcodes the forWrite variable to true even though the resource's write count is currently 0. In initilizeXMLModel the method syncReferenceCounts(id, forWrite) is called passing in the hardcoded true for the forWrite var. In this method the write index is incremented by one due to the hard coded value even though the resource's write count is still set to 0. To fix this I have updated the hardcoded true to a calculated value: initializeXMLModel(file, resource.getWriteCount() != 0);
I approve
please note that when applying patches for the build, this patch is also contained in bug 240606
Approved.