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

Embedded version of Byte Buddy fails to recognize Java 10 #177

Closed
don-vip opened this Issue Nov 3, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@don-vip
Contributor

don-vip commented Nov 3, 2017

What steps will reproduce the problem?

Run code with a project compiled with Java 10 EA build.

What is the code that triggers this problem?

Anything. All our tests using equalsverifier (53) are failing.

What error message or stack trace does EqualsVerifier give?

junit.framework.AssertionFailedError: UnsupportedOperationException: Cannot define class using reflection
	at nl.jqno.equalsverifier.EqualsVerifier.handleError(EqualsVerifier.java:384)
	at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:373)
	at org.openstreetmap.josm.actions.CombineWayActionTest.testEqualsContract(CombineWayActionTest.java:69)
	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 org.openstreetmap.josm.testutils.JOSMTestRules$TimeoutThread.run(JOSMTestRules.java:504)
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Unavailable.defineClass(ClassInjector.java:821)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:185)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:187)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:79)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4376)
	at nl.jqno.equalsverifier.internal.reflection.Instantiator.giveDynamicSubclass(Instantiator.java:103)
	at nl.jqno.equalsverifier.internal.reflection.Instantiator.instantiateAnonymousSubclass(Instantiator.java:87)
	at nl.jqno.equalsverifier.internal.reflection.ObjectAccessor.copyIntoAnonymousSubclass(ObjectAccessor.java:126)
	at nl.jqno.equalsverifier.internal.checkers.HierarchyChecker.checkSubclass(HierarchyChecker.java:137)
	at nl.jqno.equalsverifier.internal.checkers.HierarchyChecker.check(HierarchyChecker.java:61)
	at nl.jqno.equalsverifier.EqualsVerifier.verifyWithExamples(EqualsVerifier.java:434)
	at nl.jqno.equalsverifier.EqualsVerifier.performVerification(EqualsVerifier.java:396)
	at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:367)
Caused by: java.lang.IllegalArgumentException: Unknown Java version: 10
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.ClassFileVersion.ofJavaVersion(ClassFileVersion.java:135)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.ClassFileVersion$VersionLocator$ForJava9CapableVm.locate(ClassFileVersion.java:337)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.ClassFileVersion.ofThisVm(ClassFileVersion.java:147)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:301)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:290)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.<clinit>(ClassInjector.java:70)
	at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:184)

What did you expect?

Same behaviour as Java 9.

Which version of EqualsVerifier are you using?

2.3.3

Please provide any additional information below.

Embedded version of Byte Buddy is not up to date but I don't see any commit related to Java 10 yet, so probably we must ask to @raphw a new version :)

@jqno

This comment has been minimized.

Show comment
Hide comment
@jqno

jqno Nov 3, 2017

Owner

I suppose we must, although some of my other dependencies may need to upgrade as well; I'm not sure. It may not just be Byte Buddy.

In the mean time, I'm still wrapping my head around Java 9 ;).

Owner

jqno commented Nov 3, 2017

I suppose we must, although some of my other dependencies may need to upgrade as well; I'm not sure. It may not just be Byte Buddy.

In the mean time, I'm still wrapping my head around Java 9 ;).

@jqno jqno added the accepted label Nov 3, 2017

@don-vip

This comment has been minimized.

Show comment
Hide comment
@don-vip
Contributor

don-vip commented Nov 3, 2017

simon04 pushed a commit to openstreetmap/josm that referenced this issue Nov 4, 2017

floscher pushed a commit to floscher/josm that referenced this issue Nov 5, 2017

@raphw

This comment has been minimized.

Show comment
Hide comment
@raphw

raphw Nov 6, 2017

Is already fixed on master. Update version will come out some time this week.

raphw commented Nov 6, 2017

Is already fixed on master. Update version will come out some time this week.

@jqno

This comment has been minimized.

Show comment
Hide comment
@jqno

jqno Nov 7, 2017

Owner

Thanks @raphw for fixing this so quicky in Byte Buddy, and thanks @don-vip for the PRs! I'll try to do a release later this week.

Owner

jqno commented Nov 7, 2017

Thanks @raphw for fixing this so quicky in Byte Buddy, and thanks @don-vip for the PRs! I'll try to do a release later this week.

@jqno

This comment has been minimized.

Show comment
Hide comment
@jqno

jqno Nov 11, 2017

Owner

I just made a release for this (version 2.4).

Owner

jqno commented Nov 11, 2017

I just made a release for this (version 2.4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment