summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 15:34:28 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 15:34:28 +0000
commita5a958146507482866c8ac9dca4210b1e8a21391 (patch)
tree5ed1f56da0872b81fbd129604493cf1f9aeba3ba /src/library
parent05676863c18d70e3b5c979ebe2f04000305e41cd (diff)
downloadscala-a5a958146507482866c8ac9dca4210b1e8a21391.tar.gz
scala-a5a958146507482866c8ac9dca4210b1e8a21391.tar.bz2
scala-a5a958146507482866c8ac9dca4210b1e8a21391.zip
Merged revisions 22130-22131,22137,22140,22149,...
Merged revisions 22130-22131,22137,22140,22149,22285,22297-22298,22315,22355,22358,22361- 22362,22418,22475-22476,22481,22498-22501,22573-22574,22584,22587-22588, 22594,22604-22608,22614,22618-22619,22634,22636,22643,22650,22672,22674, 22739-22740,22798-22799 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22130 | dubochet | 2010-06-02 15:11:24 +0200 (Wed, 02 Jun 2010) | 1 line Removed unnecessary files containing code with an uncertain copyright status. ........ r22131 | dubochet | 2010-06-02 15:41:19 +0200 (Wed, 02 Jun 2010) | 1 line Added mandatory copyright notices for some libraries shipped with Scala. ........ r22137 | dubochet | 2010-06-02 16:04:52 +0200 (Wed, 02 Jun 2010) | 1 line Added more license notices for things shipped with Scala. ........ r22140 | dubochet | 2010-06-02 18:23:43 +0200 (Wed, 02 Jun 2010) | 1 line [scaladoc] Updated man page for Scaladoc 2. ........ r22149 | dubochet | 2010-06-03 11:22:57 +0200 (Thu, 03 Jun 2010) | 1 line [scaladoc] Fixed typo in Scaladoc man page (thanks Stéphane). No review. ........ r22285 | dubochet | 2010-06-14 16:10:43 +0200 (Mon, 14 Jun 2010) | 1 line Added test case for #432. No review. ........ r22297 | dubochet | 2010-06-15 18:08:57 +0200 (Tue, 15 Jun 2010) | 1 line [scaladoc] Slightly more robust treatment of "code" HTML elements in Scaladoc comments. No review. ........ r22298 | dubochet | 2010-06-15 18:09:36 +0200 (Tue, 15 Jun 2010) | 1 line [scaladoc] New display mode for members: ordered by inheritance class. Review by malayeri. ........ r22315 | dubochet | 2010-06-16 16:16:31 +0200 (Wed, 16 Jun 2010) | 1 line [Scaladoc] Self types are printed. Contributed by Manohar Jonnalagedda. Checked by dubochet. ........ r22355 | dubochet | 2010-06-18 14:59:39 +0200 (Fri, 18 Jun 2010) | 1 line [scaladoc] Added linear super types. Review by cunei. ........ r22358 | dubochet | 2010-06-18 17:34:35 +0200 (Fri, 18 Jun 2010) | 3 lines [scaladoc] There is a text filter tool for members (searching on member name and comment body). Adds button to reset text filter tool. No review. Known limitation: filtering of members is blocking on keystroke leading to sluggish performance on large classes. Scheduler from index needs to be used for member filtering. ........ r22361 | dubochet | 2010-06-18 18:48:05 +0200 (Fri, 18 Jun 2010) | 1 line [scaladoc] Abstract members can be filtered in or out. Pointer icons are less crazy. Review by dubochet. Contributed by Pedro Furlanetto. ........ r22362 | dubochet | 2010-06-18 18:48:34 +0200 (Fri, 18 Jun 2010) | 1 line [scaladoc] A warning is printed when usecase members have different names than the real member being commented. Review by odersky. Contributed by Pedro Furlanetto. ........ r22418 | michelou | 2010-06-29 16:00:36 +0200 (Tue, 29 Jun 2010) | 2 lines removed warnings (deprecation,unchecked) ........ r22475 | dubochet | 2010-07-02 18:38:29 +0200 (Fri, 02 Jul 2010) | 1 line Closes #1766 (structural method dispatch broken in class with multiple constructors). Review by prokopec. ........ r22476 | dubochet | 2010-07-02 20:12:33 +0200 (Fri, 02 Jul 2010) | 1 line Closes #2318 (spurious IllegalAccessException thrown by some structural calls, caused by Java bug 4071957). Review by malayeri. ........ r22481 | extempore | 2010-07-03 02:56:00 +0200 (Sat, 03 Jul 2010) | 4 lines When compilation fails because of an unimplemented abstract var, give a more precise error message about what happened. Also avoid issuing the same error twice because neither getter nor setter is implemented. Closes #36, review by rytz. ........ r22498 | dubochet | 2010-07-06 18:07:31 +0200 (Tue, 06 Jul 2010) | 1 line [scaladoc] Implements documentation of higher-kinded entities. Closes #3618. Review by moors. ........ r22499 | dubochet | 2010-07-06 18:21:00 +0200 (Tue, 06 Jul 2010) | 1 line [scaladoc] Hiding full comments in template pages at startup is done by CSS instead of JavaScript, leading to better performance. Contributed by Pedro Furlanetto. Review by dubochet. ........ r22500 | dubochet | 2010-07-06 18:29:38 +0200 (Tue, 06 Jul 2010) | 1 line [scaladoc] Follow-up on review SCL-95. No review. ........ r22501 | dubochet | 2010-07-06 18:39:31 +0200 (Tue, 06 Jul 2010) | 1 line [scaladoc] Follow-up on review SCL-110. No review. ........ r22573 | dubochet | 2010-07-15 16:13:03 +0200 (Thu, 15 Jul 2010) | 1 line [scaladoc] Full comments with "by inheritance" ordering are correctly displayed. No review. ........ r22574 | dubochet | 2010-07-15 16:13:38 +0200 (Thu, 15 Jul 2010) | 1 line [scaladoc] Scaladoc knows about Javadoc inline tags and transforms them. The transformation is currently quite basic, particularly for links. Review by malayeri. ........ r22584 | dubochet | 2010-07-18 17:59:14 +0200 (Sun, 18 Jul 2010) | 1 line [scaladoc] Print "Inherited from" headings using type instances ("SeqLike[A, List[A]]") instead of template names ("SeqLike"). Review by malayeri. ........ r22587 | dubochet | 2010-07-19 11:38:25 +0200 (Mon, 19 Jul 2010) | 1 line [scaladoc] Adds private Scaladoc option "-Yuse-stupid-types" for LAMP internal use. No review. ........ r22588 | dubochet | 2010-07-19 13:57:51 +0200 (Mon, 19 Jul 2010) | 1 line [scaladoc] Fixes an issue whereas inherited members in objects would not see their types instantiated properly. No review. ........ r22594 | dubochet | 2010-07-19 17:11:30 +0200 (Mon, 19 Jul 2010) | 1 line [scaladoc] Singleton types (`this.type`) are correctly printed. Closes #1445. Review by malayeri. ........ r22604 | malayeri | 2010-07-20 18:13:28 +0200 (Tue, 20 Jul 2010) | 1 line [scaladoc] Modify build script to copy html resources to output directory; display template in a frame rather than an iframe; change title of main page when new frame is loaded. Review by dubochet. ........ r22605 | malayeri | 2010-07-20 18:14:32 +0200 (Tue, 20 Jul 2010) | 1 line [scaladoc] Make a DocDef node for javadoc comments in Java source files. ........ r22606 | malayeri | 2010-07-20 18:15:54 +0200 (Tue, 20 Jul 2010) | 1 line [scaladoc] Remove unused template.html file. ........ r22607 | malayeri | 2010-07-20 18:17:35 +0200 (Tue, 20 Jul 2010) | 1 line [scaladoc] Don't generate documentation for empty Java companion objects. No review. ........ r22608 | malayeri | 2010-07-20 18:18:54 +0200 (Tue, 20 Jul 2010) | 1 line [scaladoc] Optionally run typer phase for Java files, if createJavadoc method returns true. No review. ........ r22614 | dubochet | 2010-07-21 18:35:26 +0200 (Wed, 21 Jul 2010) | 1 line [docs] The first comment contributed using Petr Hošek's Colladoc. ........ r22618 | malayeri | 2010-07-22 11:21:37 +0200 (Thu, 22 Jul 2010) | 1 line [scaladoc] Fix performance problem when generating Scaladoc. ........ r22619 | malayeri | 2010-07-22 11:48:12 +0200 (Thu, 22 Jul 2010) | 1 line Revert 22605 change to JavaParsers.scala, which modified parsing behavior and broke jvm test t3415. No longer create DocDef nodes for Javadoc comments in Java source files. No review. ........ r22634 | dubochet | 2010-07-27 18:33:35 +0200 (Tue, 27 Jul 2010) | 1 line [scaladoc] Setting for link to source URLs is much more flexible and should allow satisfying Toni's exacting demands. Review by cunei. ........ r22636 | dubochet | 2010-07-28 13:26:15 +0200 (Wed, 28 Jul 2010) | 1 line [docs] Documentation updates contributed through Colladoc. No review. ........ r22643 | dubochet | 2010-07-28 18:23:55 +0200 (Wed, 28 Jul 2010) | 1 line [scaladoc] Small fixes for 2.8.0 updated documentation: window title contains version number, authors are not displayed (like in Javadoc), source links have correct title. No review. ........ r22650 | dubochet | 2010-07-30 13:51:25 +0200 (Fri, 30 Jul 2010) | 1 line Fixes an issue in RefChecks when the compiler does not have an erasure phase (such as in Scaladoc), which became visible after r22644. Review by odersky. ........ r22672 | chrisJames | 2010-08-04 14:32:01 +0200 (Wed, 04 Aug 2010) | 4 lines [Scaladoc] Prints default Values, considers anyRef as a class. closes #3105. Review by prokopec. ........ r22674 | dubochet | 2010-08-04 16:54:10 +0200 (Wed, 04 Aug 2010) | 1 line Keyword of method symbol signature is correctly printed as 'def' instead of 'val'. No review. ........ r22739 | chrisJames | 2010-08-12 13:58:52 +0200 (Thu, 12 Aug 2010) | 4 lines [Scaladoc] Improve the documentation of primary constructor. Adds a @constructor for commenting the primary constructor. It also adds some comments for the primary constructor (@params, @deprecated) which are initialised in the class comment. Members that come from primary constructor parameters (val parameters or parameters of a case class) are listed as members with the comment given using the @param tag (closes #254, closes #577). Case class signature now begins by 'case class' instead of 'class'. Review by dubochet ........ r22740 | chrisJames | 2010-08-12 13:59:21 +0200 (Thu, 12 Aug 2010) | 2 lines [Scaladoc] Fixes a bug in defaultValues display ('new A' now creates a link on A). Review by dubochet ........ r22798 | dubochet | 2010-08-19 16:04:09 +0200 (Thu, 19 Aug 2010) | 6 lines [scaladoc] Merges Petr's change to Scaladoc from the Colladoc branch: bugfixes, improvements and refactorings that make it possible to extends Scaladoc into Colladoc. - Layout of index uses jQuery UI panel instead of frameset. - Search boxes have correct width on Firefox. - Scaladoc models the original, untransformed source. - Various internal bugfixes & refactorings. Review by dubochet. ........ r22799 | dubochet | 2010-08-19 16:28:46 +0200 (Thu, 19 Aug 2010) | 1 line Fixed build for Java 1.5. No review. ........
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Application.scala4
-rw-r--r--src/library/scala/Enumeration.scala2
-rw-r--r--src/library/scala/collection/TraversableLike.scala7
-rw-r--r--src/library/scala/collection/immutable/StringLike.scala3
-rw-r--r--src/library/scala/collection/mutable/BufferProxy.scala10
-rw-r--r--src/library/scala/collection/mutable/Stack.scala5
-rw-r--r--src/library/scala/compat/Platform.scala29
-rw-r--r--src/library/scala/io/Source.scala12
-rwxr-xr-xsrc/library/scala/reflect/generic/Symbols.scala1
-rw-r--r--src/library/scala/runtime/AnyValCompanion.scala2
10 files changed, 50 insertions, 25 deletions
diff --git a/src/library/scala/Application.scala b/src/library/scala/Application.scala
index efc64191ae..21e6b68091 100644
--- a/src/library/scala/Application.scala
+++ b/src/library/scala/Application.scala
@@ -73,8 +73,8 @@ import scala.compat.Platform.currentTime
trait Application {
- /** The time when execution of this program started.
- */
+ /** The time when the execution of this program started, in milliseconds since 1
+ * January 1970 UTC. */
val executionStart: Long = currentTime
/** The default main method.
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala
index 5d1a0997ed..b5a46f7018 100644
--- a/src/library/scala/Enumeration.scala
+++ b/src/library/scala/Enumeration.scala
@@ -52,7 +52,7 @@ private object Enumeration {
*
* <b>def</b> isWorkingDay(d: WeekDay) = ! (d == Sat || d == Sun)
*
- * WeekDay.iterator filter isWorkingDay foreach println
+ * WeekDay.values filter isWorkingDay foreach println
* }</pre>
*
* @param initial The initial value from which to count the integers that
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala
index 6f851fb5e7..a307ccbf3f 100644
--- a/src/library/scala/collection/TraversableLike.scala
+++ b/src/library/scala/collection/TraversableLike.scala
@@ -494,10 +494,9 @@ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr]
}
/** Selects the last element.
- * $orderDependent
- * @return the first element of this $coll.
- * @throws `NoSuchElementException` if the $coll is empty.
- */
+ * $orderDependent
+ * @return The last element of this $coll.
+ * @throws NoSuchElementException If the $coll is empty. */
def last: A = {
var lst = head
for (x <- this)
diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala
index 0c327195a4..6fe6b4555d 100644
--- a/src/library/scala/collection/immutable/StringLike.scala
+++ b/src/library/scala/collection/immutable/StringLike.scala
@@ -148,7 +148,8 @@ self =>
if (toString.startsWith(prefix)) toString.substring(prefix.length)
else toString
- /** Returns this string with the given `suffix` stripped. */
+ /** Returns this string with the given `suffix` stripped. If this string does not
+ * end with `suffix`, it is returned unchanged. */
def stripSuffix(suffix: String) =
if (toString.endsWith(suffix)) toString.substring(0, toString.length() - suffix.length)
else toString
diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala
index 7adbb8ee3f..5d2e7fd86d 100644
--- a/src/library/scala/collection/mutable/BufferProxy.scala
+++ b/src/library/scala/collection/mutable/BufferProxy.scala
@@ -125,16 +125,20 @@ trait BufferProxy[A] extends Buffer[A] with Proxy {
* @param n the index where a new element will be inserted.
* @param iter the iterable object providing all elements to insert.
*/
- def insertAll(n: Int, iter: scala.collection.Iterable[A]): Unit = self.insertAll(n, iter)
+ def insertAll(n: Int, iter: scala.collection.Iterable[A]) {
+ self.insertAll(n, iter)
+ }
- override def insertAll(n: Int, iter: scala.collection.Traversable[A]): Unit = self.insertAll(n, iter)
+ override def insertAll(n: Int, iter: scala.collection.Traversable[A]) {
+ self.insertAll(n, iter)
+ }
/** Replace element at index `n` with the new element `newelem`.
*
* @param n the index of the element to replace.
* @param newelem the new element.
*/
- def update(n: Int, newelem: A): Unit = self.update(n, newelem)
+ def update(n: Int, newelem: A) { self.update(n, newelem) }
/** Removes the element on a given index position.
*
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index e678f7fa5c..c791066398 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -62,7 +62,8 @@ class Stack[A] private (var elems: List[A]) extends scala.collection.Seq[A] with
* @param elems the element sequence.
* @return the stack with the new elements on top.
*/
- def push(elem1: A, elem2: A, elems: A*): this.type = this.push(elem1).push(elem2).pushAll(elems)
+ def push(elem1: A, elem2: A, elems: A*): this.type =
+ this.push(elem1).push(elem2).pushAll(elems)
/** Push all elements in the given traversable object onto
* the stack. The last element in the traversable object
@@ -134,5 +135,5 @@ class Stack[A] private (var elems: List[A]) extends scala.collection.Seq[A] with
// !!! TODO - integrate
object Stack {
- def apply[A](xs: A*): Stack[A] = new Stack[A] ++= xs
+ def apply[A](xs: A*): Stack[A] = new Stack[A] pushAll xs
}
diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala
index b6d7de2c56..8187360d6f 100644
--- a/src/library/scala/compat/Platform.scala
+++ b/src/library/scala/compat/Platform.scala
@@ -17,13 +17,23 @@ object Platform {
type StackOverflowError = java.lang.StackOverflowError
type ConcurrentModificationException = java.util.ConcurrentModificationException
- /**
- * @param src ..
- * @param srcPos ..
- * @param dest ..
- * @param destPos ..
- * @param length ..
- */
+ /** Copies `length` elements of array `src` starting at position `srcPos` to the
+ * array `dest` starting at position `destPos`. If `src eq dest`, the copying will
+ * behave as if the elements copied from `src` were first copied to a temporary
+ * array before being copied back into the array at the destination positions.
+ * @param src A non-null array as source for the copy.
+ * @param srcPos The starting index in the source array.
+ * @param dest A non-null array as destination for the copy.
+ * @param destPos The starting index in the destination array.
+ * @param length The number of elements to be copied.
+ * @throws java.lang.NullPointerException If either `src` or `dest` are `null`.
+ * @throws java.lang.ArrayStoreException If either `src` or `dest` are not of type
+ * [java.lang.Array]; or if the element type of `src` is not
+ * compatible with that of `dest`.
+ * @throws java.lang.IndexOutOfBoundsException If either srcPos` or `destPos` are
+ * outside of the bounds of their respective arrays; or if `length`
+ * is negative; or if there are less than `length` elements available
+ * after `srcPos` or `destPos` in `src` and `dest` respectively. */
@inline
def arraycopy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int) {
System.arraycopy(src, srcPos, dest, destPos, length)
@@ -48,6 +58,11 @@ object Platform {
val EOL = util.Properties.lineSeparator
+ /** The current time in milliseconds. The time is counted since 1 January 1970
+ * UTC.
+ *
+ * Note that the operating system timer used to obtain this value may be less
+ * precise than a millisecond. */
@inline
def currentTime: Long = System.currentTimeMillis()
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index b5313ef61b..935fe022be 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -114,11 +114,13 @@ object Source {
/** Create a <code>Source</code> from array of bytes, assuming
* one byte per character (ISO-8859-1 encoding.)
*/
- def fromRawBytes(bytes: Array[Byte]): Source = fromString(new String(bytes, Codec.ISO8859.name))
+ def fromRawBytes(bytes: Array[Byte]): Source =
+ fromString(new String(bytes, Codec.ISO8859.name))
/** creates <code>Source</code> from file with given file: URI
*/
- def fromURI(uri: URI)(implicit codec: Codec): BufferedSource = fromFile(new JFile(uri))(codec)
+ def fromURI(uri: URI)(implicit codec: Codec): BufferedSource =
+ fromFile(new JFile(uri))(codec)
/** same as fromURL(new URL(s))(Codec(enc))
*/
@@ -298,8 +300,9 @@ abstract class Source extends Iterator[Char] {
def report(pos: Int, msg: String, out: PrintStream) {
val line = Position line pos
val col = Position column pos
+ val str = getLines() toIndexedSeq line
- out println "%s:%d:%d: %s%s%s^".format(descr, line, col, msg, getLine(line), spaces(col - 1))
+ out println "%s:%d:%d: %s%s%s^".format(descr, line, col, msg, str, spaces(col - 1))
}
/**
@@ -340,8 +343,9 @@ abstract class Source extends Iterator[Char] {
}
/** The close() method closes the underlying resource. */
- def close(): Unit =
+ def close() {
if (closeFunction != null) closeFunction()
+ }
/** The reset() method creates a fresh copy of this Source. */
def reset(): Source =
diff --git a/src/library/scala/reflect/generic/Symbols.scala b/src/library/scala/reflect/generic/Symbols.scala
index 2f5e0624ab..f1226c7e19 100755
--- a/src/library/scala/reflect/generic/Symbols.scala
+++ b/src/library/scala/reflect/generic/Symbols.scala
@@ -119,6 +119,7 @@ trait Symbols { self: Universe =>
def isTrait: Boolean = isClass && hasFlag(TRAIT) // refined later for virtual classes.
final def hasDefault = isParameter && hasFlag(DEFAULTPARAM)
final def isAbstractClass = isClass && hasFlag(ABSTRACT)
+ // XXX This is unlikely to be correct: it's not looking for the ABSOVERRIDE flag?
final def isAbstractOverride = isTerm && hasFlag(ABSTRACT) && hasFlag(OVERRIDE)
final def isBridge = hasFlag(BRIDGE)
final def isCase = hasFlag(CASE)
diff --git a/src/library/scala/runtime/AnyValCompanion.scala b/src/library/scala/runtime/AnyValCompanion.scala
index 0a6f93805a..0fba1cfd60 100644
--- a/src/library/scala/runtime/AnyValCompanion.scala
+++ b/src/library/scala/runtime/AnyValCompanion.scala
@@ -6,7 +6,7 @@
** |/ **
\* */
-// $Id$
+
package scala.runtime