adjustments for Scala 2.12.0-M4

This commit is contained in:
Patrik Nordwall 2016-04-13 17:33:32 +02:00
parent 55e08682c5
commit 140a5b29f6
3 changed files with 30 additions and 13 deletions

View file

@ -3,6 +3,7 @@
*/
package akka.util
import java.util.Comparator
import org.scalatest.Matchers
import scala.concurrent.Future
import akka.testkit.AkkaSpec
@ -12,7 +13,9 @@ import akka.testkit.DefaultTimeout
class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
implicit val ec = system.dispatcher
private def emptyIndex = new Index[String, Int](100, _ compareTo _)
private def emptyIndex = new Index[String, Int](100, new Comparator[Int] {
override def compare(a: Int, b: Int): Int = Integer.compare(a, b)
})
private def indexWithValues = {
val index = emptyIndex
@ -92,7 +95,9 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
index.isEmpty should ===(true)
}
"be able to be accessed in parallel" in {
val index = new Index[Int, Int](100, _ compareTo _)
val index = new Index[Int, Int](100, new Comparator[Int] {
override def compare(a: Int, b: Int): Int = Integer.compare(a, b)
})
val nrOfTasks = 10000
val nrOfKeys = 10
val nrOfValues = 10

View file

@ -59,7 +59,9 @@ private[akka] object MessageDispatcher {
// dispatcher debugging helper using println (see below)
// since this is a compile-time constant, scalac will elide code behind if (MessageDispatcher.debug) (RK checked with 2.9.1)
final val debug = false // Deliberately without type ascription to make it a compile-time constant
lazy val actors = new Index[MessageDispatcher, ActorRef](16, _ compareTo _)
lazy val actors = new Index[MessageDispatcher, ActorRef](16, new ju.Comparator[ActorRef] {
override def compare(a: ActorRef, b: ActorRef): Int = a.compareTo(b)
})
def printActors(): Unit =
if (debug) {
for {

View file

@ -12,18 +12,29 @@ object Dependencies {
lazy val scalaTestVersion = settingKey[String]("The version of ScalaTest to use.")
lazy val scalaStmVersion = settingKey[String]("The version of ScalaSTM to use.")
lazy val scalaCheckVersion = settingKey[String]("The version of ScalaCheck to use.")
lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.")
val junitVersion = "4.12"
val Versions = Seq(
crossScalaVersions := Seq("2.11.7"), // "2.12.0-M3"
crossScalaVersions := Seq("2.11.7"), // "2.12.0-M4"
scalaVersion := crossScalaVersions.value.head,
scalaStmVersion := sys.props.get("akka.build.scalaStmVersion").getOrElse("0.7"),
scalaCheckVersion := sys.props.get("akka.build.scalaCheckVersion").getOrElse("1.11.6"),
scalaTestVersion := (
if (scalaVersion.value == "2.12.0-M2") "2.2.5-M2"
else if (scalaVersion.value == "2.12.0-M3") "2.2.5-M3"
else "2.2.4"
)
scalaTestVersion := {
scalaVersion.value match {
case "2.12.0-M1" => "2.2.5-M1"
case "2.12.0-M2" => "2.2.5-M2"
case "2.12.0-M3" => "2.2.5-M3"
case "2.12.0-M4" => "2.2.6"
case _ => "2.2.4"
}
},
java8CompatVersion := {
scalaVersion.value match {
case "2.12.0-M4" => "0.8.0-RC1"
case _ => "0.7.0"
}
}
)
object Compile {
@ -65,7 +76,7 @@ object Dependencies {
val junit = "junit" % "junit" % junitVersion // Common Public License 1.0
// For Java 8 Conversions
val java8Compat = "org.scala-lang.modules" %% "scala-java8-compat" % "0.7.0" // Scala License
val java8Compat = Def.setting {"org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value} // Scala License
object Docs {
val sprayJson = "io.spray" %% "spray-json" % "1.3.2" % "test"
@ -119,7 +130,7 @@ object Dependencies {
// TODO check if `l ++=` everywhere expensive?
val l = libraryDependencies
val actor = l ++= Seq(config, java8Compat)
val actor = l ++= Seq(config, java8Compat.value)
val testkit = l ++= Seq(Test.junit, Test.scalatest.value) ++ Test.metricsAll
@ -166,11 +177,10 @@ object Dependencies {
// akka stream & http
lazy val httpCore = l ++= Seq(
java8Compat,
Test.sprayJson, // for WS Autobahn test metadata
Test.junitIntf, Test.junit, Test.scalatest.value)
lazy val http = l ++= Seq(java8Compat)
lazy val http = l ++= Nil
// special, since it also includes a compiler plugin
lazy val parsing = Seq(