Skip to content

Commit cc19a5d

Browse files
authored
replace (#1714)
1 parent 3149205 commit cc19a5d

File tree

9 files changed

+9
-16
lines changed

9 files changed

+9
-16
lines changed

spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigMapsCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.List;
2020
import java.util.concurrent.ConcurrentHashMap;
21-
import java.util.stream.Collectors;
2221

2322
import io.kubernetes.client.openapi.ApiException;
2423
import io.kubernetes.client.openapi.apis.CoreV1Api;
@@ -79,7 +78,7 @@ private static List<StrippedSourceContainer> strippedConfigMaps(List<V1ConfigMap
7978
return configMaps.stream()
8079
.map(configMap -> new StrippedSourceContainer(configMap.getMetadata().getLabels(),
8180
configMap.getMetadata().getName(), configMap.getData()))
82-
.collect(Collectors.toList());
81+
.toList();
8382
}
8483

8584
}

spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientSecretsCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private static List<StrippedSourceContainer> strippedSecrets(List<V1Secret> secr
8080
return secrets.stream()
8181
.map(secret -> new StrippedSourceContainer(secret.getMetadata().getLabels(), secret.getMetadata().getName(),
8282
transform(secret.getData())))
83-
.collect(Collectors.toList());
83+
.toList();
8484
}
8585

8686
private static Map<String, String> transform(Map<String, byte[]> in) {

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapConfigProperties.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121
import java.util.Map;
22-
import java.util.stream.Collectors;
2322
import java.util.stream.Stream;
2423

2524
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -67,7 +66,7 @@ public List<NormalizedSource> determineSources(Environment environment) {
6766
return this.sources.stream()
6867
.flatMap(s -> s.normalize(this.name, this.namespace, this.labels, this.includeProfileSpecificSources,
6968
this.failFast, this.useNameAsPrefix, environment))
70-
.collect(Collectors.toList());
69+
.toList();
7170
}
7271

7372
/**

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsConfigProperties.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121
import java.util.Map;
22-
import java.util.stream.Collectors;
2322
import java.util.stream.Stream;
2423

2524
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -68,7 +67,7 @@ public List<NormalizedSource> determineSources(Environment environment) {
6867
return this.sources.stream()
6968
.flatMap(s -> s.normalize(this.name, this.namespace, this.labels, this.includeProfileSpecificSources,
7069
this.failFast, this.useNameAsPrefix, environment))
71-
.collect(Collectors.toList());
70+
.toList();
7271
}
7372

7473
/**

spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigMapsCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.List;
2020
import java.util.concurrent.ConcurrentHashMap;
21-
import java.util.stream.Collectors;
2221

2322
import io.fabric8.kubernetes.api.model.ConfigMap;
2423
import io.fabric8.kubernetes.client.KubernetesClient;
@@ -70,7 +69,7 @@ private static List<StrippedSourceContainer> strippedConfigMaps(List<ConfigMap>
7069
return configMaps.stream()
7170
.map(configMap -> new StrippedSourceContainer(configMap.getMetadata().getLabels(),
7271
configMap.getMetadata().getName(), configMap.getData()))
73-
.collect(Collectors.toList());
72+
.toList();
7473
}
7574

7675
}

spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8SecretsCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.List;
2020
import java.util.concurrent.ConcurrentHashMap;
21-
import java.util.stream.Collectors;
2221

2322
import io.fabric8.kubernetes.api.model.Secret;
2423
import io.fabric8.kubernetes.client.KubernetesClient;
@@ -70,7 +69,7 @@ private static List<StrippedSourceContainer> strippedSecrets(List<Secret> secret
7069
return secrets.stream()
7170
.map(secret -> new StrippedSourceContainer(secret.getMetadata().getLabels(), secret.getMetadata().getName(),
7271
secret.getData()))
73-
.collect(Collectors.toList());
72+
.toList();
7473
}
7574

7675
}

spring-cloud-kubernetes-fabric8-discovery/src/test/java/org/springframework/cloud/kubernetes/fabric8/discovery/Fabric8KubernetesDiscoveryClientTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.List;
2222
import java.util.Map;
2323
import java.util.Set;
24-
import java.util.stream.Collectors;
2524

2625
import io.fabric8.kubernetes.api.model.Endpoints;
2726
import io.fabric8.kubernetes.api.model.EndpointsBuilder;
@@ -302,7 +301,7 @@ void getEndPointsListShouldHandleNamespaces() {
302301
assertThat(result_endpoints.stream()
303302
.map(Endpoints::getMetadata)
304303
.map(ObjectMeta::getNamespace)
305-
.collect(Collectors.toList())).containsOnly(namespace1, namespace3);
304+
.toList()).containsOnly(namespace1, namespace3);
306305
}
307306

308307
@Test

spring-cloud-kubernetes-fabric8-discovery/src/test/java/org/springframework/cloud/kubernetes/fabric8/discovery/KubernetesCatalogWatchTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.List;
2121
import java.util.Map;
2222
import java.util.Set;
23-
import java.util.stream.Collectors;
2423

2524
import io.fabric8.kubernetes.api.model.EndpointAddress;
2625
import io.fabric8.kubernetes.api.model.EndpointSubset;
@@ -318,7 +317,7 @@ void testEndpointsWithoutTargetRefsAllNamespaces() {
318317
private EndpointsList createEndpointsListByServiceName(String namespace, String... serviceNames) {
319318
List<Endpoints> endpoints = stream(serviceNames)
320319
.map(s -> createEndpointsByPodName(namespace, s + "-singlePodUniqueId"))
321-
.collect(Collectors.toList());
320+
.toList();
322321

323322
EndpointsList endpointsList = new EndpointsList();
324323
endpointsList.setItems(endpoints);

spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/discovery/TestsDiscovery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static void replaceClassloader(List<URL> classpathURLs) {
8686
// /tmp/deps.txt is created by the pipeline
8787
private static List<String> entireClasspath() throws Exception {
8888
try (Stream<String> lines = Files.lines(Paths.get("/tmp/deps.txt"))) {
89-
return lines.distinct().collect(Collectors.toList());
89+
return lines.distinct().toList();
9090
}
9191
}
9292

0 commit comments

Comments
 (0)