fix compare sourceId with destId

This commit is contained in:
Roberto Cirillo 2021-09-09 12:53:22 +02:00
parent 20e3993af2
commit 3979da000f
1 changed files with 3 additions and 1 deletions

View File

@ -108,8 +108,10 @@ public class SoftCopyOperator extends SoftCopy {
String destId=dest.getId().toString();
logger.debug("destination id is "+destId);
// in this case the source and dest are the same object
if(sourceId.equals(destId))
if(sourceId.toString().equals(destId)) {
logger.info("source and destination are pointing to the same object. The copy operation will have no effects");
return destId;
}
// remove the destination file. The third parameter to true replace the file otherwise the remote id is returned
if(resource.isReplace()){
removedId = mongoPrimaryInstance.removeFile(resource, null, resource.isReplace(), null, dest);