Skip to content

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

Open

Description

@Capstan

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

Activity

  1. Capstan commented on Sep 6, 2019

    @Capstan
    Author

    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
    
  2. 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"[/+] on Sep 6, 2019
  3. Capstan commented on Sep 6, 2019

    @Capstan
    Author

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

  4. Capstan commented on Sep 6, 2019

    @Capstan
    Author

    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
    
  5. added 2 commits that reference this issue on Sep 6, 2019
    3f3a2dd
    1df6c03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions