Skip to content

Commit a2310cc

Browse files
committed
MiscUtils: deprecate equal(Object, Object) method
The standard library has this built-in now.
1 parent 460a601 commit a2310cc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/org/scijava/util/MiscUtils.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
package org.scijava.util;
3333

34+
import java.util.Objects;
35+
3436
/**
3537
* Miscellaneous utility methods. Every project needs a class like this, right?
3638
*
@@ -83,13 +85,9 @@ public static <T extends Comparable<? super T>> int compare(final T o1,
8385
}
8486

8587
/**
86-
* Compares two objects for equality, even if one or both of them are null.
87-
*
88-
* @param o1 The first object to compare.
89-
* @param o2 The second object to compare.
90-
* @return True if the two objects are both null, or both are non-null and
91-
* {@code o1.equals(o2)} holds.
88+
* @deprecated Use {@link Objects#equals(Object, Object)} instead.
9289
*/
90+
@Deprecated
9391
public static boolean equal(final Object o1, final Object o2) {
9492
return o1 == null ? o2 == null : o1.equals(o2);
9593
}

0 commit comments

Comments
 (0)