Skip to content

Commit

Permalink
replace (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
wind57 authored Sep 9, 2024
1 parent 3149205 commit cc19a5d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.apis.CoreV1Api;
Expand Down Expand Up @@ -79,7 +78,7 @@ private static List<StrippedSourceContainer> strippedConfigMaps(List<V1ConfigMap
return configMaps.stream()
.map(configMap -> new StrippedSourceContainer(configMap.getMetadata().getLabels(),
configMap.getMetadata().getName(), configMap.getData()))
.collect(Collectors.toList());
.toList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static List<StrippedSourceContainer> strippedSecrets(List<V1Secret> secr
return secrets.stream()
.map(secret -> new StrippedSourceContainer(secret.getMetadata().getLabels(), secret.getMetadata().getName(),
transform(secret.getData())))
.collect(Collectors.toList());
.toList();
}

private static Map<String, String> transform(Map<String, byte[]> in) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.client.KubernetesClient;
Expand Down Expand Up @@ -70,7 +69,7 @@ private static List<StrippedSourceContainer> strippedConfigMaps(List<ConfigMap>
return configMaps.stream()
.map(configMap -> new StrippedSourceContainer(configMap.getMetadata().getLabels(),
configMap.getMetadata().getName(), configMap.getData()))
.collect(Collectors.toList());
.toList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.client.KubernetesClient;
Expand Down Expand Up @@ -70,7 +69,7 @@ private static List<StrippedSourceContainer> strippedSecrets(List<Secret> secret
return secrets.stream()
.map(secret -> new StrippedSourceContainer(secret.getMetadata().getLabels(), secret.getMetadata().getName(),
secret.getData()))
.collect(Collectors.toList());
.toList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import io.fabric8.kubernetes.api.model.Endpoints;
import io.fabric8.kubernetes.api.model.EndpointsBuilder;
Expand Down Expand Up @@ -302,7 +301,7 @@ void getEndPointsListShouldHandleNamespaces() {
assertThat(result_endpoints.stream()
.map(Endpoints::getMetadata)
.map(ObjectMeta::getNamespace)
.collect(Collectors.toList())).containsOnly(namespace1, namespace3);
.toList()).containsOnly(namespace1, namespace3);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import io.fabric8.kubernetes.api.model.EndpointAddress;
import io.fabric8.kubernetes.api.model.EndpointSubset;
Expand Down Expand Up @@ -318,7 +317,7 @@ void testEndpointsWithoutTargetRefsAllNamespaces() {
private EndpointsList createEndpointsListByServiceName(String namespace, String... serviceNames) {
List<Endpoints> endpoints = stream(serviceNames)
.map(s -> createEndpointsByPodName(namespace, s + "-singlePodUniqueId"))
.collect(Collectors.toList());
.toList();

EndpointsList endpointsList = new EndpointsList();
endpointsList.setItems(endpoints);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static void replaceClassloader(List<URL> classpathURLs) {
// /tmp/deps.txt is created by the pipeline
private static List<String> entireClasspath() throws Exception {
try (Stream<String> lines = Files.lines(Paths.get("/tmp/deps.txt"))) {
return lines.distinct().collect(Collectors.toList());
return lines.distinct().toList();
}
}

Expand Down

0 comments on commit cc19a5d

Please sign in to comment.