Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320813

Summary: Minimized stacks are missing on restart
Product: [Eclipse Project] e4 Reporter: Eric Moffatt <emoffatt>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Remy Suen <remy.suen>
Severity: major    
Priority: P3 CC: bokowski, remy.suen
Version: 1.0   
Target Milestone: 1.0 RC3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Here's a deltas file that gives me no trim stacks...
none
The deltas file from a 'failing' version produced by my original steps\
none
XMLModelReconciler patch v1 none

Description Eric Moffatt CLA 2010-07-24 11:42:07 EDT
Run a fresh inner (no deltas)
Detach the Outline view by dragging it right
maximize the editor area

close
restart

There are no minimized stacks visible

If yoiu put a breakpoint in the WBWRenderer's processContents where it's restoring the trimBars before the restart you can see that there is only the one 'top' trim bar in the model, not sure where they went...I'll attach my deltas file, to my untrained eye the minimized stacks seem to be there (i.e. if you do a find on 'left(' there is a ToolControl defined).
Comment 1 Eric Moffatt CLA 2010-07-24 11:47:45 EDT
Created attachment 175156 [details]
Here's a deltas file that gives me no trim stacks...


The bug seems somewhat sporatic, I've had the test scenario work but fails often enough...

If you are in this state then unmax-ing the editor area will throw NPEs. Reset perspective seems to get you back to sanity.
Comment 2 Boris Bokowski CLA 2010-07-24 16:40:10 EDT
Here are steps:

1. Start with a fresh workspace
2. Detach the Package Explorer
3. Minimize the Package Explorer -> goes to the trim
4. Restart -> No minimized stack for the Package Explorer anymore
Comment 3 Eric Moffatt CLA 2010-07-24 18:02:43 EDT
*** Bug 317506 has been marked as a duplicate of this bug. ***
Comment 4 Eric Moffatt CLA 2010-07-26 09:54:38 EDT
Created attachment 175219 [details]
The deltas file from a 'failing' version produced by my original steps\
Comment 5 Remy Suen CLA 2010-07-26 10:03:07 EDT
(In reply to comment #4)
> Created an attachment (id=175219) [details]
> The deltas file from a 'failing' version produced by my original steps\

From the file, we can see that it is merely recording a direct reference to some other EMF object instead of preserving the object in its entirety...

<trimBars>
  <reference elementId="_vvVoUJi5Ed-hoIBGGUL7JQ"/>
  <reference elementId="_vveyQJi5Ed-hoIBGGUL7JQ"/>
</trimBars>

...like so...

<trimBars>
  <reference e4namespace="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" type="org.eclipse.e4.ui.model.application.ui.basic.MTrimBar" unset="true" xmiId="_i0vdUJi9Ed-4eNTZLPBU-w">
  <!-- ... -->
  </reference>
</trimBars>
Comment 6 Remy Suen CLA 2010-07-26 10:16:40 EDT
Created attachment 175221 [details]
XMLModelReconciler patch v1

The reconciler was asking trimmed windows whether their trim bars changed. If a workbench window was asked, then 'true' would be returned and the deltas would be persisted properly. If 'false' was returned, we would get the problem described in comment 5 where only an id reference was made.

The reason this bug was "somewhat" reproducible is because the iteration over the trimmed windows is undefined (as it is merely a map). So sometimes you'd get the workbench window first and get 'true' and sometimes you'd get the detached window first and get 'false'.
Comment 7 Eric Moffatt CLA 2010-07-26 10:23:27 EDT
+1 from me...I haven't had any recurrences running with the patched code...
Comment 8 Boris Bokowski CLA 2010-07-26 10:34:24 EDT
+1
Comment 9 Remy Suen CLA 2010-07-26 10:39:05 EDT
Fix released to CVS HEAD. Thanks for finding this bug, Eric.
Comment 10 Eric Moffatt CLA 2010-07-27 13:54:40 EDT
Verified on XP in I20100726-2152 (Using many of my old scenarios that would show this).