You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spying on ArrayList generates Illegal reflective access warning with Java 11 (12):
WARNING: Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger (file:/home/foobar/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/3.0.8/.../mockito-core-3.0.8.jar)
to field java.util.ArrayList.elementData
WARNING: Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger (file:/home/foobar/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/3.0.8/.../mockito-core-3.0.8.jar)
to field java.util.ArrayList.size
WARNING: Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger (file:/home/foobar/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/3.0.8/.../mockito-core-3.0.8.jar)
to field java.util.AbstractList.modCount
It's just a warning right now, but it could be disallowed one day, so maybe there is some other way to do that with ArrayList (and probably also some other classes from JDK).
The text was updated successfully, but these errors were encountered:
This is very expected since we rely on accessing all fields with reflection.
There is not really a good way around it for us, we need to access these fields. We could attempt to generated classes and inject them but this can only be done legally if the module and packages are open which then would also allow reflection.
Spying on
ArrayList
generates Illegal reflective access warning with Java 11 (12):Sample code to reproduce the situation:
Occurs with (at least):
It's just a warning right now, but it could be disallowed one day, so maybe there is some other way to do that with ArrayList (and probably also some other classes from JDK).
The text was updated successfully, but these errors were encountered: