diff --git a/spring-web/src/main/java/org/springframework/http/DefaultHttpStatusCode.java b/spring-web/src/main/java/org/springframework/http/DefaultHttpStatusCode.java index 8a1f52c444..accba24252 100644 --- a/spring-web/src/main/java/org/springframework/http/DefaultHttpStatusCode.java +++ b/spring-web/src/main/java/org/springframework/http/DefaultHttpStatusCode.java @@ -90,16 +90,12 @@ final class DefaultHttpStatusCode @Override public boolean equals(Object obj) { - if (obj instanceof HttpStatusCode other) { - return this.value == other.value(); - } - else { - return false; - } + return (obj instanceof HttpStatusCode other && this.value == other.value()); } @Override public String toString() { return Integer.toString(this.value); } + }