diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-10 09:49:46 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-10 09:49:46 -0800 |
commit | 5f2568e36b87d183fd4e4442d5c304db628846c4 (patch) | |
tree | 6a19560879d63dd3c8f8341b6c9c198428288a87 /src | |
parent | 3bdd7aa24567be7c21d33759d7e42a0c43e6bbcd (diff) | |
download | scala-5f2568e36b87d183fd4e4442d5c304db628846c4.tar.gz scala-5f2568e36b87d183fd4e4442d5c304db628846c4.tar.bz2 scala-5f2568e36b87d183fd4e4442d5c304db628846c4.zip |
Revert "Accept prefixed xml attributes with null value"
This reverts commit 51089b34a7a535498dee42e6465d4d577d65b7d5.
A scaladoc test is failing and I have no time to look at it.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/xml/PrefixedAttribute.scala | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/library/scala/xml/PrefixedAttribute.scala b/src/library/scala/xml/PrefixedAttribute.scala index b80d6a1c73..436dfcda43 100644 --- a/src/library/scala/xml/PrefixedAttribute.scala +++ b/src/library/scala/xml/PrefixedAttribute.scala @@ -13,25 +13,22 @@ package scala.xml * * @param pre ... * @param key ... - * @param value the attribute value + * @param value the attribute value, which may not be null * @param next ... */ class PrefixedAttribute( val pre: String, val key: String, val value: Seq[Node], - val next1: MetaData) + val next: MetaData) extends Attribute { - val next = if (value ne null) next1 else next1.remove(key) + if (value eq null) + throw new UnsupportedOperationException("value is null") - /** same as this(pre, key, Text(value), next), or no attribute if value is null */ + /** same as this(key, Utility.parseAttributeValue(value), next) */ def this(pre: String, key: String, value: String, next: MetaData) = - this(pre, key, if (value ne null) Text(value) else null: NodeSeq, next) - - /** same as this(pre, key, value.get, next), or no attribute if value is None */ - def this(pre: String, key: String, value: Option[Seq[Node]], next: MetaData) = - this(pre, key, value.orNull, next) + this(pre, key, Text(value), next) /** Returns a copy of this unprefixed attribute with the given * next field. |