Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 418084 - [Workbench] WorkbenchPage#findViewReference(viewId, secondaryId) odd behaviour
Summary: [Workbench] WorkbenchPage#findViewReference(viewId, secondaryId) odd behaviour
Status: CLOSED DUPLICATE of bug 401709
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-26 07:11 EDT by Ben Cox CLA
Modified: 2013-09-26 09:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Cox CLA 2013-09-26 07:11:06 EDT
I've just been trying to find an existing view with both a view and secondary ID. However, WorkbenchPage#findViewReference("my.view.id", "the.secondary.id") wasn't finding it.

I discovered that I had to call findViewReference("my.view.id:the.secondary.id", "the.secondary.id").

Further investigation shows that this is because findViewReference first performs the following check:

if (viewId.equals(reference.getId())) {...}

However, reference.getId() will return the view ID concatenated with a colon and the secondary ID, so won't match when only the view ID has been passed as the viewId parameter to the method.

Is this behaviour intended? Shouldn't this be separating the stored ID into view ID and secondary ID, and independently comparing them with the view ID and secondary ID parameters?
Comment 1 Wojciech Sudol CLA 2013-09-26 09:12:31 EDT

*** This bug has been marked as a duplicate of bug 401709 ***