Candidate: use "Objects.equals" instead of "=="

Errorprone raises the following warning:
"[ReferenceEquality] Comparison using reference equality
instead of value equality".

Change-Id: Iacb207ef0625bb987a08406d4e7461e48fade97f
This commit is contained in:
Fabio Ponciroli 2022-03-10 18:32:53 +01:00 committed by Matthias Sohn
parent 4562e79e23
commit 334852c52f
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import org.eclipse.jgit.blame.ReverseWalk.ReverseCommit;
import org.eclipse.jgit.diff.Edit;
@ -269,7 +270,7 @@ private Region clearRegionList() {
}
boolean canMergeRegions(Candidate other) {
return sourceCommit == other.sourceCommit
return Objects.equals(sourceCommit, other.sourceCommit)
&& sourcePath.getPath().equals(other.sourcePath.getPath());
}