-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 9 compatibility (using reflection) #614
Java 9 compatibility (using reflection) #614
Conversation
In JavaFXCompatibility you can remove the "new_EnumConverter" method and replace the two references to it in TextExt, see BORDER_TYPE and UNDERLINE_CAP, with the Java 8 compatible:
Unfortunately there doesn't seem to be an equivalent for the SequenceConverter ? |
Looks like the builds passed, but the demo package failed to compile due to not using the compatibility class. See AppVeyor's build |
@Jugen thanks for the hint. Fixed. Have also not found something for SequenceConverter. @JordanMartinez fixed the demo. Made class Will check whether the problematic code (see below) in class TextHyperlinkArea and in class StyledTextArea is necessary at all: // XXX: binding selectionFill to textFill,
// see the note at highlightTextFill
t.impl_selectionFillProperty().bind(t.fillProperty()); I've removed this code some time ago in PR #303. I'll try to remember why.... |
Upps, build now fails when building Javadoc for class |
That's needed so either the selection shape or the text's background fill CSS actually works correctly. I forget which. I agree that the class needs to be kept internal and not public. We should add a public API to do the same thing that Perhaps such a thing could appear in the |
Also, there is no |
Hmm, maybe they created it recently, but The problem in the BTW any idea how to change the |
… to class ParagraphText
Really? I thought it existed at one point, but in TestFX's Gitter feed, someone said it didn't exist, so that's why I made that comment. In other words, if it does now, you're right.
Is that an issue with TestFX itself?
I believe it's just sourceCompatibility = 9 // or "9"
targetCompatibility = 9 // or "9" |
…to java9-reflection # Conflicts: # richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/hyperlink/TextHyperlinkArea.java # richtextfx/src/main/java/org/fxmisc/richtext/StyledTextArea.java
…d for demos since merging PR FXMisc#617)
…raclejdk9 to detect Java 9 compatibility issues in source code
Not sure. To fix it, I've added Anyway, TestFX could avoid this by dropping |
updated initial comment with some useful information... |
I have tested this in my application as well (with Java 8 and 9) and it seems to be ok :-) Thank you ! The JRE just issues a warning when launching from a command prompt that illegal reflective access is being used and will be denied in a future release. |
The failed Mac build is another instance of #608. Otherwise, everything else builds fine. |
Have one final thing to discuss: what should we do with the package It contains public classes and interfaces that are only used in class Should we: A) move all classes/interfaces from package B) create a package C) leave it where it is D) other |
I think
That could be done in the future, but only if we need to. Otherwise, it seems unnecessary in our current development of this project. |
…xt as private nested classes/interfaces
The precise build is having issues even after restarting it. We'll ignore them for now since the build is deprecated anyways. |
@afester Since I want to respect @JFormDesigner's work and release a new version soon, could you please respond? I plan on merging this tomorrow and making a release soon thereafter. |
Thanks for your work! |
@JordanMartinez Sorry for the late answer - in any case, that definitely makes sense :-) |
This PR makes RichTextFX compatible to Java 9 (fixes #270) and keeps Java 8 compatibility.
The result is a single JAR that works for Java 8 and 9.
It is based on PR #593, which uses proxies/reflection in
TextFlowExt
to access private Java 9 classes/methods and runs without any special Java 9 runtime switches.This PR extends #593 by also using proxies/reflection in
TextFlowExt
when running in Java 8.Additionally there is a class
JavaFXCompatibility
that handles two API differences between Java 8 and 9.I've added a method cache to class
GenericIceBreaker
, which dramatically reduces the number of method lookups (Class..getDeclaredMethod(...)
invocations).Experimented also with a proxy object cache in
GenericIceBreaker
, but this reduced the number of proxy objects only by about 50% and proxy creation is very light weight. So there was no benefit at all.Travis now also builds on
oraclejdk9
using source/targetCompatibility9
to detect Java 9 compatibility issues in source code early.I've tested the PR with Markdown Writer FX running on Java 8 and 9 without any problems so far.
So I think the PR is ready for testing by others and/or merging.