summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-20 14:23:40 -0700
committerPaul Phillips <paulp@improving.org>2012-03-20 18:42:09 -0700
commit6d7bcd5818b856d4596b57b7e9f1543b71ed7329 (patch)
tree0bc4788208a585ebd25e36bc929c667d784ce6d0 /src/library
parentb9e933ffca8108ed86c09a298a44636b714f7a19 (diff)
downloadscala-6d7bcd5818b856d4596b57b7e9f1543b71ed7329.tar.gz
scala-6d7bcd5818b856d4596b57b7e9f1543b71ed7329.tar.bz2
scala-6d7bcd5818b856d4596b57b7e9f1543b71ed7329.zip
Lots of tedious warning and tree printing work.
Fewer deprecation warnings, prettier trees, prettier symbols, more polished error messages. Oh the interesting people you meet handling warnings, I feel sorry for you all that I get to do it all the time. One of the characters I met invited me into the "Dead Code Society" and that's what I'm doing on Tuesdays now. No of course you haven't, it's a SECRET society.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Specializable.scala12
-rw-r--r--src/library/scala/collection/GenTraversableOnce.scala2
-rw-r--r--src/library/scala/collection/mutable/ConcurrentTrieMap.scala2
-rw-r--r--src/library/scala/concurrent/DelayedLazyVal.scala3
-rw-r--r--src/library/scala/reflect/api/Trees.scala3
-rwxr-xr-xsrc/library/scala/xml/Elem.scala8
-rwxr-xr-xsrc/library/scala/xml/XML.scala17
7 files changed, 25 insertions, 22 deletions
diff --git a/src/library/scala/Specializable.scala b/src/library/scala/Specializable.scala
index 67126b3069..d5e22195d2 100644
--- a/src/library/scala/Specializable.scala
+++ b/src/library/scala/Specializable.scala
@@ -20,10 +20,10 @@ object Specializable {
// Smuggle a list of types by way of a tuple upon which Group is parameterized.
class Group[T >: Null](value: T) extends SpecializedGroup { }
- final val Primitives = new Group(Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit)
- final val Everything = new Group(Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit, AnyRef)
- final val Bits32AndUp = new Group(Int, Long, Float, Double)
- final val Integral = new Group(Byte, Short, Int, Long, Char)
- final val AllNumeric = new Group(Byte, Short, Int, Long, Char, Float, Double)
- final val BestOfBreed = new Group(Int, Double, Boolean, Unit, AnyRef)
+ final val Primitives = new Group((Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit))
+ final val Everything = new Group((Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit, AnyRef))
+ final val Bits32AndUp = new Group((Int, Long, Float, Double))
+ final val Integral = new Group((Byte, Short, Int, Long, Char))
+ final val AllNumeric = new Group((Byte, Short, Int, Long, Char, Float, Double))
+ final val BestOfBreed = new Group((Int, Double, Boolean, Unit, AnyRef))
}
diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala
index f18e2ab6bb..019d3d0785 100644
--- a/src/library/scala/collection/GenTraversableOnce.scala
+++ b/src/library/scala/collection/GenTraversableOnce.scala
@@ -124,7 +124,7 @@ trait GenTraversableOnce[+A] extends Any {
* scala> val b = (a /:\ 5)(_+_)
* b: Int = 15
* }}}*/
- @deprecated("use fold instead")
+ @deprecated("use fold instead", "2.10.0")
def /:\[A1 >: A](z: A1)(op: (A1, A1) => A1): A1 = fold(z)(op)
/** Applies a binary operator to a start value and all elements of this $coll,
diff --git a/src/library/scala/collection/mutable/ConcurrentTrieMap.scala b/src/library/scala/collection/mutable/ConcurrentTrieMap.scala
index 1a44c8e423..cfe1b1950d 100644
--- a/src/library/scala/collection/mutable/ConcurrentTrieMap.scala
+++ b/src/library/scala/collection/mutable/ConcurrentTrieMap.scala
@@ -1027,7 +1027,7 @@ private[collection] class ConcurrentTrieMapIterator[K, V](var level: Int, privat
Seq(this)
}
- def printDebug {
+ def printDebug() {
println("ctrie iterator")
println(stackpos.mkString(","))
println("depth: " + depth)
diff --git a/src/library/scala/concurrent/DelayedLazyVal.scala b/src/library/scala/concurrent/DelayedLazyVal.scala
index a17153bad5..96a66d83b6 100644
--- a/src/library/scala/concurrent/DelayedLazyVal.scala
+++ b/src/library/scala/concurrent/DelayedLazyVal.scala
@@ -40,9 +40,8 @@ class DelayedLazyVal[T](f: () => T, body: => Unit) {
def apply(): T = if (isDone) complete else f()
// TODO replace with scala.concurrent.future { ... }
- ops.future {
+ future {
body
_isDone = true
}
-
}
diff --git a/src/library/scala/reflect/api/Trees.scala b/src/library/scala/reflect/api/Trees.scala
index a8276dc853..466c380cef 100644
--- a/src/library/scala/reflect/api/Trees.scala
+++ b/src/library/scala/reflect/api/Trees.scala
@@ -165,11 +165,12 @@ trait Trees { self: Universe =>
def foreach(f: Tree => Unit) { new ForeachTreeTraverser(f).traverse(this) }
/** Find all subtrees matching predicate `p` */
- def filter(f: Tree => Boolean): List[Tree] = {
+ def withFilter(f: Tree => Boolean): List[Tree] = {
val ft = new FilterTreeTraverser(f)
ft.traverse(this)
ft.hits.toList
}
+ def filter(f: Tree => Boolean): List[Tree] = withFilter(f)
/** Returns optionally first tree (in a preorder traversal) which satisfies predicate `p`,
* or None if none exists.
diff --git a/src/library/scala/xml/Elem.scala b/src/library/scala/xml/Elem.scala
index cc244a5b88..5b6b9f2bb9 100755
--- a/src/library/scala/xml/Elem.scala
+++ b/src/library/scala/xml/Elem.scala
@@ -23,12 +23,12 @@ object Elem {
* @deprecated This factory method is retained for backward compatibility; please use the other one, with which you
* can specify your own preference for minimizeEmpty.
*/
- @deprecated
- def apply(prefix: String,label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*): Elem =
+ @deprecated("Use the other apply method in this object", "2.10.0")
+ def apply(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*): Elem =
apply(prefix, label, attributes, scope, child.isEmpty, child: _*)
- def apply(prefix: String,label: String, attributes: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, child: Node*): Elem =
- new Elem(prefix,label,attributes,scope, minimizeEmpty, child:_*)
+ def apply(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, child: Node*): Elem =
+ new Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
def unapplySeq(n: Node) = n match {
case _: SpecialNode | _: Group => None
diff --git a/src/library/scala/xml/XML.scala b/src/library/scala/xml/XML.scala
index 4beba91899..f6955c6612 100755
--- a/src/library/scala/xml/XML.scala
+++ b/src/library/scala/xml/XML.scala
@@ -15,8 +15,7 @@ import java.io.{ InputStream, Reader, StringReader, Writer }
import java.nio.channels.Channels
import scala.util.control.Exception.ultimately
-object Source
-{
+object Source {
def fromFile(file: File) = new InputSource(new FileInputStream(file))
def fromFile(fd: FileDescriptor) = new InputSource(new FileInputStream(fd))
def fromFile(name: String) = new InputSource(new FileInputStream(name))
@@ -31,13 +30,18 @@ object Source
* Governs how empty elements (i.e. those without child elements) should be serialized.
*/
object MinimizeMode extends Enumeration {
- /** Minimize empty tags if they were originally empty when parsed, or if they were constructed with [[scala.xml.Elem]]`#minimizeEmpty` == true */
+ /** Minimize empty tags if they were originally empty when parsed, or if they were constructed
+ * with [[scala.xml.Elem]]`#minimizeEmpty` == true
+ */
val Default = Value
- /** Always minimize empty tags. Note that this may be problematic for XHTML, in which case [[scala.xml.Xhtml]]`#toXhtml` should be used instead. */
+ /** Always minimize empty tags. Note that this may be problematic for XHTML, in which
+ * case [[scala.xml.Xhtml]]`#toXhtml` should be used instead.
+ */
val Always = Value
- /** Never minimize empty tags. */
+ /** Never minimize empty tags.
+ */
val Never = Value
}
@@ -50,8 +54,7 @@ import Source._
* @author Burak Emir
* @version 1.0, 25/04/2005
*/
-object XML extends XMLLoader[Elem]
-{
+object XML extends XMLLoader[Elem] {
val xml = "xml"
val xmlns = "xmlns"
val namespace = "http://www.w3.org/XML/1998/namespace"