This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git
commit 6ad8f8d0933c4036588323fbc9d419686b1cf3c2 Author: Martin Tzvetanov Grigorov <[email protected]> AuthorDate: Tue Jun 25 23:52:19 2019 +0300 WICKET-6678 Instant : Unsupported field: YearOfEra when cookieUtils.cookieToDebugString() is called Create a LocalDate out of the max-age millis and print it in the debug message. --- .../src/main/java/org/apache/wicket/util/cookies/CookieUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java index a7acecb..df94380 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java @@ -17,6 +17,9 @@ package org.apache.wicket.util.cookies; import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneId; + import javax.servlet.http.Cookie; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.protocol.http.WebApplication; @@ -26,7 +29,6 @@ import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.util.string.Strings; -import org.apache.wicket.util.time.Instants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -368,9 +370,9 @@ public class CookieUtils */ private String cookieToDebugString(final Cookie cookie) { + final LocalDate localDate = Instant.ofEpochMilli(cookie.getMaxAge()).atZone(ZoneId.systemDefault()).toLocalDate(); return "[Cookie " + " name = " + cookie.getName() + ", value = " + cookie.getValue() + ", domain = " + cookie.getDomain() + ", path = " + cookie.getPath() + ", maxAge = " + - Instants.localDateFormatter.format(Instant.ofEpochMilli(cookie.getMaxAge())) + - "(" + cookie.getMaxAge() + ")" + "]"; + localDate + "(" + cookie.getMaxAge() + ")" + "]"; } }
