Replace Collections.unmodifiableList(new ArrayList(..)) with List.copyOf() (#30166)
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.messaging.handler.annotation.reactive;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -93,7 +92,7 @@ public class PayloadMethodArgumentResolver implements HandlerMethodArgumentResol
|
||||
@Nullable ReactiveAdapterRegistry registry, boolean useDefaultResolution) {
|
||||
|
||||
Assert.isTrue(!CollectionUtils.isEmpty(decoders), "At least one Decoder is required");
|
||||
this.decoders = Collections.unmodifiableList(new ArrayList<>(decoders));
|
||||
this.decoders = List.copyOf(decoders);
|
||||
this.validator = validator;
|
||||
this.adapterRegistry = registry != null ? registry : ReactiveAdapterRegistry.getSharedInstance();
|
||||
this.useDefaultResolution = useDefaultResolution;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.messaging.rsocket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -73,7 +72,7 @@ public class DefaultMetadataExtractor implements MetadataExtractor, MetadataExtr
|
||||
* Constructor with list of decoders for de-serializing metadata entries.
|
||||
*/
|
||||
public DefaultMetadataExtractor(List<Decoder<?>> decoders) {
|
||||
this.decoders = Collections.unmodifiableList(new ArrayList<>(decoders));
|
||||
this.decoders = List.copyOf(decoders);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user