Skip to content

Commit d1d9538

Browse files
lock14philwebb
authored andcommitted
Allow other "timestamp" types in MVC error model
Remove casting "timestamp" to `java.util.Date` in `ErrorMvcAutoConfiguration` as the cast is not necessary and it prevents other types (e.g. `java.time`) from being used. See gh-23256
1 parent 775f0fa commit d1d9538

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public void render(Map<String, ?> model, HttpServletRequest request, HttpServlet
206206
}
207207
response.setContentType(TEXT_HTML_UTF8.toString());
208208
StringBuilder builder = new StringBuilder();
209-
Date timestamp = (Date) model.get("timestamp");
209+
Object timestamp = model.get("timestamp");
210210
Object message = model.get("message");
211211
Object trace = model.get("trace");
212212
if (response.getContentType() == null) {

0 commit comments

Comments
 (0)