Skip to content

Commit e84cc92

Browse files
committed
Update jackson-module-scala and jackson-datatype-jsr310 to 3.0.0-rc2, remove usage of jackson-module-blackbird
1 parent c407f56 commit e84cc92

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

build.sbt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,8 @@ lazy val `jsoniter-scala-benchmark` = crossProject(JVMPlatform, JSPlatform)
253253
"org.json4s" %% "json4s-ext" % "4.1.0-M8",
254254
"org.json4s" %% "json4s-jackson" % "4.1.0-M8",
255255
"org.json4s" %% "json4s-native" % "4.1.0-M8",
256-
"tools.jackson.module" %% "jackson-module-scala" % "3.0.0-rc1",
257-
"tools.jackson.datatype" % "jackson-datatype-jsr310" % "3.0.0-rc1",
258-
"tools.jackson.module" % "jackson-module-blackbird" % "3.0.0-rc1",
256+
"tools.jackson.module" %% "jackson-module-scala" % "3.0.0-rc2",
257+
"tools.jackson.datatype" % "jackson-datatype-jsr310" % "3.0.0-rc2",
259258
"org.openjdk.jmh" % "jmh-core" % "1.37",
260259
"org.openjdk.jmh" % "jmh-generator-asm" % "1.37",
261260
"org.openjdk.jmh" % "jmh-generator-bytecode" % "1.37",

jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/JacksonSerDesers.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import tools.jackson.databind.json.JsonMapper
1010
import tools.jackson.datatype.jsr310.JavaTimeModule
1111
import tools.jackson.databind.module.SimpleModule
1212
import tools.jackson.databind.ser.std.StdSerializer
13-
import tools.jackson.module.blackbird.BlackbirdModule
1413
import tools.jackson.module.scala.deser.{ImmutableBitSetDeserializer, MutableBitSetDeserializer}
1514
import tools.jackson.module.scala.{BitSetDeserializerModule, ClassTagExtensions, DefaultScalaModule}
1615
import com.github.plokhotnyuk.jsoniter_scala.benchmark.SuitEnum.SuitEnum
@@ -63,7 +62,6 @@ object JacksonSerDesers {
6362
.addDeserializer(classOf[SuitADT], new SuitADTDeserializer)
6463
.addDeserializer(classOf[SuitEnum], new SuiteEnumDeserializer)
6564
)
66-
.addModule(new BlackbirdModule)
6765
.configure(SerializationFeature.INDENT_OUTPUT, indentOutput)
6866
.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false)
6967
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)

jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/Json4sFormats.scala

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import org.json4s.ext.{EnumNameSerializer, UUIDSerializer}
55
import java.time._
66
import java.util.Base64
77
import scala.reflect.ClassTag
8+
import com.fasterxml.jackson.core._
9+
import com.fasterxml.jackson.core.util._
10+
import com.fasterxml.jackson.core.json.JsonWriteFeature
11+
import com.fasterxml.jackson.databind._
12+
import org.json4s.jackson.Json4sScalaModule
813

914
object CommonJson4sFormats {
1015
implicit val commonFormats: Formats = DefaultFormats +
@@ -47,9 +52,9 @@ object JavaTimeJson4sFormats {
4752
object GeoJsonJson4sFormats {
4853
implicit val geoJsonFormats: Formats = new DefaultFormats {
4954
override val typeHints: TypeHints = new SimpleTypeHints(List(
50-
classOf[GeoJSON.Point], classOf[GeoJSON.MultiPoint], classOf[GeoJSON.LineString],
51-
classOf[GeoJSON.MultiLineString], classOf[GeoJSON.Polygon], classOf[GeoJSON.MultiPolygon],
52-
classOf[GeoJSON.GeometryCollection], classOf[GeoJSON.Feature], classOf[GeoJSON.FeatureCollection]))
55+
classOf[GeoJSON.Point], classOf[GeoJSON.MultiPoint], classOf[GeoJSON.LineString],
56+
classOf[GeoJSON.MultiLineString], classOf[GeoJSON.Polygon], classOf[GeoJSON.MultiPolygon],
57+
classOf[GeoJSON.GeometryCollection], classOf[GeoJSON.Feature], classOf[GeoJSON.FeatureCollection]))
5358
} +
5459
new CustomSerializer[(Double, Double)](_ => ({
5560
case JArray(JDouble(x) :: JDouble(y) :: Nil) => new Tuple2[Double, Double](x, y)
@@ -92,12 +97,6 @@ class SimpleTypeHints(override val hints: List[Class[_]],
9297
}
9398

9499
object Json4sJacksonMappers {
95-
import com.fasterxml.jackson.core._
96-
import com.fasterxml.jackson.core.util._
97-
import com.fasterxml.jackson.core.json.JsonWriteFeature
98-
import com.fasterxml.jackson.databind._
99-
import org.json4s.jackson.Json4sScalaModule
100-
101100
private[this] def mapper(indentOutput: Boolean = false, escapeNonAscii: Boolean = false,
102101
useBigNumber: Boolean = false): ObjectMapper = {
103102
val jsonFactory = new JsonFactoryBuilder()
@@ -119,8 +118,8 @@ object Json4sJacksonMappers {
119118
}
120119

121120
val mapper: ObjectMapper = mapper()
121+
val jValueType: JavaType = mapper.constructType(classOf[JValue])
122122
val bigNumberMapper: ObjectMapper = mapper(useBigNumber = true)
123123
val prettyPrintMapper: ObjectMapper = mapper(indentOutput = true)
124124
val escapeNonAsciiMapper: ObjectMapper = mapper(escapeNonAscii = true)
125-
val jValueType: JavaType = mapper.constructType(classOf[JValue])
126125
}

0 commit comments

Comments
 (0)