Skip to content

Commit

Permalink
#105: getSimpleName is using reflection, and reflection in Java 8 and…
Browse files Browse the repository at this point in the history
… Java 11 uses different algorithm - JLS3 "Binary Compatibility" you can read more about it if interested; this PR addresses that and removes reflection completely from this SerDe
  • Loading branch information
lsulak committed Feb 29, 2024
1 parent 79a0bed commit 4a34b7f
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ object SerializationUtils {
private case object ResultValueTypeSerializer extends CustomSerializer[ResultValueType](format => (
{
case JString(resultValType) => resultValType match {
case "String" => String
case "Long" => Long
case "BigDecimal" => BigDecimal
case "Double" => Double
case "String" => String
case "Long" => Long
case "BigDecimal" => BigDecimal
case "Double" => Double
}
case JNull => null
},
{
case resultValType: ResultValueType => JString(resultValType.getClass.getSimpleName.replace("$",""))
case resultValType: ResultValueType => resultValType match {
case String => JString("String")
case Long => JString("Long")
case BigDecimal => JString("BigDecimal")
case Double => JString("Double")
}
}))

}

0 comments on commit 4a34b7f

Please sign in to comment.