From f51ee9e25adf9ee452c610cdee2179de9e34a7bc Mon Sep 17 00:00:00 2001 From: Eric Torreborre Date: Tue, 10 Jul 2018 10:30:24 +0200 Subject: [PATCH] publish 4.3.2 and adjusted the #682 fix to work with Scala 2.11 --- .../org/specs2/control/eff/FutureEffect.scala | 16 ++++++++++------ notes/4.3.2.markdown | 6 ++++++ version.sbt | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 notes/4.3.2.markdown diff --git a/common/shared/src/main/scala/org/specs2/control/eff/FutureEffect.scala b/common/shared/src/main/scala/org/specs2/control/eff/FutureEffect.scala index 6890579c50..3043f2e04c 100644 --- a/common/shared/src/main/scala/org/specs2/control/eff/FutureEffect.scala +++ b/common/shared/src/main/scala/org/specs2/control/eff/FutureEffect.scala @@ -42,9 +42,11 @@ object TimedFuture { def ap[A, B](fa: =>TimedFuture[A])(ff: =>TimedFuture[(A) => B]): TimedFuture[B] = { val newCallback = { es: ExecutorServices => - val ffRan = Future(ff.runNow(es))(es.executionContext).flatMap(identity)(es.executionContext) - val faRan = Future(fa.runNow(es))(es.executionContext).flatMap(identity)(es.executionContext) - faRan.flatMap(a => ffRan.map(f => f(a))(es.executionContext))(es.executionContext) + implicit val ec: ExecutionContext = es.executionContext + + val ffRan = Future(ff.runNow(es)).flatMap(identity) + val faRan = Future(fa.runNow(es)).flatMap(identity) + faRan.flatMap(a => ffRan.map(f => f(a))(es.executionContext)) } TimedFuture(newCallback) } @@ -59,9 +61,11 @@ object TimedFuture { override def ap[A, B](fa: =>TimedFuture[A])(ff: =>TimedFuture[(A) => B]): TimedFuture[B] = { val newCallback = { es: ExecutorServices => - Future(ff.runNow(es))(es.executionContext).flatten.flatMap { f => - Future(fa.runNow(es))(es.executionContext).flatten.map(f)(es.executionContext) - }(es.executionContext) + implicit val ec: ExecutionContext = es.executionContext + + Future(ff.runNow(es)).flatMap(identity).flatMap { f => + Future(fa.runNow(es)).flatMap(identity).map(f) + } } TimedFuture(newCallback) } diff --git a/notes/4.3.2.markdown b/notes/4.3.2.markdown new file mode 100644 index 0000000000..d3be456eee --- /dev/null +++ b/notes/4.3.2.markdown @@ -0,0 +1,6 @@ +Maintenance version with an additional fix for possible stackoverflow exceptions on large specifications. + +## Fixes + + * **core** #682 use constant stack running `TimedFuture` sequentially, too take constant stack while running examples in parallel (Edmund Noble) + diff --git a/version.sbt b/version.sbt index 98c4791a9d..d34313100b 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "4.3.1" +version in ThisBuild := "4.3.2"