Skip to content

Add Java 21 to CI#1134

Merged
jknack merged 1 commit intojknack:masterfrom
dsvensson:master
Aug 7, 2025
Merged

Add Java 21 to CI#1134
jknack merged 1 commit intojknack:masterfrom
dsvensson:master

Conversation

@dsvensson
Copy link
Copy Markdown
Contributor

@dsvensson dsvensson commented Jul 8, 2024

I was about to write a test case for handlebars 4.4.0 with Java 21, but apparently the project doesn't compile yet with 21. Running tests locally results in 13 test failures under Java 21. Opened PR to have CI reflect that state. All failures locally are i18n related and throw java.lang.UnsupportedOperationException so hopefully just that one module change to fix them all.

@dsvensson
Copy link
Copy Markdown
Contributor Author

dsvensson commented Jul 8, 2024

The test case I was going to add, which is not covered by the failing tests, was that when running under Java 21, @last is always true in some loops - iirc not all, so when using that to splice in , between list entries for example, that results in no , being inserted.

Something like this (stripped from content so maybe looks a bit barren):

        {{#each coll as | subcoll | }}
              {{#each subcoll as | entry |}}
                  {{entry.name}}: {{serialize entry.value}}
                  {{#unless @last}},{{/unless}}
              {{/each}}
        {{#unless @last}},{{/unless}}
        {{/each}}

@mimranfaruqi
Copy link
Copy Markdown

mimranfaruqi commented Sep 2, 2024

@dsvensson I have this issue as well. I use @last in a nested loop but it is always false. I am using it with #unless. When I use #unless 2 > 3 the condition is always true, although it has to be false IMO.

Have you found a workaround to this or have you stopped working with this for now?

@dsvensson
Copy link
Copy Markdown
Contributor Author

@mimranfaruqi Other than staying at Java 17, no.

@jknack Any idea how to get Java 21 support working?

@jknack jknack merged commit 83bd602 into jknack:master Aug 7, 2025
@dsvensson
Copy link
Copy Markdown
Contributor Author

dsvensson commented Aug 15, 2025

@jknack thanks for merging and dealing with the Java 21 fallout, perhaps best to also add Java 24 (and later change to 25) to the build matrix as Java 25 Long Term Support is due next month.

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.

3 participants