summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template2
-rw-r--r--src/main/scala/spray/json/CollectionFormats.scala4
-rw-r--r--src/main/scala/spray/json/JsValue.scala2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template b/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template
index 401ac83..fa0d875 100644
--- a/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template
+++ b/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template
@@ -31,7 +31,7 @@ trait ProductFormatsInstances { self: ProductFormats with StandardFormats =>
fields.sizeHint(1 * 2)
[#fields ++= productElement##2Field[P1](fieldName1, p, 0)#
]
- JsObject(fields: _*)
+ JsObject(fields.toSeq: _*)
}
def read(value: JsValue) = {
[#val p1V = fromField[P1](value, fieldName1)#
diff --git a/src/main/scala/spray/json/CollectionFormats.scala b/src/main/scala/spray/json/CollectionFormats.scala
index 9a3e8fd..ef94297 100644
--- a/src/main/scala/spray/json/CollectionFormats.scala
+++ b/src/main/scala/spray/json/CollectionFormats.scala
@@ -27,7 +27,7 @@ trait CollectionFormats {
implicit def listFormat[T :JsonFormat] = new RootJsonFormat[List[T]] {
def write(list: List[T]) = JsArray(list.map(_.toJson).toVector)
def read(value: JsValue): List[T] = value match {
- case JsArray(elements) => elements.map(_.convertTo[T])(collection.breakOut)
+ case JsArray(elements) => elements.toIterator.map(_.convertTo[T]).toList
case x => deserializationError("Expected List as JsArray, but got " + x)
}
}
@@ -59,7 +59,7 @@ trait CollectionFormats {
def read(value: JsValue) = value match {
case x: JsObject => x.fields.map { field =>
(JsString(field._1).convertTo[K], field._2.convertTo[V])
- } (collection.breakOut)
+ }
case x => deserializationError("Expected Map as JsObject, but got " + x)
}
}
diff --git a/src/main/scala/spray/json/JsValue.scala b/src/main/scala/spray/json/JsValue.scala
index 08a673b..7cd8cd8 100644
--- a/src/main/scala/spray/json/JsValue.scala
+++ b/src/main/scala/spray/json/JsValue.scala
@@ -50,7 +50,7 @@ sealed abstract class JsValue {
*/
case class JsObject(fields: Map[String, JsValue]) extends JsValue {
override def asJsObject(errorMsg: String) = this
- def getFields(fieldNames: String*): immutable.Seq[JsValue] = fieldNames.flatMap(fields.get)(collection.breakOut)
+ def getFields(fieldNames: String*): immutable.Seq[JsValue] = fieldNames.toIterator.flatMap(fields.get).toList
}
object JsObject {
val empty = JsObject(Map.empty[String, JsValue])