提交 2594f4e0 编写于 作者: J Juergen Hoeller

Avoid unnecessary cause initialization in ResponseStatusException

Closes gh-27196
上级 9c082562
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -47,7 +47,7 @@ public class ResponseStatusException extends NestedRuntimeException {
* @param status the HTTP status (required)
*/
public ResponseStatusException(HttpStatus status) {
this(status, null, null);
this(status, null);
}
/**
......@@ -57,7 +57,10 @@ public class ResponseStatusException extends NestedRuntimeException {
* @param reason the associated reason (optional)
*/
public ResponseStatusException(HttpStatus status, @Nullable String reason) {
this(status, reason, null);
super("");
Assert.notNull(status, "HttpStatus is required");
this.status = status.value();
this.reason = reason;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册