summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2012-04-14 18:35:43 +0200
committerHeather Miller <heather.miller@epfl.ch>2012-04-14 18:35:43 +0200
commit1246f69185d958f12ebbff047fc3a72766cfd384 (patch)
tree0586b42f769ee4cceea9162c43cd71b345c110be
parent0e8db083f63177a97f3d27024c016c6143573838 (diff)
downloadscala-1246f69185d958f12ebbff047fc3a72766cfd384.tar.gz
scala-1246f69185d958f12ebbff047fc3a72766cfd384.tar.bz2
scala-1246f69185d958f12ebbff047fc3a72766cfd384.zip
Changes to access modifiers on Unsafe and NonFatal, adds/fixes doc comments
-rw-r--r--src/library/scala/concurrent/Future.scala8
-rw-r--r--src/library/scala/concurrent/impl/NonFatal.scala5
-rw-r--r--src/library/scala/concurrent/impl/Promise.scala2
-rw-r--r--src/library/scala/concurrent/impl/Unsafe.java4
4 files changed, 10 insertions, 9 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 40acea91c9..89b04e6248 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -117,7 +117,7 @@ trait Future[+T] extends Awaitable[T] {
case Right(v) => // do nothing
}
- /** When this future is completed, either through an exception, a timeout, or a value,
+ /** When this future is completed, either through an exception, or a value,
* apply the provided function.
*
* If the future has already been completed,
@@ -242,7 +242,7 @@ trait Future[+T] extends Awaitable[T] {
* If the current future contains a value which satisfies the predicate, the new future will also hold that value.
* Otherwise, the resulting future will fail with a `NoSuchElementException`.
*
- * If the current future fails or times out, the resulting future also fails or times out, respectively.
+ * If the current future fails, then the resulting future also fails.
*
* Example:
* {{{
@@ -282,12 +282,12 @@ trait Future[+T] extends Awaitable[T] {
// def withFilter(q: S => Boolean): FutureWithFilter[S] = new FutureWithFilter[S](self, x => p(x) && q(x))
// }
- /** Creates a new future by mapping the value of the current future if the given partial function is defined at that value.
+ /** Creates a new future by mapping the value of the current future, if the given partial function is defined at that value.
*
* If the current future contains a value for which the partial function is defined, the new future will also hold that value.
* Otherwise, the resulting future will fail with a `NoSuchElementException`.
*
- * If the current future fails or times out, the resulting future also fails or times out, respectively.
+ * If the current future fails, then the resulting future also fails.
*
* Example:
* {{{
diff --git a/src/library/scala/concurrent/impl/NonFatal.scala b/src/library/scala/concurrent/impl/NonFatal.scala
index ac0cddaf1b..bc509e664c 100644
--- a/src/library/scala/concurrent/impl/NonFatal.scala
+++ b/src/library/scala/concurrent/impl/NonFatal.scala
@@ -6,7 +6,8 @@
** |/ **
\* */
-package scala.concurrent.impl
+package scala.concurrent
+package impl
/**
* Extractor of non-fatal Throwables. Will not match fatal errors
@@ -23,7 +24,7 @@ package scala.concurrent.impl
* }
* }}}
*/
-object NonFatal {
+private[concurrent] object NonFatal {
def unapply(t: Throwable): Option[Throwable] = t match {
case e: StackOverflowError ⇒ Some(e) // StackOverflowError ok even though it is a VirtualMachineError
diff --git a/src/library/scala/concurrent/impl/Promise.scala b/src/library/scala/concurrent/impl/Promise.scala
index 1388c8b357..ee1841aaff 100644
--- a/src/library/scala/concurrent/impl/Promise.scala
+++ b/src/library/scala/concurrent/impl/Promise.scala
@@ -159,7 +159,7 @@ object Promise {
}
def onComplete[U](func: Either[Throwable, T] => U): this.type = {
- @tailrec //Returns whether the future has already been completed or not
+ @tailrec //Returns the future's results if it has already been completed, or null otherwise.
def tryAddCallback(): Either[Throwable, T] = {
val cur = getState
cur match {
diff --git a/src/library/scala/concurrent/impl/Unsafe.java b/src/library/scala/concurrent/impl/Unsafe.java
index 3c695c3905..21f7e638e5 100644
--- a/src/library/scala/concurrent/impl/Unsafe.java
+++ b/src/library/scala/concurrent/impl/Unsafe.java
@@ -7,11 +7,11 @@
\* */
-package scala.concurrent.impl;
+package scala.concurrent;
import java.lang.reflect.Field;
-public final class Unsafe {
+final class Unsafe {
public final static sun.misc.Unsafe instance;
static {
try {