From 2f9c5e9761b1a2d279dd548ac6de007a96ffd018 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 3 Dec 2019 13:31:02 +0100 Subject: [PATCH] replace org.jetbrains.annotations with androidx.annotations Signed-off-by: tobiasKaminsky --- build.gradle | 3 +-- .../client/account/UserAccountManagerImpl.java | 4 +--- .../android/datamodel/FileDataStorageManager.java | 4 +--- .../android/datamodel/ThumbnailsCacheManager.java | 4 ++-- .../owncloud/android/files/services/FileUploader.java | 10 ++++------ .../com/owncloud/android/jobs/AccountRemovalJob.java | 5 ++--- .../owncloud/android/ui/dialog/SendShareDialog.java | 4 +--- .../owncloud/android/ui/fragment/PhotoFragment.java | 4 +--- .../fragment/contactsbackup/ContactListFragment.java | 3 +-- .../contactsbackup/ContactsBackupFragment.java | 7 ++----- 10 files changed, 16 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index cf6cfd1fe0..7cf35a4769 100644 --- a/build.gradle +++ b/build.gradle @@ -283,7 +283,7 @@ dependencies { implementation "androidx.work:work-runtime:2.2.0" implementation "androidx.work:work-runtime-ktx:2.2.0" implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7 - implementation 'com.google.code.findbugs:annotations:2.0.1' + compileOnly 'com.google.code.findbugs:annotations:2.0.1' implementation 'commons-io:commons-io:2.6' implementation 'com.github.tobiaskaminsky:android-job:v1.2.6.1' // 'com.github.evernote:android-job:v1.2.5' implementation 'com.jakewharton:butterknife:10.2.0' @@ -306,7 +306,6 @@ dependencies { implementation 'com.caverock:androidsvg:1.4' implementation 'androidx.annotation:annotation:1.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.jetbrains:annotations:18.0.0' implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.5.1' diff --git a/src/main/java/com/nextcloud/client/account/UserAccountManagerImpl.java b/src/main/java/com/nextcloud/client/account/UserAccountManagerImpl.java index 4ea8246872..40cee2631f 100644 --- a/src/main/java/com/nextcloud/client/account/UserAccountManagerImpl.java +++ b/src/main/java/com/nextcloud/client/account/UserAccountManagerImpl.java @@ -42,8 +42,6 @@ import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation; -import org.jetbrains.annotations.NotNull; - import java.net.URI; import java.util.ArrayList; import java.util.List; @@ -216,7 +214,7 @@ public class UserAccountManagerImpl implements UserAccountManager { * * @return User instance */ - @NotNull + @NonNull @Override public User getUser() { Account account = getCurrentAccount(); diff --git a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java index 28bd0e5411..ad7fbb6e56 100644 --- a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -54,8 +54,6 @@ import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.MimeType; import com.owncloud.android.utils.MimeTypeUtil; -import org.jetbrains.annotations.NotNull; - import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -1970,7 +1968,7 @@ public class FileDataStorageManager { return capability; } - @NotNull + @NonNull private ContentValues createContentValues(String accountName, OCCapability capability) { ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.CAPABILITIES_ACCOUNT_NAME, accountName); diff --git a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index 42651884a5..5db9a29605 100644 --- a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -66,7 +66,6 @@ import com.owncloud.android.utils.MimeTypeUtil; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.GetMethod; -import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.FileNotFoundException; @@ -76,6 +75,7 @@ import java.net.URLEncoder; import java.util.List; import java.util.Locale; +import androidx.annotation.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** @@ -868,7 +868,7 @@ public final class ThumbnailsCacheManager { return Math.round(r.getDimension(R.dimen.file_avatar_size)); } - private @NotNull + private @NonNull Drawable doAvatarInBackground() { Bitmap avatar; diff --git a/src/main/java/com/owncloud/android/files/services/FileUploader.java b/src/main/java/com/owncloud/android/files/services/FileUploader.java index 9b987d34a4..81cdb81ed3 100644 --- a/src/main/java/com/owncloud/android/files/services/FileUploader.java +++ b/src/main/java/com/owncloud/android/files/services/FileUploader.java @@ -76,8 +76,6 @@ import com.owncloud.android.ui.notifications.NotificationUtils; import com.owncloud.android.utils.ErrorMessageAdapter; import com.owncloud.android.utils.ThemeUtils; -import org.jetbrains.annotations.NotNull; - import java.io.File; import java.util.AbstractList; import java.util.HashMap; @@ -396,10 +394,10 @@ public class FileUploader extends Service public void retryFailedUploads( @NonNull final Context context, @Nullable final Account account, - @NotNull final UploadsStorageManager uploadsStorageManager, - @NotNull final ConnectivityService connectivityService, - @NotNull final UserAccountManager accountManager, - @NotNull final PowerManagementService powerManagementService, + @NonNull final UploadsStorageManager uploadsStorageManager, + @NonNull final ConnectivityService connectivityService, + @NonNull final UserAccountManager accountManager, + @NonNull final PowerManagementService powerManagementService, @Nullable final UploadResult uploadResult ) { OCUpload[] failedUploads = uploadsStorageManager.getFailedUploads(); diff --git a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java index a63793d129..ab1816122d 100644 --- a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java +++ b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java @@ -61,14 +61,13 @@ import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.PushUtils; import org.greenrobot.eventbus.EventBus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.io.File; import java.util.ArrayList; import java.util.List; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import static android.content.Context.ACCOUNT_SERVICE; import static com.owncloud.android.ui.activity.ManageAccountsActivity.PENDING_FOR_REMOVAL; @@ -93,7 +92,7 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback