From 07a5d8c91c985a1b880233cb5a1e7f2af9993224 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 11 May 2023 17:10:26 +0200 Subject: [PATCH] Fix FreeMarker tests for JDK21 build Prior to this commit, some FreeMarker tests would fail when involving property lookup in a template file, where this bean property is linked with a method implemented as a default method on an interface. While I did not manage to reproduce this behavior in an independent test case, this is most likely related to a change in JDK 21: https://bugs.openjdk.org/browse/JDK-8071693 This commit changes the template expression to using the default method directly. --- .../web/reactive/result/view/freemarker/test-macro.ftl | 2 +- .../org/springframework/web/servlet/view/freemarker/test.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-webflux/src/test/resources/org/springframework/web/reactive/result/view/freemarker/test-macro.ftl b/spring-webflux/src/test/resources/org/springframework/web/reactive/result/view/freemarker/test-macro.ftl index 168c4c6aab3..dd2ff4aaaf4 100644 --- a/spring-webflux/src/test/resources/org/springframework/web/reactive/result/view/freemarker/test-macro.ftl +++ b/spring-webflux/src/test/resources/org/springframework/web/reactive/result/view/freemarker/test-macro.ftl @@ -7,7 +7,7 @@ NAME ${command.name} AGE -${command.age} +${command.age()} MESSAGE <@spring.message "hello"/> <@spring.message "world"/> diff --git a/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/freemarker/test.ftl b/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/freemarker/test.ftl index b6fb4caf4ea..e65774ed960 100644 --- a/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/freemarker/test.ftl +++ b/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/freemarker/test.ftl @@ -7,7 +7,7 @@ NAME ${command.name} AGE -${command.age} +${command.age()} MESSAGE <@spring.message "hello"/> <@spring.message "world"/>