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

Abstract delegation: super's equals method delegates to an abstract method: null #138

Closed
don-vip opened this issue Mar 14, 2016 · 2 comments
Labels

Comments

@don-vip
Copy link
Contributor

don-vip commented Mar 14, 2016

What steps will reproduce the problem?

I'm using EqualsVerifier 2.0.1 for several classes already, but I face an error I don't know how to solve.
I want to test a generic class which looks like that:

public class Storage<T> extends AbstractSet<T>

My equals() method calls super.equals().

What is the code that triggers this problem?

EqualsVerifier.forClass(Storage.class).usingGetClass().verify();

Please try to provide an example of a complete class (equals method, hashCode method, relevant fields) and a call to EqualsVerifier.

What error message or stack trace does EqualsVerifier give?

java.lang.AssertionError: Abstract delegation: AbstractSet's equals method delegates to an abstract method:
 null
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:367)
at org.openstreetmap.josm.data.osm.StorageTest.equalsContract(StorageTest.java:20)
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:498)
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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.AbstractMethodError
at java.util.AbstractSet.equals(AbstractSet.java:92)
at nl.jqno.equalsverifier.AbstractDelegationChecker.checkAbstractMethods(AbstractDelegationChecker.java:129)
at nl.jqno.equalsverifier.AbstractDelegationChecker.checkAbstractDelegationInSuper(AbstractDelegationChecker.java:115)
at nl.jqno.equalsverifier.AbstractDelegationChecker.check(AbstractDelegationChecker.java:55)
at nl.jqno.equalsverifier.EqualsVerifier.verifyWithoutExamples(EqualsVerifier.java:405)
at nl.jqno.equalsverifier.EqualsVerifier.performVerification(EqualsVerifier.java:391)
at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:364)
... 24 more

What did you expect?

Success.

Which version of EqualsVerifier are you using?

2.0.1

Please provide any additional information below.

@jqno
Copy link
Owner

jqno commented Apr 3, 2016

I've just released version 2.0.2, which should fix this. Sorry it took a while.

@jqno jqno closed this as completed Apr 3, 2016
@don-vip
Copy link
Contributor Author

don-vip commented Apr 3, 2016

No problem, thanks for fixing it, I'm giving it a try :)

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