From f0a9f649c16218b5fe90969d33472e6a89689516 Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Fri, 8 Aug 2025 11:36:53 +0100 Subject: [PATCH] Allow null in ProblemDetail#type See gh-35294 --- .../src/main/java/org/springframework/http/ProblemDetail.java | 3 +-- 1 file changed, 1 insertion(+), 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 f24351ca09f..65968b53a9f 100644 --- a/spring-web/src/main/java/org/springframework/http/ProblemDetail.java +++ b/spring-web/src/main/java/org/springframework/http/ProblemDetail.java @@ -110,7 +110,6 @@ public class ProblemDetail implements Serializable { * @param type the problem type */ public void setType(URI type) { - Assert.notNull(type, "'type' is required"); this.type = type; } @@ -251,7 +250,7 @@ public class ProblemDetail implements Serializable { @Override public boolean equals(@Nullable Object other) { return (this == other || (other instanceof ProblemDetail that && - getType().equals(that.getType()) && + ObjectUtils.nullSafeEquals(getType(), that.getType()) && ObjectUtils.nullSafeEquals(getTitle(), that.getTitle()) && this.status == that.status && ObjectUtils.nullSafeEquals(this.detail, that.detail) &&