File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ package scoverage
22
33import java .io ._
44import scala .xml .{XML , Utility , Node }
5+ import scala .collection .Set
6+ import scala .collection .mutable
7+ import scala .io .Source
58
69/** @author Stephen Samuel */
710object IOUtils {
@@ -28,14 +31,18 @@ object IOUtils {
2831 })
2932
3033 // loads all the invoked statement ids from the given files
31- def invoked (files : Seq [File ]): Seq [Int ] = {
32- files.flatMap {
33- file =>
34- val reader = new BufferedReader (new FileReader (file))
35- val line = reader.readLine()
34+ def invoked (files : Seq [File ]): Set [Int ] = {
35+ val acc = mutable.Set [Int ]()
36+ files.foreach { file =>
37+ val reader = Source .fromFile(file)
38+ for (line <- reader.getLines()) {
39+ if (! line.isEmpty) {
40+ acc += line.toInt
41+ }
42+ }
3643 reader.close()
37- line.split(" ;" ).filterNot(_.isEmpty).map(_.toInt)
3844 }
45+ acc
3946 }
4047
4148 /**
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ object Invoker {
3131 writer = new FileWriter (file, true )
3232 threadFile.set(writer)
3333 }
34- writer.append(id.toString + '; ' ).flush()
34+ writer.append(id.toString + '\n ' ).flush()
3535 }
3636}
You can’t perform that action at this time.
0 commit comments