RichTextFX
RichTextFX copied to clipboard
setWrapText(false) causes IndexOutOfBoundsException: [-2147483648, 9)
If we use the CodeArea with setWrapText(false) and a line is longer than the available Space and the scrollbar is viewed IndexOutOfBoundsException.
java.lang.IndexOutOfBoundsException: [-2147483648, 9) is not a valid range within [0, 9) at org.reactfx.util.Lists.checkRange(Lists.java:128) at org.reactfx.util.Lists.checkRange(Lists.java:123) at org.reactfx.collection.MemoizationListImpl.forget(MemoizationList.java:184) at org.fxmisc.flowless.CellListManager.cropTo(CellListManager.java:86) at org.fxmisc.flowless.CellPositioner.cropTo(CellPositioner.java:29) at org.fxmisc.flowless.Navigator.cropToNeighborhoodOf(Navigator.java:246) at org.fxmisc.flowless.Navigator.placeStartAtMayCrop(Navigator.java:219) at org.fxmisc.flowless.Navigator.visit(Navigator.java:130) at org.fxmisc.flowless.StartOffStart.accept(TargetPosition.java:85) at org.fxmisc.flowless.Navigator.layoutChildren(Navigator.java:80) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1204) at org.fxmisc.flowless.VirtualFlow.layoutChildren(VirtualFlow.java:257) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1204) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211) at javafx.graphics/javafx.scene.Group.doComputeLayoutBounds(Group.java:176) at javafx.graphics/javafx.scene.Group.access$000(Group.java:78) at javafx.graphics/javafx.scene.Group$1.doComputeLayoutBounds(Group.java:85) at javafx.graphics/com.sun.javafx.scene.GroupHelper.computeLayoutBoundsImpl(GroupHelper.java:62) at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeLayoutBounds(NodeHelper.java:106) at javafx.graphics/javafx.scene.Node$13.computeBounds(Node.java:3499) at javafx.graphics/javafx.scene.Node$LazyBoundsProperty.get(Node.java:9764) at javafx.graphics/javafx.scene.Node$LazyBoundsProperty.get(Node.java:9734) at javafx.base/javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49) at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:355) at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80) at javafx.graphics/javafx.scene.Node$LazyBoundsProperty.invalidate(Node.java:9774) at javafx.graphics/javafx.scene.Node.layoutBoundsChanged(Node.java:3670) at javafx.graphics/javafx.scene.Node.doNotifyLayoutBoundsChanged(Node.java:4063) at javafx.graphics/javafx.scene.Node.access$800(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doNotifyLayoutBoundsChanged(Node.java:466) at javafx.graphics/com.sun.javafx.scene.NodeHelper.notifyLayoutBoundsChangedImpl(NodeHelper.java:188) at javafx.graphics/com.sun.javafx.scene.NodeHelper.notifyLayoutBoundsChanged(NodeHelper.java:141) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4016) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childBoundsChanged(Parent.java:1870) at javafx.graphics/javafx.scene.Node.notifyParentOfBoundsChange(Node.java:4088) at javafx.graphics/javafx.scene.Node.transformedBoundsChanged(Node.java:4049) at javafx.graphics/javafx.scene.Node.localBoundsChanged(Node.java:4031) at javafx.graphics/javafx.scene.Node.doGeomChanged(Node.java:4017) at javafx.graphics/javafx.scene.Node.access$700(Node.java:398) at javafx.graphics/javafx.scene.Node$1.doGeomChanged(Node.java:461) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChangedImpl(NodeHelper.java:184) at javafx.graphics/com.sun.javafx.scene.NodeHelper.geomChanged(NodeHelper.java:137) at javafx.graphics/javafx.scene.Parent.childVisibilityChanged(Parent.java:1883) at javafx.graphics/javafx.scene.Node$6.invalidated(Node.java:1392) at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110) at javafx.base/javafx.beans.property.BooleanPropertyBase.access$000(BooleanPropertyBase.java:50) at javafx.base/javafx.beans.property.BooleanPropertyBase$Listener.invalidated(BooleanPropertyBase.java:239) at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136) at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80) at javafx.base/javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:174) at javafx.base/com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:52) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.FlatMapped.selectedInvalidated(FlatMapped.java:54) at org.reactfx.value.FlatMapped.lambda$null$1(FlatMapped.java:41) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.Val$2.lambda$connect$0(Val.java:691) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.Val$2.lambda$connect$0(Val.java:691) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.Val$2.lambda$connect$0(Val.java:691) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.Val$2.lambda$connect$0(Val.java:691) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.value.OrElseConst.lambda$connect$0(OrElseConst.java:24) at org.reactfx.value.InvalidationListenerWrapper.accept(Val.java:765) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.collection.ListReduction.lambda$connect$0(ListReduction.java:53) at org.reactfx.collection.LiveList.lambda$observeChanges$9(LiveList.java:268) at org.reactfx.util.ListNotifications.lambda$takeHead$0(NotificationAccumulator.java:317) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.collection.MemoizationListImpl$MemoizedView.publishNotifications(MemoizationList.java:58) at org.reactfx.collection.MemoizationListImpl$MemoizedView.access$300(MemoizationList.java:30) at org.reactfx.collection.MemoizationListImpl.sourceChanged(MemoizationList.java:89) at org.reactfx.util.ListNotifications.lambda$takeHead$0(NotificationAccumulator.java:317) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.collection.DynamicallyMappedList.sourceChanged(MappedList.java:105) at org.reactfx.util.ListNotifications.lambda$takeHead$0(NotificationAccumulator.java:317) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.collection.MemoizationListImpl.sourceChanged(MemoizationList.java:88) at org.reactfx.util.ListNotifications.lambda$takeHead$0(NotificationAccumulator.java:317) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.collection.MappedList.sourceChanged(MappedList.java:41) at org.reactfx.util.ListNotifications.lambda$takeHead$0(NotificationAccumulator.java:317) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.SuspendableBase.resume(SuspendableBase.java:64) at org.reactfx.CloseableOnceGuard.close(Guard.java:49) at org.reactfx.MultiGuard.close(Guard.java:83) at org.reactfx.Suspendable$1.resumeSource(Suspendable.java:118) at org.reactfx.Suspendable$1.suspendSource(Suspendable.java:104) at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(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.EventStreams$3.lambda$observeInputs$0(EventStreams.java:105) at org.reactfx.value.ChangeListenerWrapper.accept(Val.java:786) at org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68) at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57) at org.reactfx.value.ValBase.invalidate(ValBase.java:32) at org.reactfx.SuspendableBoolean.release(SuspendableBoolean.java:24) at org.reactfx.CloseableOnceGuard.close(Guard.java:49) at org.reactfx.Suspendable.suspendWhile(Suspendable.java:49) at org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.updateMulti(GenericEditableStyledDocumentBase.java:218) at org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.updateSingle(GenericEditableStyledDocumentBase.java:210) at org.reactfx.util.Tuple3.exec(Tuple3.java:43) at org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.setStyleSpans(GenericEditableStyledDocumentBase.java:176) at org.fxmisc.richtext.model.SimpleEditableStyledDocument.setStyleSpans(SimpleEditableStyledDocument.java:10) at org.fxmisc.richtext.GenericStyledArea.setStyleSpans(GenericStyledArea.java:1479) at de.ituvsoft.ui.ng.widget.codearea.CodeArea.applyHighlighting(CodeArea.java:426) at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(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 java.base/java.util.Optional.ifPresent(Optional.java:183) at org.reactfx.FlatMapOptStream.lambda$observeInputs$0(FlatMapStream.java:49) at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(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$4(Await.java:174) at org.reactfx.Await.lambda$addCompletionHandler$2(Await.java:44) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.graphics/javafx.concurrent.EventHelper.fireEvent(EventHelper.java:219) at javafx.graphics/javafx.concurrent.Task.fireEvent(Task.java:1358) at javafx.graphics/javafx.concurrent.Task.setState(Task.java:725) at javafx.graphics/javafx.concurrent.Task$TaskCallable.lambda$call$1(Task.java:1436) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834)
Thanks for the bug report, could you please provide a reproducible test case.
Can you also clarify this please: "setWrapText(false) and a line is longer than the available Space and is wrapped". I don't understand how if setWrapText is set to false that you can then get "longer than the available Space and is wrapped" ??? Is that a typo and you meant: "setWrapText( true )" ?
Hello @Jugen,
sorry, i mean that the problem occur when the line will be wrapped when the linespace is not enough. So when setLineWrap is set to false and the Scrollbars are shown.
Sorry i have no time to create a Testcase. I think it would be very complicate while the Problem feels something like a racecondition. So if you show the CodeArea few times the Problem occur only in 80% of all cases...