Merge pull request #12553 from igor-suhorukov:master

* pr/12553:
  Polish
pull/12559/head
Stephane Nicoll 7 years ago
commit 40fd8888b2

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -89,7 +89,7 @@ public class BasicErrorController extends AbstractErrorController {
Map<String, Object> body = getErrorAttributes(request,
isIncludeStackTrace(request, MediaType.ALL));
HttpStatus status = getStatus(request);
return new ResponseEntity<Map<String, Object>>(body, status);
return new ResponseEntity<>(body, status);
}
@RequestMapping(produces = "text/html")
@ -111,7 +111,7 @@ public class BasicErrorController extends AbstractErrorController {
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
padding = Math.max(padding, entry.getKey().length());
}
StringBuffer body = new StringBuffer();
StringBuilder body = new StringBuilder();
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
body.append(String.format("%-" + padding + "s : %s%n", entry.getKey(),
entry.getValue()));

Loading…
Cancel
Save