Add support for Java 23 and Java 24#4901
Conversation
This commit adds language level support for Java 23 and Java 24. Neither version introduces syntax changes that affect parsing, so the validators and post-processors simply extend their Java 22 counterparts. Changes: - Add Java23Validator and Java24Validator (extend Java22Validator) - Add Java23PostProcessor and Java24PostProcessor (extend Java22PostProcessor) - Add JAVA_23 and JAVA_24 enum entries to ParserConfiguration - Update BLEEDING_EDGE to JAVA_24 - Extend yieldSupport array to include JAVA_23 and JAVA_24 - Add comprehensive tests for Java 23 and Java 24 language levels Related to: javaparser#4699 Note: Java 25 support with JEPs 511, 512, and 513 will be handled in separate pull requests as those introduce syntax changes requiring parser modifications.
|
Can you use Spotless to fix formatting errors? |
Apply consistent code style by moving closing braces to same line as class declaration for empty class bodies, matching project conventions. This fixes the CI check failure where the metamodel generator detected formatting inconsistencies.
Will do tomorrow |
|
Use mvn spotless:apply command to fix these formatting issues |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4901 +/- ##
===========================================
Coverage 58.377% 58.377%
Complexity 2534 2534
===========================================
Files 685 685
Lines 39310 39310
Branches 7134 7134
===========================================
Hits 22948 22948
Misses 13448 13448
Partials 2914 2914
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@jlerbsc Passes now. |
|
There are still issues with the code format. |
|
Can you complete this PR or should we close it? |
I'm sorry but I cannot find any format issue. On branch claude/add-java-23-24-support-018bgqTy8mGuzH89FWymTHnM nothing to commit, working tree clean |
|
Did you use the spotless command from the JP project? |
|
@rpx99 if just running edit: This is what we do in the github actions check to ensure that nothing is overwritten by codegen |
|
Yes. I did a |
|
Alternatively, you can take the git diff from the actions output and write it to a patch file, which you can then apply with |
|
Can you manually fix the 4 files? |
This seems to work! |
|
Can you check again, pls? |
|
Thank you for this contribution. |
Summary
Adds language level support for Java 23 and Java 24.
Changes
Java23ValidatorandJava24Validator(extendJava22Validator)Java23PostProcessorandJava24PostProcessor(extendJava22PostProcessor)JAVA_23andJAVA_24enum entries toParserConfigurationBLEEDING_EDGEtoJAVA_24yieldSupportarray to include Java 23 and 24Notes
Related Issues
Closes #4699
Testing
All existing tests pass + new validator tests for Java 23/24