java-json-tools / jackson-coreutils

JSON Pointer (RFC 6901) and numeric JSON equivalence for Jackson (2.2.x)
Other
5 stars 6 forks source link

Warning "Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger" #16

Open Capstan opened 5 years ago

Capstan commented 5 years ago

I see this error in the Travis CI builds, but not in local builds.

https://github.com/mockito/mockito-cglib/issues/1 seems like it's calling out use of an older mockito, but when updating to the last Java 6-supporting v2.x (v2.28.2), it produces a similar error: WARNING: Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger

Capstan commented 5 years ago

With the update to Mockito 2.28.2 in commit 15e3fdc, going to retitle this.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger (file:/home/travis/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/2.28.2/91110215a8cb9b77a46e045ee758f77d79167cc0/mockito-core-2.28.2.jar) to field java.io.StringReader.str
WARNING: Please consider reporting this to the maintainers of org.mockito.internal.util.reflection.AccessibilityChanger
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
Capstan commented 5 years ago

https://github.com/mockito/mockito/issues/1325 suggests that we have some improper uses of spy on final classes.

Capstan commented 5 years ago

With --invalid-access=deny, I get the following failures:

Gradle suite > Gradle test > com.github.fge.jackson.JsonNodeReaderTest.readerIsClosedOnRead FAILED
    java.lang.NullPointerException at JsonNodeReaderTest.java:66
Gradle suite > Gradle test > com.github.fge.jackson.JsonNodeReaderTest.streamIsClosedOnRead FAILED
    com.fasterxml.jackson.core.JsonParseException at JsonNodeReaderTest.java:55