aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/References.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/References.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/References.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/References.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/References.java
new file mode 100644
index 0000000000..b75e591212
--- /dev/null
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/References.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019, Matthias Sohn <matthias.sohn@sap.com> and others
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+package org.eclipse.jgit.util;
+
+/**
+ * Utility methods for object references
+ *
+ * @since 5.4
+ */
+public interface References {
+
+ /**
+ * Compare two references
+ *
+ * @param <T>
+ * type of the references
+ * @param ref1
+ * first reference
+ * @param ref2
+ * second reference
+ * @return {@code true} if both references refer to the same object
+ */
+ @SuppressWarnings("ReferenceEquality")
+ public static <T> boolean isSameObject(T ref1, T ref2) {
+ return ref1 == ref2;
+ }
+}