From 9277b470404ce1dce790fa82e684c9d8220940e7 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 11 Feb 2020 16:51:35 +0000 Subject: [PATCH] Polishing: remove use of cast where avoidable --- .../web/server/handler/ExceptionHandlingWebHandler.java | 4 ++-- .../web/server/session/InMemoryWebSessionStore.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/server/handler/ExceptionHandlingWebHandler.java b/spring-web/src/main/java/org/springframework/web/server/handler/ExceptionHandlingWebHandler.java index da53f6a3c07..a1e61e1eea6 100644 --- a/spring-web/src/main/java/org/springframework/web/server/handler/ExceptionHandlingWebHandler.java +++ b/spring-web/src/main/java/org/springframework/web/server/handler/ExceptionHandlingWebHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -95,7 +95,7 @@ public class ExceptionHandlingWebHandler extends WebHandlerDecorator { String query = StringUtils.hasText(rawQuery) ? "?" + rawQuery : ""; HttpMethod httpMethod = request.getMethod(); String description = "HTTP " + httpMethod + " \"" + request.getPath() + query + "\""; - return Mono.error(ex).checkpoint(description + " [ExceptionHandlingWebHandler]").cast(Void.class); + return Mono.error(ex).checkpoint(description + " [ExceptionHandlingWebHandler]"); } } diff --git a/spring-web/src/main/java/org/springframework/web/server/session/InMemoryWebSessionStore.java b/spring-web/src/main/java/org/springframework/web/server/session/InMemoryWebSessionStore.java index 09eb47560e0..825fddbdc57 100644 --- a/spring-web/src/main/java/org/springframework/web/server/session/InMemoryWebSessionStore.java +++ b/spring-web/src/main/java/org/springframework/web/server/session/InMemoryWebSessionStore.java @@ -117,9 +117,8 @@ public class InMemoryWebSessionStore implements WebSessionStore { Instant now = this.clock.instant(); this.expiredSessionChecker.checkIfNecessary(now); - return Mono.fromSupplier(() -> new InMemoryWebSession(now)) - .subscribeOn(Schedulers.boundedElastic()) - .cast(WebSession.class); + return Mono.fromSupplier(() -> new InMemoryWebSession(now)) + .subscribeOn(Schedulers.boundedElastic()); } @Override