Closing workbench: catching NPE [message #108350] |
Tue, 07 October 2008 02:37  |
Eclipse User |
|
|
|
Hi,
1. I'm catching NPE when the user closes his workbench (file/exit or
x-button).
org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseCo ntributions(WorkbenchMenuService.java:850)
org.eclipse.ui.internal.menus.WorkbenchMenuService.releaseCo ntributions(WorkbenchMenuService.java:856)
org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchW indow.java:1550)
org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:681)
org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:657)
org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindo w.java:774)
The full log version is available at http://rafb.net/p/WcV4RU17.html
2. I lurked in WorkbenchMenuService.releaseContributions:
public void releaseContributions(ContributionManager mgr) {
// Recursive remove any contributions from sub-menus
XXX: IContributionItem[] items = mgr.getItems();
for (int i = 0; i < items.length; i++) {
if (items[i] instanceof ContributionManager) {
releaseContributions((ContributionManager) items[i]);
} else if (items[i] instanceof IToolBarContributionItem) {
IToolBarContributionItem tbci = (IToolBarContributionItem) items[i];
releaseContributions((ContributionManager) tbci
..getToolBarManager());
}
}
....
}
XXX: mgr can be null, see ToolBarContributionItem
tbci ToolBarContributionItem (id=636)
chevronMenuManager null
coolItem null
currentHeight 22
currentWidth 406
disposed true
id "functionKeys"
minimumItemsToShow -1
parent CoolBarManager2 (id=591)
toolBarManager null
useChevron true
visible true
I would like to copy this to bugzilla.
|
|
|
|
|
|
Re: Closing workbench: catching NPE [message #108572 is a reply to message #108436] |
Tue, 07 October 2008 06:57  |
Eclipse User |
|
|
|
Hello Ben,
Do you think it's enough for a snippet?
http://rafb.net/p/uP20tt28.html
Thanks,
Dmitry
Benjamin Muskalla wrote:
> Hi Dmitry,
>
> if it works correctly in RCP but not in RAP I suggest to open a bug
> report. And please attach a snippet/sample project to easily reproduce
> the exception.
>
> Greets
> Benny
>
> Dmitry Pryadkin wrote:
>> Hello Ben,
>>
>> In my case, the ToolbarContributionItem gets disposed outside of
>> workbench event pipeline. I wonder why it was ok in rcp to do so.
>>
>> Thanks
>>
>> Benjamin Muskalla wrote:
>>> Hi Dmitry,
>>>
>>> it seems that this is a known bug deep down in the event life cycle
>>> of the workbench itself. There was a bug at Platform/UI about this
>>> issue:
>>>
>>> 173657: [Contributions] Nullpointer Exception in WorkbenchMenuService
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=173657
>>>
>>> Do you have your own presentation which could cause this?
>>>
|
|
|
Powered by
FUDForum. Page generated in 0.03238 seconds