From 78a6429c3295ecdbc35b064f7ebfa568079856df Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Fri, 28 Dec 2018 09:58:25 +0100 Subject: [PATCH] Document NumberUtils.parseNumber() trim behavior Issue: SPR-9523 --- .../src/main/java/org/springframework/util/NumberUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/util/NumberUtils.java b/spring-core/src/main/java/org/springframework/util/NumberUtils.java index dbd385490009..e890f64099cb 100644 --- a/spring-core/src/main/java/org/springframework/util/NumberUtils.java +++ b/spring-core/src/main/java/org/springframework/util/NumberUtils.java @@ -178,7 +178,8 @@ private static void raiseOverflowException(Number number, Class targetClass) /** * Parse the given {@code text} into a {@link Number} instance of the given * target class, using the corresponding {@code decode} / {@code valueOf} method. - *

Trims the input {@code String} before attempting to parse the number. + *

Trims all whitespace (leading, trailing, and in between characters) from + * the input {@code String} before attempting to parse the number. *

Supports numbers in hex format (with leading "0x", "0X", or "#") as well. * @param text the text to convert * @param targetClass the target class to parse into