summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Ponciroli <ponch78@gmail.com>2022-03-10 17:37:37 +0100
committerThomas Wolf <thomas.wolf@paranor.ch>2022-04-01 17:07:19 -0400
commitf1362e857e96b4994c2ad54f7dd2c80a4f7de955 (patch)
treec1a7fee4fa0a082802d9d8293bbdfc41effac054
parentaa5a2c4619aedccc99463034ab3fcf622c3dc8f3 (diff)
downloadjgit-f1362e857e96b4994c2ad54f7dd2c80a4f7de955.tar.gz
jgit-f1362e857e96b4994c2ad54f7dd2c80a4f7de955.zip
PlotCommitList: Suppress ReferenceEquality Warnings
Errorprone raises the following warning: "[ReferenceEquality] Comparison using reference equality instead of value equality" A single pointer comparison is fine here. A comparison with 'equals' would complicate the code and also impact performance. Change-Id: I6677dfc483acb95a64afbf433fd2b9460e408264
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
index 18ea7560fd..458f240982 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
@@ -92,6 +92,7 @@ public class PlotCommitList<L extends PlotLane> extends
}
/** {@inheritDoc} */
+ @SuppressWarnings("ReferenceEquality")
@Override
protected void enter(int index, PlotCommit<L> currCommit) {
setupChildren(currCommit);
@@ -188,6 +189,7 @@ public class PlotCommitList<L extends PlotLane> extends
* may be null if <code>currCommit</code> is the first commit on
* the lane
*/
+ @SuppressWarnings("ReferenceEquality")
private void handleBlockedLanes(final int index, final PlotCommit currCommit,
final PlotCommit childOnLane) {
for (PlotCommit child : currCommit.children) {
@@ -214,6 +216,7 @@ public class PlotCommitList<L extends PlotLane> extends
}
// Handles the case where currCommit is a non-first parent of the child
+ @SuppressWarnings("ReferenceEquality")
private PlotLane handleMerge(final int index, final PlotCommit currCommit,
final PlotCommit childOnLane, PlotCommit child, PlotLane laneToUse) {
@@ -287,6 +290,7 @@ public class PlotCommitList<L extends PlotLane> extends
* @param child
* @param laneToContinue
*/
+ @SuppressWarnings("ReferenceEquality")
private void drawLaneToChild(final int commitIndex, PlotCommit child,
PlotLane laneToContinue) {
for (int r = commitIndex - 1; r >= 0; r--) {