diff options
author | Paul Phillips <paulp@improving.org> | 2011-04-10 02:18:08 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-04-10 02:18:08 +0000 |
commit | 8a64f16fe1af955d11bce887a56fe07aecd0a791 (patch) | |
tree | 19de1a721286725db208dde4fff39245182f6c34 /src/library | |
parent | 8a2df2dc7066210d6db00c42bf9312b8c237b0f7 (diff) | |
download | scala-8a64f16fe1af955d11bce887a56fe07aecd0a791.tar.gz scala-8a64f16fe1af955d11bce887a56fe07aecd0a791.tar.bz2 scala-8a64f16fe1af955d11bce887a56fe07aecd0a791.zip |
More fun with xml and elements not appearing eq...
More fun with xml and elements not appearing equal. Closes #4387, no
review.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/xml/Attribute.scala | 10 | ||||
-rw-r--r-- | src/library/scala/xml/Elem.scala | 3 | ||||
-rw-r--r-- | src/library/scala/xml/MetaData.scala | 7 |
3 files changed, 4 insertions, 16 deletions
diff --git a/src/library/scala/xml/Attribute.scala b/src/library/scala/xml/Attribute.scala index dfee02c48a..5b69017e70 100644 --- a/src/library/scala/xml/Attribute.scala +++ b/src/library/scala/xml/Attribute.scala @@ -64,16 +64,6 @@ abstract trait Attribute extends MetaData { (next(arg, scope, key) == null) && (next wellformed scope) } - override def canEqual(other: Any) = other match { - case _: Attribute => true - case _ => false - } - override def strict_==(other: Equality) = other match { - case x: Attribute => (pre == x.pre) && (key == x.key) && (value sameElements x.value) && (next == x.next) - case _ => false - } - override def basisForHashCode = List(pre, key, value) - /** Appends string representation of only this attribute to stringbuffer. */ def toString1(sb: StringBuilder) { diff --git a/src/library/scala/xml/Elem.scala b/src/library/scala/xml/Elem.scala index b068a1a17d..4ea7e90de2 100644 --- a/src/library/scala/xml/Elem.scala +++ b/src/library/scala/xml/Elem.scala @@ -17,8 +17,7 @@ package scala.xml * Copyright 2008 Google Inc. All Rights Reserved. * @author Burak Emir <bqe@google.com> */ -object Elem -{ +object Elem { def apply(prefix: String,label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*) = new Elem(prefix,label,attributes,scope,child:_*) diff --git a/src/library/scala/xml/MetaData.scala b/src/library/scala/xml/MetaData.scala index ff3071e050..2e55a9d67e 100644 --- a/src/library/scala/xml/MetaData.scala +++ b/src/library/scala/xml/MetaData.scala @@ -71,8 +71,7 @@ object MetaData { * Copyright 2008 Google Inc. All Rights Reserved. * @author Burak Emir <bqe@google.com> */ -abstract class MetaData extends Iterable[MetaData] with Equality with Serializable -{ +abstract class MetaData extends Iterable[MetaData] with Equality with Serializable { /** Updates this MetaData with the MetaData given as argument. All attributes that occur in updates * are part of the resulting MetaData. If an attribute occurs in both this instance and * updates, only the one in updates is part of the result (avoiding duplicates). For prefixed @@ -135,10 +134,10 @@ abstract class MetaData extends Iterable[MetaData] with Equality with Serializab case _ => false } override def strict_==(other: Equality) = other match { - case m: MetaData => this.toSet == m.toSet + case m: MetaData => this.asAttrMap == m.asAttrMap case _ => false } - def basisForHashCode: Seq[Any] = List(this.toSet) + def basisForHashCode: Seq[Any] = List(this.asAttrMap) /** Returns an iterator on attributes */ def iterator: Iterator[MetaData] = Iterator.single(this) ++ next.iterator |