RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

Exception when using JavaKeywordsAsync

Open tomsontom opened this issue 9 years ago • 2 comments

When running the JavaKeywordsAsync example with the source code from "http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/plain/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java" it fails with

Exception in thread "JavaFX Application Thread" java.util.NoSuchElementException at org.reactfx.util.Left.getRight(Either.java:83) at org.reactfx.util.Try.get(Try.java:29) at org.reactfx.MappedStream.lambda$observeInputs$201(MappedStream.java:22) at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$272(NotificationAccumulator.java:134) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18) at org.reactfx.AwaitLatest.lambda$null$173(Await.java:174) at org.reactfx.Await.lambda$addCompletionHandler$161(Await.java:45) 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.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) 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:198) at javafx.concurrent.EventHelper.fireEvent(EventHelper.java:219) at javafx.concurrent.Task.fireEvent(Task.java:1356) at javafx.concurrent.Task.setState(Task.java:707) at javafx.concurrent.Task$TaskCallable.lambda$call$498(Task.java:1453) at com.sun.javafx.application.PlatformImpl.lambda$null$171(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$172(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

while the none Async works happily

tomsontom avatar Sep 22 '15 10:09 tomsontom

Thanks for reporting, I can reproduce it. I updated the demo to print out the error from asynchronous execution (instead of throwing the above NSEE when the async task failed). The underlying error is StackOverflow in regex matching. I guess the problematic part might be the regex for matching comments, because it might backtrack a lot. Though I have no idea why there is no such error in the non-async version, because it is the same regex and text. Also, I only get the exception on initial paste. Later edits are highlighted just fine.

TomasMikula avatar Sep 22 '15 14:09 TomasMikula

@TomasMikula Hi, i am implementing custom version of code area in my project. Can you please tell me, how you solved this error ??

deepsidhu1313 avatar Dec 30 '16 07:12 deepsidhu1313