Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not sure it is possible to get a full coverage, since <a href="http://sourceforge.net/tracker/?func=detail&amp;aid=2939804&amp;group_id=108932&amp;atid=651897" rel="nofollow noreferrer">issue 2939804</a> reports:</p> <blockquote> <p>EMMA always marks <code>synchronized(..)</code> as <strong>partially covered</strong></p> <p>Examples:</p> </blockquote> <pre><code>synchronized (lock) // partially covered (yellow line in EclEmma) { // ... } synchronized (this) // partially covered (yellow line in EclEmma) { // ... } </code></pre> <p>Maybe a different tool (<a href="http://www.rhq-project.org/display/RHQ/Code+coverage+tools#Codecoveragetools-b%29Toolsthatfullfillscriteria" rel="nofollow noreferrer">like Cobertura</a>) would yield a different result? (I have not tested it recently).</p> <hr> <p>Update December 2012 (more than 2 years later):</p> <p><a href="https://stackoverflow.com/users/651536/nathan-d-ryan">Nathan D Ryan</a> <a href="https://stackoverflow.com/questions/3715213/why-doesnt-eclemma-cover-syncronizedmyclass-class/3715232#comment19101236_3715232">reports</a>:</p> <blockquote> <p><code>synchronized</code> will light to green if the synchronized block contains code that waits on an object monitor, and a test interrupts the waiting thread. </p> <p>After a little experimentation, I was able to achieve complete coverage of the <code>synchronized</code> line if the <code>synchronized</code> block completed normally and completed abruptly due to an exception.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload