From a34ac5faa1cc225cd170ae0955d49f2c0e09cbcd Mon Sep 17 00:00:00 2001 From: jee14 <3aroa2@gmail.com> Date: Tue, 30 Jan 2024 16:32:41 +0900 Subject: [PATCH] Allow code style for ResponseCookie - Wrap the ternary operator within parentheses --- .../src/main/java/org/springframework/http/ResponseCookie.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java index e0b69e0e8736..177633b00847 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java @@ -171,7 +171,7 @@ public String toString() { if (!this.maxAge.isNegative()) { sb.append("; Max-Age=").append(this.maxAge.getSeconds()); sb.append("; Expires="); - long millis = this.maxAge.getSeconds() > 0 ? System.currentTimeMillis() + this.maxAge.toMillis() : 0; + long millis = (this.maxAge.getSeconds() > 0 ? System.currentTimeMillis() + this.maxAge.toMillis() : 0); sb.append(HttpHeaders.formatDate(millis)); } if (this.secure) {