Bug 551135 - Update Drillstack to use isEmpty and Deque instead of stack
Summary: Update Drillstack to use isEmpty and Deque instead of stack
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.14 M1   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 564941
  Show dependency tree
 
Reported: 2019-09-16 14:36 EDT by Lars Vogel CLA
Modified: 2020-07-13 18:17 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 Lars Vogel CLA 2019-09-16 14:36:43 EDT

    
Comment 1 Eclipse Genie CLA 2019-09-16 14:38:41 EDT
New Gerrit change created: https://git.eclipse.org/r/149605
Comment 3 Phil Beauvoir CLA 2020-07-05 10:56:13 EDT
This change has broken the use of DrillDownAdapter in our app, Archi.

Calling DrillDownAdapter#goHome() on a TreeViewer does not return to the root node but only the previous node on the stack.
Comment 4 Phil Beauvoir CLA 2020-07-05 11:21:34 EDT
It seems that each DrillFrame is being pushed onto the Deque stack in the wrong order.

If we have a tree:

Root
  |---Node 1
       |---Node 2

When DrillDownAdapter#goInto() is called on Node 1 and then Node 2 the Deque stack contains DrillFrames in this order:

[0] Node 1
[1] Root

Calling DrillDownAdapter#goHome() calls DrillStack#goHome() which calls Deque#getFirst() which returns element [0] and this is wrong.
Comment 5 Phil Beauvoir CLA 2020-07-05 11:28:37 EDT
So I'm wondering if in DrillStack instead of this:


public DrillFrame goHome() {
   DrillFrame aFrame = fStack.getFirst();
   reset();
   return aFrame;
}


It should be this?

public DrillFrame goHome() {
   DrillFrame aFrame = fStack.getLast();
   reset();
   return aFrame;
}
Comment 6 Phil Beauvoir CLA 2020-07-05 11:41:21 EDT
Indeed it is the case as per my previous comment. 

I changed 

DrillFrame aFrame = fStack.getFirst();

to:

DrillFrame aFrame = fStack.getLast();

And goHome() works as expected.
Comment 7 Lars Vogel CLA 2020-07-05 12:59:47 EDT
(In reply to Phil Beauvoir from comment #6)
> Indeed it is the case as per my previous comment. 
> 
> I changed 
> 
> DrillFrame aFrame = fStack.getFirst();
> 
> to:
> 
> DrillFrame aFrame = fStack.getLast();
> 
> And goHome() works as expected.

Phil, can you open a new bug and push a Gerrit?
Comment 8 Phil Beauvoir CLA 2020-07-05 13:10:31 EDT
(In reply to Lars Vogel from comment #7)
> Phil, can you open a new bug and push a Gerrit?

Opened Bug #564941