Hi,

This case requires improvement on JaCoCo side - 
see https://github.com/jacoco/jacoco/issues/1905

On Friday, June 27, 2025 at 5:47:56 PM UTC+2 zolbr...@gmail.com wrote:

Hey all,

When using JaCoCo 0.8.13 with Kotlin 2.2.0 code, I noticed that there are 
new interface methods that are marked as uncovered compared to Kotlin 
2.1.21.

After doing some digging, I saw this called out in the Kotlin 2.2.0 changes:

https://kotlinlang.org/docs/whatsnew22.html#changes-to-default-method-generation-for-interface-functions

And with the JvmDefaultMode.NO_COMPATIBILITY option it resolves the issues.

Here's an example:

`interface IMyMoviesViewModelProviderFactory : ViewModelProvider.Factory`

shows missing coverage on the default implementations of the 
`ViewModelProvider.Factory` interface (see attached image).

Additionally, for the implementation of this 
`IMyMoviesViewModelProviderFactory` interface, I only override the `public 
fun <T : ViewModel> create(modelClass: Class<T>)` method.  Coverage data 
shows that the class is missing coverage for the implementations of the 
other `ViewModelProvider.Factory` related methods, as I assume the default 
methods generated are being represented here.  I've attached a screenshot 
of this as well.

I admit I am not well versed in the tech stack here, in knowing how JaCoCo 
and/or Kotlin function - but it does seem like there's a disconnect with 
Kotlin 2.2.0 and JaCoCo coverage - does this seem like it's an issue on the 
JaCoCo side that needs to be closed out? Or should I report this on the 
Kotlin side?

Thanks all, open to hearing what you think!

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/jacoco/1af65728-67d5-4be5-8fc2-5dc06ec65475n%40googlegroups.com.

Reply via email to