mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-27 01:19:02 +00:00
Prior to this commit, a `Number` was converted to a `String` and then the string was parsed/matched using regular expressions back into a suitable `long` which was inefficient and also prevented valid data size values such as 10.0. To address those issues, this commit refactors NumberToDataSizeConverter to use DataSize.ofBytes(long) directly, first checking that the supplied Number does not have a fractional part. Closes gh-36956 Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>