-
Notifications
You must be signed in to change notification settings - Fork 330
Add compiler support for Java-25 and set up a Java-25 build #3604
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2020,21 +2020,21 @@ class ImportOrganizerTest extends AbstractXtendTestCase { | |
| // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=399519 | ||
| @Test def testExtensionFeatureCallToStaticLocalFieldFromSuper() { | ||
| ''' | ||
| import java.util.Collections | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change this test?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
So I searched for another class that's not final and has (directly or inherited) static methods that could be used for this test.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the past, when supporting Java 21, I had similar problems due to changes in the JDK. I solved them by NOT using JDK types for tests: I crafted a few Java types (stub classes) with the requirements for our tests. If you need a "class that's not final and has (directly or inherited) static methods" I'd create a stub class in that tests project and use that one in the test.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good idea.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It depends on how much work it requires.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have this problem on a regular base so i am fine with adjusting stuff while keeping the intent of the test |
||
| import java.util.ArrayList | ||
|
|
||
| import static extension java.util.Collections.* | ||
| import static extension java.util.List.* | ||
|
|
||
| class Foo extends Collections { | ||
| class Foo extends ArrayList { | ||
| def foo() { | ||
| ''.singleton | ||
| ''.of | ||
| } | ||
| } | ||
| '''.assertIsOrganizedTo(''' | ||
| import java.util.Collections | ||
| import java.util.ArrayList | ||
|
|
||
| class Foo extends Collections { | ||
| class Foo extends ArrayList { | ||
| def foo() { | ||
| ''.singleton | ||
| ''.of | ||
| } | ||
| } | ||
| ''') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| -Djava-25 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.eclipse.xtext</groupId> | ||
| <artifactId>it-tests-parent</artifactId> | ||
| <version>IT-SNAPSHOT</version> | ||
| <relativePath>../../pom.xml</relativePath> | ||
| </parent> | ||
| <artifactId>simple-java25</artifactId> | ||
| <properties> | ||
| <maven.compiler.source>25</maven.compiler.source> | ||
| <maven.compiler.target>25</maven.compiler.target> | ||
| </properties> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.eclipse.xtext</groupId> | ||
| <artifactId>xtend-maven-plugin</artifactId> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package test; | ||
|
|
||
| public record JavaRecord(String name) { | ||
| public XtendA foo(XtendA test) { | ||
| return test; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package test | ||
|
|
||
| class XtendA { | ||
| def JavaRecord newJavaRecord() { | ||
| return new JavaRecord("a test") | ||
| } | ||
|
|
||
| def String aName(JavaRecord r) { | ||
| r.name | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.