diff options
-rw-r--r-- | src/library/scala/xml/Node.scala | 9 | ||||
-rw-r--r-- | src/library/scala/xml/NodeSeq.scala | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/library/scala/xml/Node.scala b/src/library/scala/xml/Node.scala index 5636c7ddcc..c5b990fe88 100644 --- a/src/library/scala/xml/Node.scala +++ b/src/library/scala/xml/Node.scala @@ -142,6 +142,7 @@ abstract class Node extends NodeSeq { this.prefix == that.prefix && this.label == that.label && this.attributes == that.attributes && + this.scope == that.scope && equalChildren(that) case _ => false } @@ -157,13 +158,11 @@ abstract class Node extends NodeSeq { } /** <p> - * Returns a hashcode. The default implementation here calls only - * super.hashcode (which is the same as for objects). A more useful - * implementation can be invoked by calling - * <code>Utility.hashCode(pre, label, attributes.hashCode(), child)</code>. + * Returns a hashcode. * </p> */ - override def hashCode(): Int = super.hashCode + override def hashCode(): Int = + Utility.hashCode(prefix, label, attributes.hashCode(), scope.hashCode(), child) // implementations of NodeSeq methods diff --git a/src/library/scala/xml/NodeSeq.scala b/src/library/scala/xml/NodeSeq.scala index de6e38d5b7..cae43cb621 100644 --- a/src/library/scala/xml/NodeSeq.scala +++ b/src/library/scala/xml/NodeSeq.scala @@ -56,7 +56,7 @@ abstract class NodeSeq extends immutable.Seq[Node] with SeqLike[Node, NodeSeq] { def apply(i: Int): Node = theSeq(i) def apply(f: Node => Boolean): NodeSeq = filter(f) - /** structural equality */ + /** structural equality (XXX - this shatters any hope of hashCode equality) */ override def equals(x: Any): Boolean = x match { case z:Node => (length == 1) && z == apply(0) case z:Seq[_] => sameElements(z) |