diff --git a/coverage-parser/src/main/scala/com/codacy/parsers/implementation/CoberturaParser.scala b/coverage-parser/src/main/scala/com/codacy/parsers/implementation/CoberturaParser.scala
index 3568de3b..da256eab 100644
--- a/coverage-parser/src/main/scala/com/codacy/parsers/implementation/CoberturaParser.scala
+++ b/coverage-parser/src/main/scala/com/codacy/parsers/implementation/CoberturaParser.scala
@@ -7,6 +7,7 @@ import com.codacy.parsers.util.MathUtils._
import com.codacy.parsers.util.TextUtils
import com.codacy.parsers.{CoverageParser, XmlReportParser}
+import scala.collection.mutable
import scala.xml.{Elem, NodeSeq}
object CoberturaParser extends CoverageParser with XmlReportParser {
@@ -50,12 +51,18 @@ object CoberturaParser extends CoverageParser with XmlReportParser {
}
val fileHit = if (classHit.nonEmpty) { classHit.sum / classHit.length } else 0
- val lineHitMap: Map[Int, Int] =
- (for {
- xClass <- classes
- line <- xClass \\ "line"
- } yield (line \@ "number").toInt -> (line \@ "hits").toIntOrMaxValue).toMap
+ val map = mutable.Map.empty[Int, Int]
- CoverageFileReport(sourceFilename, fileHit, lineHitMap)
+ for {
+ xClass <- classes
+ line <- xClass \\ "line"
+ } {
+ val key = (line \@ "number").toInt
+ val value = (line \@ "hits").toIntOrMaxValue
+
+ map(key) = map.get(key).getOrElse(0) + value
+ }
+
+ CoverageFileReport(sourceFilename, fileHit, map.toMap)
}
}
diff --git a/coverage-parser/src/test/resources/test_cobertura.xml b/coverage-parser/src/test/resources/test_cobertura.xml
index ff31301a..e7ee31a1 100644
--- a/coverage-parser/src/test/resources/test_cobertura.xml
+++ b/coverage-parser/src/test/resources/test_cobertura.xml
@@ -9,6 +9,10 @@
+
+
+
+
diff --git a/coverage-parser/src/test/scala/com/codacy/parsers/CoberturaParserTest.scala b/coverage-parser/src/test/scala/com/codacy/parsers/CoberturaParserTest.scala
index 540d198e..bfa3f115 100644
--- a/coverage-parser/src/test/scala/com/codacy/parsers/CoberturaParserTest.scala
+++ b/coverage-parser/src/test/scala/com/codacy/parsers/CoberturaParserTest.scala
@@ -36,7 +36,7 @@ class CoberturaParserTest extends WordSpec with BeforeAndAfterAll with Matchers
CoverageFileReport(
"coverage-parser/src/test/resources/TestSourceFile.scala",
87,
- Map(5 -> 1, 10 -> 1, 6 -> 2, 9 -> 1, 3 -> 0, 4 -> 1)
+ Map(5 -> 1, 10 -> 1, 6 -> 2, 9 -> 1, 3 -> 0, 4 -> 1, 7 -> 1, 8 -> 3)
)
)
)
diff --git a/coverage-parser/src/test/scala/com/codacy/parsers/CoverageParserFactoryTest.scala b/coverage-parser/src/test/scala/com/codacy/parsers/CoverageParserFactoryTest.scala
index b89a1085..2814d42b 100644
--- a/coverage-parser/src/test/scala/com/codacy/parsers/CoverageParserFactoryTest.scala
+++ b/coverage-parser/src/test/scala/com/codacy/parsers/CoverageParserFactoryTest.scala
@@ -21,7 +21,7 @@ class CoverageParserFactoryTest extends WordSpec with BeforeAndAfterAll with Mat
CoverageFileReport(
"coverage-parser/src/test/resources/TestSourceFile.scala",
87,
- Map(5 -> 1, 10 -> 1, 6 -> 2, 9 -> 1, 3 -> 0, 4 -> 1)
+ Map(5 -> 1, 10 -> 1, 6 -> 2, 9 -> 1, 3 -> 0, 4 -> 1, 7 -> 1, 8 -> 3)
)
)
)
diff --git a/graalvm/build-deps.sh b/graalvm/build-deps.sh
index 2fbedf5c..bac5a54b 100755
--- a/graalvm/build-deps.sh
+++ b/graalvm/build-deps.sh
@@ -12,7 +12,7 @@ export CC=$TOOLCHAIN_DIR/bin/gcc
zlib='zlib-1.2.13'
zlibtargz=$zlib.tar.gz
-curl https://zlib.net/$zlibtargz --output $zlibtargz
+curl https://zlib.net/fossils/$zlibtargz --output $zlibtargz
tar -xf $zlibtargz
(