diff options
author | Fabio Ponciroli <ponch78@gmail.com> | 2022-03-10 18:32:53 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2023-05-18 05:37:11 -0400 |
commit | 334852c52fa1a926104f59ed1ab2dfaa80fa6d50 (patch) | |
tree | ae35dcb7670e5ce72d06b3256885d7795521259f /org.eclipse.jgit | |
parent | 4562e79e234696ae3e1601db9bf8b73a1ef7edf8 (diff) | |
download | jgit-334852c52fa1a926104f59ed1ab2dfaa80fa6d50.tar.gz jgit-334852c52fa1a926104f59ed1ab2dfaa80fa6d50.zip |
Candidate: use "Objects.equals" instead of "=="
Errorprone raises the following warning:
"[ReferenceEquality] Comparison using reference equality
instead of value equality".
Change-Id: Iacb207ef0625bb987a08406d4e7461e48fade97f
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java index ca5370e912..ccf99ff5b5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java @@ -12,6 +12,7 @@ package org.eclipse.jgit.blame; 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 @@ class Candidate { } boolean canMergeRegions(Candidate other) { - return sourceCommit == other.sourceCommit + return Objects.equals(sourceCommit, other.sourceCommit) && sourcePath.getPath().equals(other.sourcePath.getPath()); } |