Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE with any Java interface #232

Closed
dfa1 opened this issue Jan 27, 2019 · 3 comments
Closed

NPE with any Java interface #232

dfa1 opened this issue Jan 27, 2019 · 3 comments
Labels

Comments

@dfa1
Copy link
Contributor

dfa1 commented Jan 27, 2019

What steps will reproduce the problem?

see below

What is the code that triggers this problem?

// where CharSequence is any interface type
EqualsVerifier.forClass(CharSequence.class).verify();

What error message or stack trace does EqualsVerifier give?


java.lang.AssertionError: EqualsVerifier found a problem in class CharSequence.
-> null

For more information, go to: http://www.jqno.nl/equalsverifier/errormessages
	at nl.jqno.equalsverifier.EqualsVerifierApi.verify(EqualsVerifierApi.java:308)
	at org.hosh.spi.RecordTest.equalsContract(RecordTest.java:76)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:39)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:79)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:70)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.NullPointerException
	at nl.jqno.equalsverifier.internal.reflection.ClassAccessor.declaresMethod(ClassAccessor.java:89)
	at nl.jqno.equalsverifier.internal.reflection.ClassAccessor.declaresEquals(ClassAccessor.java:75)
	at nl.jqno.equalsverifier.internal.reflection.ClassAccessor.isEqualsInheritedFromObject(ClassAccessor.java:135)
	at nl.jqno.equalsverifier.internal.checkers.SignatureChecker.checkEqualsIsDefined(SignatureChecker.java:41)
	at nl.jqno.equalsverifier.internal.checkers.SignatureChecker.check(SignatureChecker.java:35)
	at nl.jqno.equalsverifier.EqualsVerifierApi.verifyWithoutExamples(EqualsVerifierApi.java:368)
	at nl.jqno.equalsverifier.EqualsVerifierApi.performVerification(EqualsVerifierApi.java:349)
	at nl.jqno.equalsverifier.EqualsVerifierApi.verify(EqualsVerifierApi.java:302)
	... 44 more

What did you expect?

an explicit message saying that I'm wrong

Which version of EqualsVerifier are you using?

3.1.4

Please provide any additional information below.

N/A

@dfa1 dfa1 changed the title NPE when given java interface NPE with any Java interface Jan 27, 2019
@jqno
Copy link
Owner

jqno commented Jan 27, 2019

Reproduced. I'll fix it in the next release.

@jqno
Copy link
Owner

jqno commented Feb 18, 2019

Sorry that it took a while. It's fixed now, in version 3.1.5.

@jqno jqno closed this as completed Feb 18, 2019
@dfa1
Copy link
Contributor Author

dfa1 commented Feb 18, 2019

thank you very much 🙏

akhalikov pushed a commit to akhalikov/equalsverifier that referenced this issue Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants