Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317126 - UI test failures, NPE in UIEventPublisher.notifyChanged
Summary: UI test failures, NPE in UIEventPublisher.notifyChanged
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.2 M4   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 325118 326080 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-16 18:56 EDT by Paul Webster CLA
Modified: 2011-12-06 14:23 EST (History)
3 users (show)

See Also:


Attachments
remove the UI publisher as a listener (1.17 KB, patch)
2011-10-28 13:25 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-06-16 18:56:45 EDT
I ran the tests in preparation for the build, and I had 14 errors.


UIAllTests
org.eclipse.e4.ui.tests.UIAllTests
org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests
testPartStack_SetActiveChildBug299379(org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests)
java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:159)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$9.handleEvent(WBWRenderer.java:433)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263)
	at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:730)
	at org.eclipse.swt.widgets.Display.filterProc(Display.java:1537)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2224)
	at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1995)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1408)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:518)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:397)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:445)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:623)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:572)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:102)
	at org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests.testPartStack_SetActiveChildBug299379(PartRenderingEngineTests.java:128)
	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 junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
	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.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

testPartStack_SetActiveChild2Bug299379(org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests)
java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:159)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$9.handleEvent(WBWRenderer.java:433)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263)
	at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:730)
	at org.eclipse.swt.widgets.Display.filterProc(Display.java:1537)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2224)
	at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1995)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1408)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:518)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:397)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:445)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:623)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:572)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:102)
	at org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests.testPartStack_SetActiveChild2Bug299379(PartRenderingEngineTests.java:166)
	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 junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
	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.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Eric Moffatt CLA 2010-06-17 09:27:54 EDT
This may be the result of the testing setup (running the tests through VNC)...

The tests are currently green on my system, if others see failures then please ping here.
Comment 2 Oleg Besedin CLA 2010-06-17 09:30:02 EDT
Works for me on WinXP too.
Comment 3 Paul Webster CLA 2010-06-17 18:45:25 EDT
This occurs in the nightly tests, however ... maybe linux event ordering problem.

http://build.eclipse.org/eclipse/e4/build/e4/downloads/drops/4.0.0/I20100617-1536/I20100617-1536/results/html/org.eclipse.e4.ui.tests_linux.gtk.ppc.html

PW
Comment 4 Paul Webster CLA 2010-06-21 11:03:49 EDT
UI Model Event: org/eclipse/e4/ui/model/ui/ElementContainer/selectedElement/SET args: {OldValue=org.eclipse.e4.ui.model.application.ui.basic.impl.WindowImpl@1ec21ec2 (elementId: null, tags: []) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null) (label: null, iconURI: null, tooltip: null, context: Anonymous Context, variables: [], bindingContexts: [], x: 0, y: 0, width: 11, height: 30), AttName=selectedElement, EventType=SET, NewValue=org.eclipse.e4.ui.model.application.ui.basic.impl.WindowImpl@62f062f0 (elementId: null, tags: []) (widget: Shell {}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer@7e607e60, toBeRendered: true, onTop: false, visible: true, containerData: null) (label: null, iconURI: null, tooltip: null, context: Anonymous Context, variables: [], bindingContexts: [], x: 0, y: 0, width: 11, height: 30), Widget=null, ChangedElement=org.eclipse.e4.ui.model.application.impl.ApplicationImpl@1ea01ea0 (elementId: null, tags: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null) (context: Anonymous Context, variables: null, bindingContexts: [])}


Seems to be caused by a event broker that's left around, listening on a window after the window has been disposed.

PW
Comment 5 Paul Webster CLA 2010-07-19 11:18:28 EDT
OK, I see open on one shell causing an SWT.Activate on another shell.  This causes the WBWRenderer inner class to call application.setSelectedElement(window) on a previously used application.  The adapter for that application causes the old UIEventPublisher to try and fire the event, but since the app context was disposed it can't find the event broker and NPEs.

This could be a test cleanup problem where the previous Shell is not being disposed, although why the current shell.open() should activate a different shell is not clear to me.

PW
Comment 6 Paul Webster CLA 2010-11-03 10:10:53 EDT
at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:2044)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1457)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:539)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:494)

triggers

	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$9.handleEvent(WBWRenderer.java:430)

which is pointing at the previous application model.

PW
Comment 7 Paul Webster CLA 2010-11-03 10:11:07 EDT
*** Bug 325118 has been marked as a duplicate of this bug. ***
Comment 8 Paul Webster CLA 2010-11-03 10:11:13 EDT
*** Bug 326080 has been marked as a duplicate of this bug. ***
Comment 9 Paul Webster CLA 2011-10-28 13:25:06 EDT
Created attachment 206144 [details]
remove the UI publisher as a listener
Comment 10 Remy Suen CLA 2011-10-31 08:55:12 EDT
Paul, I noticed you pushed a change to master. Can this bug be closed?
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=88425a5ffdbdc6eeb6825bf5daa85965540278b4
Comment 11 Paul Webster CLA 2011-10-31 09:53:59 EDT
Yes, we've accepted this fix for the tests.  We'll need to observe our next test output.

PW
Comment 12 Paul Webster CLA 2011-12-06 14:23:10 EST
verified in http://download.eclipse.org/eclipse/downloads/drops4/I20111206-1015

PW