Revert bad update in r1034828; fix NPE warning a different way
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1034904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
35ca6531ef
commit
ea623e575e
|
@ -17,7 +17,6 @@
|
|||
package org.apache.commons.lang3.concurrent;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -51,13 +50,14 @@ public class ConstantInitializerTest {
|
|||
*/
|
||||
private void checkEquals(Object obj, boolean expected) {
|
||||
assertEquals("Wrong result of equals", expected, init.equals(obj));
|
||||
assertNotNull(obj);
|
||||
if (obj != null) {
|
||||
assertEquals("Not symmetric", expected, obj.equals(init));
|
||||
if (expected) {
|
||||
assertEquals("Different hash codes", init.hashCode(),
|
||||
obj.hashCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether the correct object is returned.
|
||||
|
|
Loading…
Reference in New Issue