From 5f2568e36b87d183fd4e4442d5c304db628846c4 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 10 Jan 2012 09:49:46 -0800 Subject: 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. --- src/library/scala/xml/PrefixedAttribute.scala | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/library') 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. -- cgit v1.2.3