summaryrefslogtreecommitdiff
path: root/src/library/scala/xml
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/scala/xml
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/scala/xml')
-rwxr-xr-xsrc/library/scala/xml/Elem.scala8
-rwxr-xr-xsrc/library/scala/xml/XML.scala17
2 files changed, 14 insertions, 11 deletions
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"