Skip to content

Commit 73b6355

Browse files
committed
Update spring-boot to 4.0.0-M1
1 parent 7b36e32 commit 73b6355

File tree

36 files changed

+222
-232
lines changed

36 files changed

+222
-232
lines changed

.github/utils/next_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.1.0
1+
v2.0.0

gradle/libs.versions.toml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[versions]
22
jetbrains-annotations = "26.0.2-1"
33
problem4j-core = "1.1.1"
4-
problem4j-jackson = "1.1.1"
5-
spring-boot = "3.5.7"
4+
problem4j-jackson3 = "1.0.2"
5+
spring-boot = "4.0.0-M3"
66

77
[libraries]
88
jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" }
99

1010
problem4j-core = { module = "io.github.malczuuu.problem4j:problem4j-core", version.ref = "problem4j-core" }
11-
problem4j-jackson = { module = "io.github.malczuuu.problem4j:problem4j-jackson", version.ref = "problem4j-jackson" }
11+
problem4j-jackson3 = { module = "io.github.malczuuu.problem4j:problem4j-jackson3", version.ref = "problem4j-jackson3" }
1212

1313
spring-boot-dependencies = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot" }
1414
spring-boot-configuration-processor = { module = "org.springframework.boot:spring-boot-configuration-processor", version.ref = "spring-boot" }
@@ -17,15 +17,19 @@ spring-boot-configuration-processor = { module = "org.springframework.boot:sprin
1717
spring-boot-autoconfigure = { module = "org.springframework.boot:spring-boot-autoconfigure" }
1818

1919
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test" }
20-
spring-boot-starter-web = { module = "org.springframework.boot:spring-boot-starter-web" }
2120
spring-boot-starter-webflux = { module = "org.springframework.boot:spring-boot-starter-webflux" }
21+
spring-boot-starter-webmvc = { module = "org.springframework.boot:spring-boot-starter-webmvc" }
2222
spring-boot-starter-validation = { module = "org.springframework.boot:spring-boot-starter-validation" }
2323

24+
spring-boot-restclient = { module = "org.springframework.boot:spring-boot-restclient" }
25+
spring-boot-validation = { module = "org.springframework.boot:spring-boot-validation" }
26+
spring-boot-web-server = { module = "org.springframework.boot:spring-boot-web-server" }
27+
spring-boot-webflux = { module = "org.springframework.boot:spring-boot-webflux" }
28+
spring-boot-webmvc = { module = "org.springframework.boot:spring-boot-webmvc" }
29+
2430
spring-web = { module = "org.springframework:spring-web" }
25-
spring-webflux = { module = "org.springframework:spring-webflux" }
26-
spring-webmvc = { module = "org.springframework:spring-webmvc" }
2731

28-
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind" }
32+
jackson-databind = { module = "tools.jackson.core:jackson-databind" }
2933

3034
jakarta-servlet-api = { module = "jakarta.servlet:jakarta.servlet-api" }
3135
jakarta-validation-api = { module = "jakarta.validation:jakarta.validation-api" }

problem4j-spring-bom/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ val problem4jJacksonVersion: String by project
1111
dependencies {
1212
constraints {
1313
api(libs.problem4j.core)
14-
api(libs.problem4j.jackson)
14+
api(libs.problem4j.jackson3)
1515
api(project(":problem4j-spring-web"))
1616
api(project(":problem4j-spring-webflux"))
1717
api(project(":problem4j-spring-webmvc"))

problem4j-spring-web/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ val springBootVersion: String by project
1919
dependencies {
2020
// Main
2121
api(libs.problem4j.core)
22-
api(libs.problem4j.jackson)
22+
api(libs.problem4j.jackson3)
2323

2424
compileOnly(platform(libs.spring.boot.dependencies))
2525
compileOnly(libs.spring.boot.autoconfigure)
@@ -36,8 +36,8 @@ dependencies {
3636
// Test
3737
testImplementation(platform(libs.spring.boot.dependencies))
3838
testImplementation(libs.spring.boot.starter.test)
39-
testImplementation(libs.spring.boot.starter.web)
40-
testImplementation(libs.spring.boot.starter.validation)
39+
testImplementation(libs.spring.boot.web.server)
40+
testImplementation(libs.spring.boot.validation)
4141
testImplementation(libs.jakarta.servlet.api)
4242

4343
testRuntimeOnly(libs.junit.platform.launcher)

problem4j-spring-web/src/main/java/io/github/malczuuu/problem4j/spring/web/ProblemAutoConfiguration.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.malczuuu.problem4j.spring.web;
22

3-
import com.fasterxml.jackson.databind.module.SimpleModule;
4-
import io.github.malczuuu.problem4j.jackson.ProblemModule;
3+
import io.github.malczuuu.problem4j.jackson3.ProblemJacksonModule;
54
import io.github.malczuuu.problem4j.spring.web.annotation.DefaultProblemMappingProcessor;
65
import io.github.malczuuu.problem4j.spring.web.annotation.ProblemMappingProcessor;
76
import io.github.malczuuu.problem4j.spring.web.format.DefaultProblemFormat;
@@ -19,6 +18,7 @@
1918
import org.springframework.context.annotation.Bean;
2019
import org.springframework.context.annotation.Configuration;
2120
import org.springframework.context.annotation.Import;
21+
import tools.jackson.databind.module.SimpleModule;
2222

2323
@AutoConfiguration
2424
@EnableConfigurationProperties({ProblemProperties.class})
@@ -99,19 +99,19 @@ public ProblemResolverStore problemResolverStore(
9999
return problemResolverStore;
100100
}
101101

102-
@ConditionalOnClass({ProblemModule.class, SimpleModule.class})
102+
@ConditionalOnClass({ProblemJacksonModule.class, SimpleModule.class})
103103
@Configuration(proxyBeanMethods = false)
104104
public static class ProblemModuleConfiguration {
105105

106106
/**
107-
* Provides a {@link ProblemModule} if none is defined.
107+
* Provides a {@link ProblemJacksonModule} if none is defined.
108108
*
109-
* @return a new {@link ProblemModule}
109+
* @return a new {@link ProblemJacksonModule}
110110
*/
111-
@ConditionalOnMissingBean(ProblemModule.class)
111+
@ConditionalOnMissingBean(ProblemJacksonModule.class)
112112
@Bean
113-
public ProblemModule problemModule() {
114-
return new ProblemModule();
113+
public ProblemJacksonModule problemJacksonModule() {
114+
return new ProblemJacksonModule();
115115
}
116116
}
117117
}

problem4j-spring-web/src/test/java/io/github/malczuuu/problem4j/spring/web/CachingProblemResolverStoreTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.util.Map;
1515
import java.util.Optional;
1616
import java.util.concurrent.Callable;
17+
import java.util.concurrent.ExecutionException;
1718
import java.util.concurrent.ExecutorService;
1819
import java.util.concurrent.Executors;
1920
import java.util.concurrent.Future;
@@ -83,7 +84,8 @@ private static class DummyResolver extends AbstractProblemResolver {
8384
}
8485

8586
@Test
86-
void whenManyThreadsLookupSameException_thenComputeResolverRunsOnce() throws Exception {
87+
void whenManyThreadsLookupSameException_thenComputeResolverRunsOnce()
88+
throws InterruptedException, ExecutionException {
8789
AtomicInteger computeCounter = new AtomicInteger(0);
8890

8991
DummyResolver resolver = new DummyResolver(IOException.class);

problem4j-spring-webflux/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ dependencies {
1919

2020
compileOnly(platform(libs.spring.boot.dependencies))
2121
compileOnly(libs.spring.boot.autoconfigure)
22-
compileOnly(libs.spring.web)
23-
compileOnly(libs.spring.webflux)
22+
compileOnly(libs.spring.boot.web.server)
23+
compileOnly(libs.spring.boot.webflux)
2424

2525
compileOnly(libs.jakarta.validation.api)
2626
compileOnly(libs.slf4j.api)
@@ -31,7 +31,7 @@ dependencies {
3131
testImplementation(platform(libs.spring.boot.dependencies))
3232
testImplementation(libs.spring.boot.starter.test)
3333
testImplementation(libs.spring.boot.starter.webflux)
34-
testImplementation(libs.spring.boot.starter.validation)
34+
testImplementation(libs.spring.boot.validation)
3535

3636
testRuntimeOnly(libs.junit.platform.launcher)
3737
}

problem4j-spring-webflux/src/main/java/io/github/malczuuu/problem4j/spring/webflux/ProblemEnhancedWebFluxHandler.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ public ProblemEnhancedWebFluxHandler(
5757
this.adviceWebFluxInspectors = adviceWebFluxInspectors;
5858
}
5959

60-
/**
61-
* <b>Note:</b> Although {@link HttpHeaders#writableHttpHeaders(HttpHeaders)} is deprecated, it is
62-
* used here for backward compatibility with older Spring Framework versions.
63-
*
64-
* <p>The deprecation alternative provided by Spring is not available in versions {@code 6.0.*}
65-
* and {@code 6.1.*} (Spring Framework versions, not Spring Boot). Therefore, this method is
66-
* retained to ensure compatibility across those versions.
67-
*/
6860
@Override
6961
protected Mono<ResponseEntity<Object>> handleExceptionInternal(
7062
Exception ex,
@@ -75,7 +67,7 @@ protected Mono<ResponseEntity<Object>> handleExceptionInternal(
7567
ProblemContext context =
7668
exchange.getAttributeOrDefault(PROBLEM_CONTEXT, ProblemContext.empty());
7769

78-
headers = headers != null ? HttpHeaders.writableHttpHeaders(headers) : new HttpHeaders();
70+
headers = headers != null ? new HttpHeaders(headers) : new HttpHeaders();
7971
headers.setContentType(MediaType.APPLICATION_PROBLEM_JSON);
8072

8173
Problem problem;

problem4j-spring-webflux/src/main/java/io/github/malczuuu/problem4j/spring/webflux/ProblemWebFluxAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
1414
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
1515
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
16-
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
17-
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
1816
import org.springframework.boot.context.properties.EnableConfigurationProperties;
17+
import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration;
18+
import org.springframework.boot.webflux.autoconfigure.error.ErrorWebFluxAutoConfiguration;
1919
import org.springframework.context.annotation.Bean;
2020
import org.springframework.context.annotation.Configuration;
2121
import org.springframework.context.annotation.Import;

problem4j-spring-webflux/src/main/java/io/github/malczuuu/problem4j/spring/webflux/error/ProblemErrorWebExceptionHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import java.util.Optional;
1212
import org.springframework.boot.autoconfigure.web.ErrorProperties;
1313
import org.springframework.boot.autoconfigure.web.WebProperties;
14-
import org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler;
15-
import org.springframework.boot.web.reactive.error.ErrorAttributes;
14+
import org.springframework.boot.webflux.autoconfigure.error.DefaultErrorWebExceptionHandler;
15+
import org.springframework.boot.webflux.error.ErrorAttributes;
1616
import org.springframework.context.ApplicationContext;
1717
import org.springframework.http.MediaType;
1818
import org.springframework.web.reactive.function.BodyInserters;
@@ -22,8 +22,8 @@
2222
import reactor.core.publisher.Mono;
2323

2424
/**
25-
* A WebFlux {@link org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler} that
26-
* renders HTTP problems (RFC 7807) instead of the default JSON error response.
25+
* A WebFlux {@link org.springframework.boot.webflux.error.ErrorWebExceptionHandler} that renders
26+
* HTTP problems (RFC 7807) instead of the default JSON error response.
2727
*
2828
* <p>It replaces the response body with a {@link Problem} object while preserving the original HTTP
2929
* status and content type {@code application/problem+json}.

0 commit comments

Comments
 (0)