From e3743b812ab05f15db8a8e64e47f8b92948fe180 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 12 Aug 2010 09:02:46 +0000 Subject: Changes in docs and layout. No review. --- src/compiler/scala/tools/nsc/io/AbstractFile.scala | 4 +--- src/library/scala/collection/TraversableOnce.scala | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/scala/tools/nsc/io/AbstractFile.scala b/src/compiler/scala/tools/nsc/io/AbstractFile.scala index fd96da4f73..870cc64913 100644 --- a/src/compiler/scala/tools/nsc/io/AbstractFile.scala +++ b/src/compiler/scala/tools/nsc/io/AbstractFile.scala @@ -106,9 +106,7 @@ abstract class AbstractFile extends AnyRef with Iterable[AbstractFile] { def underlyingSource: Option[AbstractFile] = None /** Does this abstract file denote an existing file? */ - def exists: Boolean = - if (file ne null) file.exists - else true + def exists: Boolean = (file eq null) || file.exists /** Does this abstract file represent something which can contain classfiles? */ def isClassContainer = isDirectory || (sfile exists (Path isJarOrZip _)) diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index de4eb6fc22..6656b05083 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -294,7 +294,7 @@ trait TraversableOnce[+A] { * @tparam B the result type of the `*` operator. * @return the product of all elements of this $coll with respect to the `*` operator in `num`. * - * @usecase def product: Int + * @usecase def product: A * * @return the product of all elements in this $coll of numbers of type `Int`. * Instead of `Int`, any other type `T` with an implicit `Numeric[T]` implementation @@ -442,6 +442,9 @@ trait TraversableOnce[+A] { * is undefined. * $willNotTerminateInf * @return a map containing all elements of this $coll. + * @usecase def toMap: Map[K, V] + * @return a map of type `immutable.Map[K, V]` + * containing all key/value pairs of type `(K, V)` of this $coll. */ def toMap[T, U](implicit ev: A <:< (T, U)): immutable.Map[T, U] = { val b = immutable.Map.newBuilder[T, U] -- cgit v1.2.3