Community
Participate
Working Groups
The StructuredTextEditor may complete the model lifecycle on a different model during doSave(). Initially, the internal model is notified that it is about to be changed. But, upon saving, it is possible for the input to have been deleted, which would cause a saveAs() to set the new input for the editor creating a new internal model in the process. When the finally clause is reached in the doSave(), the editor completes the lifecycle on the new model instead of the old.
Created attachment 174105 [details] patch
Nitin, would you mind taking a look at this for 3.2.1?
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. The primary issue with this is that the wrong model is notified that changes to it have been completed. This causes a couple of things to occur: 1. The lock guarding both the structured document and model is over-released, which may cause synchronization problems between the model and document 2. The model will fire off notifications to its model state listeners signaling that the model has changed, when it fact it hasn't. This can give the listeners the wrong idea about the current state of the model and may result in errors (model changed without model about to change notification). * Is there a work-around? If so, why do you believe the work-around is insufficient? No. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Existing unit tests have been run as well as manual testing. * Give a brief technical overview. Who has reviewed this fix? The editor always managed the lifecycle of its current model during a save. In the case where a save could lead to a save as (e.g., original file could not be written to), the model changes since the editor's input changes. This resulted in the finalizing of the model's life cycle to be executed on the wrong model. This fix makes sure that finalizing the model's life cycle is done on the same model that the editor started with. Nitin has reviewed the fix. * What is the risk associated with this fix? Almost none. Just guaranteeing that we use the same model through the lifecycle calls.
Released to Maintenance and HEAD.