Skip to content

Commit f0a9f64

Browse files
committed
Allow null in ProblemDetail#type
See gh-35294
1 parent 600d6c6 commit f0a9f64

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

spring-web/src/main/java/org/springframework/http/ProblemDetail.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ protected ProblemDetail() {
110110
* @param type the problem type
111111
*/
112112
public void setType(URI type) {
113-
Assert.notNull(type, "'type' is required");
114113
this.type = type;
115114
}
116115

@@ -251,7 +250,7 @@ public Map<String, Object> getProperties() {
251250
@Override
252251
public boolean equals(@Nullable Object other) {
253252
return (this == other || (other instanceof ProblemDetail that &&
254-
getType().equals(that.getType()) &&
253+
ObjectUtils.nullSafeEquals(getType(), that.getType()) &&
255254
ObjectUtils.nullSafeEquals(getTitle(), that.getTitle()) &&
256255
this.status == that.status &&
257256
ObjectUtils.nullSafeEquals(this.detail, that.detail) &&

0 commit comments

Comments
 (0)