Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8128071

Updating selected text in textfield throws exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • fx2.0.2
    • fx2.0.2
    • javafx

      The fix for Fix for RT-16386 caused a critical exception in typing into a selected text field. To reproduce this, run StockQuote or any other example with a text field. Select all of the text in the text field, and type a character. You will get the following exception:

      Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBounds
      Exception: String index out of range: 4
              at java.lang.String.substring(String.java:1934)
              at com.sun.javafx.sg.prism.NGText.getRangeShapeImpl(NGText.java:1849)
              at com.sun.javafx.sg.prism.NGText.getSelectionShape(NGText.java:1722)
              at com.sun.javafx.tk.quantum.PrismTextHelper.getSelectionShape(PrismTextHelper.java:53)
              at javafx.scene.text.Text.getDecorationShapes(Text.java:1021)
              at javafx.scene.text.Text.impl_geomChanged(Text.java:637)
              at javafx.scene.text.Text$1.invalidated(Text.java:159)
              at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:86)
              at javafx.beans.property.StringPropertyBase.access$100(StringPropertyBase.java:26)
              at javafx.beans.property.StringPropertyBase$Listener.invalidated(StringPropertyBase.java:195)
              at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:140)
              at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
              at javafx.beans.binding.StringBinding.invalidate(StringBinding.java:150)
              at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:29)
              at com.sun.javafx.binding.ExpressionHelper$MultipleInvalidation.fireValueChangedEvent(ExpressionHelper.java:301)
              at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
              at javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:150)
              at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:29)
              at com.sun.javafx.binding.ExpressionHelper$MultipleInvalidation.fireValueChangedEvent(ExpressionHelper.java:301)
              at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
              at javafx.scene.control.TextInputControl$TextProperty.fireValueChangedEvent(TextInputControl.java:965)
              at javafx.scene.control.TextInputControl$TextProperty.markInvalid(TextInputControl.java:969)
              at javafx.scene.control.TextInputControl$TextProperty.invalidate(TextInputControl.java:909)
              at javafx.scene.control.TextInputControl$TextProperty.access$100(TextInputControl.java:886)
              at javafx.scene.control.TextInputControl$1.invalidated(TextInputControl.java:88)
              at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:140)
              at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
              at javafx.scene.control.TextField$TextFieldContent.insert(TextField.java:49)
              at javafx.scene.control.TextInputControl.replaceText(TextInputControl.java:317)
              at com.sun.javafx.scene.control.skin.TextFieldSkin.replaceText(TextFieldSkin.java:386)
              at com.sun.javafx.scene.control.behavior.TextFieldBehavior.replaceText(TextFieldBehavior.java:105)
              at com.sun.javafx.scene.control.behavior.TextInputControlBehavior.defaultKeyTyped(TextInputControlBehavior.java:164)
              at com.sun.javafx.scene.control.behavior.TextInputControlBehavior.callAction(TextInputControlBehavior.java:93)
              at com.sun.javafx.scene.control.behavior.BehaviorBase.callActionForEvent(BehaviorBase.java:144)
              at com.sun.javafx.scene.control.behavior.TextInputControlBehavior.callActionForEvent(TextInputControlBehavior.java:86)
              at com.sun.javafx.scene.control.behavior.BehaviorBase$1.handle(BehaviorBase.java:106)
              at com.sun.javafx.scene.control.behavior.BehaviorBase$1.handle(BehaviorBase.java:104)
              at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:56)
              at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:162)
              at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:115)
              at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
              at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
              at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
              at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
              at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
              at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:47)
              at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
              at javafx.event.Event.fireEvent(Event.java:171)
              at javafx.scene.Scene$KeyHandler.process(Scene.java:2908)
              at javafx.scene.Scene$KeyHandler.access$1600(Scene.java:2838)
              at javafx.scene.Scene.impl_processKeyEvent(Scene.java:1410)
              at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:1841)
              at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:107)
              at com.sun.glass.ui.View.handleKeyEvent(View.java:274)
              at com.sun.glass.ui.View.notifyKey(View.java:569)
              at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
              at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
              at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
              at java.lang.Thread.run(Thread.java:662)

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: