Skip to content

Conversation

andrioli
Copy link
Member

@andrioli andrioli commented Mar 6, 2024

No description provided.

@andrioli andrioli self-assigned this Mar 6, 2024
@andrioli
Copy link
Member Author

andrioli commented Mar 6, 2024

🕵🏻‍♂️ found it... Looks that JaCoCo prior to 0.8.9 was hiding the issue related to Mockito!

Build with JDK >= 16 is failing with the following 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 @cafebabe

@andrioli andrioli closed this Mar 6, 2024
@andrioli andrioli mentioned this pull request Mar 6, 2024
andrioli added a commit that referenced this pull request Mar 6, 2024
This is only for JDK >= 16.

Without this fix some unit tests that uses Mockito will fail with the
following 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 @cafebabe
```

We notice this error only after upgrade JaCoCo to version 0.8.9 because
prior this version the error was being hide by a side effect of JaCoCo.

See: jacoco/jacoco#1334
See: jacoco/jacoco#1328
See: #86 (comment)
See: #86 (comment)
See: #86 (comment)
See: #87

This is a workaround and the added profile should be removed in the
future in order of a definitive fix (maybe Mockito upgrade).

This reverts commit 31a8d68.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant