Bug 486155 - The tree viewer state restoration upon Eclipse startup occasionally failing
Summary: The tree viewer state restoration upon Eclipse startup occasionally failing
Status: CLOSED WONTFIX
Alias: None
Product: Sphinx
Classification: Automotive
Component: Navigator & Editor Sockets (show other bugs)
Version: 0.10.0   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Stephan Eberle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 02:51 EST by Stephan Eberle CLA
Modified: 2024-05-06 23:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Eberle CLA 2016-01-20 02:51:53 EST
= Problem description =

After having shut down Eclipse with a workspace in where one or several model files had been expanded in the Model Explorer, it occasionally happens that the expansion state is not fully restored when the workbench is restarted again. The common observation is that only the root element(s) of the model files are expanded in such cases but the expansion state of the nested model elements is not restored.

= Problem analysis =

The root cause of this problem seems to be located in the first while loop of TreeViewerStateRecorder#applyState(): Here, it can happen that a model file is skipped because it has not been loaded yet but the model elements contained in that file are not skipped because apparently the file has been loaded in parallel to this iteration. 

= Proposed solution =

To avoid this kind of trouble, TreeViewerStateRecorder#applyState() must be made aware of the tree paths behind the recorded tree element state providers and skip all remaining tree element state providers that are on the same tree path if a given tree element state provider turn out to be not loaded yet. This can be achieved by changing ITreeViewerState#getExpandedElements() from a flat list of tree element state providers into a list of tree element state provider lists where the inner list contains the tree element state providers that are on the same tree path. The logic in #recordState(), #saveState() and #restoreState() to be adapted accordingly. When #applyState() detects that a given tree element state provider from this 2-dimensional list is not loaded yet then it must skip all remaining tree element state providers on the same inner list (i.e., on the same tree path) instead of skipping only the current one.
Comment 1 Balazs Grill CLA 2024-05-06 23:13:33 EDT
Closed stale issue before migration