Skip to content

Commit 040a3de

Browse files
derrickburnsclaude
andcommitted
fix: add scala-parallel-collections for Scala 2.12 compatibility
The CollectionConverters import requires scala-parallel-collections library for both Scala 2.12 and 2.13. Added version 0.2.0 for 2.12 and kept 1.0.4 for 2.13. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 56be979 commit 040a3de

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

build.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
"org.scalacheck" %% "scalacheck" % "1.17.0" % "test"
2828
)
2929

30-
// Scala 2.13 requires parallel collections as a separate dependency
30+
// Both Scala 2.12 and 2.13 need parallel collections library for CollectionConverters
3131
libraryDependencies ++= {
3232
CrossVersion.partialVersion(scalaVersion.value) match {
33+
case Some((2, 12)) =>
34+
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0")
3335
case Some((2, n)) if n >= 13 =>
3436
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4")
3537
case _ =>

src/main/scala/com/massivedatascience/clusterer/KMeansPlusPlus.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import com.massivedatascience.util.XORShiftRandom
2424

2525
import scala.annotation.tailrec
2626
import scala.collection.mutable.ArrayBuffer
27+
28+
// Cross-version compatible parallel collections import
2729
import scala.collection.parallel.CollectionConverters._
2830

2931
/** This implements the <a href="http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf">KMeans++ initialization

0 commit comments

Comments
 (0)