Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 392150 - InjectionException hitting return on part with no focus method
Summary: InjectionException hitting return on part with no focus method
Status: CLOSED DUPLICATE of bug 390924
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-17 06:29 EDT by Thomas M??der CLA
Modified: 2012-10-17 08:04 EDT (History)
2 users (show)

See Also:


Attachments
A test project showing the problem (15.50 KB, application/zip)
2012-10-17 06:29 EDT, Thomas M??der CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas M??der CLA 2012-10-17 06:29:32 EDT
Created attachment 222459 [details]
A test project showing the problem

When I have a part that doesn't have a method which is annotated with @Focus and I hit return in that part, I get an InjectionException
Comment 1 Thomas M??der CLA 2012-10-17 06:30:03 EDT
Teh stack trace is:

org.eclipse.e4.core.di.InjectionException: Unable to find matching method to invoke
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:201)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:89)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$7.keyTraversed(StackRenderer.java:892)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:265)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
	at org.eclipse.swt.custom.CTabFolder.onTraverse(CTabFolder.java:2061)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:278)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Control.traverse(Control.java:4050)
	at org.eclipse.swt.widgets.Control.translateTraversal(Control.java:4032)
	at org.eclipse.swt.widgets.Display.translateTraversal(Display.java:4794)
	at org.eclipse.swt.widgets.Display.filterMessage(Display.java:1276)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Comment 2 Thomas M??der CLA 2012-10-17 06:30:50 EDT
To reproduce:

1) Run the attached project
2) click into the text field inside "Part1"
3) Hit <return>
4) Observe: you get an exception
Comment 3 Paul Webster CLA 2012-10-17 06:40:04 EDT
@Focus currently must be provided, although there's some discussion about making it optional on bug 379024

We should catch the injection exception or use invoke(*) with a default return value and provide a more descriptive log message.

PW
Comment 4 Nobody - feel free to take it CLA 2012-10-17 08:04:25 EDT
I think I fixed this for 4.2.2

*** This bug has been marked as a duplicate of bug 390924 ***