Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in ContributedPartRenderer$1.setFocus #2367

Closed
jukzi opened this issue Oct 8, 2024 · 4 comments
Closed

NPE in ContributedPartRenderer$1.setFocus #2367

jukzi opened this issue Oct 8, 2024 · 4 comments
Labels
bug Something isn't working test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Oct 8, 2024

logged in https://download.eclipse.org/eclipse/downloads/drops4/I20241007-1800/testresults/ep434I-unit-win32-java17_win32.win32.x86_64_17/org.eclipse.e4.ui.tests.UIAllTests.txt

!ENTRY org.eclipse.e4.ui.workbench 4 0 2024-10-07 23:41:23.155
!MESSAGE Error disposing widget for : org.eclipse.e4.ui.model.application.ui.basic.impl.WindowImpl null
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.e4.ui.workbench.IPresentationEngine.focusGui(org.eclipse.e4.ui.model.application.ui.MUIElement)" because "pe" is null
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.setFocus(ContributedPartRenderer.java:106)
	at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations.java:763)
	at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1527)
	at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2374)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4722)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1482)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2347)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5155)
	at org.eclipse.swt.internal.win32.OS.DestroyWindow(Native Method)
	at org.eclipse.swt.widgets.Control.destroyWidget(Control.java:737)
	at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:736)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:906)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:478)
	at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:396)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.disposeWidget(SWTPartRenderer.java:186)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeRemoveGui(PartRenderingEngine.java:934)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:857)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:841)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.stop(PartRenderingEngine.java:1225)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.close(E4Workbench.java:190)
	at org.eclipse.e4.ui.tests.rules.WorkbenchContextRule.dispose(WorkbenchContextRule.java:91)
	at org.eclipse.e4.ui.tests.rules.WorkbenchContextRule$1.evaluate(WorkbenchContextRule.java:64)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:63)
	at org.eclipse.test.EclipseTestRunner.runTests(EclipseTestRunner.java:212)
	at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:187)
	at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:53)
	at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:35)
	at org.eclipse.test.CoreTestApplication.start(CoreTestApplication.java:44)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
	Suppressed: java.lang.NullPointerException: Cannot invoke "org.eclipse.e4.ui.workbench.IPresentationEngine.focusGui(org.eclipse.e4.ui.model.application.ui.MUIElement)" because "pe" is null
		at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.setFocus(ContributedPartRenderer.java:106)
		at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations.java:763)
		at org.eclipse.swt.widgets.Decorations.WM_SETFOCUS(Decorations.java:1618)
		at org.eclipse.swt.widgets.Control.windowProc(Control.java:4797)
		... 75 more

@jukzi jukzi added bug Something isn't working test junit test related things labels Oct 8, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Oct 8, 2024

feels wrong that destroyWidget() triggers a restoreFocus

@jukzi
Copy link
Contributor Author

jukzi commented Oct 8, 2024

NPE locally reproducible with PartRenderingEngineTests (fails with another exception)

@iloveeclipse
Copy link
Member

feels wrong that destroyWidget() triggers a restoreFocus

If the dislosed widget had focus, other one should get the focus. However I haven't analyzed stack trace whether that was the case here.

@jukzi
Copy link
Contributor Author

jukzi commented Oct 8, 2024

makes sense. the destroy is actually called on another shell then the restore.

jukzi pushed a commit to jukzi/eclipse.platform.ui that referenced this issue Oct 8, 2024
jukzi pushed a commit that referenced this issue Oct 8, 2024
@jukzi jukzi closed this as completed Oct 8, 2024
praveen-skp pushed a commit to praveen-skp/eclipse.platform.ui that referenced this issue Oct 14, 2024
lathapatil pushed a commit to lathapatil/eclipse.platform.ui that referenced this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test junit test related things
Projects
None yet
Development

No branches or pull requests

2 participants