From f1362e857e96b4994c2ad54f7dd2c80a4f7de955 Mon Sep 17 00:00:00 2001 From: Fabio Ponciroli Date: Thu, 10 Mar 2022 17:37:37 +0100 Subject: 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 --- org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java | 4 ++++ 1 file changed, 4 insertions(+) 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 extends } /** {@inheritDoc} */ + @SuppressWarnings("ReferenceEquality") @Override protected void enter(int index, PlotCommit currCommit) { setupChildren(currCommit); @@ -188,6 +189,7 @@ public class PlotCommitList extends * may be null if currCommit 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 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 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--) { -- cgit v1.2.3