LANG-1279: Update Java requirement from Java 6 to 7

replace usage of deprecated ArrayUtils#isEquals with Objects#deepEquals
This commit is contained in:
pascalschumacher 2016-10-23 20:25:45 +02:00
parent 89afbb0c3e
commit 23108b1bd9
2 changed files with 17 additions and 15 deletions

View File

@ -29,6 +29,7 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.lang3.ArrayUtils;
@ -727,7 +728,7 @@ public class MethodUtils {
Method inexactMatch = null;
for (final Method method : methodArray) {
if (methodName.equals(method.getName()) &&
ArrayUtils.isEquals(parameterTypes, method.getParameterTypes())) {
Objects.deepEquals(parameterTypes, method.getParameterTypes())) {
return method;
} else if (methodName.equals(method.getName()) &&
ClassUtils.isAssignable(parameterTypes, method.getParameterTypes(), true)) {

View File

@ -35,6 +35,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
import java.util.Objects;
import java.util.regex.PatternSyntaxException;
import org.apache.commons.lang3.text.WordUtils;
@ -1031,25 +1032,25 @@ public class StringUtilsTest {
assertNull(StringUtils.splitByCharacterType(null));
assertEquals(0, StringUtils.splitByCharacterType("").length);
assertTrue(ArrayUtils.isEquals(new String[]{"ab", " ", "de", " ",
assertTrue(Objects.deepEquals(new String[]{"ab", " ", "de", " ",
"fg"}, StringUtils.splitByCharacterType("ab de fg")));
assertTrue(ArrayUtils.isEquals(new String[]{"ab", " ", "de", " ",
assertTrue(Objects.deepEquals(new String[]{"ab", " ", "de", " ",
"fg"}, StringUtils.splitByCharacterType("ab de fg")));
assertTrue(ArrayUtils.isEquals(new String[]{"ab", ":", "cd", ":",
assertTrue(Objects.deepEquals(new String[]{"ab", ":", "cd", ":",
"ef"}, StringUtils.splitByCharacterType("ab:cd:ef")));
assertTrue(ArrayUtils.isEquals(new String[]{"number", "5"},
assertTrue(Objects.deepEquals(new String[]{"number", "5"},
StringUtils.splitByCharacterType("number5")));
assertTrue(ArrayUtils.isEquals(new String[]{"foo", "B", "ar"},
assertTrue(Objects.deepEquals(new String[]{"foo", "B", "ar"},
StringUtils.splitByCharacterType("fooBar")));
assertTrue(ArrayUtils.isEquals(new String[]{"foo", "200", "B", "ar"},
assertTrue(Objects.deepEquals(new String[]{"foo", "200", "B", "ar"},
StringUtils.splitByCharacterType("foo200Bar")));
assertTrue(ArrayUtils.isEquals(new String[]{"ASFR", "ules"},
assertTrue(Objects.deepEquals(new String[]{"ASFR", "ules"},
StringUtils.splitByCharacterType("ASFRules")));
}
@ -1058,25 +1059,25 @@ public class StringUtilsTest {
assertNull(StringUtils.splitByCharacterTypeCamelCase(null));
assertEquals(0, StringUtils.splitByCharacterTypeCamelCase("").length);
assertTrue(ArrayUtils.isEquals(new String[]{"ab", " ", "de", " ",
assertTrue(Objects.deepEquals(new String[]{"ab", " ", "de", " ",
"fg"}, StringUtils.splitByCharacterTypeCamelCase("ab de fg")));
assertTrue(ArrayUtils.isEquals(new String[]{"ab", " ", "de", " ",
assertTrue(Objects.deepEquals(new String[]{"ab", " ", "de", " ",
"fg"}, StringUtils.splitByCharacterTypeCamelCase("ab de fg")));
assertTrue(ArrayUtils.isEquals(new String[]{"ab", ":", "cd", ":",
assertTrue(Objects.deepEquals(new String[]{"ab", ":", "cd", ":",
"ef"}, StringUtils.splitByCharacterTypeCamelCase("ab:cd:ef")));
assertTrue(ArrayUtils.isEquals(new String[]{"number", "5"},
assertTrue(Objects.deepEquals(new String[]{"number", "5"},
StringUtils.splitByCharacterTypeCamelCase("number5")));
assertTrue(ArrayUtils.isEquals(new String[]{"foo", "Bar"},
assertTrue(Objects.deepEquals(new String[]{"foo", "Bar"},
StringUtils.splitByCharacterTypeCamelCase("fooBar")));
assertTrue(ArrayUtils.isEquals(new String[]{"foo", "200", "Bar"},
assertTrue(Objects.deepEquals(new String[]{"foo", "200", "Bar"},
StringUtils.splitByCharacterTypeCamelCase("foo200Bar")));
assertTrue(ArrayUtils.isEquals(new String[]{"ASF", "Rules"},
assertTrue(Objects.deepEquals(new String[]{"ASF", "Rules"},
StringUtils.splitByCharacterTypeCamelCase("ASFRules")));
}