diff options
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/ObjectUtils.java')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/ObjectUtils.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java index 2778da75f..c1208fdd5 100644 --- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java +++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java @@ -822,7 +822,7 @@ public class ObjectUtils { * @since 3.2 */ public static void identityToString(final Appendable appendable, final Object object) throws IOException { - Validate.notNull(object, "object"); + Objects.requireNonNull(object, "object"); appendable.append(object.getClass().getName()) .append(AT_SIGN) .append(identityHashCodeHex(object)); @@ -878,7 +878,7 @@ public class ObjectUtils { */ @Deprecated public static void identityToString(final StrBuilder builder, final Object object) { - Validate.notNull(object, "object"); + Objects.requireNonNull(object, "object"); final String name = object.getClass().getName(); final String hexString = identityHashCodeHex(object); builder.ensureCapacity(builder.length() + name.length() + 1 + hexString.length()); @@ -903,7 +903,7 @@ public class ObjectUtils { * @since 2.4 */ public static void identityToString(final StringBuffer buffer, final Object object) { - Validate.notNull(object, "object"); + Objects.requireNonNull(object, "object"); final String name = object.getClass().getName(); final String hexString = identityHashCodeHex(object); buffer.ensureCapacity(buffer.length() + name.length() + 1 + hexString.length()); @@ -928,7 +928,7 @@ public class ObjectUtils { * @since 3.2 */ public static void identityToString(final StringBuilder builder, final Object object) { - Validate.notNull(object, "object"); + Objects.requireNonNull(object, "object"); final String name = object.getClass().getName(); final String hexString = identityHashCodeHex(object); builder.ensureCapacity(builder.length() + name.length() + 1 + hexString.length()); @@ -1108,7 +1108,7 @@ public class ObjectUtils { public static <T> T median(final Comparator<T> comparator, final T... items) { Validate.notEmpty(items, "null/empty items"); Validate.noNullElements(items); - Validate.notNull(comparator, "comparator"); + Objects.requireNonNull(comparator, "comparator"); final TreeSet<T> treeSet = new TreeSet<>(comparator); Collections.addAll(treeSet, items); @SuppressWarnings("unchecked") //we know all items added were T instances |