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
This commit is contained in:
Fabio Ponciroli 2022-03-10 17:37:37 +01:00 committed by Thomas Wolf
parent aa5a2c4619
commit f1362e857e
1 changed files with 4 additions and 0 deletions

View File

@ -92,6 +92,7 @@ public void findPassingThrough(final PlotCommit<L> currCommit,
}
/** {@inheritDoc} */
@SuppressWarnings("ReferenceEquality")
@Override
protected void enter(int index, PlotCommit<L> currCommit) {
setupChildren(currCommit);
@ -188,6 +189,7 @@ private void continueActiveLanes(PlotCommit currCommit) {
* 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 @@ private void handleBlockedLanes(final int index, final PlotCommit currCommit,
}
// 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 @@ private PlotLane handleMerge(final int index, final PlotCommit currCommit,
* @param child
* @param laneToContinue
*/
@SuppressWarnings("ReferenceEquality")
private void drawLaneToChild(final int commitIndex, PlotCommit child,
PlotLane laneToContinue) {
for (int r = commitIndex - 1; r >= 0; r--) {