Skip to content

Commit

Permalink
sync: dropbox: Cleanup nullable analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jefftharris committed Jul 14, 2024
1 parent 4c14e82 commit 8699463
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,9 @@ protected TokenRevokeTask(DropboxCoreProvider provider)
itsProvider = new ManagedRef<>(provider);
}

@Nullable
@Override
protected Void doInBackground(DbxClientV2... clients)
protected Void doInBackground(@NonNull DbxClientV2... clients)
{
PasswdSafeUtil.dbginfo(TAG, "revoking auth tokens");
for (DbxClientV2 client: clients) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (©) 2017 Jeff Harris <[email protected]>
* Copyright (©) 2017-2024 Jeff Harris <[email protected]>
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
Expand All @@ -9,6 +9,9 @@

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.dropbox.core.DbxException;
import com.dropbox.core.v2.DbxClientV2;
import com.dropbox.core.v2.files.FileMetadata;
Expand Down Expand Up @@ -47,7 +50,8 @@ public DropboxCoreSyncer(DbxClientV2 client,
}

/** Create a remote identifier from the local name of a file */
public static String createRemoteIdFromLocal(DbFile dbfile)
@NonNull
public static String createRemoteIdFromLocal(@NonNull DbFile dbfile)
{
return ProviderRemoteFile.PATH_SEPARATOR +
dbfile.itsLocalTitle.toLowerCase();
Expand All @@ -56,15 +60,17 @@ public static String createRemoteIdFromLocal(DbFile dbfile)
/**
* Get the account display name
*/
public static String getDisplayName(DbxClientV2 client) throws DbxException
@NonNull
public static String getDisplayName(@NonNull DbxClientV2 client)
throws DbxException
{
FullAccount acct = client.users().getCurrentAccount();
return acct.getName().getDisplayName();
}


@Override
protected SyncRemoteFiles getSyncRemoteFiles(List<DbFile> dbfiles)
protected SyncRemoteFiles getSyncRemoteFiles(@NonNull List<DbFile> dbfiles)
throws DbxException
{
SyncRemoteFiles files = new SyncRemoteFiles();
Expand Down Expand Up @@ -134,6 +140,7 @@ protected SyncRemoteFiles getSyncRemoteFiles(List<DbFile> dbfiles)
* @return The file's FileMetadata if found; null or DeletedMetadata if
* not found
*/
@Nullable
private Metadata getRemoteFile(String remoteId)
throws DbxException
{
Expand Down

0 comments on commit 8699463

Please sign in to comment.