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

Bug 320131

Summary: NPE in ModelEditor.setFocus
Product: [Eclipse Project] e4 Reporter: Reto Urfer <reto.urfer>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tom.schindl
Version: unspecified   
Target Milestone: 1.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Reto Urfer CLA 2010-07-16 13:09:56 EDT
If you open an Application.e4xmi within the SimpleIDE example application a NPE is thrown.

Caused by: java.lang.NullPointerException
	at org.eclipse.e4.tools.emf.ui.internal.common.ModelEditor.setFocus(ModelEditor.java:660)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:47)
	... 29 more


The reason seem to be the clipboardService which is defined
	@Inject
	@Optional
	private IClipboardService clipboardService;

but there is no null check in the setFocus method.
Comment 1 Thomas Schindl CLA 2010-07-16 18:09:13 EDT
fixed in head