Dear JavaFX community
Following situation. I have a touch handler who recognizes special gestures and fires javafx.GestureEvent derivates on positive detection. the gesture event carries a list of cloned touch points for carrying the touches on start and end of the gesture.
Now if a listener to this GestureEvents fails for whatever reason with an uncaught exception, JavaFX touch point handling goes awry by constantly throwing RuntimeExceptions: "Too many touch points reported". From that point, the touch application is not usable anymore and must be restarted.
If the listener completes without error, the app continues to work as expected.
Firing the GestureEvent in a Platform.runLater seemed to help, but I experienced the problem at least once. The problem is not reproducable reliably though.
I believe this to be a bug in JavaFX.
Any thoughts/hints/comments on this?
See the stacktraces below. The first NPE trace is my deliberately provoked exception. The second trace arises upon every single subsequent touch event
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at view.services.ui.navigation.internal.NavigationService.home(NavigationService.java:319)
at view.ui.gestures.addons.grab.internal.DefaultGrabEventHandler.handle(DefaultGrabEventHandler.java:298)
at view.ui.gestures.addons.grab.internal.DefaultGrabEventHandler.handle(DefaultGrabEventHandler.java:1)
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.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:203)
at keba.view.javafx.gestures.grab.GrabDetector.fireEvent(GrabDetector.java:579)
at keba.view.javafx.gestures.grab.GrabDetector.fireGrabMoveOrEnd(GrabDetector.java:452)
at keba.view.javafx.gestures.grab.GrabDetector.handleTouchReleased(GrabDetector.java:415)
at keba.view.javafx.gestures.grab.GrabDetector.handle(GrabDetector.java:336)
at keba.view.javafx.gestures.grab.GrabDetector.handle(GrabDetector.java:1)
at com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(CompositeEventHandler.java:282)
at com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(CompositeEventHandler.java:98)
at com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:223)
at com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:180)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
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:203)
at javafx.scene.Scene.processTouchEvent(Scene.java:1773)
at javafx.scene.Scene.access$5800(Scene.java:193)
at javafx.scene.Scene$ScenePeerListener.touchEventEnd(Scene.java:2712)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$11.run(GlassViewEventHandler.java:989)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$11.run(GlassViewEventHandler.java:985)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleEndTouchEvent(GlassViewEventHandler.java:985)
at com.sun.glass.ui.View.handleEndTouchEvent(View.java:553)
at com.sun.glass.ui.View.notifyEndTouchEvent(View.java:1007)
at com.sun.glass.ui.TouchInputSupport.notifyEndTouchEvent(TouchInputSupport.java:85)
at com.sun.glass.ui.win.WinGestureSupport.notifyEndTouchEvent(WinGestureSupport.java:62)
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)
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: Too many touch points reported
at javafx.scene.Scene$ScenePeerListener.touchEventNext(Scene.java:2668)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$10.run(GlassViewEventHandler.java:965)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$10.run(GlassViewEventHandler.java:944)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleNextTouchEvent(GlassViewEventHandler.java:944)
at com.sun.glass.ui.View.handleNextTouchEvent(View.java:547)
at com.sun.glass.ui.View.notifyNextTouchEvent(View.java:1002)
at com.sun.glass.ui.TouchInputSupport.notifyNextTouchEvent(TouchInputSupport.java:117)
at com.sun.glass.ui.win.WinGestureSupport.notifyNextTouchEvent(WinGestureSupport.java:58)
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)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Scene.processTouchEvent(Scene.java:1766)
at javafx.scene.Scene.access$5800(Scene.java:193)
at javafx.scene.Scene$ScenePeerListener.touchEventEnd(Scene.java:2712)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$11.run(GlassViewEventHandler.java:989)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$11.run(GlassViewEventHandler.java:985)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleEndTouchEvent(GlassViewEventHandler.java:985)
at com.sun.glass.ui.View.handleEndTouchEvent(View.java:553)
at com.sun.glass.ui.View.notifyEndTouchEvent(View.java:1007)
at com.sun.glass.ui.TouchInputSupport.notifyEndTouchEvent(TouchInputSupport.java:85)
at com.sun.glass.ui.win.WinGestureSupport.notifyEndTouchEvent(WinGestureSupport.java:62)
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)