You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Pojo {
private static Integer[] MY_STATIC_THAT_MAKES_YOU_SAD;
@Override
public final boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || !(o instanceof Pojo)) {
return false;
}
return true;
}
@Override
public final int hashCode() {
return 0;
}
}
Test:
@Test
public void testEquals() throws Exception {
EqualsVerifier.forClass(Pojo.class).suppress(Warning.NONFINAL_FIELDS).verify();
}
What error message or stack trace does EqualsVerifier give?
java.lang.AssertionError: NullPointerException:
For more information, go to: http://www.jqno.nl/equalsverifier/errormessages
at nl.jqno.equalsverifier.EqualsVerifier.handleError(EqualsVerifier.java:381)
at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:370)
at PojoTest.equals(PojoTest.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.NullPointerException
at nl.jqno.equalsverifier.FieldsChecker$ArrayFieldCheck.arrayCopy(FieldsChecker.java:261)
at nl.jqno.equalsverifier.FieldsChecker$ArrayFieldCheck.replaceInnermostArrayValue(FieldsChecker.java:256)
at nl.jqno.equalsverifier.FieldsChecker$ArrayFieldCheck.execute(FieldsChecker.java:245)
at nl.jqno.equalsverifier.FieldInspector.check(FieldInspector.java:40)
What did you expect?
A proper test response. This NullPointerException is unexpected and doesn't occur with old versions of EqualsVerifier (< 2.0)
Which version of EqualsVerifier are you using?
2.+ (2.1.8)
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
Include a static field with no value assigned
What is the code that triggers this problem?
Class under test:
Test:
What error message or stack trace does EqualsVerifier give?
What did you expect?
A proper test response. This NullPointerException is unexpected and doesn't occur with old versions of EqualsVerifier (< 2.0)
Which version of EqualsVerifier are you using?
2.+ (2.1.8)
The text was updated successfully, but these errors were encountered: