Closed planetf1 closed 5 years ago
I notice class java.lang.Object
is in the list of classes. This is one of the classes OpenJ9 does not allow to be modified. https://github.com/eclipse/openj9/blob/7b4ace6a507a7af17b138b1de663caadcee86241/runtime/util/hshelp.c#L3226
@gacholio
The MacOS build isn't ready for production yet (there are no official releases for JDK8) - it may not even be able to load the JIT yet, which might explain differences in behaviour from Windows (not that there are any intentional differences - all JVMTI features should work equally well on all platforms).
Thanks for the update. I think a fair conclusion would be that mockito inlining is not expected to work with OpenJ9 due to the attempted class modifications that mockito does for stubbing.
I would expect it to work if Object was not modified.
@planetf1 We're working to allow Object to be redefined. Can you provide a reproducible test I can run to very the feature?
I see it as well in the context of R3 Corda to an app similar https://github.com/corda/cordapp-example. There unfortunately I run into a further issue next to Mockito (https://github.com/puniverse/quasar/issues/321). Our app is closed source unfortunately, but if there is something I could try, you could let me know. Hope run into this issue with cordapp-example as well once the other issue is resolved.
@remmeier We've merged #4714 which allows redefinition of Object. Would you be able to test an AdoptOpenJDK nightly build later this week to validate this fixes the issue?
I should be able to test within a couple of days. Let me know when there is a jdk you'd like me to try with. Thanks
@DanHeidinga I have the same error in one of my project.
I can confirm that the latest nightly OpenJDK8U-jdk_x64_windows_openj9_2019-02-27-11-11.zip works fine and the mockito inline mode does not throw an error.
Excellent. Glad to hear it's resolved!
I can confirm I am no longer seeing this either. thanks!
I tried building http://github.com/odpi/egeria using the JDK 8 192 J9 SDK from adoptopenjdk on Windows 10. A few of the tests use mockito inline mocking and failed (see log below)
I then tried using JDK 8 192 SDK from adoptopenjdk on MacOS Mojave and it all seemed to work just fine, as indeed does both the oracle jdk on windows, and openjdk/hotspot on windows.
So this looks like an issue with the Windows 10 JDK
I do not know if this is a build issue, or the code.
original discussion was at https://adoptopenjdk.slack.com/archives/C09NLQQAV/p1540215988000100
Error I hit was:
It also looked somewhat similar to https://github.com/mockito/mockito/issues/801
As above - somewhat hard to determine where the responsiblities arise between
However the IMPACT to Java Developers is
Apologies no direct test case yet, but if you could offer some guidance on the best way to proceed I can look at putting a small module together that demonstrates the issue