summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-29 21:42:25 +0000
committerPaul Phillips <paulp@improving.org>2011-07-29 21:42:25 +0000
commit9bdc1a0b6deb5bf8a056af0253b25fcf5d92c7f7 (patch)
tree9625ceb6358baf68b84eae5e1dc6fa74d267e425 /src/library
parent902c61f397069b9918f1854b8bf95a50b52c08fc (diff)
downloadscala-9bdc1a0b6deb5bf8a056af0253b25fcf5d92c7f7.tar.gz
scala-9bdc1a0b6deb5bf8a056af0253b25fcf5d92c7f7.tar.bz2
scala-9bdc1a0b6deb5bf8a056af0253b25fcf5d92c7f7.zip
Following up on things that -Xlint told me, som...
Following up on things that -Xlint told me, sometimes because Mr. Linty was being sensible and other times just to shut him up so we can hear better in the future. - made xml.Equality public because it occurs in public method signatures - made some actor classes with inaccessible-unoverridable methods final - eliminated a bunch of "dead code follows" warnings by deleting the dead code which really did follow - improved the reliability of warnings about inaccessible types For the changes in actors, review by phaller.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Array.scala86
-rw-r--r--src/library/scala/collection/parallel/ParIterableLike.scala1
-rw-r--r--src/library/scala/collection/parallel/ParSeqViewLike.scala9
-rw-r--r--src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala1
-rw-r--r--src/library/scala/util/parsing/combinator/Parsers.scala4
-rw-r--r--src/library/scala/xml/Attribute.scala4
-rw-r--r--src/library/scala/xml/Equality.scala1
-rw-r--r--src/library/scala/xml/PrefixedAttribute.scala2
-rw-r--r--src/library/scala/xml/UnprefixedAttribute.scala2
9 files changed, 47 insertions, 63 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala
index 2c008c6021..b18f838a0a 100644
--- a/src/library/scala/Array.scala
+++ b/src/library/scala/Array.scala
@@ -522,61 +522,37 @@ object Array extends FallbackArrayBuilding {
*/
final class Array[T](_length: Int) extends java.io.Serializable with java.lang.Cloneable {
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = {
- this(dim1);
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = {
- this(dim1)
- throw new Error()
- }
-
- /** Multidimensional array creation */
- @deprecated("use `Array.ofDim` instead", "2.8.0")
- def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = {
- this(dim1)
- throw new Error()
- }
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = this(dim1)
+
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim` instead", "2.8.0")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = this(dim1)
/** The length of the array */
def length: Int = throw new Error()
diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala
index cc18ec895c..f0d79ada9d 100644
--- a/src/library/scala/collection/parallel/ParIterableLike.scala
+++ b/src/library/scala/collection/parallel/ParIterableLike.scala
@@ -275,6 +275,7 @@ self: ParIterableLike[T, Repr, Sequential] =>
trait TaskOps[R, Tp] {
def mapResult[R1](mapping: R => R1): ResultMapping[R, Tp, R1]
+ // public method with inaccessible types in parameters
def compose[R3, R2, Tp2](t2: SSCTask[R2, Tp2])(resCombiner: (R, R2) => R3): SeqComposite[R, R2, R3, SSCTask[R, Tp], SSCTask[R2, Tp2]]
def parallel[R3, R2, Tp2](t2: SSCTask[R2, Tp2])(resCombiner: (R, R2) => R3): ParComposite[R, R2, R3, SSCTask[R, Tp], SSCTask[R2, Tp2]]
}
diff --git a/src/library/scala/collection/parallel/ParSeqViewLike.scala b/src/library/scala/collection/parallel/ParSeqViewLike.scala
index 0da6f413d9..6fdc181793 100644
--- a/src/library/scala/collection/parallel/ParSeqViewLike.scala
+++ b/src/library/scala/collection/parallel/ParSeqViewLike.scala
@@ -92,10 +92,18 @@ self =>
override def seq = self.seq.patch(from, patch, replaced).asInstanceOf[SeqView[U, CollSeq]]
}
+ // !!!
+ //
+ // What is up with this trait and method, why are they here doing
+ // nothing but throwing exceptions, without even being deprecated?
+ // They're not implementing something abstract; why aren't they
+ // just removed?
+ //
// use Patched instead
trait Prepended[U >: T] extends super.Prepended[U] with Transformed[U] {
unsupported
}
+ protected def newPrepended[U >: T](elem: U): Transformed[U] = unsupported
/* wrapper virtual ctors */
@@ -122,7 +130,6 @@ self =>
val patch = _patch;
val replaced = _replaced
} with Patched[U]
- protected def newPrepended[U >: T](elem: U): Transformed[U] = unsupported
/* operation overrides */
diff --git a/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala b/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
index 8290438c10..2cb0f541d8 100644
--- a/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
+++ b/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
@@ -29,6 +29,7 @@ extends LazyCombiner[T, ParArray[T], ExposedArrayBuffer[T]]
override def sizeHint(sz: Int) = if (chain.length == 1) chain(0).sizeHint(sz)
+ // public method with private[mutable] type ExposedArrayBuffer in parameter type; cannot be overridden.
def newLazyCombiner(c: ArrayBuffer[ExposedArrayBuffer[T]]) = ResizableParArrayCombiner(c)
def allocateAndCopy = if (chain.size > 1) {
diff --git a/src/library/scala/util/parsing/combinator/Parsers.scala b/src/library/scala/util/parsing/combinator/Parsers.scala
index 084a849037..a7d3157fbd 100644
--- a/src/library/scala/util/parsing/combinator/Parsers.scala
+++ b/src/library/scala/util/parsing/combinator/Parsers.scala
@@ -138,8 +138,8 @@ trait Parsers {
/** An extractor so `NoSuccess(msg, next)` can be used in matches. */
object NoSuccess {
def unapply[T](x: ParseResult[T]) = x match {
- case Failure(msg, next) => Some(msg, next)
- case Error(msg, next) => Some(msg, next)
+ case Failure(msg, next) => Some((msg, next))
+ case Error(msg, next) => Some((msg, next))
case _ => None
}
}
diff --git a/src/library/scala/xml/Attribute.scala b/src/library/scala/xml/Attribute.scala
index 5b69017e70..bce3ffe60d 100644
--- a/src/library/scala/xml/Attribute.scala
+++ b/src/library/scala/xml/Attribute.scala
@@ -15,8 +15,8 @@ package scala.xml
object Attribute {
def unapply(x: Attribute) = x match {
- case PrefixedAttribute(_, key, value, next) => Some(key, value, next)
- case UnprefixedAttribute(key, value, next) => Some(key, value, next)
+ case PrefixedAttribute(_, key, value, next) => Some((key, value, next))
+ case UnprefixedAttribute(key, value, next) => Some((key, value, next))
case _ => None
}
diff --git a/src/library/scala/xml/Equality.scala b/src/library/scala/xml/Equality.scala
index 051783c1cd..cc31c6eaa7 100644
--- a/src/library/scala/xml/Equality.scala
+++ b/src/library/scala/xml/Equality.scala
@@ -65,7 +65,6 @@ object Equality {
}
import Equality._
-private[xml]
trait Equality extends scala.Equals {
def basisForHashCode: Seq[Any]
def strict_==(other: Equality): Boolean
diff --git a/src/library/scala/xml/PrefixedAttribute.scala b/src/library/scala/xml/PrefixedAttribute.scala
index 01a3e0c4b6..436dfcda43 100644
--- a/src/library/scala/xml/PrefixedAttribute.scala
+++ b/src/library/scala/xml/PrefixedAttribute.scala
@@ -53,5 +53,5 @@ extends Attribute
}
object PrefixedAttribute {
- def unapply(x: PrefixedAttribute) = Some(x.pre, x.key, x.value, x.next)
+ def unapply(x: PrefixedAttribute) = Some((x.pre, x.key, x.value, x.next))
}
diff --git a/src/library/scala/xml/UnprefixedAttribute.scala b/src/library/scala/xml/UnprefixedAttribute.scala
index bf4f99c55f..c56fba1e6c 100644
--- a/src/library/scala/xml/UnprefixedAttribute.scala
+++ b/src/library/scala/xml/UnprefixedAttribute.scala
@@ -56,5 +56,5 @@ extends Attribute
next(namespace, scope, key)
}
object UnprefixedAttribute {
- def unapply(x: UnprefixedAttribute) = Some(x.key, x.value, x.next)
+ def unapply(x: UnprefixedAttribute) = Some((x.key, x.value, x.next))
}