Skip to content

Commit 4903fee

Browse files
committed
Permit @⁠Nullable value in ResponseCookie from*() factory methods
Closes gh-35377
1 parent 6978f0a commit 4903fee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-web/src/main/java/org/springframework/http/ResponseCookie.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public String toString() {
211211
* @return a builder to create the cookie with
212212
* @since 6.0
213213
*/
214-
public static ResponseCookieBuilder from(final String name) {
214+
public static ResponseCookieBuilder from(String name) {
215215
return new DefaultResponseCookieBuilder(name, null, false);
216216
}
217217

@@ -222,7 +222,7 @@ public static ResponseCookieBuilder from(final String name) {
222222
* @param value the cookie value
223223
* @return a builder to create the cookie with
224224
*/
225-
public static ResponseCookieBuilder from(final String name, final String value) {
225+
public static ResponseCookieBuilder from(String name, @Nullable String value) {
226226
return new DefaultResponseCookieBuilder(name, value, false);
227227
}
228228

@@ -236,7 +236,7 @@ public static ResponseCookieBuilder from(final String name, final String value)
236236
* @return a builder to create the cookie with
237237
* @since 5.2.5
238238
*/
239-
public static ResponseCookieBuilder fromClientResponse(final String name, final String value) {
239+
public static ResponseCookieBuilder fromClientResponse(String name, @Nullable String value) {
240240
return new DefaultResponseCookieBuilder(name, value, true);
241241
}
242242

@@ -425,7 +425,7 @@ private static class DefaultResponseCookieBuilder implements ResponseCookieBuild
425425
@Nullable
426426
private String sameSite;
427427

428-
public DefaultResponseCookieBuilder(String name, @Nullable String value, boolean lenient) {
428+
DefaultResponseCookieBuilder(String name, @Nullable String value, boolean lenient) {
429429
this.name = name;
430430
this.value = value;
431431
this.lenient = lenient;

0 commit comments

Comments
 (0)