Skip to content

Conversation

@seintur
Copy link
Contributor

@seintur seintur commented Jan 3, 2026

This PR provides a test to check the support of Java 25 flexible constructor bodies https://openjdk.org/jeps/513

@seintur seintur changed the title Test for Java 25 flexible constructor body test: Java 25 flexible constructor body Jan 3, 2026
@monperrus
Copy link
Collaborator

thanks a lot @seintur the test passes so there is support out of the box?

@SirYwell
Copy link
Collaborator

SirYwell commented Jan 4, 2026

Would it make sense to also have some printing tests?

@seintur
Copy link
Contributor Author

seintur commented Jan 4, 2026

Thanks @SirYwell for the recommendation. I have added some printing tests in 3ccc6f4

@seintur
Copy link
Contributor Author

seintur commented Jan 4, 2026

Hi @monperrus

Indeed JDT with compliance level 25 builds a correct AST, and the construction of the model by Spoon does not require any change.

In particular

public <T extends CtStatementList> T addStatement(CtStatement statement) {
is used and does not enforce any other contract than adding the statement at the end of the list. So the ordering of statements as constructed by JDT in the AST is preserved by Spoon.

@monperrus monperrus merged commit 53d7649 into INRIA:master Jan 4, 2026
13 checks passed
@monperrus
Copy link
Collaborator

monperrus commented Jan 4, 2026

thanks a lot @seintur, @SirYwell and @I-Al-Istannen

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.

4 participants