Skip to content

Conversation

@tsaglam
Copy link
Member

@tsaglam tsaglam commented Sep 16, 2025

This PR adds support for Java 25. This also means the whole project is built with Java 25, as we use JavaC as part of our Java language module. Thus, this pull request updates the project's Java version from 21 to 25 across the entire codebase and documentation.

  • Update pom.xml
  • Update CI workflows
  • Update documentation
  • Update Java language module
  • Fix tokenization of compact source files (no class declaration)
  • Update/extend Java language tests
  • Figure out issue with @RecordBuilder and Java 25 (io.soabase.record-builder)
  • Wait for Temurin JDK 25 release
  • Change workflows back from Java 25-ea (early access) to Java 25.
  • .Wait for org.kohsuke.metainf-services to support Java 25 or swap to an alternative (Introduce Google Auto Service #2623).

Tokenization of new Java Syntax:

1       import module java.base;
        |IMPORT

2       import module java.sql;
        |IMPORT

3       
4       public class Java25 {
               |CLASS{

5       
6           // Compact main method
7           void main() {
            |METHOD{

8               // Module imports:
9               List<String> list = List.of("a", "b", "c"); // java.util.List from java.base is imported
                |VARDEF            ||APPLY|

10              java.sql.Date date = new java.sql.Date(0);  // java.sql.Date from java.sql is imported
                |VARDEF             ||NEWCLASS       |

11      
12              // Unnamed variables:
13              int count;
                |VARDEF |

14              for (String _ : list) {// loop variable is unused
                |LOOP{

15                  count++;
                    |ASSIGN

16              }
                |}loop

17      
18          }
            |}method

19      
20          class Person {
            |CLASS{

21              Person(int age) {
                |METHOD{
                       |VARDEF

22                  /* ... */ }
                              |}method

23          }
            |}class

24      
25          class Employee extends Person {
            |CLASS{

26              Employee(int age) {
                |METHOD{ |VARDEF

27                  if (age < 0)
                    |IF{

28                      age = 0;   // validate before calling super
                        |ASSIGN|}if

29                  super(age);            // now allowed after other statements
                    |APPLY

30                  System.out.println("Employee age: " + age);
                    |APPLY           |

31              }
                |}method

32          }
            |}class

33      }
        |}class
        |eof

Especially for compact source files (no class declared explicitly):

1       // Compact main method
2       void main() {
        |CLASS{
        |METHOD{

3           foo();
            |APPLY

4       }
        |}method

5       
6       private static void foo() {
        |METHOD{

7          IO.println("Compact source file and main");
           |APPLY   |

8      }
       |}method
       |}class
       |eof

@tsaglam tsaglam added enhancement Issue/PR that involves features, improvements and other changes major Major issue/feature/contribution/change language PR / Issue deals (partly) with new and/or existing languages for JPlag wiki Regards the documentation in the wiki labels Sep 16, 2025
@tsaglam
Copy link
Member Author

tsaglam commented Sep 16, 2025

The Temurin release is expected to be in September 2025.

@tsaglam
Copy link
Member Author

tsaglam commented Sep 23, 2025

As @TwoOfTwelve found out, org.kohsuke.metainf-services is currently not working correctly in Java 25. Thus, the workflows fail even with Java 25-ea.

@tsaglam
Copy link
Member Author

tsaglam commented Oct 13, 2025

Nice, seems to work now! I could not resist seeing if my PR works now! 😄

@tsaglam tsaglam marked this pull request as ready for review October 13, 2025 16:04
@robinmaisch robinmaisch merged commit d5e3dc9 into develop Oct 13, 2025
50 checks passed
@tsaglam tsaglam deleted the feature/java-25 branch October 14, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Issue/PR that involves features, improvements and other changes language PR / Issue deals (partly) with new and/or existing languages for JPlag major Major issue/feature/contribution/change wiki Regards the documentation in the wiki

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants