Skip to content

Commit

Permalink
Move objectNodeSetAll to companion object
Browse files Browse the repository at this point in the history
Resolves binary compat issue.
  • Loading branch information
etspaceman authored and travisbrown committed Dec 16, 2019
1 parent cd1c26d commit e4643b9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion 210/src/main/scala/io/circe/jackson/JacksonCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ private[jackson] trait JacksonCompat {
parser: JsonParser
): Unit =
context.handleUnexpectedToken(klass, parser)
}

protected def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
private[jackson] object JacksonCompat {
def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
node.setAll[JsonNode](fields)
}
4 changes: 3 additions & 1 deletion 25/src/main/scala/io/circe/jackson/JacksonCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ private[jackson] trait JacksonCompat {
parser: JsonParser
): Unit =
throw context.mappingException(klass)
}

protected def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
private[jackson] object JacksonCompat {
def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
node.setAll(fields)
}
4 changes: 3 additions & 1 deletion 27/src/main/scala/io/circe/jackson/JacksonCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ private[jackson] trait JacksonCompat {
parser: JsonParser
): Unit =
throw context.mappingException(klass)
}

protected def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
private[jackson] object JacksonCompat {
def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
node.setAll(fields)
}
4 changes: 3 additions & 1 deletion 28/src/main/scala/io/circe/jackson/JacksonCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ private[jackson] trait JacksonCompat {
parser: JsonParser
): Unit =
context.handleUnexpectedToken(klass, parser)
}

protected def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
private[jackson] object JacksonCompat {
def objectNodeSetAll(node: ObjectNode, fields: java.util.Map[String, JsonNode]): JsonNode =
node.setAll(fields)
}
5 changes: 4 additions & 1 deletion shared/src/main/scala/io/circe/jackson/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ package object jackson extends WithJacksonMapper with JacksonParser with Jackson
},
TextNode.valueOf(_),
array => JsonNodeFactory.instance.arrayNode.addAll(array.map(circeToJackson).asJava),
obj => objectNodeSetAll(JsonNodeFactory.instance.objectNode, obj.toMap.mapValues(circeToJackson).asJava)
obj => JacksonCompat.objectNodeSetAll(
JsonNodeFactory.instance.objectNode,
obj.toMap.mapValues(circeToJackson).asJava
)
)

/**
Expand Down

0 comments on commit e4643b9

Please sign in to comment.