@@ -75,32 +75,32 @@ object Serializer {
75
75
def coverageFile (dataDir : String ): File = new File (dataDir, Constants .CoverageFileName )
76
76
77
77
def deserialize (file : File ): Coverage = {
78
- deserialize(Source .fromFile(file)(Codec .UTF8 ).getLines)
78
+ deserialize(Source .fromFile(file)(Codec .UTF8 ).getLines() )
79
79
}
80
80
81
81
def deserialize (lines : Iterator [String ]): Coverage = {
82
82
def toStatement (lines : Iterator [String ]): Statement = {
83
- val id : Int = lines.next.toInt
84
- val sourcePath = lines.next
85
- val packageName = lines.next
86
- val className = lines.next
87
- val classType = lines.next
88
- val fullClassName = lines.next
89
- val method = lines.next
83
+ val id : Int = lines.next() .toInt
84
+ val sourcePath = lines.next()
85
+ val packageName = lines.next()
86
+ val className = lines.next()
87
+ val classType = lines.next()
88
+ val fullClassName = lines.next()
89
+ val method = lines.next()
90
90
val loc = Location (packageName, className, fullClassName, ClassType .fromString(classType), method, sourcePath)
91
- val start : Int = lines.next.toInt
92
- val end : Int = lines.next.toInt
93
- val lineNo : Int = lines.next.toInt
94
- val symbolName : String = lines.next
95
- val treeName : String = lines.next
96
- val branch : Boolean = lines.next.toBoolean
97
- val count : Int = lines.next.toInt
98
- val ignored : Boolean = lines.next.toBoolean
91
+ val start : Int = lines.next() .toInt
92
+ val end : Int = lines.next() .toInt
93
+ val lineNo : Int = lines.next() .toInt
94
+ val symbolName : String = lines.next()
95
+ val treeName : String = lines.next()
96
+ val branch : Boolean = lines.next() .toBoolean
97
+ val count : Int = lines.next() .toInt
98
+ val ignored : Boolean = lines.next() .toBoolean
99
99
val desc = lines.toList.mkString(" \n " )
100
100
Statement (loc, id, start, end, lineNo, desc, symbolName, treeName, branch, count, ignored)
101
101
}
102
102
103
- val headerFirstLine = lines.next
103
+ val headerFirstLine = lines.next()
104
104
require(headerFirstLine == " # Coverage data, format version: 2.0" , " Wrong file format" )
105
105
106
106
val linesWithoutHeader = lines.dropWhile(_.startsWith(" #" ))
0 commit comments