Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 240985 - NPE adding org.eclipse.ui.console.consolePageParticipants extension without enablement clause
Summary: NPE adding org.eclipse.ui.console.consolePageParticipants extension without e...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 16:13 EDT by Dan Heidinga CLA
Modified: 2008-07-15 16:58 EDT (History)
1 user (show)

See Also:


Attachments
Checks for null enablement expression (1.29 KB, patch)
2008-07-15 16:19 EDT, Dan Heidinga CLA
Michael_Rennie: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Heidinga CLA 2008-07-15 16:13:15 EDT
Build ID:  I20080617-2000

Steps To Reproduce:
1. Create an org.eclipse.ui.console.consolePageParticipants extension
2. Delete the (enablement) from the extension.
3. Launch a runtime eclipse and see the exception when opening the console.


More information:
The enablement is an optional attribute according to the javadoc for IConsolePageParticipant.
(http://help.eclipse.org/ganymede/index.jsp)

Either the consolePageParticipants extension needs to be updated to require an (enablement) be supplied, or the code that checks the enablement needs to be able to handle the null case.

StackTrace:
Caused by: java.lang.NullPointerException
	at org.eclipse.ui.internal.console.ConsolePageParticipantExtension.isEnabledFor(ConsolePageParticipantExtension.java:49)
	at org.eclipse.ui.internal.console.ConsoleManager.getPageParticipants(ConsoleManager.java:430)
	at org.eclipse.ui.internal.console.ConsoleView.doCreatePage(ConsoleView.java:310)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:399)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:741)
	at org.eclipse.ui.internal.console.ConsoleView$4.run(ConsoleView.java:389)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
	... 42 more
Comment 1 Dan Heidinga CLA 2008-07-15 16:19:43 EDT
Created attachment 107521 [details]
Checks for null enablement expression

Check for a null enablement expression.  If the expression is null, we should default to enabled.
Comment 2 Michael Rennie CLA 2008-07-15 16:56:59 EDT
It is never good to have an NPE, applied patch. 

Note that the enablement expression is required: it is a series of min 1 and max 1. If you turn on PDE errors you will see the following:

Description	Resource	Path	Location	Type
A minimum of 1 'enablement' elements must be specified.	plugin.xml	org.eclipse.ui.console	line 80	Plug-in Problem

marking fixed
Comment 3 Michael Rennie CLA 2008-07-15 16:57:47 EDT
verified