Skip to content

Commit

Permalink
Use upper bounded wildcard to read and delete cookie in OAuthWebUiCookie
Browse files Browse the repository at this point in the history
  • Loading branch information
krvikash committed Sep 24, 2024
1 parent 870c0bb commit 60225b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public NewCookie[] create(String token, Instant tokenExpiration, boolean isSecur
return cookiesToSet.build().toArray(new NewCookie[0]);
}

public Optional<String> read(Map<String, Cookie> existingCookies)
public Optional<String> read(Map<String, ? extends Cookie> existingCookies)
{
long cookiesCount = existingCookies.values().stream()
.filter(this::matchesName)
Expand All @@ -85,7 +85,7 @@ public Optional<String> read(Map<String, Cookie> existingCookies)
return Optional.of(token.toString());
}

public NewCookie[] delete(Map<String, Cookie> existingCookies, boolean isSecured)
public NewCookie[] delete(Map<String, ? extends Cookie> existingCookies, boolean isSecured)
{
ImmutableSet.Builder<NewCookie> cookiesToDelete = ImmutableSet.builder();
cookiesToDelete.add(deleteCookie(cookieName, isSecured)); // Always invalidate first cookie even if it doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public static NewCookie[] create(String token, Instant tokenExpiration)
return MULTIPART_COOKIE.create(token, tokenExpiration, true);
}

public static Optional<String> read(Map<String, Cookie> availableCookies)
public static Optional<String> read(Map<String, ? extends Cookie> availableCookies)
{
return MULTIPART_COOKIE.read(availableCookies);
}

public static NewCookie[] delete(Map<String, Cookie> availableCookies)
public static NewCookie[] delete(Map<String, ? extends Cookie> availableCookies)
{
return MULTIPART_COOKIE.delete(availableCookies, true);
}
Expand Down

0 comments on commit 60225b1

Please sign in to comment.