diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java index 434aff7db..be2d3cf9a 100644 --- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java +++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java @@ -182,6 +182,7 @@ public class ObjectUtils { * @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 class ObjectUtils { 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; diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java index 2df5ae86e..6365f9d5e 100644 --- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java @@ -89,6 +89,7 @@ public class ObjectUtilsTest { } //----------------------------------------------------------------------- + @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 class ObjectUtilsTest { 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)); diff --git a/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java b/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java index 998c9999e..3061cce10 100644 --- a/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java +++ b/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java @@ -46,6 +46,7 @@ public class StrTokenizerTest { } // ----------------------------------------------------------------------- + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test1() { @@ -67,6 +68,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test2() { @@ -88,6 +90,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test3() { @@ -109,6 +112,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test4() { @@ -130,6 +134,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test5() { @@ -188,6 +193,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test7() { @@ -209,6 +215,7 @@ public class StrTokenizerTest { } + @SuppressWarnings( "Deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2 @Test public void test8() {