Use toUnmodifiableSet and toList instead of collectingAndThen
Since Spring Framework 6 uses JDK 17 for its baseline, we can make use of toList() and toUnmodifiableSet() which were introduced in JDK 16 and JDK 10, respectively. Closes gh-27618
This commit is contained in:
committed by
Sam Brannen
parent
5ea1cf532e
commit
8dd385b440
@@ -146,7 +146,7 @@ public abstract class YamlProcessor {
|
||||
else {
|
||||
Assert.noNullElements(supportedTypes, "'supportedTypes' must not contain null elements");
|
||||
this.supportedTypes = Arrays.stream(supportedTypes).map(Class::getName)
|
||||
.collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
|
||||
.collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user