1 /*
2 * Copyright (C) 2019, Matthias Sohn <matthias.sohn@sap.com> and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10 package org.eclipse.jgit.util;
11
12 /**
13 * Utility methods for object references
14 *
15 * @since 5.4
16 */
17 public interface References {
18
19 /**
20 * Compare two references
21 *
22 * @param <T>
23 * type of the references
24 * @param ref1
25 * first reference
26 * @param ref2
27 * second reference
28 * @return {@code true} if both references refer to the same object
29 */
30 @SuppressWarnings("ReferenceEquality")
31 public static <T> boolean isSameObject(T ref1, T ref2) {
32 return ref1 == ref2;
33 }
34 }