Skip to content
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

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

Open
Capstan opened this issue Sep 5, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@Capstan
Copy link

Capstan commented Sep 5, 2019

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

mockito/mockito-cglib#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 Capstan added the bug Something isn't working label Sep 5, 2019
@Capstan
Copy link
Author

Capstan commented Sep 6, 2019

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 Capstan changed the title Warning "Illegal reflective access by org.mockito.cglib.core.ReflectUtil$2" Warning "Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger" Sep 6, 2019
@Capstan
Copy link
Author

Capstan commented Sep 6, 2019

mockito/mockito#1325 suggests that we have some improper uses of spy on final classes.

@Capstan
Copy link
Author

Capstan commented Sep 6, 2019

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

Capstan added a commit to Capstan/jackson-coreutils that referenced this issue Sep 6, 2019
Capstan added a commit to Capstan/jackson-coreutils that referenced this issue Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant