diff options
author | Stefan Niedermann <info@niedermann.it> | 2021-03-28 23:39:28 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2021-03-28 23:39:28 +0300 |
commit | f63e5f31c0e6cb6282db76f4fc8c554dc13e9778 (patch) | |
tree | b36ba4db85f373cdd34f1364b3bbbd635751ea42 /app/src/main/java | |
parent | bc5bddc0d25a07ed0748612a6d0969aa8da1530f (diff) |
Minor stuff
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java')
2 files changed, 12 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java index 8e8104692..155ca9fde 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java @@ -1,5 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +import androidx.annotation.Nullable; + import java.time.Instant; import java.util.ArrayList; import java.util.List; @@ -13,11 +15,12 @@ import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; public abstract class AbstractSyncDataProvider<T extends IRemoteEntity> { + @Nullable protected AbstractSyncDataProvider<?> parent; - private List<AbstractSyncDataProvider<?>> children = new ArrayList<>(); + private final List<AbstractSyncDataProvider<?>> children = new ArrayList<>(); private boolean stillGoingDeeper = false; - public AbstractSyncDataProvider(AbstractSyncDataProvider<?> parent) { + public AbstractSyncDataProvider(@Nullable AbstractSyncDataProvider<?> parent) { this.parent = parent; } @@ -68,6 +71,7 @@ public abstract class AbstractSyncDataProvider<T extends IRemoteEntity> { children.add(child); } + @SuppressWarnings("UnnecessaryReturnStatement") public void getAllFromServer(ServerAdapter serverAdapter, long accountId, IResponseCallback<List<T>> responder, Instant lastSync) { return; } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java index 6f908af1a..322643d79 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java @@ -1,5 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +import androidx.annotation.Nullable; + import java.time.Instant; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -19,10 +21,10 @@ import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.AsyncUtil; public class AccessControlDataProvider extends AbstractSyncDataProvider<AccessControl> { private static final Long TYPE_GROUP = 1L; - private List<AccessControl> acl; - private FullBoard board; + private final List<AccessControl> acl; + private final FullBoard board; - public AccessControlDataProvider(AbstractSyncDataProvider<?> parent, FullBoard board, List<AccessControl> acl) { + public AccessControlDataProvider(@Nullable AbstractSyncDataProvider<?> parent, FullBoard board, List<AccessControl> acl) { super(parent); this.board = board; this.acl = acl; @@ -32,7 +34,7 @@ public class AccessControlDataProvider extends AbstractSyncDataProvider<AccessCo public void getAllFromServer(ServerAdapter serverAdapter, DataBaseAdapter dataBaseAdapter, long accountId, IResponseCallback<List<AccessControl>> responder, Instant lastSync) { AsyncUtil.awaitAsyncWork(acl.size(), latch -> { for (AccessControl accessControl : acl) { - if (accessControl.getType() == TYPE_GROUP) { + if (TYPE_GROUP.equals(accessControl.getType())) { serverAdapter.searchGroupMembers(accessControl.getUser().getUid(), new IResponseCallback<GroupMemberUIDs>(responder.getAccount()) { @Override public void onResponse(GroupMemberUIDs response) { |