You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Peter De Maeyer (Jira)" <ji...@apache.org> on 2020/11/28 19:08:00 UTC

[jira] [Commented] (CXF-8381) EasyMock is causing illegal reflective access warning with Java 11

    [ https://issues.apache.org/jira/browse/CXF-8381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240033#comment-17240033 ] 

Peter De Maeyer commented on CXF-8381:
--------------------------------------

I took a quick look at the source code what it would take to migrate from EasyMock to Mockito... 322 occurrences.
That's a lot of work to do all at once, but maybe it can be done gradually, _if_ there is an agreement at least that it would be a good idea...
Since it's been over 10 years since I used EasyMock, I took a trip down memory lane by looking at one of the tests, and immediately I remembered why I like Mockito so much better:
# EasyMock has an annoying coupling of expectations (expected invocations) and the mocking/stubbing of behavior. Mockito decouples both, which is much more intuitive and elegant.
# EasyMock has this silly 'replay' that you have to call to switch your mock in the right state. I had almost forgotten (more like suppressed it from memory).

> EasyMock is causing illegal reflective access warning with Java 11
> ------------------------------------------------------------------
>
>                 Key: CXF-8381
>                 URL: https://issues.apache.org/jira/browse/CXF-8381
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.4.1
>            Reporter: Peter De Maeyer
>            Priority: Minor
>
> When I build cxf master with Java 11, there is a warning about an illegal reflective access operation:
> {noformat}
> [ERROR] WARNING: An illegal reflective access operation has occurred
> [ERROR] WARNING: Illegal reflective access by org.easymock.cglib.core.ReflectUtils$1 (file:/home/peter/.m2/repository/org/easymock/easymock/4.2/easymock-4.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
> [ERROR] WARNING: Please consider reporting this to the maintainers of org.easymock.cglib.core.ReflectUtils$1
> [ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> [ERROR] WARNING: All illegal access operations will be denied in a future release
> {noformat}
> This probably needs to be fixed in EasyMock, or maybe it is already fixed in EasyMock and CXF just needs to bump the version of the dependency?
> Slightly off topic: I was surprised EasyMock is still alive...
> I switched from EasyMock to Mockito 15 years ago or so, across different companies and different projects, and never looked back.
> Could CXF consider doing the same?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)