From 6ffb74def366bf3f836bed301c683b2950c48cfc Mon Sep 17 00:00:00 2001 From: jee14 <3aroa2@gmail.com> Date: Tue, 30 Jan 2024 16:32:41 +0900 Subject: [PATCH 1/2] Wrap ternary operator within parantheses See gh-32157 --- .../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 e0b69e0e87..177633b008 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 final class ResponseCookie extends HttpCookie { 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) { From 298f308ce1f723ecacf7ad1f3f4230c8670a5de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 30 Jan 2024 15:59:06 +0100 Subject: [PATCH 2/2] Upgrade copyright year of changed file See gh-32157 --- .../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 177633b008..cbe65d1b89 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 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.