Skip to content

Commit ccec3ca

Browse files
authored
Merge pull request #704 from xuwei-k/new-wildcard-syntax
use new wildcard syntax
2 parents 2e0d1bb + a5eecfe commit ccec3ca

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class XMLTestJVM {
393393

394394
@UnitTest
395395
def t5115(): Unit = {
396-
def assertHonorsIterableContract(i: Iterable[_]): Unit = assertEquals(i.size.toLong, i.iterator.size.toLong)
396+
def assertHonorsIterableContract(i: Iterable[?]): Unit = assertEquals(i.size.toLong, i.iterator.size.toLong)
397397

398398
assertHonorsIterableContract(<a/>.attributes)
399399
assertHonorsIterableContract(<a x=""/>.attributes)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class Atom[+A](val data: A) extends SpecialNode with Serializable {
2929
override protected def basisForHashCode: Seq[Any] = Seq(data)
3030

3131
override def strict_==(other: Equality): Boolean = other match {
32-
case x: Atom[_] => data == x.data
32+
case x: Atom[?] => data == x.data
3333
case _ => false
3434
}
3535

3636
override def canEqual(other: Any): Boolean = other match {
37-
case _: Atom[_] => true
37+
case _: Atom[?] => true
3838
case _ => false
3939
}
4040

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object Equality {
5353
* Note - these functions assume strict equality has already failed.
5454
*/
5555
def compareBlithely(x1: AnyRef, x2: String): Boolean = x1 match {
56-
case x: Atom[_] => x.data == x2
56+
case x: Atom[?] => x.data == x2
5757
case x: NodeSeq => x.text == x2
5858
case _ => false
5959
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class Node extends NodeSeq {
5656
/**
5757
* used internally. Atom/Molecule = -1 PI = -2 Comment = -3 EntityRef = -5
5858
*/
59-
def isAtom: Boolean = this.isInstanceOf[Atom[_]]
59+
def isAtom: Boolean = this.isInstanceOf[Atom[?]]
6060

6161
/** The logic formerly found in typeTag$, as best I could infer it. */
6262
def doCollectNamespaces: Boolean = true // if (tag >= 0) DO collect namespaces

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ class NodeBuffer extends scala.collection.mutable.ArrayBuffer[Node] with ScalaVe
3939
def &+(o: Any): NodeBuffer = {
4040
o match {
4141
case null | _: Unit | Text("") => // ignore
42-
case it: Iterator[_] => it.foreach(&+)
42+
case it: Iterator[?] => it.foreach(&+)
4343
case n: Node => super.+=(n)
44-
case ns: Iterable[_] => this &+ ns.iterator
45-
case ns: Array[_] => this &+ ns.iterator
44+
case ns: Iterable[?] => this &+ ns.iterator
45+
case ns: Array[?] => this &+ ns.iterator
4646
case d => super.+=(new Atom(d))
4747
}
4848
this

shared/src/main/scala/scala/xml/PrettyPrinter.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
136136

137137
protected def childrenAreLeaves(n: Node): Boolean = {
138138
def isLeaf(l: Node): Boolean = l match {
139-
case _: Atom[_] | _: Comment | _: EntityRef | _: ProcInstr => true
139+
case _: Atom[?] | _: Comment | _: EntityRef | _: ProcInstr => true
140140
case _ => false
141141
}
142142
n.child.forall(isLeaf)
@@ -152,7 +152,7 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
152152

153153
case Text(s) if s.trim.isEmpty =>
154154

155-
case _: Atom[_] | _: Comment | _: EntityRef | _: ProcInstr =>
155+
case _: Atom[?] | _: Comment | _: EntityRef | _: ProcInstr =>
156156
makeBox(ind, node.toString.trim)
157157
case Group(xs) =>
158158
traverse(xs.iterator, pscope, ind)

shared/src/test/scala/scala/xml/PatternMatchingTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PatternMatchingTest {
5757

5858
object SafeNodeSeq {
5959
def unapplySeq(any: Any): Option[Seq[Node]] = any match {
60-
case s: Seq[_] => Some(s.flatMap {
60+
case s: Seq[?] => Some(s.flatMap {
6161
case n: Node => n
6262
case _ => NodeSeq.Empty
6363
})

shared/src/test/scala/scala/xml/XMLTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ Ours is the portal of hope, come as you are."
408408

409409
@UnitTest
410410
def t5115(): Unit = {
411-
def assertHonorsIterableContract(i: Iterable[_]): Unit = assertEquals(i.size.toLong, i.iterator.size.toLong)
411+
def assertHonorsIterableContract(i: Iterable[?]): Unit = assertEquals(i.size.toLong, i.iterator.size.toLong)
412412

413413
assertHonorsIterableContract(<a/>.attributes)
414414
assertHonorsIterableContract(<a x=""/>.attributes)

0 commit comments

Comments
 (0)