From 37f60c7984633cfe3dd3279462cb4c00bc37514e Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 22 Sep 2023 12:34:07 +0200 Subject: [PATCH] [errorprone] FileReftableStack: fix EqualsUnsafeCast See https://errorprone.info/bugpattern/EqualsUnsafeCast Change-Id: I23274c1850061f0574133f52692e125cfa6b92ff --- .../eclipse/jgit/internal/storage/file/FileReftableStack.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java index c74a29842..d48a2d726 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java @@ -617,6 +617,9 @@ public boolean equals(Object other) { if (other == null) { return false; } + if (!(other instanceof Segment)) { + return false; + } Segment o = (Segment) other; return o.bytes == bytes && o.log == log && o.start == start && o.end == end;