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

EqualsVerifier seems to fail on java 16-ea #339

Closed
scordio opened this issue Aug 24, 2020 · 15 comments · Fixed by #343
Closed

EqualsVerifier seems to fail on java 16-ea #339

scordio opened this issue Aug 24, 2020 · 15 comments · Fixed by #343

Comments

@scordio
Copy link
Contributor

scordio commented Aug 24, 2020

EqualsVerifier tests on java 16-ea seem to fail:

org.assertj.core.api.recursive.comparison.FieldLocation_Test
2020-08-24T19:18:23.7475611Z [ERROR] should_honor_equals_contract  Time elapsed: 0.012 s  <<< FAILURE!
2020-08-24T19:18:23.7478316Z java.lang.AssertionError: 
2020-08-24T19:18:23.7485662Z EqualsVerifier found a problem in class org.assertj.core.api.recursive.comparison.FieldLocation.
2020-08-24T19:18:23.7489677Z -> Unsupported class file major version 60
2020-08-24T19:18:23.7490709Z 
2020-08-24T19:18:23.7496702Z For more information, go to: http://www.jqno.nl/equalsverifier/errormessages
2020-08-24T19:18:23.7504713Z 	at nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi.verify(SingleTypeEqualsVerifierApi.java:271)
2020-08-24T19:18:23.7513305Z 	at org.assertj.core.api.recursive.comparison.FieldLocation_Test.should_honor_equals_contract(FieldLocation_Test.java:34)
2020-08-24T19:18:23.7531906Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-08-24T19:18:23.7539397Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
2020-08-24T19:18:23.7549154Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-08-24T19:18:23.7554155Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
2020-08-24T19:18:23.7561378Z 	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
2020-08-24T19:18:23.7568242Z 	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
2020-08-24T19:18:23.7577359Z 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
2020-08-24T19:18:23.7666265Z 	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
2020-08-24T19:18:23.7674271Z 	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
2020-08-24T19:18:23.7681762Z 	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
2020-08-24T19:18:23.7691062Z 	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
2020-08-24T19:18:23.7699980Z 	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
2020-08-24T19:18:23.7709918Z 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
2020-08-24T19:18:23.7717766Z 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
2020-08-24T19:18:23.7726229Z 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
2020-08-24T19:18:23.7734035Z 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
2020-08-24T19:18:23.7740676Z 	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
2020-08-24T19:18:23.7747251Z 	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
2020-08-24T19:18:23.7755979Z 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:212)
2020-08-24T19:18:23.7763644Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7771866Z 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:208)
2020-08-24T19:18:23.7779525Z 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)
2020-08-24T19:18:23.7841170Z 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
2020-08-24T19:18:23.7842268Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
2020-08-24T19:18:23.7843264Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7844261Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-08-24T19:18:23.7845255Z 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-08-24T19:18:23.7846470Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-08-24T19:18:23.7847487Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7848486Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-08-24T19:18:23.7849469Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-08-24T19:18:23.7850453Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2020-08-24T19:18:23.7851473Z 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
2020-08-24T19:18:23.7852767Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
2020-08-24T19:18:23.7857403Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7859350Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-08-24T19:18:23.7861349Z 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-08-24T19:18:23.7862389Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-08-24T19:18:23.7863387Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7864380Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-08-24T19:18:23.7865370Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-08-24T19:18:23.7867015Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2020-08-24T19:18:23.7868702Z 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
2020-08-24T19:18:23.7870377Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
2020-08-24T19:18:23.7871395Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7872163Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-08-24T19:18:23.7872840Z 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-08-24T19:18:23.7874482Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-08-24T19:18:23.7875116Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-24T19:18:23.7876240Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-08-24T19:18:23.7877943Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-08-24T19:18:23.7878590Z 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
2020-08-24T19:18:23.7879682Z 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
2020-08-24T19:18:23.7881518Z 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
2020-08-24T19:18:23.7882030Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
2020-08-24T19:18:23.7883532Z 	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
2020-08-24T19:18:23.7895610Z 	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
2020-08-24T19:18:23.7897068Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
2020-08-24T19:18:23.7897925Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
2020-08-24T19:18:23.7898840Z 	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
2020-08-24T19:18:23.7900366Z 	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
2020-08-24T19:18:23.7902148Z 	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
2020-08-24T19:18:23.7902813Z 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
2020-08-24T19:18:23.7903899Z 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
2020-08-24T19:18:23.7905889Z 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
2020-08-24T19:18:23.7906376Z Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 60
2020-08-24T19:18:23.7907859Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:196)
2020-08-24T19:18:23.7908519Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:177)
2020-08-24T19:18:23.8002781Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:163)
2020-08-24T19:18:23.8011327Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.utility.OpenedClassReader.of(OpenedClassReader.java:86)
2020-08-24T19:18:23.8018378Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default.parse(TypePool.java:679)
2020-08-24T19:18:23.8030387Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default.doDescribe(TypePool.java:665)
2020-08-24T19:18:23.8038024Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$AbstractBase.describe(TypePool.java:406)
2020-08-24T19:18:23.8046622Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$AbstractBase$Hierarchical.describe(TypePool.java:482)
2020-08-24T19:18:23.8057111Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default$LazyTypeDescription$AnnotationToken.toAnnotationDescription(TypePool.java:5332)
2020-08-24T19:18:23.8066781Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default$LazyTypeDescription$AnnotationToken.access$2000(TypePool.java:5284)
2020-08-24T19:18:23.8076771Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyAnnotationDescription.asList(TypePool.java:5893)
2020-08-24T19:18:23.8086332Z 	at nl.jqno.equalsverifier.internal.lib.bytebuddy.pool.TypePool$Default$LazyTypeDescription.getDeclaredAnnotations(TypePool.java:2681)
2020-08-24T19:18:23.8095110Z 	at nl.jqno.equalsverifier.internal.reflection.annotations.AnnotationCacheBuilder.visitClass(AnnotationCacheBuilder.java:96)
2020-08-24T19:18:23.8103830Z 	at nl.jqno.equalsverifier.internal.reflection.annotations.AnnotationCacheBuilder.visitType(AnnotationCacheBuilder.java:52)
2020-08-24T19:18:23.8112252Z 	at nl.jqno.equalsverifier.internal.reflection.annotations.AnnotationCacheBuilder.build(AnnotationCacheBuilder.java:38)
2020-08-24T19:18:23.8119422Z 	at nl.jqno.equalsverifier.internal.util.Configuration.buildAnnotationCache(Configuration.java:122)
2020-08-24T19:18:23.8125951Z 	at nl.jqno.equalsverifier.internal.util.Configuration.build(Configuration.java:87)
2020-08-24T19:18:23.8133906Z 	at nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi.buildConfig(SingleTypeEqualsVerifierApi.java:325)
2020-08-24T19:18:23.8142143Z 	at nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi.performVerification(SingleTypeEqualsVerifierApi.java:312)
2020-08-24T19:18:23.8149569Z 	at nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi.verify(SingleTypeEqualsVerifierApi.java:267)
2020-08-24T19:18:23.8151363Z 	... 66 more

Example test: https://github.com/joel-costigliola/assertj-core/blob/424805bafc451eebfaa32b79f0c3292b15bfc1af/src/test/java/org/assertj/core/api/recursive/comparison/FieldLocation_Test.java#L30-L35

Build run: https://github.com/joel-costigliola/assertj-core/runs/1023223509

@scordio
Copy link
Contributor Author

scordio commented Aug 24, 2020

It seems to fail inside Byte Buddy according to the stack trace, although Byte Buddy version 1.10.14 should already have experimental support for Java 16. @raphw, would it make sense to raise a separate issue for Byte Buddy?

@scordio
Copy link
Contributor Author

scordio commented Aug 24, 2020

@jqno I'd propose to add Java 16 to the CI configuration. If you agree, I can raise a PR about it.

@raphw
Copy link

raphw commented Aug 24, 2020

Should work with -net.bytebuddy.experimental=true.

@scordio
Copy link
Contributor Author

scordio commented Aug 25, 2020

Thanks for the fast feedback @raphw!

@jqno
Copy link
Owner

jqno commented Aug 25, 2020

I already have a pipeline with -net.bytebuddy.experimental=true, I just haven't switched it over to JDK 16 yet. Thanks for the reminder! I'll look into that today.

@jqno
Copy link
Owner

jqno commented Aug 25, 2020

I've switched over the weekly regression build to JDK 16. Just to try it out, I've added JDK 16 also to the on-push trigger job. It builds fine with the -net.bytebuddy.experimental=true flag.

@scordio
Copy link
Contributor Author

scordio commented Aug 27, 2020

-Dnet.bytebuddy.experimental=true did not work because ByteBuddy is shaded in EqualsVerifier, which has also an impact on the experimental flag.

Setting -Dnl.jqno.equalsverifier.internal.lib.bytebuddy.experimental=true works fine.

Maybe it's a minor detail, but what do you think about excluding that property from the shading configuration?

@jqno
Copy link
Owner

jqno commented Aug 28, 2020

I wasn't aware that shading changes this setting. Yeah, I think it's a good idea to make sure that shading doesn't change that. Can you help me set that up?

@jqno jqno reopened this Aug 28, 2020
@scordio
Copy link
Contributor Author

scordio commented Aug 28, 2020

Sure, I'll play with it and raise a PR (I anyway wanted to do the same in AssertJ).

@jqno
Copy link
Owner

jqno commented Aug 28, 2020

Awesome, thanks!

@jqno
Copy link
Owner

jqno commented Sep 8, 2020

I've just released this in version 3.4.3.

@scordio
Copy link
Contributor Author

scordio commented Sep 8, 2020

Thanks!

@scordio
Copy link
Contributor Author

scordio commented Sep 16, 2020

I've just released this in version 3.4.3.

It seems that version 3.4.3 is still not available on Maven Central.

@jqno
Copy link
Owner

jqno commented Sep 17, 2020

Oh, that's awkward. Looks like I made a mistake in the release procedure. It's fixed now, and should be syncing with Maven Central as we speak. Thanks for letting me know!

@scordio
Copy link
Contributor Author

scordio commented Sep 17, 2020

I guess the search UI needs more time for the sync, but at least it's available here: https://repo.maven.apache.org/maven2/nl/jqno/equalsverifier/equalsverifier/3.4.3/.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants