jacoco icon indicating copy to clipboard operation
jacoco copied to clipboard

KotlinDefaultMethodsFilter should also filter methods with parameters

Open Godin opened this issue 4 years ago • 4 comments

See https://github.com/jacoco/jacoco/issues/905#issuecomment-746204180

Filter added by #1012 in version 0.8.6 doesn't take into account

  • methods with parameters
  • methods consisting of super call followed by code other than return
  • methods consisting of super call of method with different name

In the following example

interface I {
  fun m(p: Int) = Unit
}

class C : I {
}

method m generated by Kotlin compiler in C should be filtered out.


In the following example

interface I {
  fun m() = Unit
}

class C : I {
  override fun m() {
    super.m()
    println()
  }
}

method m in C should not be filtered out.


In the following example

interface I {
  fun m1() = Unit
  fun m2() = Unit
}

class C : I {
  override fun m1() {
    super.m2()
  }
}

method m1 in C should not be filtered out.

Godin avatar Dec 16 '20 13:12 Godin

Can you please move this to 0.8.9 and release 0.8.8 in the meantime? I don’t use Kotlin, but I do need the assert filtering… Thanks in advance!

mirabilos avatar Jun 21 '21 19:06 mirabilos

Would love to have this in jacoco 0.8.8! Any updates here?

alisonthemonster avatar Jul 08 '21 20:07 alisonthemonster

@alisonthemonster We're working in our spare time and completely transparently: All information and the current status of the implementation can be seen in this pull request.

marchof avatar Jul 09 '21 05:07 marchof

Looks good. When is the 0.8.9 release tentatively expected by?

pexa-adash avatar Apr 07 '22 14:04 pexa-adash