Repository: commons-lang
Updated Branches:
refs/heads/master 9b481a970 -> 4733cb5b7
LANG-1279: Update Java requirement from Java 6 to 7
replace usage of deprecated ObjectUtils#equals with Objects#equals
Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/cfdc3f76
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/cfdc3f76
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/cfdc3f76
Branch: refs/heads/master
Commit: cfdc3f767c0063224622af168e78c6b2d2c77388
Parents: 9b481a9
Author: pascalschumacher
Authored: Fri Oct 28 18:33:40 2016 +0200
Committer: pascalschumacher
Committed: Fri Oct 28 18:33:40 2016 +0200
--
.../commons/lang3/concurrent/ConstantInitializer.java | 5 ++---
.../java/org/apache/commons/lang3/reflect/TypeUtils.java| 4 ++--
src/main/java/org/apache/commons/lang3/tuple/Pair.java | 7 +++
src/main/java/org/apache/commons/lang3/tuple/Triple.java| 9 -
4 files changed, 11 insertions(+), 14 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/cfdc3f76/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
--
diff --git
a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
index 7d5e4fc..4c6bc3e 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
@@ -16,7 +16,7 @@
*/
package org.apache.commons.lang3.concurrent;
-import org.apache.commons.lang3.ObjectUtils;
+import java.util.Objects;
/**
*
@@ -100,7 +100,6 @@ public class ConstantInitializer implements
ConcurrentInitializer {
* @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 implements
ConcurrentInitializer {
}
final ConstantInitializer c = (ConstantInitializer) obj;
-return ObjectUtils.equals(getObject(), c.getObject());
+return Objects.equals(getObject(), c.getObject());
}
/**
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/cfdc3f76/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
--
diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
index ad032e8..93f80de 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
@@ -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) {
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/cfdc3f76/src/main/java/org/apache/commons/lang3/tuple/Pair.java
--
diff --git a/src/main/java/org/apache/commons/lang3/tuple/Pair.java
b/src/main/java/org/apache/commons/lang3/tuple/Pair.java
index 94b421c..de95170 100644
--- a/src/main/java/org/apache/commons/lang3/tuple/Pair.java
+++ b/src/main/java/org/apache/commons/lang3/tuple/Pair.java
@@ -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 implements Map.Entry, Comparable implements Map.Entry, Comparable) {
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;