Hi, explicitly thrown Exceptions like throw new Exception();
should be marked as covered. We have an integration test for this <https://github.com/jacoco/jacoco/blob/master/org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/targets/ExceptionsTarget.java#L77>. Only lines with implicitly thown exception like methodThatThrowsAnException(); are not marked as covered due to a technical limitation. This is documented in the 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. Best regards, -marc > On 25. Jan 2024, at 10:22, RK <rajkumarprk...@gmail.com> wrote: > > I am new to jacoco and its group. Not sure whether i can post this query > here. Kindly let me know if any. > > I found that there are some limitations in jacoco like throw exception line > will always be in red. > > Sample code : > > boolean value=true; > if(value){ > throw new IOException("exeception"); > } > > > > Like this , is there any other limitations in jacoco? > > if there is any document or thread which discuss this kind of limitations , > kindly share some info on this. > > I have seen the FAQ <https://www.jacoco.org/jacoco/trunk/doc/faq.html> but > still i am not understand clearly . Going through the previous conversations. > Help is much appreciated > > Thanks 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/68313ee5-eb54-441e-80ee-184e7f786958n%40googlegroups.com > > <https://groups.google.com/d/msgid/jacoco/68313ee5-eb54-441e-80ee-184e7f786958n%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/E15DE9C4-23EF-4762-957B-3C6614CDF7A0%40mountainminds.com.