Skip to content

Commit b8b279d

Browse files
committed
Use Java 24 to build Spring Framework
This commit also adapts tests for a Java 24 runtime. Closes gh-34639
1 parent 274a689 commit b8b279d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

buildSrc/src/main/java/org/springframework/build/JavaConventions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class JavaConventions {
4444
/**
4545
* The Java version we should use as the JVM baseline for building the project
4646
*/
47-
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(23);
47+
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(24);
4848

4949
/**
5050
* The Java version we should use as the baseline for the compiled bytecode (the "-release" compiler argument)

spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJEnableCachingIsolatedTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ void multipleCacheManagerBeans() {
9595
}
9696
catch (NoUniqueBeanDefinitionException ex) {
9797
assertThat(ex.getMessage()).contains(
98-
"no CacheResolver specified and expected single matching CacheManager but found 2: cm1,cm2");
98+
"no CacheResolver specified and expected single matching CacheManager but found 2")
99+
.contains("cm1", "cm2");
99100
assertThat(ex.getNumberOfBeansFound()).isEqualTo(2);
100-
assertThat(ex.getBeanNamesFound()).containsExactly("cm1", "cm2");
101+
assertThat(ex.getBeanNamesFound()).containsExactlyInAnyOrder("cm1", "cm2");
101102
}
102103
}
103104

spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ void multipleCacheManagerBeans() {
9494
assertThatThrownBy(ctx::refresh)
9595
.isInstanceOfSatisfying(NoUniqueBeanDefinitionException.class, ex -> {
9696
assertThat(ex.getMessage()).contains(
97-
"no CacheResolver specified and expected single matching CacheManager but found 2: cm1,cm2");
97+
"no CacheResolver specified and expected single matching CacheManager but found 2")
98+
.contains("cm1", "cm2");
9899
assertThat(ex.getNumberOfBeansFound()).isEqualTo(2);
99-
assertThat(ex.getBeanNamesFound()).containsExactly("cm1", "cm2");
100+
assertThat(ex.getBeanNamesFound()).containsExactlyInAnyOrder("cm1", "cm2");
100101
}).hasNoCause();
101102
}
102103

spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void configurationWithMethodNameMismatchAndOverridingAllowed() {
228228
BeanFactory factory = initBeanFactory(true, ConfigWithMethodNameMismatch.class);
229229

230230
SpousyTestBean foo = factory.getBean("foo", SpousyTestBean.class);
231-
assertThat(foo.getName()).isEqualTo("foo1");
231+
assertThat(foo.getName()).isIn("foo1", "foo2");
232232
}
233233

234234
@Test

0 commit comments

Comments
 (0)