Skip to content

Commit

Permalink
jackson 2.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington committed Oct 11, 2024
1 parent 9582455 commit 4599092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package com.netflix.atlas.json

import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.JsonToken
import com.fasterxml.jackson.core.io.doubleparser.JavaDoubleParser

object JsonParserHelper {

Expand Down Expand Up @@ -94,11 +93,16 @@ object JsonParserHelper {
parser.nextToken() match {
case VALUE_NUMBER_INT => parser.getValueAsDouble
case VALUE_NUMBER_FLOAT => parser.getValueAsDouble
case VALUE_STRING => JavaDoubleParser.parseDouble(parser.getText)
case VALUE_STRING => parseDouble(parser.getText)
case t => fail(parser, s"expected VALUE_NUMBER_FLOAT but received $t")
}
}

private def parseDouble(v: String): Double = {
// Common case for string encoding is NaN
if (v == "NaN") Double.NaN else java.lang.Double.parseDouble(v)
}

def foreachItem[T](parser: JsonParser)(f: => T): Unit = {
requireNextToken(parser, JsonToken.START_ARRAY)
var t = parser.nextToken()
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Dependencies {
val pekko = "1.0.3"
val pekkoHttpV = "1.0.1"
val iep = "5.0.26"
val jackson = "2.17.2"
val jackson = "2.18.0"
val log4j = "2.24.1"
val scala = "2.13.15"
val slf4j = "2.0.16"
Expand Down

0 comments on commit 4599092

Please sign in to comment.