Permalink
Browse files

Rearrange to satisfy MiMa

  • Loading branch information...
travisbrown committed Jan 9, 2019
1 parent 24db3b2 commit 3e8ce006ef44461063ea3bf1e0c9c1bfa3c0d9c6
Showing with 2 additions and 2 deletions.
  1. +2 −2 modules/core/shared/src/main/scala/io/circe/JsonNumber.scala
@@ -84,6 +84,7 @@ sealed abstract class JsonNumber extends Serializable {
private[circe] sealed abstract class BiggerDecimalJsonNumber extends JsonNumber {
final def toBigDecimal: Option[BigDecimal] = toBiggerDecimal.toBigDecimal.map(BigDecimal(_))
final def toBigInt: Option[BigInt] = toBiggerDecimal.toBigInteger.map(BigInt(_))
def toDouble: Double = toBiggerDecimal.toDouble
final def toLong: Option[Long] = toBiggerDecimal.toLong
}

@@ -99,14 +100,13 @@ private[circe] final case class JsonDecimal(value: String) extends BiggerDecimal
} else result
}

def toDouble: Double = java.lang.Double.parseDouble(value)
override final def toDouble: Double = java.lang.Double.parseDouble(value)
override def toString: String = value
private[circe] def appendToStringBuilder(builder: StringBuilder): Unit = builder.append(value)
}

private[circe] final case class JsonBiggerDecimal(value: BiggerDecimal) extends BiggerDecimalJsonNumber {
private[circe] def toBiggerDecimal: BiggerDecimal = value
def toDouble: Double = value.toDouble
override def toString: String = value.toString
private[circe] def appendToStringBuilder(builder: StringBuilder): Unit = value.appendToStringBuilder(builder)
}

0 comments on commit 3e8ce00

Please sign in to comment.