Commit 40fd8888 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #12553 from igor-suhorukov:master

* pr/12553:
  Polish
parents a902caa7 21628a9a
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -89,7 +89,7 @@ public class BasicErrorController extends AbstractErrorController { ...@@ -89,7 +89,7 @@ public class BasicErrorController extends AbstractErrorController {
Map<String, Object> body = getErrorAttributes(request, Map<String, Object> body = getErrorAttributes(request,
isIncludeStackTrace(request, MediaType.ALL)); isIncludeStackTrace(request, MediaType.ALL));
HttpStatus status = getStatus(request); HttpStatus status = getStatus(request);
return new ResponseEntity<Map<String, Object>>(body, status); return new ResponseEntity<>(body, status);
} }
@RequestMapping(produces = "text/html") @RequestMapping(produces = "text/html")
...@@ -111,7 +111,7 @@ public class BasicErrorController extends AbstractErrorController { ...@@ -111,7 +111,7 @@ public class BasicErrorController extends AbstractErrorController {
for (Map.Entry<String, Object> entry : attributes.entrySet()) { for (Map.Entry<String, Object> entry : attributes.entrySet()) {
padding = Math.max(padding, entry.getKey().length()); padding = Math.max(padding, entry.getKey().length());
} }
StringBuffer body = new StringBuffer(); StringBuilder body = new StringBuilder();
for (Map.Entry<String, Object> entry : attributes.entrySet()) { for (Map.Entry<String, Object> entry : attributes.entrySet()) {
body.append(String.format("%-" + padding + "s : %s%n", entry.getKey(), body.append(String.format("%-" + padding + "s : %s%n", entry.getKey(),
entry.getValue())); entry.getValue()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment