Fix TraversableOnce deprecation warnings
Fixes following warning:
type TraversableOnce in package scala is deprecated (since 2.13.0): Use IterableOnce instead of TraversableOnce
Change-Id: I641588ee14ea4c52000959eebf6714ae3338b1fd
diff --git a/build.sbt b/build.sbt
index d24135d..144f784 100644
--- a/build.sbt
+++ b/build.sbt
@@ -8,7 +8,7 @@
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)
-ThisBuild / scalacOptions += "-feature"
+ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature")
lazy val root = (project in file("."))
.settings(
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
index b9427d3..5047805 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
@@ -139,7 +139,7 @@
def get(projectRes: ProjectResource, startDate: Option[Long], stopDate: Option[Long],
aggregationStrategy: AggregationStrategy, extractBranches: Boolean)
- : TraversableOnce[UserActivitySummary] = {
+ : IterableOnce[UserActivitySummary] = {
Using.resource(repoManager.openRepository(projectRes.getNameKey)) { repo =>
val stats = new Statistics(projectRes.getNameKey, commitsStatisticsCache)
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
index 310ccd0..70df461 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
@@ -28,7 +28,7 @@
.registerTypeHierarchyAdapter(classOf[Iterable[Any]], new IterableSerializer)
.registerTypeHierarchyAdapter(classOf[Option[Any]], new OptionSerializer())
- def format[T](values: TraversableOnce[T], out: PrintWriter) = {
+ def format[T](values: IterableOnce[T], out: PrintWriter) = {
val gson: Gson = gsonBuilder.create
for (value <- values) {
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/JsonStreamedResultBuilder.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/JsonStreamedResultBuilder.scala
index de01b79..7e3c507 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/JsonStreamedResultBuilder.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/JsonStreamedResultBuilder.scala
@@ -21,7 +21,7 @@
import scala.util.Using
class GsonStreamedResult[T](val jsonFmt: GsonFormatter,
- val committers: TraversableOnce[T]) extends BinaryResult {
+ val committers: IterableOnce[T]) extends BinaryResult {
override def writeTo(os: OutputStream) =
Using.resource(new PrintWriter(os))(jsonFmt.format(committers, _))
}