From 689782cbad24e8a69adfba6d99f9d7d1f7f7ceea Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 11 Feb 2025 22:33:05 +0100 Subject: [PATCH] Make ProblemDetail Serializable This commit makes the `ProblemDetail` type implement `Serializable` in order to be serialized and shared in distributed systems. Closes gh-34409 --- .../main/java/org/springframework/http/ProblemDetail.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/ProblemDetail.java b/spring-web/src/main/java/org/springframework/http/ProblemDetail.java index 016160acb5..e0ed1bee4c 100644 --- a/spring-web/src/main/java/org/springframework/http/ProblemDetail.java +++ b/spring-web/src/main/java/org/springframework/http/ProblemDetail.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.springframework.http; +import java.io.Serializable; import java.net.URI; import java.util.LinkedHashMap; import java.util.Map; @@ -49,7 +50,9 @@ import org.springframework.util.ObjectUtils; * @see org.springframework.web.ErrorResponse * @see org.springframework.web.ErrorResponseException */ -public class ProblemDetail { +public class ProblemDetail implements Serializable { + + private static final long serialVersionUID = 3307761915842206538L; private static final URI BLANK_TYPE = URI.create("about:blank");