Merge pull request #5401 from nextcloud/needlesslyBoxing

NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
This commit is contained in:
Andy Scherzinger 2020-02-05 10:50:26 +01:00 committed by GitHub
commit c64e90e8cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 34 additions and 38 deletions

View File

@ -1 +1 @@
414
387

View File

@ -128,7 +128,7 @@ public class FilesystemDataProvider {
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_LOCAL_PATH, localPath);
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_IS_FOLDER, isFolderValue);
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_SENT_FOR_UPLOAD, false);
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_SENT_FOR_UPLOAD, Boolean.FALSE);
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_SYNCED_FOLDER_ID, syncedFolder.getId());
long newCrc32 = getFileChecksum(localPath);

View File

@ -106,7 +106,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
activities = (ArrayList) data.get(0);
lastGiven = (int) data.get(1);
return true;
return Boolean.TRUE;
} else {
Log_OC.d(TAG, result.getLogMessage());
// show error
@ -114,7 +114,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) {
errorMessage = context.getString(R.string.file_list_empty_headline_server_search);
}
return false;
return Boolean.FALSE;
}
} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {
@ -131,7 +131,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
errorMessage = "Authentication Exception";
}
return false;
return Boolean.FALSE;
}
@Override

View File

@ -116,13 +116,13 @@ public class FilesServiceApiImpl implements FilesServiceApi {
synchFolderOp.execute(ownCloudClient);
}
}
return true;
return Boolean.TRUE;
} catch (ClientFactory.CreationException e) {
Log_OC.e(TAG, "Account not found", e);
errorMessage = baseActivity.getString(R.string.account_not_found);
}
return false;
return Boolean.FALSE;
}
@Override

View File

@ -243,10 +243,10 @@ public class ErrorsWhileCopyingHandlerActivity extends AppCompatActivity implem
} else {
// FAIL
return false;
return Boolean.FALSE;
}
}
return true;
return Boolean.TRUE;
}
/**

View File

@ -51,7 +51,7 @@ public class CheckRemoteWipeTask extends AsyncTask<Void, Void, Boolean> {
if (fileActivity == null) {
Log_OC.e(this, "Check for remote wipe: no context available");
return false;
return Boolean.FALSE;
}
RemoteOperationResult checkWipeResult = new CheckRemoteWipeRemoteOperation().execute(account, fileActivity);
@ -75,6 +75,6 @@ public class CheckRemoteWipeTask extends AsyncTask<Void, Void, Boolean> {
}
return true;
return Boolean.TRUE;
}
}

View File

@ -60,7 +60,7 @@ public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boole
default:
// do nothing
return false;
return Boolean.FALSE;
}
method.setRequestHeader(RemoteOperation.OCS_API_HEADER, RemoteOperation.OCS_API_HEADER_VALUE);
@ -70,7 +70,7 @@ public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boole
status = client.executeMethod(method);
} catch (IOException e) {
Log_OC.e(this, "Execution of notification action failed: " + e);
return false;
return Boolean.FALSE;
}
return status == HttpStatus.SC_OK || status == HttpStatus.SC_ACCEPTED;

View File

@ -82,19 +82,19 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
int status = client.executeMethod(getMethod);
if (status == HttpStatus.SC_OK) {
if (file.exists() && !file.delete()) {
return false;
return Boolean.FALSE;
}
file.getParentFile().mkdirs();
if (!file.getParentFile().exists()) {
Log_OC.d(TAG, file.getParentFile().getAbsolutePath() + " does not exist");
return false;
return Boolean.FALSE;
}
if (!file.createNewFile()) {
Log_OC.d(TAG, file.getAbsolutePath() + " could not be created");
return false;
return Boolean.FALSE;
}
BufferedInputStream bis = new BufferedInputStream(getMethod.getResponseBodyAsStream());
@ -113,7 +113,7 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
}
// Check if the file is completed
if (transferred != totalToTransfer) {
return false;
return Boolean.FALSE;
}
if (getMethod.getResponseBodyAsStream() != null) {
@ -124,7 +124,7 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
Log_OC.e(TAG, "Error reading file", e);
}
return true;
return Boolean.TRUE;
}
@Override

View File

@ -1551,9 +1551,9 @@ public class OCFileListFragment extends ExtendedListFragment implements
remoteOperation = new GetSharesRemoteOperation();
}
remoteOperationAsyncTask = new AsyncTask() {
remoteOperationAsyncTask = new AsyncTask<Void, Void, Boolean>() {
@Override
protected Object doInBackground(Object[] params) {
protected Boolean doInBackground(Void... voids) {
setTitle();
if (getContext() != null && !isCancelled()) {
RemoteOperationResult remoteOperationResult = remoteOperation.execute(
@ -1592,12 +1592,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
return remoteOperationResult.isSuccess();
} else {
return false;
return Boolean.FALSE;
}
}
@Override
protected void onPostExecute(Object o) {
protected void onPostExecute(Boolean bool) {
if (!isCancelled()) {
mAdapter.notifyDataSetChanged();
}

View File

@ -535,7 +535,7 @@ public class ContactListFragment extends FileFragment implements Injectable {
}
private AsyncTask loadContactsTask = new AsyncTask() {
private AsyncTask loadContactsTask = new AsyncTask<Void, Void, Boolean>() {
@Override
protected void onPreExecute() {
@ -543,7 +543,7 @@ public class ContactListFragment extends FileFragment implements Injectable {
}
@Override
protected Object doInBackground(Object[] params) {
protected Boolean doInBackground(Void... voids) {
if (!isCancelled()) {
File file = new File(ocFile.getStoragePath());
try {
@ -551,15 +551,15 @@ public class ContactListFragment extends FileFragment implements Injectable {
Collections.sort(vCards, new VCardComparator());
} catch (IOException e) {
Log_OC.e(TAG, "IO Exception: " + file.getAbsolutePath());
return false;
return Boolean.FALSE;
}
return true;
return Boolean.TRUE;
}
return false;
return Boolean.FALSE;
}
@Override
protected void onPostExecute(Object o) {
protected void onPostExecute(Boolean bool) {
if (!isCancelled()) {
emptyListContainer.setVisibility(View.GONE);
contactListAdapter.replaceVCards(vCards);

View File

@ -225,7 +225,7 @@ public class ContactsBackupFragment extends FileFragment implements DatePickerDi
RemoteOperationResult result = operation.execute(account, getContext());
return result.isSuccess();
} else {
return false;
return Boolean.FALSE;
}
}

View File

@ -383,7 +383,7 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
Log_OC.e(TAG, "onStop");
if (textLoadAsyncTask != null) {
textLoadAsyncTask.cancel(Boolean.TRUE);
textLoadAsyncTask.cancel(true);
}
}

View File

@ -23,16 +23,12 @@
*/
package com.owncloud.android.ui.trashbin;
import android.accounts.Account;
import android.content.Context;
import android.os.AsyncTask;
import com.nextcloud.client.account.User;
import com.nextcloud.client.network.ClientFactory;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.trashbin.EmptyTrashbinRemoteOperation;
@ -124,7 +120,7 @@ public class RemoteTrashbinRepository implements TrashbinRepository {
return result.isSuccess();
} catch (ClientFactory.CreationException e) {
Log_OC.e(this, "Cannot create client", e);
return false;
return Boolean.FALSE;
}
}
@ -206,12 +202,12 @@ public class RemoteTrashbinRepository implements TrashbinRepository {
RemoteOperationResult result = new ReadTrashbinFolderRemoteOperation(remotePath).execute(client);
if (result.isSuccess()) {
trashbinFiles = result.getData();
return true;
return Boolean.TRUE;
} else {
return false;
return Boolean.FALSE;
}
} catch (ClientFactory.CreationException e) {
return false;
return Boolean.FALSE;
}
}