From 4a05bfbd08320ae4b03b37a4324e988017d466d3 Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Wed, 22 Aug 2018 10:34:48 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index fc453cfd7..9abc86a4b 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -556,7 +556,7 @@ public final class Utility { * @return 新数组 */ public static T[] remove(final T[] array, final T item) { - return remove(array, (i) -> item.equals(item)); + return remove(array, (i) -> Objects.equals(i, item)); } /** @@ -677,8 +677,7 @@ public final class Utility { public static boolean contains(T[] values, T value) { if (values == null) return false; for (T v : values) { - if (v == null && value == null) return true; - if (v != null && v.equals(value)) return true; + if (Objects.equals(v, value)) return true; } return false; }