From 8187debb7148483d991b7fa131e0c66cdee6e646 Mon Sep 17 00:00:00 2001 From: Szabolcs Berecz Date: Sun, 17 Feb 2013 13:56:13 +0100 Subject: SI-7074 Fix xml attribute sorting Sorting the attributes of an xml element could drop some of the attributes. It was caused by the incorrect use of MetaData#copy() to concatenate "smaller" with the rest of the attributes. The MetaData#copy() method is similar to the following hypothetical method on a List: def copy(other: List): List = head :: other The fix prepends all elements of "smaller" to the rest of the attributes in the proper order. --- test/files/run/t7074.check | 9 +++++++++ test/files/run/t7074.scala | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/files/run/t7074.check create mode 100644 test/files/run/t7074.scala (limited to 'test/files/run') diff --git a/test/files/run/t7074.check b/test/files/run/t7074.check new file mode 100644 index 0000000000..ab9cf11f16 --- /dev/null +++ b/test/files/run/t7074.check @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/test/files/run/t7074.scala b/test/files/run/t7074.scala new file mode 100644 index 0000000000..693a076a7a --- /dev/null +++ b/test/files/run/t7074.scala @@ -0,0 +1,15 @@ +import scala.xml.Utility.sort + +object Test extends App { + println(sort()) + println(sort()) + println(sort()) + println(sort()) + println(sort()) + + println(sort()) + println(sort()) + println(sort()) + println(sort()) +} + -- cgit v1.2.3