LANG-1279: Update Java requirement from Java 6 to 7
replace usage of deprecated ObjectUtils#equals with Objects#equals
This commit is contained in:
parent
9b481a9701
commit
cfdc3f767c
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.apache.commons.lang3.concurrent;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -100,7 +100,6 @@ public class ConstantInitializer<T> implements ConcurrentInitializer<T> {
|
|||
* @param obj the object to compare to
|
||||
* @return a flag whether the objects are equal
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj) {
|
||||
|
@ -111,7 +110,7 @@ public class ConstantInitializer<T> implements ConcurrentInitializer<T> {
|
|||
}
|
||||
|
||||
final ConstantInitializer<?> c = (ConstantInitializer<?>) obj;
|
||||
return ObjectUtils.equals(getObject(), c.getObject());
|
||||
return Objects.equals(getObject(), c.getObject());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
@ -1570,9 +1571,8 @@ public class TypeUtils {
|
|||
* @return boolean
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
|
||||
public static boolean equals(final Type t1, final Type t2) {
|
||||
if (ObjectUtils.equals(t1, t2)) {
|
||||
if (Objects.equals(t1, t2)) {
|
||||
return true;
|
||||
}
|
||||
if (t1 instanceof ParameterizedType) {
|
||||
|
|
|
@ -18,8 +18,8 @@ package org.apache.commons.lang3.tuple;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.builder.CompareToBuilder;
|
||||
|
||||
/**
|
||||
|
@ -124,7 +124,6 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
|||
* @param obj the object to compare to, null returns false
|
||||
* @return true if the elements of the pair are equal
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == this) {
|
||||
|
@ -132,8 +131,8 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
|||
}
|
||||
if (obj instanceof Map.Entry<?, ?>) {
|
||||
final Map.Entry<?, ?> other = (Map.Entry<?, ?>) obj;
|
||||
return ObjectUtils.equals(getKey(), other.getKey())
|
||||
&& ObjectUtils.equals(getValue(), other.getValue());
|
||||
return Objects.equals(getKey(), other.getKey())
|
||||
&& Objects.equals(getValue(), other.getValue());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.commons.lang3.tuple;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.builder.CompareToBuilder;
|
||||
|
||||
/**
|
||||
|
@ -104,7 +104,6 @@ public abstract class Triple<L, M, R> implements Comparable<Triple<L, M, R>>, Se
|
|||
* @param obj the object to compare to, null returns false
|
||||
* @return true if the elements of the triple are equal
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == this) {
|
||||
|
@ -112,9 +111,9 @@ public abstract class Triple<L, M, R> implements Comparable<Triple<L, M, R>>, Se
|
|||
}
|
||||
if (obj instanceof Triple<?, ?, ?>) {
|
||||
final Triple<?, ?, ?> other = (Triple<?, ?, ?>) obj;
|
||||
return ObjectUtils.equals(getLeft(), other.getLeft())
|
||||
&& ObjectUtils.equals(getMiddle(), other.getMiddle())
|
||||
&& ObjectUtils.equals(getRight(), other.getRight());
|
||||
return Objects.equals(getLeft(), other.getLeft())
|
||||
&& Objects.equals(getMiddle(), other.getMiddle())
|
||||
&& Objects.equals(getRight(), other.getRight());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue