Skip to content

Commit dff4e1b

Browse files
Burak Emiradriaanm
Burak Emir
authored andcommitted
removed deprecation and some unapply stuff
1 parent a9ec02f commit dff4e1b

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/library/scala/xml/Atom.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Atom[+A]( val data: A ) extends SpecialNode {
2828
def label = "#PCDATA";
2929

3030
override def equals(x:Any) = x match {
31-
case s:Atom[A] => data == s.data ;
32-
case _ => false;
31+
case s:Atom[_] => data == s.data
32+
case _ => false;
3333
}
3434

3535
/** hashcode for this Text */

src/library/scala/xml/Group.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case class Group(val nodes: Seq[Node]) extends Node {
2929
override def equals(x: Any) = x match {
3030
case z:Group => (length == z.length) && sameElements(z)
3131
case z:Node => (length == 1) && z == apply(0)
32-
case z:Seq[Node] => sameElements(z)
32+
case z:Seq[_] => sameElements(z)
3333
case z:String => text == z
3434
case _ => false;
3535
}

src/library/scala/xml/NodeSeq.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class NodeSeq extends Seq[Node] {
4343
/** structural equality */
4444
override def equals(x: Any) = x match {
4545
case z:Node => (length == 1) && z == apply(0)
46-
case z:Seq[Node] => sameElements(z)
46+
case z:Seq[_] => sameElements(z)
4747
case z:String => text == z
4848
case _ => false;
4949
}

src/library/scala/xml/PrettyPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class PrettyPrinter( width:Int, step:Int ) {
143143
val it = n.child.elements
144144
while (it.hasNext)
145145
it.next match {
146-
case _:Atom[Any] | _:Comment | _:EntityRef | _:ProcInstr =>
146+
case _:Atom[_] | _:Comment | _:EntityRef | _:ProcInstr =>
147147
case _:Node =>
148148
return false
149149
}
@@ -158,7 +158,7 @@ class PrettyPrinter( width:Int, step:Int ) {
158158

159159
case Text(s) if s.trim() == "" =>
160160
;
161-
case _:Atom[Any] | _:Comment | _:EntityRef | _:ProcInstr =>
161+
case _:Atom[_] | _:Comment | _:EntityRef | _:ProcInstr =>
162162
makeBox( ind, node.toString().trim() )
163163
case _ =>
164164
val test = {

src/library/scala/xml/dtd/ElementValidator.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ class ElementValidator() extends Function1[Node,Boolean] {
4444
this.adecls = adecls;
4545

4646
def getIterator(nodes: Seq[Node], skipPCDATA: Boolean): Iterator[ElemName] =
47-
nodes . toList
48-
. filter { x => x match {
49-
case y:SpecialNode => y match {
47+
nodes.toList
48+
.filter { x => x match {
49+
case y:SpecialNode => y match {
5050

51-
case a:Atom[String] if (a.data.asInstanceOf[String].trim().length() == 0 ) =>
51+
case a:Atom[_] if (a.data.isInstanceOf[String] &&
52+
a.data.asInstanceOf[String].trim.length == 0 ) =>
5253
false; // always skip all-whitespace nodes
5354

5455
case _ =>

0 commit comments

Comments
 (0)