Skip to content

Conversation

@chengenzhao
Copy link
Contributor

@chengenzhao chengenzhao commented Dec 17, 2025

Bump Kotlin to 2.3, JDK to 25, JavaFX to 25.0.1

Upgrade Kotlin compiler jvm target to 21 instead of 17(onle one LTS version lower than current LTS version)

Modify deprecated kotlin API String.toLowercase() to .lowercase() which is required modification for upgrading Kotlin version

this PR should fix #1451

and also modify kotlin compiler jvm target to 21 instead of 17(onle one LTS version lower than current LTS version)
and also modify deprecated kotlin API String.toLowercase() to .lowercase()
@chengenzhao chengenzhao changed the title Bump kotlin to 2.3, jdk to 25, javafx to 25.0.1 Bump Kotlin to 2.3, JDK to 25, Javafx to 25.0.1 Dec 17, 2025
@chengenzhao

This comment was marked as outdated.

@chengenzhao
Copy link
Contributor Author

chengenzhao commented Dec 17, 2025

@AlmasB there is one test failed

    fun `Path`() {
        val rect = Rectangle(160.0, 50.0)

        val anim = AnimatedPath(rect)

        assertThat(anim.getValue(0.0), `is`(Point3D(0.0, 0.13125, 0.0)))
        assertThat(anim.getValue(1.0), `is`(Point3D(0.0, 0.0, 0.0)))
        assertThat(anim.getValue(0.5), `is`(Point3D(160.0, 50.0, 0.0)))
    }

Got the solution here

        while (t < 1.0) {
            points[percent++] = Point3D(dummy.translateX, dummy.translateY, 0.0)

            t += 0.01
            Thread.sleep(10)//add this line, seems like if the time elapsed speed is not matching the transition time, the calculation wont activated...

            pt.jumpTo(Duration.seconds(t))
        }

@chengenzhao
Copy link
Contributor Author

chengenzhao commented Dec 17, 2025

Here is the recreation of the bug:

  public static void main(String... args) throws Exception {

    var c = new Circle(10,Color.RED);
    var pt = new PathTransition(Duration.seconds(1), new Rectangle(160,50), c);
    pt.play();

    Thread.sleep(500);//comment out this line, translate X wont changed
    pt.jumpTo(Duration.seconds(0.5));

    IO.println(c.getTranslateX());//print 160.0, but if comment out the above line, here will be 0.0
  }

dont know exactly the reason but it works

@chengenzhao chengenzhao changed the title Bump Kotlin to 2.3, JDK to 25, Javafx to 25.0.1 Bump Kotlin to 2.3, JDK to 25, Javafx to 25.0.1, Jackson 2.18.2 -> 2.19.4 Dec 17, 2025
@chengenzhao chengenzhao changed the title Bump Kotlin to 2.3, JDK to 25, Javafx to 25.0.1, Jackson 2.18.2 -> 2.19.4 Bump Kotlin 2.0 -> 2.3, JDK to 23 -> 25, Javafx to 21.0.1 -> 25.0.1, Jackson 2.18.2 -> 2.19.4, JaCoCo 0.8.12 -> 0.8.14 Dec 17, 2025
Copy link
Owner

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the version bumps, there seem to be a few unrelated changes. Can you have a look at the comments please.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not recall previous tests failing, is this a result of the new PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because when we upgrade JavaFX version to 25 then it causes this problem
I have recreate the bug by the Java code and test it in JavaFX 25.0.1
and when it failed, we directly run the test and it failed also then here is the recreation of the problem

  public static void main(String... args) throws Exception {

    var c = new Circle(10,Color.RED);
    var pt = new PathTransition(Duration.seconds(1), new Rectangle(160,50), c);
    pt.play();

    Thread.sleep(500);//comment out this line, translate X wont changed
    pt.jumpTo(Duration.seconds(0.5));

    IO.println(c.getTranslateX());//print 160.0, but if comment out the above line, here will be 0.0
  }

basically this code should work as expected

var pt = new PathTransition(Duration.seconds(1), new Rectangle(160,50), c);
pt.play();
pt.jumpTo(Duration.seconds(0.5));
assertEqual(c.getTranslateX() == 160.0);

but it failed
it is 0.0, the circle node didnt move at all
but if we add in like this line

Thread.sleep(500);

then it works as epected

and I noticed that the CI failed in all three OS(win,mac&linux)
so you may recreate this problem in your machine just using JavaFX 25.0.1

Copy link
Contributor Author

@chengenzhao chengenzhao Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested the same code using JavaFX 21.0.1
it works as expected no need to use Thread.sleep
so pretty sure it is the problem of JavaFX
when we upgrade JavaFX from 21.0.1 to 25.0.1
it happens

so any suggestions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you may see here, using JavaFX 21.0.1 it works fine
image
this is JavaFX 25.0.1 assert failed
image

@chengenzhao chengenzhao requested a review from AlmasB December 17, 2025 08:46
points[percent++] = Point3D(dummy.translateX, dummy.translateY, 0.0)

t += 0.01
Thread.sleep(10)//seems like if the time elapsed speed is not matching the transition time, the calculation wont be activated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for investigating. This is rarely used, so it sounds fine to have this workaround. Please can you add a comment that this change is due to JavaFX behaviour being different between versions 21 and 25.

…m due to the different behaviors of between JavaFX 25 and previous LTS version 21.

Also change README.md file version back to 21.1 since it will be updated to 25 when releasing.
@chengenzhao chengenzhao requested a review from AlmasB December 17, 2025 10:37
@AlmasB AlmasB changed the title Bump Kotlin 2.0 -> 2.3, JDK to 23 -> 25, Javafx to 21.0.1 -> 25.0.1, Jackson 2.18.2 -> 2.19.4, JaCoCo 0.8.12 -> 0.8.14 build: Bump Kotlin 2.0 -> 2.3, JDK to 23 -> 25, Javafx to 21.0.1 -> 25.0.1, Jackson 2.18.2 -> 2.19.4, JaCoCo 0.8.12 -> 0.8.14 Dec 17, 2025
@AlmasB AlmasB changed the title build: Bump Kotlin 2.0 -> 2.3, JDK to 23 -> 25, Javafx to 21.0.1 -> 25.0.1, Jackson 2.18.2 -> 2.19.4, JaCoCo 0.8.12 -> 0.8.14 build: Bump Kotlin 2.0 -> 2.3, JDK to 23 -> 25, Javafx to 21.0.1 -> 25.0.1, Jackson 2.18.2 -> 2.19.4, JaCoCo 0.8.12 -> 0.8.14, attach 4.0.17 -> 4.0.24 Dec 17, 2025
@AlmasB AlmasB merged commit 0ee5516 into AlmasB:dev Dec 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix vulnerability issues

2 participants