LANG-940: Fix deprecation warnings; found some more usages

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1557592 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2014-01-12 18:53:16 +00:00
parent bdb68492fc
commit 10fee7abaf
3 changed files with 13 additions and 1 deletions

View File

@ -182,6 +182,7 @@ public static boolean equals(final Object object1, final Object object2) {
* @param object2 the second object, may be {@code null}
* @return {@code false} if the values of both objects are the same
*/
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
public static boolean notEqual(final Object object1, final Object object2) {
return ObjectUtils.equals(object1, object2) == false;
}
@ -239,7 +240,9 @@ public static int hashCodeMulti(final Object... objects) {
int hash = 1;
if (objects != null) {
for (final Object object : objects) {
hash = hash * 31 + ObjectUtils.hashCode(object);
@SuppressWarnings( "Deprecation" ) // ObjectUtils.hashCode(Object) has been deprecated in 3.2
int tmpHash = ObjectUtils.hashCode(object);
hash = hash * 31 + tmpHash;
}
}
return hash;

View File

@ -89,6 +89,7 @@ public void testFirstNonNull() {
}
//-----------------------------------------------------------------------
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void testEquals() {
assertTrue("ObjectUtils.equals(null, null) returned false", ObjectUtils.equals(null, null));
@ -107,6 +108,7 @@ public void testNotEqual() {
assertFalse("ObjectUtils.notEqual(\"foo\", \"foo\") returned false", ObjectUtils.notEqual(FOO, FOO));
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void testHashCode() {
assertEquals(0, ObjectUtils.hashCode(null));

View File

@ -46,6 +46,7 @@ private void checkClone(final StrTokenizer tokenizer) {
}
// -----------------------------------------------------------------------
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test1() {
@ -67,6 +68,7 @@ public void test1() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test2() {
@ -88,6 +90,7 @@ public void test2() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test3() {
@ -109,6 +112,7 @@ public void test3() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test4() {
@ -130,6 +134,7 @@ public void test4() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test5() {
@ -188,6 +193,7 @@ public void test6() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test7() {
@ -209,6 +215,7 @@ public void test7() {
}
@SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
@Test
public void test8() {