BaseRenderer.unbindWidget [message #1235456] |
Fri, 24 January 2014 07:19  |
Eclipse User |
|
|
|
Hi Tom,
I'm having a null pointer exception coming from the unbindWidget because sometimes the Widget argument of the method is null and there is no null check in the implementation of the unbind.
To get this null pointer you only need to restart the presentation engine a couple may be 3 times e.g.
@Inject
IPresentationEngine pe;
@Inject
MApplication app;
void init(){
Button restartPresentationEngine = new Button("Presentation engine restart");
restartPresentationEngine.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
System.out.println("RESTARTING PRESENTATION ENGINE");
pe.stop();
pe.run(app, app.getContext());
}
});
[....]
}
I did a workaround by adding a nullcheck in the BaseRenderer.java
private void unbindWidget(M me, W widget) {
if (widget != null)
widget.setDomElement(null);
if (me != null)
me.setWidget(null);
}
But perhaps there is a deeper problem and unbindWidget should never receive null as an argument. I don't know...
Should I fire a bug in jira?
Below, the stacktrace of the exception
Best
Pablo
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.unbindWidget(BaseRenderer.java:263)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.destroyWidget(BaseRenderer.java:253)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.removeGui(PartRenderingEngine.java:330)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.removeGui(PartRenderingEngine.java:305)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.removeGui(PartRenderingEngine.java:313)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.removeGui(PartRenderingEngine.java:313)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.stop(PartRenderingEngine.java:410)
at UnbindWidgetNull.parts.MediaPart$1.handle(MediaPart.java:69)
at UnbindWidgetNull.parts.MediaPart$1.handle(MediaPart.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:204)
at javafx.scene.Node.fireEvent(Node.java:8175)
at javafx.scene.control.Button.fire(Button.java:185)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:204)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3684)
at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3409)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1671)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2462)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:314)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:345)
at com.sun.glass.ui.View.handleMouseEvent(View.java:526)
at com.sun.glass.ui.View.notifyMouse(View.java:898)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
at java.lang.Thread.run(Thread.java:744)
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04073 seconds