diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java index 0cd614f36c..590c2152f5 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java @@ -106,8 +106,7 @@ public class InjectionMetadata { * @since 6.0.10 */ public Collection getInjectedElements(@Nullable PropertyValues pvs) { - return this.injectedElements.stream() - .filter(candidate -> candidate.shouldInject(pvs)).toList(); + return this.injectedElements.stream().filter(candidate -> candidate.shouldInject(pvs)).toList(); } /** @@ -117,7 +116,7 @@ public class InjectionMetadata { * @since 5.2.4 */ protected boolean needsRefresh(Class clazz) { - return this.targetClass != clazz; + return (this.targetClass != clazz); } public void checkConfigMembers(RootBeanDefinition beanDefinition) { diff --git a/spring-core/src/main/java/org/springframework/core/serializer/DefaultDeserializer.java b/spring-core/src/main/java/org/springframework/core/serializer/DefaultDeserializer.java index ddc87f3133..07bf246b05 100644 --- a/spring-core/src/main/java/org/springframework/core/serializer/DefaultDeserializer.java +++ b/spring-core/src/main/java/org/springframework/core/serializer/DefaultDeserializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 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. @@ -50,6 +50,7 @@ public class DefaultDeserializer implements Deserializer { /** * Create a {@code DefaultDeserializer} for using an {@link ObjectInputStream} * with the given {@code ClassLoader}. + * @param classLoader the ClassLoader to use * @since 4.2.1 * @see ConfigurableObjectInputStream#ConfigurableObjectInputStream(InputStream, ClassLoader) */ diff --git a/spring-core/src/main/java/org/springframework/core/serializer/support/DeserializingConverter.java b/spring-core/src/main/java/org/springframework/core/serializer/support/DeserializingConverter.java index 7412907159..782ddc901b 100644 --- a/spring-core/src/main/java/org/springframework/core/serializer/support/DeserializingConverter.java +++ b/spring-core/src/main/java/org/springframework/core/serializer/support/DeserializingConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2023 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. @@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream; import org.springframework.core.convert.converter.Converter; import org.springframework.core.serializer.DefaultDeserializer; import org.springframework.core.serializer.Deserializer; +import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -50,10 +51,11 @@ public class DeserializingConverter implements Converter { /** * Create a {@code DeserializingConverter} for using an {@link java.io.ObjectInputStream} * with the given {@code ClassLoader}. + * @param classLoader the ClassLoader to use * @since 4.2.1 * @see DefaultDeserializer#DefaultDeserializer(ClassLoader) */ - public DeserializingConverter(ClassLoader classLoader) { + public DeserializingConverter(@Nullable ClassLoader classLoader) { this.deserializer = new DefaultDeserializer(classLoader); } diff --git a/spring-web/src/main/java/org/springframework/web/server/ServerWebExchange.java b/spring-web/src/main/java/org/springframework/web/server/ServerWebExchange.java index c1f758c7e7..56c5cef3a6 100644 --- a/spring-web/src/main/java/org/springframework/web/server/ServerWebExchange.java +++ b/spring-web/src/main/java/org/springframework/web/server/ServerWebExchange.java @@ -148,11 +148,10 @@ public interface ServerWebExchange { */ default Mono cleanupMultipart() { return getMultipartData() - .onErrorResume(t -> Mono.empty()) // ignore errors reading multipart data + .onErrorResume(t -> Mono.empty()) // ignore errors reading multipart data .flatMapIterable(Map::values) .flatMapIterable(Function.identity()) - .flatMap(part -> part.delete() - .onErrorResume(ex -> Mono.empty())) + .flatMap(part -> part.delete().onErrorResume(ex -> Mono.empty())) .then(); }