Skip to content

Commit 3be423b

Browse files
committed
Issues with 1.0.4 locally, now fixed
1 parent 77c7cf5 commit 3be423b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

scalac-scoverage-plugin/src/main/scala/scoverage/report/CodeGrid.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ class CodeGrid(mfile: MeasuredFile) {
2323
mfile.statements.foreach(stmt => {
2424
for ( k <- stmt.start until stmt.end ) {
2525
if (k < cells.size) {
26-
// if the cell is set to NotInvoked, then it cannot be changed further, even if an outer statement
27-
// is green. This is because, for example, a block may be entered, but not all contained statements
26+
// if the cell is set to Invoked, then it be changed to NotInvoked, as an inner statement will override
27+
// outer containing statments. If a cell is NotInvoked then it can not be changed further.
2828
// in that block were executed
29-
if (cells(k).status != NotInvoked) {
30-
if (stmt.isInvoked) cells(k).status = Invoked
29+
cells(k).status match {
30+
case Invoked => if (!stmt.isInvoked) cells(k).status = NotInvoked
31+
case NoData =>
32+
if (!stmt.isInvoked) cells(k).status = NotInvoked
33+
else if (stmt.isInvoked) cells(k).status = Invoked
34+
case NotInvoked =>
3135
}
3236
}
3337
}

scalac-scoverage-plugin/src/main/scala/scoverage/report/StatementWriter.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class StatementWriter(mfile: MeasuredFile) {
1919

2020
<table cellspacing="0" cellpadding="0" class="table statementlist">
2121
<tr>
22-
<th>Line Number</th>
23-
<th>Statement Id</th>
22+
<th>Line</th>
23+
<th>Stmt Id</th>
2424
<th>Pos</th>
25-
<th>Tree Type</th>
25+
<th>Tree</th>
2626
<th>Symbol</th>
2727
<th>Code</th>
2828
</tr>{mfile.statements.toSeq.sortBy(_.line).map(stmt => {

0 commit comments

Comments
 (0)