Hi Villu,

thanks for this follow-up! Anyways, in the particular example provided, you came across a known limitation: JaCoCo works on Java bytecode and therefore reflects certain compiler artifacts. In case of finally statements the code is actually emitted twice (once for the good case, once for the exception path). Therefore all branches seems to double. Please find a description here:

  https://github.com/jacoco/jacoco/wiki/filtering-JAVAC.FINALLY

Future versions of JaCoCo might detect and filter such situations.

Cheers,
-marc

On 2015-08-16 18:56, [email protected] wrote:
Answering myself. Maybe someone avoids spending searching solution.
Key point was moving Cobertura->Jacoco, as I wanted to keep both
coverage tools in work together. There were Cobertura-Instrumented
classes in classpath and these were causing these problems for jacoco
(most probably there was compiled into such info that was causing
problems), after removing cobertura totally, I am getting similar
results in Jacoco that were previously with Cobertura

Villu

pühapäev, 16. august 2015 0:02.34 UTC+3 kirjutas [email protected]:
Hi,

I am trying to move from Cobertura to jacoco and get huge branch coverage difference. Started to investigate it and..

Can someone explain what I am missing.

I have finally block in my code and it is:
              } finally {
                        try {
                                if (rs != null) {
                                        rs.close();
                                }
                                if (st != null) {
                                        st.close();
                                }
                                if (con != null) {
                                        con.close();
                                }

                        } catch (SQLException ex) {
                                ex.printStackTrace();
                        }
                }

And on that jacoco report thinks that

                                if (rs != null) { >> 0/8 branches
                                        rs.close(); >>0/12 branches
And so on. What are these 12 branches in rs.close() sentence? And in if I can get 2 (rs is NULL or isn't NULL)

Br,

Villu

--
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/bddd2315937fefaa8aa8ab52df966db4%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to