Add compiler support for Java-25 and set up a Java-25 build#3604
Add compiler support for Java-25 and set up a Java-25 build#3604HannesWell wants to merge 2 commits intoeclipse-xtext:mainfrom
Conversation
| matrix: # 'macos-14' is arm64 | ||
| os: ['ubuntu-22.04', 'macos-14', 'windows-2022'] | ||
| java: [ 21 ] | ||
| java: [ 25 ] |
There was a problem hiding this comment.
In case just minimal support is added for Java-25 at the moment the main build could also stay at Java-21 and just one extra branch for Java-25 could be added.
|
what is still unclear to me: how does this work without changes to bom |
| // assertEquals(ClassFileConstants.JDK21, JavaVersion.JAVA21.toJdtClassFileConstant()); | ||
| assertEquals(4259840, JavaVersion.JAVA21.toJdtClassFileConstant()); | ||
| // assertEquals(ClassFileConstants.JDK25, JavaVersion.JAVA25.toJdtClassFileConstant()); | ||
| assertEquals(4521984, JavaVersion.JAVA25.toJdtClassFileConstant()); |
There was a problem hiding this comment.
i assume we need to use the try catch approach here
There was a problem hiding this comment.
Why? I don't see anything referenced that's not available in the baseline Java or Eclipse version?
There was a problem hiding this comment.
also in the 2024-03 target platform / the one that is also used in maven bom?
There was a problem hiding this comment.
in the past we did some reflection in that test instead of
4521984
There was a problem hiding this comment.
also in the 2024-03 target platform / the one that is also used in maven bom?
It should be yes. Eclipse 2025-12 had complete Java-25 support and since Java-21 was released two years earlier I expect the 21 constants to be available since 2023-12.
And I also ran the Jenkins build in the m2e JIPP with the lowest TP and java-17 and it succeeded.
in the past we did some reflection in that test instead of
That would work too, but I think the approach to just inline the value (implemented before by @LorenzoBettini) is simpler.
And the later expected code is already available as commented out code.
Test Results 8 071 files + 3 219 8 071 suites +3 219 3h 45m 13s ⏱️ + 1h 28m 47s For more details on these failures, see this check. Results for commit 8d1b756. ± Comparison against base commit 99a5c22. This pull request removes 5 and adds 7 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Indeed. |
|
i also assume it wont work at runtime due to bom |
|
What bom are you referring to exactly? |
|
stuff like the xtext maven plugin uses the bom i have linked above / in the other discussionhttps://github.com/eclipse-xtext/xtext/blob/425a9bee287588415dacc1042ce9e31f4ac7a3fa/org.eclipse.xtext.dev-bom/pom.xml#L273 |
- Add constants for Java-25 - Add compiler and wizard tests for Java-25. - Add Java-25 profile to xtext-dev BOM - Fix tests failing on Java-25: - java.util.Collections class is final in Java-25
In the meantime I added a java-25 profile to the BOM. But I'm not sure if it is actually necessary, because the Furthermore I added a dedicated compiler and wizard tests for Java-25 and adapted failing tests. In the current state all Github and Jenkins builds (executed in the m2e JIPP) succeeded in my testing. Please let me know if something is missing. |

This adds only compiler support for Java-25, i.e. it becomes possible to compile projects that target Java-25.
This doesn't add UI support for it yet, but I can try to extend this PR if you want to have this one pass.
A dedicated Java-25 test project is also missing (like the one added for Java-21), but I can also look into that.
As far as I know now new relevant compiler constructs where added respectivly the Java standard library wasn't changed between Java-21 and 25 in a way that affects Xtext.
Java-17 support is maintained with this.
Part of
This also includes
I could do it without it, the latter but it would become more complex eventually.