From 505ae2808fddeabf55a942b29eb0555bb8df04a3 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Fri, 19 Apr 2024 12:56:05 +0200 Subject: [PATCH] Use set. --- .../core/nextcloud/NextcloudShareFeature.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nextcloud/src/main/java/ch/cyberduck/core/nextcloud/NextcloudShareFeature.java b/nextcloud/src/main/java/ch/cyberduck/core/nextcloud/NextcloudShareFeature.java index 56bc3694931..7d0c422edb1 100644 --- a/nextcloud/src/main/java/ch/cyberduck/core/nextcloud/NextcloudShareFeature.java +++ b/nextcloud/src/main/java/ch/cyberduck/core/nextcloud/NextcloudShareFeature.java @@ -51,10 +51,9 @@ import java.io.IOException; import java.net.URI; import java.text.MessageFormat; -import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.List; import java.util.Set; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -109,14 +108,14 @@ public Set getSharees(final Type type) throws BackgroundException { Collections.singletonList(Sharee.world) ); try { - sharees.addAll(session.getClient().execute(resource, new OcsResponseHandler>() { + sharees.addAll(session.getClient().execute(resource, new OcsResponseHandler>() { @Override - public List handleEntity(final HttpEntity entity) throws IOException { + public Set handleEntity(final HttpEntity entity) throws IOException { final XmlMapper mapper = new XmlMapper(); final ocs value = mapper.readValue(entity.getContent(), ocs.class); if(value.data != null) { if(value.data.users != null) { - final List sharees = new ArrayList<>(); + final Set sharees = new HashSet<>(); for(ocs.user user : value.data.users) { final String id = user.value.shareWith; final String label = String.format("%s (%s)", user.label, user.shareWithDisplayNameUnique); @@ -125,7 +124,7 @@ public List handleEntity(final HttpEntity entity) throws IOException { return sharees; } } - return Collections.emptyList(); + return Collections.emptySet(); } } ));