summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2012-08-08 08:03:17 +0200
committerHeather Miller <heather.miller@epfl.ch>2012-08-08 08:03:17 +0200
commit540706a95d15b43dd94b5258477d36468e76474b (patch)
tree8aee0c19e20e71ed5f82da2a67c743a3b4b84843
parentea81ab3314359c98986e6fac74c807fa1accdfb6 (diff)
downloadscala-540706a95d15b43dd94b5258477d36468e76474b.tar.gz
scala-540706a95d15b43dd94b5258477d36468e76474b.tar.bz2
scala-540706a95d15b43dd94b5258477d36468e76474b.zip
Doc fix on exec ctx prepare method, fix to tests
-rw-r--r--src/library/scala/concurrent/ExecutionContext.scala3
-rw-r--r--src/library/scala/concurrent/Future.scala2
-rw-r--r--test/files/jvm/future-spec/TryTests.scala1
-rw-r--r--test/files/jvm/try-type-tests.scala4
4 files changed, 6 insertions, 4 deletions
diff --git a/src/library/scala/concurrent/ExecutionContext.scala b/src/library/scala/concurrent/ExecutionContext.scala
index 82c1cff4b1..1be6050303 100644
--- a/src/library/scala/concurrent/ExecutionContext.scala
+++ b/src/library/scala/concurrent/ExecutionContext.scala
@@ -29,7 +29,8 @@ trait ExecutionContext {
def reportFailure(t: Throwable): Unit
/** Prepares for the execution of a task. Returns the prepared
- * execution context.
+ * execution context. A valid implementation of `prepare` is one
+ * that simply returns `this`.
*/
def prepare(): ExecutionContext = this
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 09e29d971d..bc0b437a33 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -312,7 +312,7 @@ trait Future[+T] extends Awaitable[T] {
case Success(v) =>
try {
if (pred(v)) p success v
- else p failure new NoSuchElementException("Future.filter predicate is not satisfied by: " + v)
+ else p failure new NoSuchElementException("Future.filter predicate is not satisfied")
} catch {
case NonFatal(t) => p failure t
}
diff --git a/test/files/jvm/future-spec/TryTests.scala b/test/files/jvm/future-spec/TryTests.scala
index db0be0dfff..82ca12276f 100644
--- a/test/files/jvm/future-spec/TryTests.scala
+++ b/test/files/jvm/future-spec/TryTests.scala
@@ -1,4 +1,3 @@
-x
// This is a port of the com.twitter.util Try spec.
// --
// It lives in the future-spec directory simply because it requires a specs-like
diff --git a/test/files/jvm/try-type-tests.scala b/test/files/jvm/try-type-tests.scala
index 351f02b183..17811f64c5 100644
--- a/test/files/jvm/try-type-tests.scala
+++ b/test/files/jvm/try-type-tests.scala
@@ -107,7 +107,7 @@ trait TryStandard {
val s = Success(1)
val succ = (x: Int) => Success(x * 10)
val fail = (x: Throwable) => Success(0)
- assert(s.transform(succ, fail).get == s.get)
+ assert(s.transform(succ, fail).get == 10)
}
def testFailureTransform(): Unit = {
@@ -133,6 +133,8 @@ trait TryStandard {
testFlattenSuccess()
testFailedSuccess()
testFailedFailure()
+ testSuccessTransform()
+ testFailureTransform()
}
object Test