diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java index 0a509acb7..b095d20e6 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java @@ -74,9 +74,28 @@ public abstract class AnyLongObjectId implements Comparable { * @param secondObjectId * the second identifier to compare. Must not be null. * @return true if the two identifiers are the same. + * @deprecated use {@link #isEqual(AnyLongObjectId, AnyLongObjectId)} + * instead. */ + @Deprecated + @SuppressWarnings("AmbiguousMethodReference") public static boolean equals(final AnyLongObjectId firstObjectId, final AnyLongObjectId secondObjectId) { + return isEqual(firstObjectId, secondObjectId); + } + + /** + * Compare two object identifier byte sequences for equality. + * + * @param firstObjectId + * the first identifier to compare. Must not be null. + * @param secondObjectId + * the second identifier to compare. Must not be null. + * @return true if the two identifiers are the same. + * @since 5.4 + */ + public static boolean isEqual(final AnyLongObjectId firstObjectId, + final AnyLongObjectId secondObjectId) { if (References.isSameObject(firstObjectId, secondObjectId)) { return true; } @@ -276,7 +295,7 @@ public abstract class AnyLongObjectId implements Comparable { * the other id to compare to. May be null. * @return true only if both LongObjectIds have identical bits. */ - @SuppressWarnings("NonOverridingEquals") + @SuppressWarnings({ "NonOverridingEquals", "AmbiguousMethodReference" }) public final boolean equals(AnyLongObjectId other) { return other != null ? equals(this, other) : false; }