You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/05/19 14:53:00 UTC

[camel] branch main updated (373c37bbd51 -> a2a5b908ab0)

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from 373c37bbd51 Regen for commit da9a2e5443ffc706fc40e16138a096f0b9b1699b (#10159)
     new 65aa26065fe (chores) camel-consul: use unmodifiable list when possible
     new a2a5b908ab0 (chores) camel-azure-storage-blob: use unmodifiable list when possible

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../azure/storage/blob/client/BlobContainerClientWrapper.java        | 3 +--
 .../azure/storage/blob/operations/BlobChangeFeedOperations.java      | 5 ++---
 .../component/azure/storage/blob/operations/BlobOperations.java      | 3 +--
 .../apache/camel/component/consul/cloud/ConsulServiceDiscovery.java  | 3 +--
 .../apache/camel/component/consul/cloud/ConsulServiceRegistry.java   | 3 +--
 5 files changed, 6 insertions(+), 11 deletions(-)


[camel] 01/02: (chores) camel-consul: use unmodifiable list when possible

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 65aa26065fe028d47e8d12f15c849b5a58344ae0
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri May 19 14:53:26 2023 +0200

    (chores) camel-consul: use unmodifiable list when possible
---
 .../apache/camel/component/consul/cloud/ConsulServiceDiscovery.java    | 3 +--
 .../org/apache/camel/component/consul/cloud/ConsulServiceRegistry.java | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscovery.java b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscovery.java
index eb3a59c8a01..1df61585534 100644
--- a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscovery.java
+++ b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscovery.java
@@ -21,7 +21,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Supplier;
-import java.util.stream.Collectors;
 
 import com.orbitz.consul.Consul;
 import com.orbitz.consul.model.catalog.CatalogService;
@@ -64,7 +63,7 @@ public final class ConsulServiceDiscovery extends DefaultServiceDiscovery {
             List<CatalogService> services = client.get().catalogClient().getService(name, queryOptions).getResponse();
             List<ServiceHealth> healths = client.get().healthClient().getAllServiceInstances(name, queryOptions).getResponse();
 
-            return services.stream().map(service -> newService(name, service, healths)).collect(Collectors.toList());
+            return services.stream().map(service -> newService(name, service, healths)).toList();
         } catch (Exception e) {
             LOGGER.warn("Error getting '{}' services from consul.", name, e);
             return Collections.emptyList();
diff --git a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistry.java b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistry.java
index 7ac3b3fda04..1f939ce4920 100644
--- a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistry.java
+++ b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistry.java
@@ -23,7 +23,6 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
 
 import com.orbitz.consul.Consul;
 import com.orbitz.consul.NotRegisteredException;
@@ -247,7 +246,7 @@ public class ConsulServiceRegistry extends AbstractServiceRegistry {
                 .port(definition.getPort()).name(definition.getName())
                 .id(definition.getId()).check(computeCheck(definition))
                 .tags(definition.getMetadata().entrySet().stream().filter(e -> e.getValue() != null)
-                        .map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.toList()))
+                        .map(e -> e.getKey() + "=" + e.getValue()).toList())
                 .addTags("_consul.service.registry.id=" + getId()).build();
 
         // perform service registration against consul


[camel] 02/02: (chores) camel-azure-storage-blob: use unmodifiable list when possible

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a2a5b908ab08305e871fdb4f5b3a44baa81291a4
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri May 19 14:53:45 2023 +0200

    (chores) camel-azure-storage-blob: use unmodifiable list when possible
---
 .../azure/storage/blob/client/BlobContainerClientWrapper.java        | 3 +--
 .../azure/storage/blob/operations/BlobChangeFeedOperations.java      | 5 ++---
 .../component/azure/storage/blob/operations/BlobOperations.java      | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/client/BlobContainerClientWrapper.java b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/client/BlobContainerClientWrapper.java
index 6047d68acd2..88455ab47ec 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/client/BlobContainerClientWrapper.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/client/BlobContainerClientWrapper.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.azure.storage.blob.client;
 import java.time.Duration;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import com.azure.core.http.HttpHeaders;
 import com.azure.core.util.Context;
@@ -48,7 +47,7 @@ public class BlobContainerClientWrapper {
     }
 
     public List<BlobItem> listBlobs(final ListBlobsOptions listBlobsOptions, final Duration timeout) {
-        return client.listBlobs(listBlobsOptions, timeout).stream().collect(Collectors.toList());
+        return client.listBlobs(listBlobsOptions, timeout).stream().toList();
     }
 
     public BlobClientWrapper getBlobClientWrapper(final String blobName) {
diff --git a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobChangeFeedOperations.java b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobChangeFeedOperations.java
index 56591429297..5930ae809e7 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobChangeFeedOperations.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobChangeFeedOperations.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.azure.storage.blob.operations;
 
 import java.time.OffsetDateTime;
 import java.util.List;
-import java.util.stream.Collectors;
 
 import com.azure.core.util.Context;
 import com.azure.storage.blob.changefeed.BlobChangefeedClient;
@@ -52,13 +51,13 @@ public class BlobChangeFeedOperations {
     }
 
     private List<BlobChangefeedEvent> getEvents() {
-        return client.getEvents().stream().collect(Collectors.toList());
+        return client.getEvents().stream().toList();
     }
 
     private List<BlobChangefeedEvent> getEvents(
             final OffsetDateTime startTime, final OffsetDateTime endTime, final Context context) {
 
-        return client.getEvents(startTime, endTime, context).stream().collect(Collectors.toList());
+        return client.getEvents(startTime, endTime, context).stream().toList();
     }
 
 }
diff --git a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java
index f8e911b0761..55d05fd9641 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java
@@ -26,7 +26,6 @@ import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import com.azure.core.http.rest.PagedIterable;
 import com.azure.core.http.rest.Response;
@@ -263,7 +262,7 @@ public class BlobOperations {
 
         final List<String> blockIds = blockEntries.stream()
                 .map(Block::getName)
-                .collect(Collectors.toList());
+                .toList();
 
         final Response<BlockBlobItem> response = client.commitBlockBlob(blockIds, commonRequestOptions.getBlobHttpHeaders(),
                 commonRequestOptions.getMetadata(),