Merge pull request #5401 from nextcloud/needlesslyBoxing
NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
This commit is contained in:
commit
c64e90e8cc
@ -1 +1 @@
|
|||||||
414
|
387
|
@ -128,7 +128,7 @@ public class FilesystemDataProvider {
|
|||||||
|
|
||||||
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_LOCAL_PATH, localPath);
|
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_LOCAL_PATH, localPath);
|
||||||
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_FILE_IS_FOLDER, isFolderValue);
|
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());
|
cv.put(ProviderMeta.ProviderTableMeta.FILESYSTEM_SYNCED_FOLDER_ID, syncedFolder.getId());
|
||||||
|
|
||||||
long newCrc32 = getFileChecksum(localPath);
|
long newCrc32 = getFileChecksum(localPath);
|
||||||
|
@ -106,7 +106,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
|
|||||||
activities = (ArrayList) data.get(0);
|
activities = (ArrayList) data.get(0);
|
||||||
|
|
||||||
lastGiven = (int) data.get(1);
|
lastGiven = (int) data.get(1);
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
} else {
|
} else {
|
||||||
Log_OC.d(TAG, result.getLogMessage());
|
Log_OC.d(TAG, result.getLogMessage());
|
||||||
// show error
|
// show error
|
||||||
@ -114,7 +114,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
|
|||||||
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) {
|
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) {
|
||||||
errorMessage = context.getString(R.string.file_list_empty_headline_server_search);
|
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) {
|
} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {
|
||||||
@ -131,7 +131,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
|
|||||||
errorMessage = "Authentication Exception";
|
errorMessage = "Authentication Exception";
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -116,13 +116,13 @@ public class FilesServiceApiImpl implements FilesServiceApi {
|
|||||||
synchFolderOp.execute(ownCloudClient);
|
synchFolderOp.execute(ownCloudClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
} catch (ClientFactory.CreationException e) {
|
} catch (ClientFactory.CreationException e) {
|
||||||
Log_OC.e(TAG, "Account not found", e);
|
Log_OC.e(TAG, "Account not found", e);
|
||||||
errorMessage = baseActivity.getString(R.string.account_not_found);
|
errorMessage = baseActivity.getString(R.string.account_not_found);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -243,10 +243,10 @@ public class ErrorsWhileCopyingHandlerActivity extends AppCompatActivity implem
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// FAIL
|
// FAIL
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ public class CheckRemoteWipeTask extends AsyncTask<Void, Void, Boolean> {
|
|||||||
|
|
||||||
if (fileActivity == null) {
|
if (fileActivity == null) {
|
||||||
Log_OC.e(this, "Check for remote wipe: no context available");
|
Log_OC.e(this, "Check for remote wipe: no context available");
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteOperationResult checkWipeResult = new CheckRemoteWipeRemoteOperation().execute(account, fileActivity);
|
RemoteOperationResult checkWipeResult = new CheckRemoteWipeRemoteOperation().execute(account, fileActivity);
|
||||||
@ -75,6 +75,6 @@ public class CheckRemoteWipeTask extends AsyncTask<Void, Void, Boolean> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boole
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
// do nothing
|
// do nothing
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
method.setRequestHeader(RemoteOperation.OCS_API_HEADER, RemoteOperation.OCS_API_HEADER_VALUE);
|
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);
|
status = client.executeMethod(method);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log_OC.e(this, "Execution of notification action failed: " + 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;
|
return status == HttpStatus.SC_OK || status == HttpStatus.SC_ACCEPTED;
|
||||||
|
@ -82,19 +82,19 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
|
|||||||
int status = client.executeMethod(getMethod);
|
int status = client.executeMethod(getMethod);
|
||||||
if (status == HttpStatus.SC_OK) {
|
if (status == HttpStatus.SC_OK) {
|
||||||
if (file.exists() && !file.delete()) {
|
if (file.exists() && !file.delete()) {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
|
|
||||||
if (!file.getParentFile().exists()) {
|
if (!file.getParentFile().exists()) {
|
||||||
Log_OC.d(TAG, file.getParentFile().getAbsolutePath() + " does not exist");
|
Log_OC.d(TAG, file.getParentFile().getAbsolutePath() + " does not exist");
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file.createNewFile()) {
|
if (!file.createNewFile()) {
|
||||||
Log_OC.d(TAG, file.getAbsolutePath() + " could not be created");
|
Log_OC.d(TAG, file.getAbsolutePath() + " could not be created");
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferedInputStream bis = new BufferedInputStream(getMethod.getResponseBodyAsStream());
|
BufferedInputStream bis = new BufferedInputStream(getMethod.getResponseBodyAsStream());
|
||||||
@ -113,7 +113,7 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
|
|||||||
}
|
}
|
||||||
// Check if the file is completed
|
// Check if the file is completed
|
||||||
if (transferred != totalToTransfer) {
|
if (transferred != totalToTransfer) {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getMethod.getResponseBodyAsStream() != null) {
|
if (getMethod.getResponseBodyAsStream() != null) {
|
||||||
@ -124,7 +124,7 @@ public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
|
|||||||
Log_OC.e(TAG, "Error reading file", e);
|
Log_OC.e(TAG, "Error reading file", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1551,9 +1551,9 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||||||
remoteOperation = new GetSharesRemoteOperation();
|
remoteOperation = new GetSharesRemoteOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteOperationAsyncTask = new AsyncTask() {
|
remoteOperationAsyncTask = new AsyncTask<Void, Void, Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected Object doInBackground(Object[] params) {
|
protected Boolean doInBackground(Void... voids) {
|
||||||
setTitle();
|
setTitle();
|
||||||
if (getContext() != null && !isCancelled()) {
|
if (getContext() != null && !isCancelled()) {
|
||||||
RemoteOperationResult remoteOperationResult = remoteOperation.execute(
|
RemoteOperationResult remoteOperationResult = remoteOperation.execute(
|
||||||
@ -1592,12 +1592,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||||||
|
|
||||||
return remoteOperationResult.isSuccess();
|
return remoteOperationResult.isSuccess();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Object o) {
|
protected void onPostExecute(Boolean bool) {
|
||||||
if (!isCancelled()) {
|
if (!isCancelled()) {
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
@ -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
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
@ -543,7 +543,7 @@ public class ContactListFragment extends FileFragment implements Injectable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object doInBackground(Object[] params) {
|
protected Boolean doInBackground(Void... voids) {
|
||||||
if (!isCancelled()) {
|
if (!isCancelled()) {
|
||||||
File file = new File(ocFile.getStoragePath());
|
File file = new File(ocFile.getStoragePath());
|
||||||
try {
|
try {
|
||||||
@ -551,15 +551,15 @@ public class ContactListFragment extends FileFragment implements Injectable {
|
|||||||
Collections.sort(vCards, new VCardComparator());
|
Collections.sort(vCards, new VCardComparator());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log_OC.e(TAG, "IO Exception: " + file.getAbsolutePath());
|
Log_OC.e(TAG, "IO Exception: " + file.getAbsolutePath());
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Object o) {
|
protected void onPostExecute(Boolean bool) {
|
||||||
if (!isCancelled()) {
|
if (!isCancelled()) {
|
||||||
emptyListContainer.setVisibility(View.GONE);
|
emptyListContainer.setVisibility(View.GONE);
|
||||||
contactListAdapter.replaceVCards(vCards);
|
contactListAdapter.replaceVCards(vCards);
|
||||||
|
@ -225,7 +225,7 @@ public class ContactsBackupFragment extends FileFragment implements DatePickerDi
|
|||||||
RemoteOperationResult result = operation.execute(account, getContext());
|
RemoteOperationResult result = operation.execute(account, getContext());
|
||||||
return result.isSuccess();
|
return result.isSuccess();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
|
|||||||
Log_OC.e(TAG, "onStop");
|
Log_OC.e(TAG, "onStop");
|
||||||
|
|
||||||
if (textLoadAsyncTask != null) {
|
if (textLoadAsyncTask != null) {
|
||||||
textLoadAsyncTask.cancel(Boolean.TRUE);
|
textLoadAsyncTask.cancel(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,16 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.owncloud.android.ui.trashbin;
|
package com.owncloud.android.ui.trashbin;
|
||||||
|
|
||||||
import android.accounts.Account;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
|
||||||
import com.nextcloud.client.account.User;
|
import com.nextcloud.client.account.User;
|
||||||
import com.nextcloud.client.network.ClientFactory;
|
import com.nextcloud.client.network.ClientFactory;
|
||||||
import com.owncloud.android.R;
|
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.OwnCloudClient;
|
||||||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
|
||||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||||
import com.owncloud.android.lib.resources.trashbin.EmptyTrashbinRemoteOperation;
|
import com.owncloud.android.lib.resources.trashbin.EmptyTrashbinRemoteOperation;
|
||||||
@ -124,7 +120,7 @@ public class RemoteTrashbinRepository implements TrashbinRepository {
|
|||||||
return result.isSuccess();
|
return result.isSuccess();
|
||||||
} catch (ClientFactory.CreationException e) {
|
} catch (ClientFactory.CreationException e) {
|
||||||
Log_OC.e(this, "Cannot create client", 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);
|
RemoteOperationResult result = new ReadTrashbinFolderRemoteOperation(remotePath).execute(client);
|
||||||
if (result.isSuccess()) {
|
if (result.isSuccess()) {
|
||||||
trashbinFiles = result.getData();
|
trashbinFiles = result.getData();
|
||||||
return true;
|
return Boolean.TRUE;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
} catch (ClientFactory.CreationException e) {
|
} catch (ClientFactory.CreationException e) {
|
||||||
return false;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user