The methods defined here:
|
PathElement[] getUnderlineShape(int from, int to) { |
Now override final methods that exist in the base JFX TextFlow class: openjdk/jfx@04c5e40
The exception:
Caused by: java.lang.IncompatibleClassChangeError: class org.fxmisc.richtext.TextFlowExt overrides final method javafx.scene.text.TextFlow.getUnderlineShape(II)[Ljavafx/scene/shape/PathElement;
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
...
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at org.fxmisc.richtext.ParagraphBox.<init>(ParagraphBox.java:98)
...
at org.fxmisc.richtext.GenericStyledArea.<init>(GenericStyledArea.java:811)
at org.fxmisc.richtext.StyledTextArea.<init>(StyledTextArea.java:33)
at org.fxmisc.richtext.StyledTextArea.<init>(StyledTextArea.java:45)
at org.fxmisc.richtext.StyleClassedTextArea.<init>(StyleClassedTextArea.java:21)
at org.fxmisc.richtext.StyleClassedTextArea.<init>(StyleClassedTextArea.java:34)
at org.fxmisc.richtext.CodeArea.<init>(CodeArea.java:37)
You can observe the failure by using a CodeArea with JavaFX 26-ea
Possible fixes:
- Rename the methods in
TextFlowEx to maintain compatibility with older JavaFX releases and newer ones
- The methods added by RichTextFX are package private anyways, so library consumers will see this as an invisible change that fixes JavaFX 25+ incompatibility
- Bump the minimum target to JavaFX 25 and drop support for older releases
- Library consumers will see this as a patch that requires bumping JavaFX in their own projects, and in turn possibly bumping up to Java 23+ (As JavaFX has a N-2 version target policy now)
The methods defined here:
RichTextFX/richtextfx/src/main/java/org/fxmisc/richtext/TextFlowExt.java
Line 71 in 9f772d9
Now override final methods that exist in the base JFX
TextFlowclass: openjdk/jfx@04c5e40The exception:
You can observe the failure by using a
CodeAreawith JavaFX 26-eaPossible fixes:
TextFlowExto maintain compatibility with older JavaFX releases and newer ones