diff --git a/shared/src/main/scala/scala/xml/MetaData.scala b/shared/src/main/scala/scala/xml/MetaData.scala index 1affff4e0..cdb988518 100644 --- a/shared/src/main/scala/scala/xml/MetaData.scala +++ b/shared/src/main/scala/scala/xml/MetaData.scala @@ -225,4 +225,6 @@ abstract class MetaData final def remove(namespace: String, owner: Node, key: String): MetaData = remove(namespace, owner.scope, key) + + protected[this] override def writeReplace(): AnyRef = this } diff --git a/shared/src/main/scala/scala/xml/NodeSeq.scala b/shared/src/main/scala/scala/xml/NodeSeq.scala index 97b2ddf2a..c99fe978c 100644 --- a/shared/src/main/scala/scala/xml/NodeSeq.scala +++ b/shared/src/main/scala/scala/xml/NodeSeq.scala @@ -155,4 +155,6 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S override def toString(): String = theSeq.mkString def text: String = (this map (_.text)).mkString + + protected[this] override def writeReplace(): AnyRef = this }