Skip to content

Commit

Permalink
ResponseWriter#writeResponseStatusAndHeaders drops some redundant code
Browse files Browse the repository at this point in the history
A condition with identical branches.

Found this when looking at:
4977fec
Author: jansupol <[email protected]>
Date:   Mon Feb 21 18:23:20 2022 +0100
Replace removed API in Servlet 6
  • Loading branch information
rw7 committed Jun 24, 2024
1 parent 1277084 commit e06de9d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,7 @@ public OutputStream writeResponseStatusAndHeaders(final long contentLength, fina
}
}

final String reasonPhrase = responseContext.getStatusInfo().getReasonPhrase();
if (reasonPhrase != null) {
response.setStatus(responseContext.getStatus());
} else {
response.setStatus(responseContext.getStatus());
}
response.setStatus(responseContext.getStatus());

if (!responseContext.hasEntity()) {
return null;
Expand Down

0 comments on commit e06de9d

Please sign in to comment.