sendgrid/java-http-client

JDK 9 support

Closed this issue · 2 comments

Issue Summary

The Sendgrid Java Http Client dependency on version 1.10.19 of mockito-core leads to the following warning when running a Scala project using JDK 9:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.mockito.cglib.core.ReflectUtils$2 (file:/home/petrova/.ivy2/cache/org.mockito/mockito-core/jars/mockito-core-1.10.19.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.mockito.cglib.core.ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I assume pure Java 9 projects would have a similar issue.

As mentioned in this issue, the warning can be avoided by upgrading to mockito version 2.13.0.

Steps to Reproduce

  1. Run tests for project which make use of the Sendgrid Java HTTP client
  2. Receive the following warning in the terminal

Expectations: Not to see the warning.

Technical details:

  • java-http-client Version: 4.1.0 (as the dependency is pulled in from sendgrid-java, which has not yet upgraded to 4.2.0). (I can also open up an issue over there if that is helpful).
  • Java Version: 9

Let me know if there is any other information I can provide which would be useful!

Thanks for taking the time to report this @outkaj!

Mokito should only be necessary for development work on this library. Moving Mokito to a test dependency should do the trick also.

This issue has been added to our backlog for a fix.

With Best Regards,

Elmer

It looks like this is done, we just need to deploy the fix.