Skip to content

Incompatibility with OpenJFX 22 #87

@adangel

Description

@adangel

Describe the bug
When using openjdk 21 and openjfx 22, a lot of exceptions are logged with --verbose mode, e.g.

Exception in thread "JavaFX Application Thread" java.lang.reflect.UndeclaredThrowableException
	at org.fxmisc.richtext.$Proxy13.getHitInfo(Unknown Source)
	at org.fxmisc.richtext.TextFlowExt.hit(TextFlowExt.java:137)
	at org.fxmisc.richtext.ParagraphBox.hit(ParagraphBox.java:158)
	at org.fxmisc.richtext.ParagraphBox.hit(ParagraphBox.java:151)
	at org.fxmisc.richtext.GenericStyledArea.hit(GenericStyledArea.java:847)
	at org.fxmisc.richtext.GenericStyledAreaBehavior.handleFirstPrimaryPress(GenericStyledAreaBehavior.java:471)
	at org.fxmisc.wellbehaved.event.template.InputMapTemplate.lambda$consume$0(InputMapTemplate.java:221)
	at org.fxmisc.wellbehaved.event.template.PatternActionTemplate.lambda$null$1(InputMapTemplate.java:425)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.fxmisc.wellbehaved.event.template.PatternActionTemplate.lambda$getInputHandlerTemplateMap$2(InputMapTemplate.java:425)
	at org.fxmisc.wellbehaved.event.template.InputHandlerTemplateMap.lambda$sequence$0(InputHandlerTemplateMap.java:25)
	at org.fxmisc.wellbehaved.event.template.InputHandlerTemplateMap.lambda$sequence$0(InputHandlerTemplateMap.java:24)
	at org.fxmisc.wellbehaved.event.template.InputHandlerTemplateMap.lambda$sequence$0(InputHandlerTemplateMap.java:24)
	at org.fxmisc.wellbehaved.event.template.InputMapTemplate$HandlerTemplateConsumer$1.lambda$accept$0(InputMapTemplate.java:103)
	at org.fxmisc.wellbehaved.event.InputHandler.handle(InputHandler.java:50)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	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.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.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:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3985)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1891)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2709)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:430)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at com.sun.glass.ui.View.notifyMouse(View.java:937)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(GtkApplication.java:264)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NoSuchMethodException: com.sun.javafx.text.PrismTextLayout.getHitInfo(float,float)
	at java.base/java.lang.Class.getDeclaredMethod(Class.java:2848)
	at org.fxmisc.richtext.TextFlowExt$GenericIceBreaker.getDeclaredMethod(TextFlowExt.java:276)
	at org.fxmisc.richtext.TextFlowExt$GenericIceBreaker.invoke(TextFlowExt.java:221)
	... 51 more

The user impacting symptom is: the arrow up/down cursor keys are not working in the text areas anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Download java 21 from https://adoptium.net/temurin/releases/
  2. Download openjfx 22.0.2 from https://gluonhq.com/products/javafx/
  3. Launch the designer from PMD 7.3.0 (https://github.com/pmd/pmd/releases/pmd_releases%2F7.3.0) with pmd designer --verbose
  4. Try to edit the source code and moving around the cursor with your keyboard

Expected behavior
No exceptions, source code can be edited as usual.

Desktop (please complete the following information):

  • OS: Linux (but I have seen this originally under Windows as well)
  • Java: 21.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions