Browse Source

codacy: useless qualified this usage in the same class.

AndyScherzinger 6 years ago
parent
commit
2e9d7ce028

+ 1 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -2222,7 +2222,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
 
     private void doOnResumeAndBound() {
         //Log_OC.e(TAG, "registering to listen for operation callbacks" );
-        mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);
+        mOperationsServiceBinder.addOperationListener(this, mHandler);
         if (mWaitingForOpId <= Integer.MAX_VALUE) {
             mOperationsServiceBinder.dispatchResultIfFinished((int) mWaitingForOpId, this);
         }

+ 2 - 2
src/main/java/com/owncloud/android/services/OperationsService.java

@@ -617,13 +617,13 @@ public class OperationsService extends Service {
                                 remotePath,
                                 shareType,
                                 shareWith,
-                                OperationsService.this
+                                this
                         );
                     }
                     
                 } else if (ACTION_GET_SERVER_INFO.equals(action)) {
                     // check OC server and get basic information from it
-                    operation = new GetServerInfoOperation(serverUrl, OperationsService.this);
+                    operation = new GetServerInfoOperation(serverUrl, this);
 
                 } else if (ACTION_OAUTH2_GET_ACCESS_TOKEN.equals(action)) {
                     /// GET ACCESS TOKEN to the OAuth server

+ 1 - 1
src/main/java/com/owncloud/android/ui/EmptyRecyclerView.java

@@ -69,7 +69,7 @@ public class EmptyRecyclerView extends RecyclerView {
             int emptyCount = hasFooter ? 1 : 0;
             boolean empty = getAdapter() == null || getAdapter().getItemCount() == emptyCount;
             mEmptyView.setVisibility(empty ? VISIBLE : GONE);
-            EmptyRecyclerView.this.setVisibility(empty ? GONE : VISIBLE);
+            this.setVisibility(empty ? GONE : VISIBLE);
         }
     }
 

+ 2 - 2
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -1386,7 +1386,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
                     getCapabilities.execute(getStorageManager(), getBaseContext());
                 }
 
-                Account account = AccountUtils.getCurrentOwnCloudAccount(DrawerActivity.this);
+                Account account = AccountUtils.getCurrentOwnCloudAccount(this);
 
                 if (account != null && getStorageManager() != null &&
                         getStorageManager().getCapability(account.name) != null &&
@@ -1405,7 +1405,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
 
                         Log_OC.d("ExternalLinks", "update via api");
                         RemoteOperation getExternalLinksOperation = new ExternalLinksOperation();
-                        RemoteOperationResult result = getExternalLinksOperation.execute(account, DrawerActivity.this);
+                        RemoteOperationResult result = getExternalLinksOperation.execute(account, this);
 
                         if (result.isSuccess() && result.getData() != null) {
                             externalLinksProvider.deleteAllExternalLinks();

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/FileActivity.java

@@ -493,7 +493,7 @@ public abstract class FileActivity extends DrawerActivity
 
 
     private void doOnResumeAndBound() {
-        mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+        mOperationsServiceBinder.addOperationListener(this, mHandler);
         long waitingForOpId = mFileOperationsHelper.getOpIdWaitingFor();
         if (waitingForOpId <= Integer.MAX_VALUE) {
             boolean wait = mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId,

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.java

@@ -225,7 +225,7 @@ public class SyncedFoldersActivity extends FileActivity implements SyncedFolderA
 
         List<SyncedFolder> syncedFolderArrayList = mSyncedFolderProvider.getSyncedFolders();
         List<SyncedFolder> currentAccountSyncedFoldersList = new ArrayList<>();
-        Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(SyncedFoldersActivity.this);
+        Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(this);
         for (SyncedFolder syncedFolder : syncedFolderArrayList) {
             if (currentAccount != null && syncedFolder.getAccount().equals(currentAccount.name)) {
                 currentAccountSyncedFoldersList.add(syncedFolder);

+ 2 - 3
src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -260,8 +260,7 @@ public class UserInfoActivity extends FileActivity {
     private void populateUserInfoUi(UserInfo userInfo) {
         userName.setText(account.name);
         avatar.setTag(account.name);
-        DisplayUtils.setAvatar(account, UserInfoActivity.this, mCurrentAccountAvatarRadiusDimension, getResources(),
-                avatar, this);
+        DisplayUtils.setAvatar(account, this, mCurrentAccountAvatarRadiusDimension, getResources(), avatar, this);
 
         int tint = ThemeUtils.primaryColor(account, true, this);
 
@@ -412,7 +411,7 @@ public class UserInfoActivity extends FileActivity {
     private void fetchAndSetData() {
         Thread t = new Thread(() -> {
             RemoteOperation getRemoteUserInfoOperation = new GetRemoteUserInfoOperation();
-            RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, UserInfoActivity.this);
+            RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, this);
 
             if (result.isSuccess() && result.getData() != null) {
                 userInfo = (UserInfo) result.getData().get(0);

+ 1 - 1
src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -577,7 +577,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
                 if (ThumbnailsCacheManager.cancelPotentialThumbnailWork(getFile(), activity.getPreviewImageView()) &&
                         mContainerActivity.getStorageManager() != null) {
                     final ThumbnailsCacheManager.ResizedImageGenerationTask task =
-                            new ThumbnailsCacheManager.ResizedImageGenerationTask(FileDetailFragment.this,
+                            new ThumbnailsCacheManager.ResizedImageGenerationTask(this,
                                     activity.getPreviewImageView(),
                                     mContainerActivity.getStorageManager(),
                                     mContainerActivity.getStorageManager().getAccount());

+ 1 - 1
src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java

@@ -248,7 +248,7 @@ public class PreviewImageFragment extends FileFragment {
                     if (ThumbnailsCacheManager.cancelPotentialThumbnailWork(getFile(), mImageView) &&
                             mContainerActivity.getStorageManager() != null) {
                         final ThumbnailsCacheManager.ResizedImageGenerationTask task =
-                                new ThumbnailsCacheManager.ResizedImageGenerationTask(PreviewImageFragment.this,
+                                new ThumbnailsCacheManager.ResizedImageGenerationTask(this,
                                         mImageView,
                                         mContainerActivity.getStorageManager(),
                                         mContainerActivity.getStorageManager().getAccount());