diff --git a/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala b/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala index 39f8f769f5..d5c020be49 100644 --- a/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala @@ -33,11 +33,12 @@ class DurationSpec extends WordSpec with MustMatchers { val one = 1.second val inf = Duration.Inf val minf = Duration.MinusInf + val undefined = Duration.Undefined (-inf) must be(minf) - intercept[IllegalArgumentException] { minf + inf } - intercept[IllegalArgumentException] { inf - inf } - intercept[IllegalArgumentException] { inf + minf } - intercept[IllegalArgumentException] { minf - minf } + (minf + inf) must be(undefined) + (inf - inf) must be(undefined) + (inf + minf) must be(undefined) + (minf - minf) must be(undefined) (inf + inf) must be(inf) (inf - minf) must be(inf) (minf - inf) must be(minf) diff --git a/akka-camel/src/main/scala/akka/camel/Consumer.scala b/akka-camel/src/main/scala/akka/camel/Consumer.scala index 8a5db0a8ed..2915235745 100644 --- a/akka-camel/src/main/scala/akka/camel/Consumer.scala +++ b/akka-camel/src/main/scala/akka/camel/Consumer.scala @@ -8,6 +8,7 @@ import akka.camel.internal.CamelSupervisor.Register import org.apache.camel.model.{ RouteDefinition, ProcessorDefinition } import akka.actor._ import scala.concurrent.duration._ +import akka.dispatch.Mapper /** * Mixed in by Actor implementations that consume message from Camel endpoints. diff --git a/akka-camel/src/test/java/akka/camel/CustomRouteTestBase.java b/akka-camel/src/test/java/akka/camel/CustomRouteTestBase.java index c002bceec1..ae6d9c5531 100644 --- a/akka-camel/src/test/java/akka/camel/CustomRouteTestBase.java +++ b/akka-camel/src/test/java/akka/camel/CustomRouteTestBase.java @@ -17,7 +17,6 @@ import org.apache.camel.component.mock.MockEndpoint; import org.junit.Before; import org.junit.After; import org.junit.Test; -import scala.concurrent.util.FiniteDuration; import java.util.concurrent.TimeUnit; diff --git a/akka-camel/src/test/java/akka/camel/SampleErrorHandlingConsumer.java b/akka-camel/src/test/java/akka/camel/SampleErrorHandlingConsumer.java index 9c6af3ba2b..e8a057e1ac 100644 --- a/akka-camel/src/test/java/akka/camel/SampleErrorHandlingConsumer.java +++ b/akka-camel/src/test/java/akka/camel/SampleErrorHandlingConsumer.java @@ -12,7 +12,7 @@ import org.apache.camel.builder.Builder; import org.apache.camel.model.ProcessorDefinition; import org.apache.camel.model.RouteDefinition; import scala.Option; -import scala.concurrent.util.FiniteDuration; +import scala.concurrent.duration.FiniteDuration; /** * @author Martin Krasser diff --git a/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala b/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala index 9f4b802081..ca7b4ba3cc 100644 --- a/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala +++ b/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala @@ -6,7 +6,7 @@ package akka.camel import org.scalatest.matchers.MustMatchers import org.scalatest.WordSpec import akka.actor.ActorSystem -import scala.concurrent.util.Duration +import scala.concurrent.duration.Duration import java.util.concurrent.TimeUnit._ class CamelConfigSpec extends WordSpec with MustMatchers { diff --git a/akka-cluster/src/main/scala/akka/cluster/ClusterMetricsCollector.scala b/akka-cluster/src/main/scala/akka/cluster/ClusterMetricsCollector.scala index 180d3eb40a..984c7fa3b6 100644 --- a/akka-cluster/src/main/scala/akka/cluster/ClusterMetricsCollector.scala +++ b/akka-cluster/src/main/scala/akka/cluster/ClusterMetricsCollector.scala @@ -9,7 +9,7 @@ import scala.concurrent.duration._ import scala.collection.immutable.{ SortedSet, Map } import scala.concurrent.forkjoin.ThreadLocalRandom import scala.util.{ Try, Success, Failure } -import scala.math.ScalaNumber +import scala.math.ScalaNumericConversions import scala.runtime.{ RichLong, RichDouble, RichInt } import akka.actor._ @@ -238,7 +238,7 @@ private[cluster] case class MetricsGossipEnvelope(from: Address, gossip: Metrics * * @param startTime the time of initial sampling for this data stream */ -private[cluster] case class DataStream(decay: Int, ewma: ScalaNumber, startTime: Long, timestamp: Long) +private[cluster] case class DataStream(decay: Int, ewma: ScalaNumericConversions, startTime: Long, timestamp: Long) extends ClusterMessage with MetricNumericConverter { /** @@ -249,13 +249,13 @@ private[cluster] case class DataStream(decay: Int, ewma: ScalaNumber, startTime: /** * Calculates the exponentially weighted moving average for a given monitored data set. - * The datam can be too large to fit into an int or long, thus we use ScalaNumber, + * The datam can be too large to fit into an int or long, thus we use ScalaNumericConversions, * and defer to BigInt or BigDecimal. * * @param xn the new data point * @return an new [[akka.cluster.DataStream]] with the updated yn and timestamp */ - def :+(xn: ScalaNumber): DataStream = convert(xn) fold ( + def :+(xn: ScalaNumericConversions): DataStream = convert(xn) fold ( nl ⇒ copy(ewma = BigInt(α * nl + 1 - α * ewma.longValue()), timestamp = newTimestamp), nd ⇒ copy(ewma = BigDecimal(α * nd + 1 - α * ewma.doubleValue()), timestamp = newTimestamp)) @@ -273,7 +273,7 @@ private[cluster] case class DataStream(decay: Int, ewma: ScalaNumber, startTime: */ private[cluster] object DataStream { - def apply(decay: Int, data: ScalaNumber): Option[DataStream] = if (decay > 0) + def apply(decay: Int, data: ScalaNumericConversions): Option[DataStream] = if (decay > 0) Some(DataStream(decay, data, newTimestamp, newTimestamp)) else None } @@ -288,7 +288,7 @@ private[cluster] object DataStream { * @param average the data stream of the metric value, for trending over time. Metrics that are already * averages (e.g. system load average) or finite (e.g. as total cores), are not trended. */ -private[cluster] case class Metric(name: String, value: Option[ScalaNumber], average: Option[DataStream]) +private[cluster] case class Metric(name: String, value: Option[ScalaNumericConversions], average: Option[DataStream]) extends ClusterMessage with MetricNumericConverter { /** @@ -352,7 +352,7 @@ private[cluster] object Metric extends MetricNumericConverter { * or defined for the OS (JMX). If undefined we set the value option to None and do not modify * the latest sampled metric to avoid skewing the statistical trend. */ - def apply(name: String, value: Option[ScalaNumber]): Metric = value match { + def apply(name: String, value: Option[ScalaNumericConversions]): Metric = value match { case Some(v) if defined(v) ⇒ Metric(name, value, None) case _ ⇒ Metric(name, None, None) } @@ -409,15 +409,15 @@ private[cluster] trait MetricNumericConverter { *