Skip to content

Commit

Permalink
Fix spotbugs
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Jan 26, 2024
1 parent e9b1cbc commit 7d73d45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ public void updateDatabaseUploadResult(RemoteOperationResult uploadResult, Uploa
upload.getRemotePath(),
localPath
);
} else if (uploadResult.getCode().equals(RemoteOperationResult.ResultCode.SYNC_CONFLICT) &&
} else if (uploadResult.getCode() == RemoteOperationResult.ResultCode.SYNC_CONFLICT &&
new FilesUploadHelper().isSameFileOnRemote(
upload.getUser(), new File(upload.getStoragePath()), upload.getRemotePath(), upload.getContext())) {

Expand All @@ -750,7 +750,7 @@ public void updateDatabaseUploadResult(RemoteOperationResult uploadResult, Uploa
upload.getRemotePath(),
localPath
);
} else if (uploadResult.getCode().equals(RemoteOperationResult.ResultCode.LOCAL_FILE_NOT_FOUND)) {
} else if (uploadResult.getCode() == RemoteOperationResult.ResultCode.LOCAL_FILE_NOT_FOUND) {
updateUploadStatus(
upload.getOCUploadId(),
UploadStatus.UPLOAD_SUCCEEDED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile pare
}
}

RemoteOperationResult collisionResult = checkNameCollision(client, fileNames, parentFile.isEncrypted(),originalFile);
RemoteOperationResult collisionResult = checkNameCollision(client, fileNames, parentFile.isEncrypted());
if (collisionResult != null) {
result = collisionResult;
return collisionResult;
Expand Down Expand Up @@ -849,7 +849,7 @@ private RemoteOperationResult normalUpload(OwnCloudClient client) {
}

// check name collision
RemoteOperationResult collisionResult = checkNameCollision(client, null, false, originalFile);
RemoteOperationResult collisionResult = checkNameCollision(client, null, false);
if (collisionResult != null) {
result = collisionResult;
return collisionResult;
Expand Down Expand Up @@ -1038,8 +1038,7 @@ private RemoteOperationResult copyFile(File originalFile, String expectedPath) t
@CheckResult
private RemoteOperationResult checkNameCollision(OwnCloudClient client,
List<String> fileNames,
boolean encrypted,
File originalFile)
boolean encrypted)
throws OperationCancelledException {
Log_OC.d(TAG, "Checking name collision in server");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void onBindViewHolder(SectionedViewHolder holder, int section, int relati
}

// show status if same file conflict or local file deleted
if (item.getUploadStatus().equals(UploadStatus.UPLOAD_SUCCEEDED) &&
if (item.getUploadStatus() == UploadStatus.UPLOAD_SUCCEEDED &&
item.getLastResult() != UploadResult.UPLOADED){
itemViewHolder.binding.uploadStatus.setVisibility(View.VISIBLE);
itemViewHolder.binding.uploadStatus.setTypeface(null, Typeface.BOLD);
Expand Down

0 comments on commit 7d73d45

Please sign in to comment.