Hi Nikola,

there is no simple relationship between probes and line numbers. Probes are 
inserted based on the control flow in methods. Line numbers depend on your 
source code formatting and the compiler.

That’s why JaCoCo needs the original class files to reconstruct coverage data 
from probes. The algorithm is documented here: 
https://www.jacoco.org/jacoco/trunk/doc/flow.html 
<https://www.jacoco.org/jacoco/trunk/doc/flow.html>

So my recommendation is to use JaCoCo based tools or the JaCoCo Java API to 
create line coverage. Here are some code examples: 
https://www.jacoco.org/jacoco/trunk/doc/api.html 
<https://www.jacoco.org/jacoco/trunk/doc/api.html>

Regards,
-marc



> On 14. Aug 2020, at 10:01, Nikola Veber <[email protected]> wrote:
> 
> Hi,
> 
> I have tried to figure this out by debugging during report generation, but 
> without much luck.
> 
> Can you suggest a way to get a correlation between source line numbers and 
> probe "ids"?
> 
> I would like to have something like 
> line x -> depends on probes [0, 2, 7] 
> (or the other way around)
> 
> 
> Cheers,
> Nikola
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/0e5fc174-1e86-4f1b-a70e-2670506baa9bn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/0e5fc174-1e86-4f1b-a70e-2670506baa9bn%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/5FF45787-D124-4D49-AF30-A25A8F58AEE1%40mountainminds.com.

Reply via email to