code coverage and try-finally

48 views
Skip to first unread message

silve...@gmail.com

unread,
Dec 22, 2014, 3:36:16 AM12/22/14
to jac...@googlegroups.com
In following code I've got coverage till return but not for finally and related code when java actually run it. What is the mistake ?

public String getNodeID() {
mResourcesNodesLock.lock();
try {
return mResourcesNodes.get(LOCAL_RESOURCES_NODE).id;
} finally {
mResourcesNodesLock.unlock();
}
}

Mirko Friedenhagen

unread,
Dec 22, 2014, 5:09:08 AM12/22/14
to jac...@googlegroups.com

Silvio, the java compiler is probably creating multiple branches in byte code for your source. The number of branches depend on the jdk version.

Just search in your favorite  search engine for "jacoco try finally".

Regards
Mirko
--
Sent from my mobile

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/0740fa04-0f90-4f4d-863c-9d0ea5ebb580%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages