diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java index 58a7d0a91e..bb427cf0c0 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java @@ -347,9 +347,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker Object key = generateKey(context, CacheOperationExpressionEvaluator.NO_RESULT); Cache cache = context.getCaches().iterator().next(); try { - return wrapCacheValue(method, cache.get(key, () -> { - return unwrapReturnValue(invokeOperation(invoker)); - })); + return wrapCacheValue(method, cache.get(key, () -> unwrapReturnValue(invokeOperation(invoker)))); } catch (Cache.ValueRetrievalException ex) { // The invoker wraps any Throwable in a ThrowableWrapper instance so we diff --git a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java index 02397ef761..9d7ca04612 100644 --- a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java +++ b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java @@ -653,16 +653,12 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override public void convertAndSend(Destination destination, final Object message) throws JmsException { - send(destination, session -> { - return getRequiredMessageConverter().toMessage(message, session); - }); + send(destination, session -> getRequiredMessageConverter().toMessage(message, session)); } @Override public void convertAndSend(String destinationName, final Object message) throws JmsException { - send(destinationName, session -> { - return getRequiredMessageConverter().toMessage(message, session); - }); + send(destinationName, session -> getRequiredMessageConverter().toMessage(message, session)); } @Override @@ -742,9 +738,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable public Message receiveSelected(final Destination destination, @Nullable final String messageSelector) throws JmsException { - return execute(session -> { - return doReceive(session, destination, messageSelector); - }, true); + return execute(session -> doReceive(session, destination, messageSelector), true); } @Override diff --git a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java index 465d968d42..e8e1cbf5e8 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java +++ b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java @@ -110,9 +110,7 @@ public class XmlEventDecoder extends AbstractDecoder { InputStream is = dataBuffer.asInputStream(); Iterator eventReader = inputFactory.createXMLEventReader(is); return Flux.fromIterable((Iterable) () -> eventReader) - .doFinally(t -> { - DataBufferUtils.release(dataBuffer); - }); + .doFinally(t -> DataBufferUtils.release(dataBuffer)); } catch (XMLStreamException ex) { return Mono.error(ex); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFilterFunctions.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFilterFunctions.java index 933599348c..0806c1ba07 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFilterFunctions.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFilterFunctions.java @@ -91,10 +91,8 @@ public abstract class ExchangeFilterFunctions { clientRequest -> credentialsFunction.apply(clientRequest).map( credentials -> { ClientRequest authorizedRequest = ClientRequest.from(clientRequest) - .headers(headers -> { - headers.set(HttpHeaders.AUTHORIZATION, - authorization(credentials)); - }) + .headers(headers -> headers.set(HttpHeaders.AUTHORIZATION, + authorization(credentials))) .build(); return Mono.just(authorizedRequest); }) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/RouterFunctionMapping.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/RouterFunctionMapping.java index ef59f7f301..cdb3c8b1f0 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/RouterFunctionMapping.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/RouterFunctionMapping.java @@ -114,9 +114,7 @@ public class RouterFunctionMapping extends AbstractHandlerMapping implements Ini List> routerFunctions = routerFunctions(); if (!CollectionUtils.isEmpty(routerFunctions) && logger.isInfoEnabled()) { - routerFunctions.forEach(routerFunction -> { - logger.info("Mapped " + routerFunction); - }); + routerFunctions.forEach(routerFunction -> logger.info("Mapped " + routerFunction)); } this.routerFunction = routerFunctions.stream() .reduce(RouterFunction::andOther)