Skip to content

Commit

Permalink
Use List#isEmpty() in DispatcherServlet
Browse files Browse the repository at this point in the history
This commit uses !isEmpty() instead of size() > 0.

Closes gh-31244
  • Loading branch information
shin-mallang authored and sbrannen committed Sep 16, 2023
1 parent 293e6dd commit 3932f91
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ else if (isEnableLoggingRequestDetails()) {

if (traceOn) {
List<String> values = Collections.list(request.getHeaderNames());
String headers = values.size() > 0 ? "masked" : "";
String headers = values.isEmpty() ? "" : "masked";
if (isEnableLoggingRequestDetails()) {
headers = values.stream().map(name -> name + ":" + Collections.list(request.getHeaders(name)))
.collect(Collectors.joining(", "));
Expand Down

0 comments on commit 3932f91

Please sign in to comment.