This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 304863 - [Compatibility] NPE thrown when using multiple consoles
Summary: [Compatibility] NPE thrown when using multiple consoles
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.0 RC2   Edit
Assignee: Project Inbox CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-05 14:00 EST by Remy Suen CLA
Modified: 2010-07-09 13:45 EDT (History)
0 users

See Also:


Attachments
Patch that prevents RenderedToolBars from getting disposed (18.39 KB, patch)
2010-07-09 13:37 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-03-05 14:00:25 EST
1. Window > Show View > Console
2. Click the dropdown > New Console View
3. Close the new view.
4. Try clicking the dropdown again.
5. Nothing happens. An NPE is logged.

java.lang.NullPointerException
	at org.eclipse.ui.internal.console.OpenConsoleAction.getMenu(OpenConsoleAction.java:83)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
Comment 1 Remy Suen CLA 2010-03-05 14:02:41 EST
1. Window > Show View > Console
2. Click the dropdown > New Console View
3. Go back to the first 'Console'.
4. Try clicking the dropdown again.
Comment 2 Remy Suen CLA 2010-07-06 12:23:22 EDT
1. Ctrl+3 > Console
2. Show the console drop down.
3. Activate the 'Declaration' view.
4. Activate the 'Console' view.
5. Show the console drop down again. You'll hit the NPE.

This problems seems more severe than before.
Comment 3 Remy Suen CLA 2010-07-06 12:29:04 EDT
We dispose and recreate a part's tool bar every time the selected part in a part stack changes. The disposal of the tool item causes the console action to also be disposed due to its use of the IMenuCreator interface.

Thread [main] (Suspended (breakpoint at line 53 in OpenConsoleAction))	
	OpenConsoleAction.dispose() line: 53	
	ActionContributionItem.handleWidgetDispose(Event) line: 474	
	ActionContributionItem.access$1(ActionContributionItem, Event) line: 466	
	ActionContributionItem$6.handleEvent(Event) line: 447	
	EventTable.sendEvent(Event) line: 84	
	ToolItem(Widget).sendEvent(Event) line: 1053	
	ToolItem(Widget).sendEvent(int, Event, boolean) line: 1077	
	ToolItem(Widget).sendEvent(int) line: 1058	
	ToolItem(Widget).release(boolean) line: 808	
	ToolBar.releaseChildren(boolean) line: 807	
	ToolBar(Widget).release(boolean) line: 811	
	ToolBar(Widget).dispose() line: 446	
	StackRenderer.showTab(MUIElement) line: 490
Comment 4 Eric Moffatt CLA 2010-07-09 13:37:50 EDT
Created attachment 173885 [details]
Patch that prevents RenderedToolBars from getting disposed


This also changes the way that toolbars in views are managed, using the TBR state as opposed to directly disposing the TB (allowing the RenderedTB's to not have their widget disposed.
Comment 5 Eric Moffatt CLA 2010-07-09 13:45:07 EDT
Committed in >20100709. Applied the patch (removed a piece of test code that was adding "VM" as the view menu button's text).