The GitHub Actions job "Scalafmt" on pekko.git/fix/metric-java-math-number-support has succeeded. Run started by GitHub user He-Pin (triggered by He-Pin).
Head commit for run: ddfb337c7e07570f4c5b365eb37b06a88730c296 / 虎鸣 <[email protected]> fix: support any Number subtype in MetricNumericConverter and MessageSerializer Motivation: Metric.value is typed as java.lang.Number, so any Number subtype should be accepted without throwing. Previously only Int/Long/Double/Float/BigInt/ BigDecimal were handled; other Number subtypes (Short, Byte, AtomicInteger, AtomicLong, java.math.BigInteger) would throw IllegalArgumentException. Additionally, BigInt/BigDecimal fell through to Java ObjectOutputStream serialization in numberToProto, which is inefficient and a security concern. Modification: - Add generic `case n: Number => Left(n.longValue)` catch-all in convertNumber, with java.math.BigDecimal kept explicit (needs doubleValue) - Add BigInt/BigDecimal/java.math.BigDecimal and generic Number cases in numberToProto to use efficient protobuf encoding (Long/Double) instead of Java serialization fallback - Expand tests to cover Short, Byte, AtomicInteger, AtomicLong, BigDecimal, java.math.BigInteger, java.math.BigDecimal round-trip serialization Result: Any java.lang.Number subtype is now accepted as a Metric value. Serialization uses efficient protobuf encoding for all Number types, eliminating Java ObjectOutputStream usage for known numeric types. Tests: - sbt "cluster-metrics / Test / test" — All 59 tests passed References: Refs #3385 Report URL: https://github.com/apache/pekko/actions/runs/30173776220 With regards, GitHub Actions via GitBox --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
