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

ReflectionException when EqualsVerifier fails to create PrefabValue for old Guava Range #149

Closed
alastairandrew opened this issue Jul 16, 2016 · 2 comments
Labels

Comments

@alastairandrew
Copy link

What steps will reproduce the problem?

Add an old version version of Google's Guava library to your classpath (13.0)

What is the code that triggers this problem?

Any EqualsVerifier usage.

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?

nl.jqno.equalsverifier.internal.exceptions.ReflectionException: java.lang.NoSuchMethodException: com.google.common.collect.Range.open(java.lang.Comparable, java.lang.Comparable)
    at nl.jqno.equalsverifier.internal.ConditionalInstantiator.callFactory(ConditionalInstantiator.java:132)
    at nl.jqno.equalsverifier.internal.ConditionalInstantiator.callFactory(ConditionalInstantiator.java:99)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addNewGoogleGuavaClasses(JavaApiPrefabValues.java:389)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addJavaClasses(JavaApiPrefabValues.java:95)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addTo(JavaApiPrefabValues.java:75)
    at nl.jqno.equalsverifier.EqualsVerifier.<init>(EqualsVerifier.java:113)
    at nl.jqno.equalsverifier.EqualsVerifier.forClass(EqualsVerifier.java:124)
    at uk.co.airts.katoptasolver.model.TaskTest.testTaskContract(TaskTest.java:110)
    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.NoSuchMethodException: com.google.common.collect.Range.open(java.lang.Comparable, java.lang.Comparable)
    at java.lang.Class.getMethod(Class.java:1786)
    at nl.jqno.equalsverifier.internal.ConditionalInstantiator.callFactory(ConditionalInstantiator.java:127)
    ... 30 more


What did you expect?

EqualsVerifier to only fail if the test actually used the old library.

Which version of EqualsVerifier are you using?

2.1.2

Please provide any additional information below.

Raised this issue as the result of this forum thread.

@jqno
Copy link
Owner

jqno commented Jul 17, 2016

I just released a fix: version 2.1.3.

@jqno jqno closed this as completed Jul 17, 2016
@alastairandrew
Copy link
Author

Brilliant. Thanks for all your hard work.

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