Skip to content

Update mockito to 4.11.0#309

Open
Dgzt wants to merge 1 commit into
JamesTKhan:masterfrom
Dgzt:mockito-version-update
Open

Update mockito to 4.11.0#309
Dgzt wants to merge 1 commit into
JamesTKhan:masterfrom
Dgzt:mockito-version-update

Conversation

@Dgzt

@Dgzt Dgzt commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator

The Mundus can not build with jdk >= 17 because there is this error:

Caused by:
java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @76552cb
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at org.mockito.cglib.core.ReflectUtils$2.run(ReflectUtils.java:57)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at org.mockito.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:47)
    ... 17 more

The mockito upgrade resolves this issue. With this fix the project can build with jdk 17 and jdk 21.

Without this fix, can run with jdk 21, but should build with jdk8.

@Dgzt Dgzt requested a review from JamesTKhan August 4, 2025 09:21
@Dgzt Dgzt added the bug Something isn't working label Aug 4, 2025
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

Successfully merging this pull request may close these issues.

1 participant