JDK-8355415 : RichTextArea: NPE in VFlow::scrollCaretToVisible
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: jfx24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-04-23
  • Updated: 2025-07-07
  • Resolved: 2025-05-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx25 b18Fixed
Related Reports
Blocks :  
Relates :  
Description
This operation attempts to scroll to visible which requires a valid layout.

Uncovered by RichTextAreaTest::insertLineBreak.


Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.jfx.incubator.scene.control.richtext.CaretInfo.getMaxY()" because "c" is null
	at jfx.incubator.richtext/com.sun.jfx.incubator.scene.control.richtext.VFlow.scrollCaretToVisible(VFlow.java:999)
	at jfx.incubator.richtext/com.sun.jfx.incubator.scene.control.richtext.VFlow.handleSelectionChange(VFlow.java:405)
	at jfx.incubator.richtext/com.sun.jfx.incubator.scene.control.richtext.util.ListenerHelper$2.changed(ListenerHelper.java:140)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:386)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:91)
	at javafx.base/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80)
	at javafx.base/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:103)
	at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
	at javafx.base/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
	at jfx.incubator.richtext/jfx.incubator.scene.control.richtext.SingleSelectionModel.setSelectionSegment(SingleSelectionModel.java:157)
	at jfx.incubator.richtext/jfx.incubator.scene.control.richtext.SingleSelectionModel.setSelection(SingleSelectionModel.java:73)
	at jfx.incubator.richtext/jfx.incubator.scene.control.richtext.RichTextArea.select(RichTextArea.java:1874)
	at jfx.incubator.richtext/com.sun.jfx.incubator.scene.control.richtext.RichTextAreaBehavior.moveCaret(RichTextAreaBehavior.java:811)
	at jfx.incubator.richtext/com.sun.jfx.incubator.scene.control.richtext.RichTextAreaBehavior.insertLineBreak(RichTextAreaBehavior.java:359)
	at jfx.incubator.input/com.sun.jfx.incubator.scene.control.input.SkinInputMap.execute(SkinInputMap.java:187)
	at jfx.incubator.input/jfx.incubator.scene.control.input.InputMap.executeDefault(InputMap.java:221)
	at jfx.incubator.input/jfx.incubator.scene.control.input.InputMap.execute(InputMap.java:215)
	at jfx.incubator.input/jfx.incubator.scene.control.input.InputMap$1.execute(InputMap.java:445)
	at jfx.incubator.input/com.sun.jfx.incubator.scene.control.input.InputMapHelper.execute(InputMapHelper.java:56)
	at jfx.incubator.richtext/jfx.incubator.scene.control.richtext.RichTextArea.execute(RichTextArea.java:1304)
	at jfx.incubator.richtext/jfx.incubator.scene.control.richtext.RichTextArea.insertLineBreak(RichTextArea.java:1456)
	at andy_test/goryachev.bugs.RichTextArea_InsertLineBreak_8355415.start(RichTextArea_InsertLineBreak_8355415.java:22)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$7(LauncherImpl.java:845)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$5(PlatformImpl.java:449)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$4(PlatformImpl.java:424)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

Comments
Changeset: 9ca61edb Branch: master Author: Andy Goryachev <angorya@openjdk.org> Date: 2025-05-20 17:17:05 +0000 URL: https://git.openjdk.org/jfx/commit/9ca61edb982420371c509f62042284e09917d31e
20-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1793 Date: 2025-04-23 22:05:33 +0000
24-04-2025