|
Re: NPE in HandledContributionItem when testing application on eclipse 4.5 [message #1705781 is a reply to message #1705721] |
Wed, 19 August 2015 07:29 |
Arne Deutsch Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Some more information after more debugging:
Inside "PartRenderingEngine" there is something called a "limbo" Shell (probably used for offscreen rendering). I can see there following comment:
// HACK!! we should loop until the display gets disposed...
// ...then we listen for the last 'main' window to get disposed
// and dispose the Display
And a bit later the following loop:
// Spin the event loop until someone disposes the display
while (((testShell != null && !testShell.isDisposed()) || (theApp != null && someAreVisible(theApp.getChildren()))) && !display.isDisposed()) {
try {
if (!display.readAndDispatch()) {
runContext.processWaiting();
if (spinOnce) {
return;
}
advisor.eventLoopIdle(display);
}
} catch (ThreadDeath th) {
throw th;
} catch (Exception ex) {
handle(ex, advisor);
} catch (Error err) {
handle(err, advisor);
}
}
In addition there is some SWTBot code that disposes exactly this shell in "SWTBotShell":
public void close() throws TimeoutException {
notify(SWT.Close);
asyncExec(new VoidResult() {
public void run() {
// TODO investigate bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=259895
if (!widget.isDisposed())
widget.close();
}
});
new SWTBot().waitUntil(new DefaultCondition() {
public boolean test() throws Exception {
return !isOpen();
}
public String getFailureMessage() {
return "Timed out waiting for " + SWTUtils.toString(widget) + " to close."; //$NON-NLS-1$ //$NON-NLS-2$
}
});
}
I can see it in this stack trace:
Thread [main] (Suspended (breakpoint at line 725 in Shell))
owns: RunnableLock (id=6507)
Shell.dispose() line: 725
Shell(Decorations).closeWidget() line: 309
Shell.close() line: 538
SWTBotShell$2.run() line: 101
UIThreadRunnable$5.doRun() line: 221
UIThreadRunnable$1.run() line: 89
RunnableLock.run() line: 35
UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 135
Display.runAsyncMessages(boolean) line: 4155
Display.readAndDispatch() line: 3772
PartRenderingEngine$4.run() line: 1127
Realm.runWithDefault(Realm, Runnable) line: 337
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 1018
E4Workbench.createAndRunUI(MApplicationElement) line: 156
Workbench$5.run() line: 654
Realm.runWithDefault(Realm, Runnable) line: 337
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 598
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 150
IDEApplication.start(IApplicationContext) line: 139
UITestApplication.start(IApplicationContext) line: 57
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 134
EclipseAppLauncher.start(Object) line: 104
EclipseStarter.run(Object) line: 380
EclipseStarter.run(String[], Runnable) line: 235
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 497
Main.invokeFramework(String[], URL[]) line: 669
Main.basicRun(String[]) line: 608
Main.run(String[]) line: 1515
Main.main(String[]) line: 1488
Not sure yet what is the root cause and the intention of this code ... every helpfull comment still appreciated .
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03915 seconds