Permalink
Browse files

2nd round of clean ups (see r25285)

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25292 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
  • Loading branch information...
1 parent 661cfc6 commit 9f6e8eeb1440f14b4bdd5e7d43ff4905cac1e388 michelou committed Jul 15, 2011
Showing with 1,849 additions and 1,845 deletions.
  1. +1 −1 src/library/scala/Application.scala
  2. +8 −0 src/library/scala/Array.scala
  3. +8 −7 src/library/scala/Console.scala
  4. +38 −38 src/library/scala/Enumeration.scala
  5. +12 −11 src/library/scala/Function.scala
  6. +4 −4 src/library/scala/Math.scala
  7. +24 −28 src/library/scala/MathCommon.scala
  8. +35 −36 src/library/scala/Predef.scala
  9. +11 −11 src/library/scala/Product.scala
  10. +4 −6 src/library/scala/Responder.scala
  11. +1 −4 src/library/scala/SerialVersionUID.scala
  12. +12 −17 src/library/scala/Symbol.scala
  13. +5 −8 src/library/scala/annotation/Annotation.scala
  14. +3 −5 src/library/scala/annotation/ClassfileAnnotation.scala
  15. +2 −4 src/library/scala/annotation/StaticAnnotation.scala
  16. +10 −12 src/library/scala/annotation/TypeConstraint.scala
  17. +19 −16 src/library/scala/annotation/elidable.scala
  18. +6 −5 src/library/scala/annotation/tailrec.scala
  19. +4 −5 src/library/scala/annotation/varargs.scala
  20. +4 −5 src/library/scala/collection/GenSeqLike.scala
  21. +4 −2 src/library/scala/collection/GenTraversableLike.scala
  22. +42 −38 src/library/scala/collection/GenTraversableOnce.scala
  23. +2 −6 src/library/scala/collection/IterableProxy.scala
  24. +102 −92 src/library/scala/collection/JavaConversions.scala
  25. +286 −245 src/library/scala/collection/JavaConverters.scala
  26. +10 −13 src/library/scala/collection/SeqViewLike.scala
  27. +28 −25 src/library/scala/collection/TraversableLike.scala
  28. +11 −16 src/library/scala/collection/generic/IterableForwarder.scala
  29. +18 −20 src/library/scala/collection/generic/SeqForwarder.scala
  30. +14 −13 src/library/scala/collection/generic/TraversableForwarder.scala
  31. +2 −4 src/library/scala/collection/immutable/BitSet.scala
  32. +35 −34 src/library/scala/collection/immutable/IntMap.scala
  33. +29 −39 src/library/scala/collection/immutable/List.scala
  34. +6 −6 src/library/scala/collection/immutable/LongMap.scala
  35. +15 −17 src/library/scala/collection/immutable/Queue.scala
  36. +5 −8 src/library/scala/collection/immutable/Stack.scala
  37. +2 −3 src/library/scala/collection/mutable/AddingBuilder.scala
  38. +29 −14 src/library/scala/collection/mutable/ConcurrentMap.scala
  39. +3 −6 src/library/scala/collection/mutable/MapProxy.scala
  40. +9 −11 src/library/scala/collection/mutable/MutableList.scala
  41. +6 −7 src/library/scala/collection/mutable/QueueProxy.scala
  42. +12 −10 src/library/scala/collection/mutable/ResizableArray.scala
  43. +2 −4 src/library/scala/collection/mutable/SetProxy.scala
  44. +6 −9 src/library/scala/collection/mutable/Stack.scala
  45. +15 −13 src/library/scala/collection/mutable/StringBuilder.scala
  46. +3 −7 src/library/scala/collection/mutable/Subscriber.scala
  47. +2 −5 src/library/scala/collection/script/Location.scala
  48. +2 −5 src/library/scala/collection/script/Scriptable.scala
  49. +9 −10 src/library/scala/concurrent/DelayedLazyVal.scala
  50. +2 −3 src/library/scala/concurrent/JavaConversions.scala
  51. +5 −6 src/library/scala/concurrent/ManagedBlocker.scala
  52. +3 −5 src/library/scala/concurrent/ops.scala
  53. +9 −11 src/library/scala/concurrent/pilib.scala
  54. +19 −0 src/library/scala/deprecatedName.scala
  55. +8 −8 src/library/scala/math/Equiv.scala
  56. +20 −22 src/library/scala/math/Ordered.scala
  57. +42 −45 src/library/scala/math/Ordering.scala
  58. +6 −7 src/library/scala/reflect/BeanInfo.scala
  59. +3 −8 src/library/scala/reflect/BooleanBeanProperty.scala
  60. +19 −21 src/library/scala/reflect/ClassManifest.scala
  61. +6 −6 src/library/scala/reflect/Manifest.scala
  62. +3 −7 src/library/scala/reflect/OptManifest.scala
  63. +35 −29 src/library/scala/reflect/generic/HasFlags.scala
  64. +26 −34 src/library/scala/reflect/generic/Trees.scala
  65. +13 −2 src/library/scala/remote.scala
  66. +14 −12 src/library/scala/sys/process/ProcessLogger.scala
  67. +21 −35 src/library/scala/testing/Benchmark.scala
  68. +8 −9 src/library/scala/testing/Show.scala
  69. +3 −5 src/library/scala/throws.scala
  70. +3 −5 src/library/scala/unchecked.scala
  71. +10 −11 src/library/scala/util/automata/BaseBerrySethi.scala
  72. +20 −24 src/library/scala/util/control/Breaks.scala
  73. +14 −18 src/library/scala/util/control/ControlThrowable.scala
  74. +76 −68 src/library/scala/util/control/Exception.scala
  75. +19 −11 src/library/scala/util/control/TailCalls.scala
  76. +39 −37 src/library/scala/util/parsing/combinator/PackratParsers.scala
  77. +97 −90 src/library/scala/util/parsing/combinator/Parsers.scala
  78. +11 −10 src/library/scala/util/parsing/combinator/lexical/StdLexical.scala
  79. +9 −13 src/library/scala/util/parsing/combinator/testing/Tester.scala
  80. +32 −33 src/library/scala/util/parsing/json/JSON.scala
  81. +15 −16 src/library/scala/util/regexp/WordExp.scala
  82. +15 −19 src/library/scala/xml/Equality.scala
  83. +12 −15 src/library/scala/xml/NodeBuffer.scala
  84. +23 −23 src/library/scala/xml/NodeSeq.scala
  85. +5 −8 src/library/scala/xml/SpecialNode.scala
  86. +1 −2 src/library/scala/xml/Text.scala
  87. +4 −4 src/library/scala/xml/TextBuffer.scala
  88. +29 −30 src/library/scala/xml/Utility.scala
  89. +7 −11 src/library/scala/xml/include/CircularIncludeException.scala
  90. +2 −6 src/library/scala/xml/include/UnavailableResourceException.scala
  91. +5 −9 src/library/scala/xml/include/sax/XIncludeFilter.scala
  92. +12 −15 src/library/scala/xml/include/sax/XIncluder.scala
  93. +1 −1 src/library/scala/xml/parsing/ConstructingParser.scala
  94. +1 −1 src/library/scala/xml/parsing/FactoryAdapter.scala
  95. +128 −110 src/library/scala/xml/parsing/MarkupParser.scala
  96. +29 −23 src/library/scala/xml/parsing/TokenTests.scala
  97. +5 −6 src/library/scala/xml/parsing/XhtmlEntities.scala
  98. +7 −13 src/library/scala/xml/parsing/XhtmlParser.scala
  99. +33 −33 src/library/scala/xml/persistent/CachedFileStorage.scala
@@ -47,7 +47,7 @@ import scala.compat.Platform.currentTime
* fail to optimize or JIT the code in the body of an `object` extending
* `Application`. This can lead to a significant performance degradation.
*
- * It is recommended to use the `[[scala.App]]` trait instead.
+ * It is recommended to use the [[scala.App]] trait instead.
* {{{
* object Main {
* def main(args: Array[String]) {
@@ -35,6 +35,14 @@ class FallbackArrayBuilding {
}
/** Utility methods for operating on arrays.
+ * For example:
+ * {{{
+ * val a = Array(1, 2)
+ * val b = Array.ofDim[Int](2)
+ * val c = Array.concat(a, b)
+ * }}}
+ * where the array objects `a`, `b` and `c` have respectively the values
+ * `Array(1, 2)`, `Array(0, 0)` and `Array(1, 2, 0, 0)`.
*
* @author Martin Odersky
* @version 1.0
@@ -253,7 +253,7 @@ object Console {
*/
def printf(text: String, args: Any*) { out.print(text format (args : _*)) }
- /** Read a full line from the default input. Returns <code>null</code> if the end of the
+ /** Read a full line from the default input. Returns `null` if the end of the
* input stream has been reached.
*
* @return the string read from the terminal or null if the end of stream was reached.
@@ -397,14 +397,14 @@ object Console {
s.toDouble
}
- /** Reads in some structured input (from the default input), specified by a format specifier.
- * See class <code>java.text.MessageFormat</code> for details of
+ /** Reads in some structured input (from the default input), specified by
+ * a format specifier. See class `java.text.MessageFormat` for details of
* the format specification.
*
* @param format the format of the input.
* @return a list of all extracted values.
- * @throws java.io.EOFException if the end of the
- * input stream has been reached.
+ * @throws java.io.EOFException if the end of the input stream has been
+ * reached.
*/
def readf(format: String): List[Any] = {
val s = readLine()
@@ -414,8 +414,9 @@ object Console {
textComponents(new MessageFormat(format).parse(s))
}
- /** Reads in some structured input (from the default input), specified by a format specifier, returning
- * only the first value extracted, according to the format specification.
+ /** Reads in some structured input (from the default input), specified by
+ * a format specifier, returning only the first value extracted, according
+ * to the format specification.
*
* @param format format string, as accepted by `readf`.
* @return The first value that was extracted from the input
@@ -11,18 +11,17 @@ package scala
import scala.collection.{ mutable, immutable, generic, SetLike }
import java.lang.reflect.{ Modifier, Method => JMethod, Field => JField }
-/**
- * Defines a finite set of values specific to the enumeration. Typically
- * these values enumerate all possible forms something can take and provide a
- * lightweight alternative to case classes.
+/** Defines a finite set of values specific to the enumeration. Typically
+ * these values enumerate all possible forms something can take and provide
+ * a lightweight alternative to case classes.
*
- * Each call to a `Value` method adds a new unique value to the
- * enumeration. To be accessible, these values are usually defined as
- * `val` members of the evaluation.
+ * Each call to a `Value` method adds a new unique value to the enumeration.
+ * To be accessible, these values are usually defined as `val` members of
+ * the evaluation.
*
- * All values in an enumeration share a common, unique type defined as the
- * `Value` type member of the enumeration (`Value`
- * selected on the stable identifier path of the enumeration instance).
+ * All values in an enumeration share a common, unique type defined as the
+ * `Value` type member of the enumeration (`Value` selected on the stable
+ * identifier path of the enumeration instance).
*
* @example {{{
* object Main extends Application {
@@ -54,7 +53,7 @@ import java.lang.reflect.{ Modifier, Method => JMethod, Field => JField }
@SerialVersionUID(8476000850333817230L)
abstract class Enumeration(initial: Int, names: String*) extends Serializable {
thisenum =>
-
+
def this() = this(0)
def this(names: String*) = this(0, names: _*)
@@ -65,7 +64,7 @@ abstract class Enumeration(initial: Int, names: String*) extends Serializable {
/** The name of this enumeration.
*/
override def toString = (getClass.getName stripSuffix "$" split '.' last) split '$' last
-
+
/** The mapping from the integer used to identify values to the actual
* values. */
private val vmap: mutable.Map[Int, Value] = new mutable.HashMap
@@ -90,7 +89,7 @@ abstract class Enumeration(initial: Int, names: String*) extends Serializable {
/** The integer to use to identify the next created value. */
protected var nextId = initial
-
+
/** The string to use to name the next created value. */
protected var nextName = names.iterator
private def nextNameOrNull =
@@ -108,43 +107,44 @@ abstract class Enumeration(initial: Int, names: String*) extends Serializable {
*/
final def apply(x: Int): Value = vmap(x)
- /** Returns a Value from this Enumeration whose name matches
- * the argument <var>s</var>.
+ /**
+ * Return a `Value` from this `Enumeration` whose name matches
+ * the argument `s`.
*
- * You can pass a String* set of names to the constructor, or
- * initialize each Enumeration with Value(String). Otherwise, the
- * names are determined automatically through reflection.
+ * You can pass a String* set of names to the constructor, or initialize
+ * each `Enumeration` with `Value(String)`. Otherwise, the names are
+ * determined automatically through reflection.
*
* Note the change here wrt 2.7 is intentional. You should know whether
- * a name is in an Enumeration beforehand. If not, just use find on
+ * a name is in an `Enumeration` beforehand. If not, just use find on
* values.
*
- * @param s an Enumeration name
- * @return the Value of this Enumeration if its name matches <var>s</var>
- * @throws java.util.NoSuchElementException if no Value with a matching
- * name is in this Enumeration
+ * @param s an `Enumeration` name
+ * @return the `Value` of this `Enumeration` if its name matches `s`
+ * @throws java.util.NoSuchElementException if no `Value` with a matching
+ * name is in this `Enumeration`
*/
final def withName(s: String): Value = values.find(_.toString == s).get
/** Creates a fresh value, part of this enumeration. */
protected final def Value: Value = Value(nextId)
-
- /** Creates a fresh value, part of this enumeration, identified by the integer
- * `i`.
+
+ /** Creates a fresh value, part of this enumeration, identified by the
+ * integer `i`.
*
* @param i An integer that identifies this value at run-time. It must be
* unique amongst all values of the enumeration.
* @return Fresh value identified by `i`.
*/
protected final def Value(i: Int): Value = Value(i, nextNameOrNull)
-
+
/** Creates a fresh value, part of this enumeration, called `name`.
*
* @param name A human-readable name for that value.
* @return Fresh value called `name`.
*/
protected final def Value(name: String): Value = Value(nextId, name)
-
+
/** Creates a fresh value, part of this enumeration, called `name`
* and identified by the integer `i`.
*
@@ -196,17 +196,16 @@ abstract class Enumeration(initial: Int, names: String*) extends Serializable {
}
override def hashCode: Int = id.##
}
-
- /** A class implementing the <a href="Enumeration.Value.html"
- * target="contentFrame">`Value`</a> type. This class can be
- * overridden to change the enumeration's naming and integer identification
- * behaviour.
+
+ /** A class implementing the [[scala.Enumeration.Value]] type. This class
+ * can be overridden to change the enumeration's naming and integer
+ * identification behaviour.
*/
@SerialVersionUID(0 - 3501153230598116017L)
protected class Val(i: Int, name: String) extends Value with Serializable {
- def this(i: Int) = this(i, nextNameOrNull)
- def this(name: String) = this(nextId, name)
- def this() = this(nextId)
+ def this(i: Int) = this(i, nextNameOrNull)
+ def this(name: String) = this(nextId, name)
+ def this() = this(nextId)
assert(!vmap.isDefinedAt(i), "Duplicate id: " + i)
vmap(i) = this
@@ -226,9 +225,10 @@ abstract class Enumeration(initial: Int, names: String*) extends Serializable {
}
}
- /** A class for sets of values
+ /** A class for sets of values.
* Iterating through this set will yield values in increasing order of their ids.
- * @param ids The set of ids of values, organized as a SortedSet.
+ *
+ * @param ids The set of ids of values, organized as a `SortedSet`.
*/
class ValueSet private[Enumeration] (val ids: immutable.SortedSet[Int]) extends Set[Value] with SetLike[Value, ValueSet] {
override def empty = ValueSet.empty
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -16,9 +16,8 @@ package scala
* @version 1.0, 29/11/2006
*/
object Function {
- /** Given a sequence of functions <code>f<sub>1</sub></code>, ...,
- * <code>f<sub>n</sub></code>, return the function <code>f<sub>1</sub>
- * andThen ... andThen f<sub>n</sub></code>.
+ /** Given a sequence of functions `f,,1,,`, ..., `f,,n,,`, return the
+ * function `f,,1,, andThen ... andThen f,,n,,`.
*
* @param fs The given sequence of functions
* @return ...
@@ -28,15 +27,17 @@ object Function {
/** The constant function */
def const[T, U](x: T)(y: U): T = x
- /** Turns a function `A => Option[B]` into a `PartialFunction[A, B]`. Important note:
- * this transformation implies the original function will be called 2 or more
- * times on each logical invocation, because the only way to supply an implementation
- * of isDefinedAt is to call the function and examine the return value.
+ /** Turns a function `A => Option[B]` into a `PartialFunction[A, B]`.
*
- * @param f a function T => Option[R]
+ * '''Important note''': this transformation implies the original function
+ * will be called 2 or more times on each logical invocation, because the
+ * only way to supply an implementation of `isDefinedAt` is to call the
+ * function and examine the return value.
+ *
+ * @param f a function `T => Option[R]`
* @return a partial function defined for those inputs where
- * f returns Some(_) and undefined where f returns None.
- * @see PartialFunction#lift
+ * f returns `Some(_)` and undefined where `f` returns `None`.
+ * @see [[scala.PartialFunction#lift]]
*/
def unlift[T, R](f: T => Option[R]): PartialFunction[T, R] = new PartialFunction[T, R] {
def apply(x: T): R = f(x).get
@@ -9,9 +9,9 @@
package scala
-/** The object <code>Math</code> contains methods for performing basic numeric
- * operations such as the elementary exponential, logarithm, square root, and
- * trigonometric functions.
+/** The object `Math` contains methods for performing basic numeric
+ * operations such as the elementary exponential, logarithm, square root,
+ * and trigonometric functions.
*/
@deprecated("use the scala.math package object instead.\n(Example package object usage: scala.math.Pi )", "2.8.0")
object Math extends MathCommon {
@@ -92,4 +92,4 @@ object Math extends MathCommon {
/** Positive infinity of type [[scala.Double]]. */
@deprecated("Use `scala.Double.PositiveInfinity` instead", "2.8.0")
val POS_INF_DOUBLE = java.lang.Double.POSITIVE_INFINITY
-}
+}
@@ -9,23 +9,22 @@
package scala
-/** Common code between the deprecated scala.Math object and
- * the scala.math package object.
+/** Common code between the deprecated `scala.Math` object and
+ * the `scala.math` package object.
*/
private[scala] class MathCommon {
- /** The <code>double</code> value that is closer than any other to
- * <code>e</code>, the base of the natural logarithms.
+ /** The `double` value that is closer than any other to `e`, the base of
+ * the natural logarithms.
*/
val E = java.lang.Math.E
- /** The <code>double</code> value that is closer than any other to
- * <code>pi</code>, the ratio of the circumference of a circle to its
- * diameter.
+ /** The `double` value that is closer than any other to `pi`, the ratio of
+ * the circumference of a circle to its diameter.
*/
val Pi = java.lang.Math.PI
- /** Returns a <code>double</code> value with a positive sign, greater than
- * or equal to <code>0.0</code> and less than <code>1.0</code>.
+ /** Returns a `double` value with a positive sign, greater than or equal
+ * to `0.0` and less than `1.0`.
*/
def random: Double = java.lang.Math.random()
@@ -40,24 +39,23 @@ private[scala] class MathCommon {
* angle measured in radians.
*
* @param x an angle, in degrees
- * @return the measurement of the angle <code>x</code> in radians.
+ * @return the measurement of the angle `x` in radians.
*/
def toRadians(x: Double): Double = java.lang.Math.toRadians(x)
/** Converts an angle measured in radians to an approximately equivalent
* angle measured in degrees.
*
* @param x angle, in radians
- * @return the measurement of the angle <code>x</code> in degrees.
+ * @return the measurement of the angle `x` in degrees.
*/
def toDegrees(x: Double): Double = java.lang.Math.toDegrees(x)
- /** Returns Euler's number <code>e</code> raised to the power of a
- * <code>double</code> value.
+ /** Returns Euler's number `e` raised to the power of a `double` value.
*
- * @param x the exponent to raise <code>e</code> to.
- * @return the value <code>e<sup>a</sup></code>, where <code>e</code>
- * is the base of the natural logarithms.
+ * @param x the exponent to raise `e` to.
+ * @return the value `e^a^`, where `e` is the base of the natural
+ * logarithms.
*/
def exp(x: Double): Double = java.lang.Math.exp(x)
def log(x: Double): Double = java.lang.Math.log(x)
@@ -67,23 +65,22 @@ private[scala] class MathCommon {
def ceil(x: Double): Double = java.lang.Math.ceil(x)
def floor(x: Double): Double = java.lang.Math.floor(x)
- /** Returns the <code>double</code> value that is closest in value to the
+ /** Returns the `double` value that is closest in value to the
* argument and is equal to a mathematical integer.
*
- * @param x a <code>double</code> value
+ * @param x a `double` value
* @return the closest floating-point value to a that is equal to a
* mathematical integer.
*/
def rint(x: Double): Double = java.lang.Math.rint(x)
- /** Converts rectangular coordinates <code>(x, y)</code> to polar
- * <code>(r, theta)</code>.
+ /** Converts rectangular coordinates `(x, y)` to polar `(r, theta)`.
*
* @param x the ordinate coordinate
* @param y the abscissa coordinate
- * @return the <em>theta</em> component of the point <code>(r, theta)</code>
- * in polar coordinates that corresponds to the point
- * <code>(x, y)</code> in Cartesian coordinates.
+ * @return the ''theta'' component of the point `(r, theta)` in polar
+ * coordinates that corresponds to the point `(x, y)` in
+ * Cartesian coordinates.
*/
def atan2(y: Double, x: Double): Double = java.lang.Math.atan2(y, x)
@@ -92,15 +89,14 @@ private[scala] class MathCommon {
*
* @param x the base.
* @param y the exponent.
- * @return the value <code>x<sup>y</sup></code>.
+ * @return the value `x^y^`.
*/
def pow(x: Double, y: Double): Double = java.lang.Math.pow(x, y)
- /** Returns the closest <code>long</code> to the argument.
+ /** Returns the closest `long` to the argument.
*
- * @param x a floating-point value to be rounded to a <code>long</code>.
- * @return the value of the argument rounded to the nearest
- * <code>long</code> value.
+ * @param x a floating-point value to be rounded to a `long`.
+ * @return the value of the argument rounded to the nearest`long` value.
*/
def round(x: Float): Int = java.lang.Math.round(x)
def round(x: Double): Long = java.lang.Math.round(x)
Oops, something went wrong. Retry.

0 comments on commit 9f6e8ee

Please sign in to comment.