| Summary: | Danger of losing edits when saving resources | ||
|---|---|---|---|
| Product: | [Technology] STEM | Reporter: | Stefan Edlund <sedlund> |
| Component: | UI | Assignee: | Stefan Edlund <sedlund> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | mattadav |
| Version: | unspecified | ||
| Target Milestone: | 1.1.2 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Stefan Edlund
To me *** Bug 312675 has been marked as a duplicate of this bug. *** The following has been fixed: 1. You do not lose edits when saving a parent model on top of a sub model the way described in the defect. 2. The project explorer now keeps track of changes to models and scenarios without closing the nodes in the trees. Changes should show up immediately when they are saved in the editors The ideal solution described in the defect is not working yet though, and the editors could still show stale data. But the edits won't be lost at least. Here is one problem that still shows up: 1. Open an editor for model M2 containing some content, for instance a decorator 2. Open an editor for a model M1 containing model M2. DO NOT EXPAND THE TOP LEVEL NODE. 3. Go back to the M2 editor and remove the decorator, then save M2 4. Go back to the M1 editor and open the top node then the M2 node. A "ghost" decorator with an ID that looks randomly generated shows up. If you close and reopen the M1 editor the problem goes away. I've also sporadically seen tree nodes in the project explorer with an empty name, but this seems difficult to reproduce. Refreshing the project seems to fix this. I will lower the severity of this bug to normal, since the edit losses seems fixed. However, I think we should fix the other (less severe) problems. Looks like I spoke to early. I see data still being lost occasionally, I suspect there might be a race condition somewhere in the code. Will raise the severity again, but not sure if I can do much before the demo this week. The source of the problem is an EMF bug, and a bugzilla has been opened against it (333711) More information is available in this thread: http://www.eclipse.org/forums/index.php?t=msg&goto=647546&S=44f04262c14bea4fd44a01d0a1d62f32#msg_647546 I've committed a proposed additional fix for the "random disappearance of resources from children resources", but in high impact code that will need thorough testing. Actual Bug Circumstance: Completely unresolved proxy references do not get serialized as part of their parent resource. XMLSaveImpl calls the getHREF() method from XMLHelper to get a save path for proxy reference. In STEM, we override XMLHelper in STEMXMIResourceFactoryImpl. If getHREF() returns null, XMLSaveImpl skips & does not serialize the proxy ref. In the overridden getHREF() method, we call getURI() on the Identifiable. If the URI is null, then getHREF() returns null. If the proxy is unresolved, getURI() returns null. For proxies, we return eProxyUri() for the href - which is correct. However that happens after the URI null check - so unresolved proxies return a null href. The proposed fix is to return eProxyUri() for proxies without checking for a null URI. Fix verified. |