Skip to content

Commit 21fe9aa

Browse files
committed
Seq => collection.Seq
1 parent 4a54464 commit 21fe9aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+119
-119
lines changed

jvm/src/test/scala/scala/xml/ReuseNodesTest.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ import org.junit.runner.RunWith
1717
object ReuseNodesTest {
1818

1919
class OriginalTranformr(rules: RewriteRule*) extends RuleTransformer(rules:_*) {
20-
override def transform(ns: Seq[Node]): Seq[Node] = {
20+
override def transform(ns: collection.Seq[Node]): collection.Seq[Node] = {
2121
val xs = ns.toStream map transform
2222
val (xs1, xs2) = xs zip ns span { case (x, n) => unchanged(n, x) }
2323

2424
if (xs2.isEmpty) ns
2525
else (xs1 map (_._2)) ++ xs2.head._1 ++ transform(ns drop (xs1.length + 1))
2626
}
27-
override def transform(n:Node): Seq[Node] = super.transform(n)
27+
override def transform(n:Node): collection.Seq[Node] = super.transform(n)
2828
}
2929

3030
class ModifiedTranformr(rules: RewriteRule*) extends RuleTransformer(rules:_*) {
31-
override def transform(ns: Seq[Node]): Seq[Node] = {
31+
override def transform(ns: collection.Seq[Node]): collection.Seq[Node] = {
3232
val changed = ns flatMap transform
3333

3434
if (changed.length != ns.length || (changed, ns).zipped.exists(_ != _)) changed
3535
else ns
3636
}
37-
override def transform(n:Node): Seq[Node] = super.transform(n)
37+
override def transform(n:Node): collection.Seq[Node] = super.transform(n)
3838
}
3939

4040
class AlternateTranformr(rules: RewriteRule*) extends RuleTransformer(rules:_*) {
41-
override def transform(ns: Seq[Node]): Seq[Node] = {
41+
override def transform(ns: collection.Seq[Node]): collection.Seq[Node] = {
4242
val xs = ns.toStream map transform
4343
val (xs1, xs2) = xs zip ns span { case (x, n) => unchanged(n, x) }
4444

4545
if (xs2.isEmpty) ns
4646
else (xs1 map (_._2)) ++ xs2.head._1 ++ transform(ns drop (xs1.length + 1))
4747
}
48-
override def transform(n:Node): Seq[Node] = super.transform(n)
48+
override def transform(n:Node): collection.Seq[Node] = super.transform(n)
4949
}
5050

5151
def rewriteRule = new RewriteRule {
@@ -80,7 +80,7 @@ class ReuseNodesTest {
8080
recursiveAssert(original,transformed)
8181
}
8282

83-
def recursiveAssert(original:Seq[Node], transformed:Seq[Node]):Unit = {
83+
def recursiveAssert(original: collection.Seq[Node], transformed: collection.Seq[Node]):Unit = {
8484
original zip transformed foreach {
8585
case (x, y) => recursiveAssert(x, y)
8686
}

jvm/src/test/scala/scala/xml/SerializationTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SerializationTest {
2323
@Test
2424
def implicitConversion: Unit = {
2525
val parent = <parent><child></child><child/></parent>
26-
val children: Seq[Node] = parent.child
26+
val children: collection.Seq[Node] = parent.child
2727
val asNodeSeq: NodeSeq = children
2828
assertEquals(asNodeSeq, JavaByteSerialization.roundTrip(asNodeSeq))
2929
}

jvm/src/test/scala/scala/xml/XMLTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ class XMLTestJVM {
489489
def attributes = {
490490
val noAttr = <t/>
491491
val attrNull = <t a={ null: String }/>
492-
val attrNone = <t a={ None: Option[Seq[Node]] }/>
492+
val attrNone = <t a={ None: Option[collection.Seq[Node]] }/>
493493
val preAttrNull = <t p:a={ null: String }/>
494-
val preAttrNone = <t p:a={ None: Option[Seq[Node]] }/>
494+
val preAttrNone = <t p:a={ None: Option[collection.Seq[Node]] }/>
495495
assertEquals(noAttr, attrNull)
496496
assertEquals(noAttr, attrNone)
497497
assertEquals(noAttr, preAttrNull)

shared/src/main/scala/scala/xml/Atom.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Atom[+A](val data: A) extends SpecialNode with Serializable {
2020
if (data == null)
2121
throw new IllegalArgumentException("cannot construct " + getClass.getSimpleName + " with null")
2222

23-
override protected def basisForHashCode: Seq[Any] = Seq(data)
23+
override protected def basisForHashCode: collection.Seq[Any] = Seq(data)
2424

2525
override def strict_==(other: Equality) = other match {
2626
case x: Atom[_] => data == x.data

shared/src/main/scala/scala/xml/Attribute.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ object Attribute {
2323
}
2424

2525
/** Convenience functions which choose Un/Prefixedness appropriately */
26-
def apply(key: String, value: Seq[Node], next: MetaData): Attribute =
26+
def apply(key: String, value: collection.Seq[Node], next: MetaData): Attribute =
2727
new UnprefixedAttribute(key, value, next)
2828

2929
def apply(pre: String, key: String, value: String, next: MetaData): Attribute =
3030
if (pre == null || pre == "") new UnprefixedAttribute(key, value, next)
3131
else new PrefixedAttribute(pre, key, value, next)
3232

33-
def apply(pre: String, key: String, value: Seq[Node], next: MetaData): Attribute =
33+
def apply(pre: String, key: String, value: collection.Seq[Node], next: MetaData): Attribute =
3434
if (pre == null || pre == "") new UnprefixedAttribute(key, value, next)
3535
else new PrefixedAttribute(pre, key, value, next)
3636

37-
def apply(pre: Option[String], key: String, value: Seq[Node], next: MetaData): Attribute =
37+
def apply(pre: Option[String], key: String, value: collection.Seq[Node], next: MetaData): Attribute =
3838
pre match {
3939
case None => new UnprefixedAttribute(key, value, next)
4040
case Some(p) => new PrefixedAttribute(p, key, value, next)
@@ -50,11 +50,11 @@ object Attribute {
5050
abstract trait Attribute extends MetaData {
5151
def pre: String // will be null if unprefixed
5252
val key: String
53-
val value: Seq[Node]
53+
val value: collection.Seq[Node]
5454
val next: MetaData
5555

56-
def apply(key: String): Seq[Node]
57-
def apply(namespace: String, scope: NamespaceBinding, key: String): Seq[Node]
56+
def apply(key: String): collection.Seq[Node]
57+
def apply(namespace: String, scope: NamespaceBinding, key: String): collection.Seq[Node]
5858
def copy(next: MetaData): Attribute
5959

6060
def remove(key: String) =

shared/src/main/scala/scala/xml/Document.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
3030
* excluded. If there is a document type declaration, the list also
3131
* contains a document type declaration information item.
3232
*/
33-
var children: Seq[Node] = _
33+
var children: collection.Seq[Node] = _
3434

3535
/** The element information item corresponding to the document element. */
3636
var docElem: Node = _
@@ -43,14 +43,14 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
4343
* declared in the DTD. If any notation is multiply declared, this property
4444
* has no value.
4545
*/
46-
def notations: Seq[scala.xml.dtd.NotationDecl] =
46+
def notations: collection.Seq[scala.xml.dtd.NotationDecl] =
4747
dtd.notations
4848

4949
/**
5050
* An unordered set of unparsed entity information items, one for each
5151
* unparsed entity declared in the DTD.
5252
*/
53-
def unparsedEntities: Seq[scala.xml.dtd.EntityDecl] =
53+
def unparsedEntities: collection.Seq[scala.xml.dtd.EntityDecl] =
5454
dtd.unparsedEntities
5555

5656
/** The base URI of the document entity. */
@@ -90,7 +90,7 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
9090

9191
// methods for NodeSeq
9292

93-
def theSeq: Seq[Node] = this.docElem
93+
def theSeq: collection.Seq[Node] = this.docElem
9494

9595
override def canEqual(other: Any) = other match {
9696
case _: Document => true

shared/src/main/scala/scala/xml/Elem.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Elem(
111111
// setting namespace scope if necessary
112112
// cleaning adjacent text nodes if necessary
113113

114-
override protected def basisForHashCode: Seq[Any] =
114+
override protected def basisForHashCode: collection.Seq[Any] =
115115
prefix :: label :: attributes :: child.toList
116116

117117
/**
@@ -136,7 +136,7 @@ class Elem(
136136
attributes: MetaData = this.attributes,
137137
scope: NamespaceBinding = this.scope,
138138
minimizeEmpty: Boolean = this.minimizeEmpty,
139-
child: Seq[Node] = this.child.toSeq): Elem = Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
139+
child: collection.Seq[Node] = this.child.toSeq): Elem = Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
140140

141141
/**
142142
* Returns concatenation of `text(n)` for each child `n`.

shared/src/main/scala/scala/xml/Equality.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package xml
3030
*
3131
* Among the obstacles to sanity are/were:
3232
*
33-
* Node extends NodeSeq extends Seq[Node]
33+
* Node extends NodeSeq extends collection.Seq[Node]
3434
* MetaData extends Iterable[MetaData]
3535
* The hacky "Group" xml node which throws exceptions
3636
* with wild abandon, so don't get too close
@@ -69,7 +69,7 @@ object Equality {
6969
import Equality._
7070

7171
trait Equality extends scala.Equals {
72-
protected def basisForHashCode: Seq[Any]
72+
protected def basisForHashCode: collection.Seq[Any]
7373

7474
def strict_==(other: Equality): Boolean
7575
def strict_!=(other: Equality) = !strict_==(other)

shared/src/main/scala/scala/xml/Group.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package xml
1414
*
1515
* @author Burak Emir
1616
*/
17-
final case class Group(nodes: Seq[Node]) extends Node {
17+
final case class Group(nodes: collection.Seq[Node]) extends Node {
1818
override def theSeq = nodes
1919

2020
override def canEqual(other: Any) = other match {

shared/src/main/scala/scala/xml/MetaData.scala

+12-12
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ abstract class MetaData
9999
* Gets value of unqualified (unprefixed) attribute with given key, null if not found
100100
*
101101
* @param key
102-
* @return value as Seq[Node] if key is found, null otherwise
102+
* @return value as collection.Seq[Node] if key is found, null otherwise
103103
*/
104-
def apply(key: String): Seq[Node]
104+
def apply(key: String): collection.Seq[Node]
105105

106106
/**
107107
* convenience method, same as `apply(namespace, owner.scope, key)`.
@@ -110,7 +110,7 @@ abstract class MetaData
110110
* @param owner the element owning this attribute list
111111
* @param key the attribute key
112112
*/
113-
final def apply(namespace_uri: String, owner: Node, key: String): Seq[Node] =
113+
final def apply(namespace_uri: String, owner: Node, key: String): collection.Seq[Node] =
114114
apply(namespace_uri, owner.scope, key)
115115

116116
/**
@@ -119,9 +119,9 @@ abstract class MetaData
119119
* @param namespace_uri namespace uri of key
120120
* @param scp a namespace scp (usually of the element owning this attribute list)
121121
* @param k to be looked for
122-
* @return value as Seq[Node] if key is found, null otherwise
122+
* @return value as collection.Seq[Node] if key is found, null otherwise
123123
*/
124-
def apply(namespace_uri: String, scp: NamespaceBinding, k: String): Seq[Node]
124+
def apply(namespace_uri: String, scp: NamespaceBinding, k: String): collection.Seq[Node]
125125

126126
/**
127127
* returns a copy of this MetaData item with next field set to argument.
@@ -147,7 +147,7 @@ abstract class MetaData
147147
case m: MetaData => this.asAttrMap == m.asAttrMap
148148
case _ => false
149149
}
150-
protected def basisForHashCode: Seq[Any] = List(this.asAttrMap)
150+
protected def basisForHashCode: collection.Seq[Any] = List(this.asAttrMap)
151151

152152
/** filters this sequence of meta data */
153153
override def filter(f: MetaData => Boolean): MetaData =
@@ -158,7 +158,7 @@ abstract class MetaData
158158
def key: String
159159

160160
/** returns value of this MetaData item */
161-
def value: Seq[Node]
161+
def value: collection.Seq[Node]
162162

163163
/**
164164
* Returns a String containing "prefix:key" if the first key is
@@ -182,12 +182,12 @@ abstract class MetaData
182182
* Gets value of unqualified (unprefixed) attribute with given key, None if not found
183183
*
184184
* @param key
185-
* @return value in Some(Seq[Node]) if key is found, None otherwise
185+
* @return value in Some(collection.Seq[Node]) if key is found, None otherwise
186186
*/
187-
final def get(key: String): Option[Seq[Node]] = Option(apply(key))
187+
final def get(key: String): Option[collection.Seq[Node]] = Option(apply(key))
188188

189189
/** same as get(uri, owner.scope, key) */
190-
final def get(uri: String, owner: Node, key: String): Option[Seq[Node]] =
190+
final def get(uri: String, owner: Node, key: String): Option[collection.Seq[Node]] =
191191
get(uri, owner.scope, key)
192192

193193
/**
@@ -196,9 +196,9 @@ abstract class MetaData
196196
* @param uri namespace of key
197197
* @param scope a namespace scp (usually of the element owning this attribute list)
198198
* @param key to be looked fore
199-
* @return value as Some[Seq[Node]] if key is found, None otherwise
199+
* @return value as Some[collection.Seq[Node]] if key is found, None otherwise
200200
*/
201-
final def get(uri: String, scope: NamespaceBinding, key: String): Option[Seq[Node]] =
201+
final def get(uri: String, scope: NamespaceBinding, key: String): Option[collection.Seq[Node]] =
202202
Option(apply(uri, scope, key))
203203

204204
protected def toString1(): String = sbToString(toString1)

shared/src/main/scala/scala/xml/NamespaceBinding.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ case class NamespaceBinding(prefix: String, uri: String, parent: NamespaceBindin
6363
case _ => false
6464
}
6565

66-
def basisForHashCode: Seq[Any] = List(prefix, uri, parent)
66+
def basisForHashCode: collection.Seq[Any] = List(prefix, uri, parent)
6767

6868
def buildString(stop: NamespaceBinding): String = sbToString(buildString(_, stop))
6969

shared/src/main/scala/scala/xml/Node.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ abstract class Node extends NodeSeq {
8585
* @return value of `UnprefixedAttribute` with given key
8686
* in attributes, if it exists, otherwise `null`.
8787
*/
88-
final def attribute(key: String): Option[Seq[Node]] = attributes.get(key)
88+
final def attribute(key: String): Option[collection.Seq[Node]] = attributes.get(key)
8989

9090
/**
9191
* Convenience method, looks up a prefixed attribute in attributes of this node.
@@ -96,7 +96,7 @@ abstract class Node extends NodeSeq {
9696
* @return value of `PrefixedAttribute` with given namespace
9797
* and given key, otherwise `'''null'''`.
9898
*/
99-
final def attribute(uri: String, key: String): Option[Seq[Node]] =
99+
final def attribute(uri: String, key: String): Option[collection.Seq[Node]] =
100100
attributes.get(uri, this, key)
101101

102102
/**
@@ -113,12 +113,12 @@ abstract class Node extends NodeSeq {
113113
*
114114
* @return all children of this node
115115
*/
116-
def child: Seq[Node]
116+
def child: collection.Seq[Node]
117117

118118
/**
119119
* Children which do not stringify to "" (needed for equality)
120120
*/
121-
def nonEmptyChildren: Seq[Node] = child filterNot (_.toString == "")
121+
def nonEmptyChildren: collection.Seq[Node] = child filterNot (_.toString == "")
122122

123123
/**
124124
* Descendant axis (all descendants of this node, not including node itself)
@@ -139,7 +139,7 @@ abstract class Node extends NodeSeq {
139139
case _ => false
140140
}
141141

142-
override protected def basisForHashCode: Seq[Any] =
142+
override protected def basisForHashCode: collection.Seq[Any] =
143143
prefix :: label :: attributes :: nonEmptyChildren.toList
144144

145145
override def strict_==(other: Equality) = other match {
@@ -159,7 +159,7 @@ abstract class Node extends NodeSeq {
159159
/**
160160
* returns a sequence consisting of only this node
161161
*/
162-
def theSeq: Seq[Node] = this :: Nil
162+
def theSeq: collection.Seq[Node] = this :: Nil
163163

164164
/**
165165
* String representation of this node

shared/src/main/scala/scala/xml/NodeBuffer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ package xml
1111

1212
/**
1313
* This class acts as a Buffer for nodes. If it is used as a sequence of
14-
* nodes `Seq[Node]`, it must be ensured that no updates occur after that
14+
* nodes `collection.Seq[Node]`, it must be ensured that no updates occur after that
1515
* point, because `scala.xml.Node` is assumed to be immutable.
1616
*
1717
* Despite this being a sequence, don't use it as key in a hashtable.

shared/src/main/scala/scala/xml/NodeSeq.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import scala.language.implicitConversions
2121
*/
2222
object NodeSeq {
2323
final val Empty = fromSeq(Nil)
24-
def fromSeq(s: Seq[Node]): NodeSeq = new NodeSeq {
24+
def fromSeq(s: collection.Seq[Node]): NodeSeq = new NodeSeq {
2525
def theSeq = s
2626
}
2727
type Coll = NodeSeq
@@ -31,11 +31,11 @@ object NodeSeq {
3131
def apply() = newBuilder
3232
}
3333
def newBuilder: Builder[Node, NodeSeq] = new ListBuffer[Node] mapResult fromSeq
34-
implicit def seqToNodeSeq(s: Seq[Node]): NodeSeq = fromSeq(s)
34+
implicit def seqToNodeSeq(s: collection.Seq[Node]): NodeSeq = fromSeq(s)
3535
}
3636

3737
/**
38-
* This class implements a wrapper around `Seq[Node]` that adds XPath
38+
* This class implements a wrapper around `collection.Seq[Node]` that adds XPath
3939
* and comprehension methods.
4040
*
4141
* @author Burak Emir
@@ -45,7 +45,7 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S
4545
/** Creates a list buffer as builder for this class */
4646
override protected[this] def newBuilder = NodeSeq.newBuilder
4747

48-
def theSeq: Seq[Node]
48+
def theSeq: collection.Seq[Node]
4949
def length = theSeq.length
5050
override def iterator = theSeq.iterator
5151

@@ -62,7 +62,7 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S
6262
!these.hasNext && !those.hasNext
6363
}
6464

65-
protected def basisForHashCode: Seq[Any] = theSeq
65+
protected def basisForHashCode: collection.Seq[Any] = theSeq
6666

6767
override def canEqual(other: Any) = other match {
6868
case _: NodeSeq => true

shared/src/main/scala/scala/xml/Null.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ case object Null extends MetaData {
4141
case x: MetaData => x.length == 0
4242
case _ => false
4343
}
44-
override protected def basisForHashCode: Seq[Any] = Nil
44+
override protected def basisForHashCode: collection.Seq[Any] = Nil
4545

4646
def apply(namespace: String, scope: NamespaceBinding, key: String) = null
4747
def apply(key: String) =

0 commit comments

Comments
 (0)