Skip to content

Commit

Permalink
Avoid unnecessary cause initialization in ResponseStatusException
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Sep 2, 2021
1 parent 9c931f6 commit 50d597e
Showing 1 changed file with 6 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* 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.
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -57,7 +57,10 @@ public ResponseStatusException(HttpStatus status) {
* @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;
this.reason = reason;
}

/**
Expand Down

0 comments on commit 50d597e

Please sign in to comment.