This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 383679 - [Contributions] Contribution of a control via org.eclipse.ui.menus to a view toolbar leads to a NPE
Summary: [Contributions] Contribution of a control via org.eclipse.ui.menus to a view ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows Vista
: P3 major with 3 votes (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 13:56 EDT by Adam Wehner CLA
Modified: 2014-04-22 07:20 EDT (History)
5 users (show)

See Also:


Attachments
Exception Stack Trace (12.17 KB, text/plain)
2012-06-27 13:57 EDT, Adam Wehner CLA
no flags Details
(Modified) Mail RCP Sample for reproducing the error (96.49 KB, application/zip)
2012-06-27 13:58 EDT, Adam Wehner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Wehner CLA 2012-06-27 13:56:42 EDT
Build Identifier: Version:4.2 - Build id:I20120608-1400

When contribution a control by the extension point "org.eclipse.ui.menus" to a view toolbar, the control does not appear. It seems to be a problem with a null parent, which is invoked, what leads to a NullPointerException.

See the attachment for the exception stack trace and a modified "Mail RCP Sample App" to reproduce the error.

Reproducible: Always
Comment 1 Adam Wehner CLA 2012-06-27 13:57:38 EDT
Created attachment 217957 [details]
Exception Stack Trace
Comment 2 Adam Wehner CLA 2012-06-27 13:58:10 EDT
Created attachment 217959 [details]
(Modified) Mail RCP Sample for reproducing the error
Comment 3 Paul Webster CLA 2012-06-27 15:21:02 EDT
org.eclipse.ui.internal.menus.CompatibilityWorkbenchWindowControlContribution assumes it will be in a trim bar:

MUIElement parent = toolControl.getParent();
while (!(parent instanceof MTrimBar)) {
	parent = parent.getParent();
}

But in this case, it will be contained within a view MToolBar.

PW
Comment 4 Daniel Rolka CLA 2014-04-22 07:20:14 EDT
I'm not able to recreate the issue. Probably it has been fixed by the patch for the Bug 414741.

I'm going to set the 'WORKSFORME' status for the bug. Please reopen it when the issue occurs again

Daniel