Skip to content

Commit 0efeea6

Browse files
committed
Add more nullability annotations to module/spring-boot-web-server
See gh-46587
1 parent 526b9d0 commit 0efeea6

File tree

1 file changed

+5
-1
lines changed
  • module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server

1 file changed

+5
-1
lines changed

module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Ssl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,12 @@ public enum ClientAuth {
457457
* @return the mapped value
458458
* @since 3.1.0
459459
*/
460+
@Contract("_, !null, _, _ -> !null")
460461
public static <R> @Nullable R map(@Nullable ClientAuth clientAuth, @Nullable R none, R want, R need) {
461-
return switch ((clientAuth != null) ? clientAuth : NONE) {
462+
if (clientAuth == null) {
463+
return none;
464+
}
465+
return switch (clientAuth) {
462466
case NONE -> none;
463467
case WANT -> want;
464468
case NEED -> need;

0 commit comments

Comments
 (0)