Dear Jens, this is indeed a known limitation. Not because of the default method, but because of the exception which is always thrown. See FAQ <https://www.jacoco.org/jacoco/trunk/doc/faq.html>:
> Source code lines with exceptions show no coverage. Why? > > JaCoCo determines code execution with so called probes. Probes are inserted > into the control flow at certain positions. Code is considered as executed > when a subsequent probe has been executed. In case of exceptions such a > sequence of instructions is aborted somewhere in the middle and the > corresponding lines of source code are not marked as covered. > Regards, -marc > On 13. Jun 2024, at 13:03, 'Jens Kaiser' via JaCoCo and EclEmma Users > <jacoco@googlegroups.com> wrote: > > Hi *, > > one of my projects contains an interface with some default methods. > > public interface ExpressionVisitor<I, O> { > default O handleWithException(Object expression) { > throw new UnsupportedOperationException("unsupported"); > } > > default O visit(Node expression, I input) { > return handleWithException(expression); > } > } > > The visit method is called directly in some tests an is never overridden. But > only the handleWithException coverage can be found, not the coverage of the > visit method. In the Intellij coverage tool I can see the coverage for visit. > > Is this a known limitation of jacoco? > > Thank you in advance. > > -- > 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 > <mailto:jacoco+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/2d72316c-f8f6-42f1-8281-fa22bc724b39n%40googlegroups.com > > <https://groups.google.com/d/msgid/jacoco/2d72316c-f8f6-42f1-8281-fa22bc724b39n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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 on the web visit https://groups.google.com/d/msgid/jacoco/FF680E1B-4337-4681-8BD3-E00D51AD289D%40mountainminds.com.