Skip to content

Commit 50d597e

Browse files
committed
Avoid unnecessary cause initialization in ResponseStatusException
Closes gh-27196
1 parent 9c931f6 commit 50d597e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spring-web/src/main/java/org/springframework/web/server/ResponseStatusException.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class ResponseStatusException extends NestedRuntimeException {
4747
* @param status the HTTP status (required)
4848
*/
4949
public ResponseStatusException(HttpStatus status) {
50-
this(status, null, null);
50+
this(status, null);
5151
}
5252

5353
/**
@@ -57,7 +57,10 @@ public ResponseStatusException(HttpStatus status) {
5757
* @param reason the associated reason (optional)
5858
*/
5959
public ResponseStatusException(HttpStatus status, @Nullable String reason) {
60-
this(status, reason, null);
60+
super("");
61+
Assert.notNull(status, "HttpStatus is required");
62+
this.status = status;
63+
this.reason = reason;
6164
}
6265

6366
/**

0 commit comments

Comments
 (0)