Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 510621

Summary: [e4] NullPointerException in HandlerServiceImpl.executeHandler()
Product: [RT] RAP Reporter: ben <benjamin.leipold>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows NT   
See Also: https://git.eclipse.org/r/89934/
Whiteboard:
Attachments:
Description Flags
Snippet that demonstrates the bug none

Description ben CLA 2017-01-18 06:06:11 EST
If IEclipseContext executionContext is disposed (which can happen if e.g. a view is closed by the executed handler), the call of method pop(IEclipseContext) in the finally block results in a NullPointerException. This happens because getContextStack() returns null for disposed conexts.
Comment 1 Ivan Furnadjiev CLA 2017-01-26 07:26:19 EST
Please provide a simple snippet/patch against our e4 demo that demostrate the issue.
Comment 2 Ivan Furnadjiev CLA 2017-01-26 07:46:55 EST
The platform HandlerServiceImpl class is newer than the one in forked RAP "org.eclipse.e4.core.commands" bundle and has some changes exactly in this field. The issue will be fixed once the forked bundle is synchronized with the platform.
Comment 3 ben CLA 2017-01-30 08:42:34 EST
So, do you still need a snippet or is this report obsolete?
Comment 4 Ivan Furnadjiev CLA 2017-01-30 09:47:10 EST
A snippet will be good...
Comment 5 Ivan Furnadjiev CLA 2017-01-31 06:01:05 EST
Fixed with change https://git.eclipse.org/r/89934/
Comment 6 ben CLA 2017-02-13 04:00:52 EST
Created attachment 266780 [details]
Snippet that demonstrates the bug

Just click on the sole view action to provoke a NullPointerException.