Make HttpStatusCode extend Serializable

`HttpStatusCode` instance only hold an int value and are held by
`Serializable` classes, so this commit enforces this.

Without this change, Java 19+ will emit a compiler warning as
`Serializable` classes use `HttpStatusCode` as a field.
This commit is contained in:
Brian Clozel 2022-09-09 19:56:00 +02:00
parent a09811e73a
commit 1dc3d5d2d6
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,8 @@
package org.springframework.http;
import java.io.Serializable;
import org.springframework.util.Assert;
/**
@ -27,7 +29,7 @@ import org.springframework.util.Assert;
* @see <a href="https://www.iana.org/assignments/http-status-codes">HTTP Status Code Registry</a>
* @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">List of HTTP status codes - Wikipedia</a>
*/
public sealed interface HttpStatusCode permits DefaultHttpStatusCode, HttpStatus {
public sealed interface HttpStatusCode extends Serializable permits DefaultHttpStatusCode, HttpStatus {
/**
* Return the integer value of this status code.