Browse Source

Use Java 24 to build Spring Framework

This commit also adapts tests for a Java 24 runtime.

Closes gh-34639
pull/34655/head
Brian Clozel 10 months ago
parent
commit
b8b279d3e0
  1. 2
      buildSrc/src/main/java/org/springframework/build/JavaConventions.java
  2. 5
      spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJEnableCachingIsolatedTests.java
  3. 5
      spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java
  4. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java

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

@ -44,7 +44,7 @@ public class JavaConventions { @@ -44,7 +44,7 @@ public class JavaConventions {
/**
* The Java version we should use as the JVM baseline for building the project
*/
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(23);
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(24);
/**
* The Java version we should use as the baseline for the compiled bytecode (the "-release" compiler argument)

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

@ -95,9 +95,10 @@ class AspectJEnableCachingIsolatedTests { @@ -95,9 +95,10 @@ class AspectJEnableCachingIsolatedTests {
}
catch (NoUniqueBeanDefinitionException ex) {
assertThat(ex.getMessage()).contains(
"no CacheResolver specified and expected single matching CacheManager but found 2: cm1,cm2");
"no CacheResolver specified and expected single matching CacheManager but found 2")
.contains("cm1", "cm2");
assertThat(ex.getNumberOfBeansFound()).isEqualTo(2);
assertThat(ex.getBeanNamesFound()).containsExactly("cm1", "cm2");
assertThat(ex.getBeanNamesFound()).containsExactlyInAnyOrder("cm1", "cm2");
}
}

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

@ -94,9 +94,10 @@ class EnableCachingTests extends AbstractCacheAnnotationTests { @@ -94,9 +94,10 @@ class EnableCachingTests extends AbstractCacheAnnotationTests {
assertThatThrownBy(ctx::refresh)
.isInstanceOfSatisfying(NoUniqueBeanDefinitionException.class, ex -> {
assertThat(ex.getMessage()).contains(
"no CacheResolver specified and expected single matching CacheManager but found 2: cm1,cm2");
"no CacheResolver specified and expected single matching CacheManager but found 2")
.contains("cm1", "cm2");
assertThat(ex.getNumberOfBeansFound()).isEqualTo(2);
assertThat(ex.getBeanNamesFound()).containsExactly("cm1", "cm2");
assertThat(ex.getBeanNamesFound()).containsExactlyInAnyOrder("cm1", "cm2");
}).hasNoCause();
}

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

@ -228,7 +228,7 @@ class ConfigurationClassProcessingTests { @@ -228,7 +228,7 @@ class ConfigurationClassProcessingTests {
BeanFactory factory = initBeanFactory(true, ConfigWithMethodNameMismatch.class);
SpousyTestBean foo = factory.getBean("foo", SpousyTestBean.class);
assertThat(foo.getName()).isEqualTo("foo1");
assertThat(foo.getName()).isIn("foo1", "foo2");
}
@Test

Loading…
Cancel
Save