From a2d41db55aa46bd4fedb215c978f03e282cf1ffb Mon Sep 17 00:00:00 2001
From: Rob Tompkins Checks whether the String a valid Java number. Valid numbers include hexadecimal marked with the String
to check
* @return true
if the string is a correctly formatted number
- * @since 3.3 the code supports hex {@code 0Xhhh} and octal {@code 0ddd} validation
- * @deprecated This feature will be removed in Lang 4.0, use {@link NumberUtils#isCreatable(String)} instead
+ * @since 3.3 the code supports hex {@code 0Xhhh} an
+ * octal {@code 0ddd} validation
+ * @deprecated This feature will be removed in Lang 4.0,
+ * use {@link NumberUtils#isCreatable(String)} instead
*/
@Deprecated
public static boolean isNumber(final String str) {
@@ -1377,9 +1379,9 @@ public static boolean isNumber(final String str) {
* 0x
or
- * 0X
qualifier, octal numbers, scientific notation and numbers
- * marked with a type qualifier (e.g. 123L).0X
qualifier, octal numbers, scientific notation and
+ * numbers marked with a type qualifier (e.g. 123L).
Non-hexadecimal strings beginning with a leading zero are
* treated as octal values. Thus the string 09
will return
* false
, since 9
is not a valid octal value.
@@ -1405,7 +1407,8 @@ public static boolean isCreatable(final String str) {
boolean hasDecPoint = false;
boolean allowSigns = false;
boolean foundDigit = false;
- boolean isJava6 = StringUtils.startsWith(System.getProperty("java.version"), "1.6");
+ boolean isJava6 = StringUtils.startsWith(
+ System.getProperty("java.version"), "1.6");
// deal with any possible sign up front
final int start = (chars[0] == '-' || chars[0] == '+') ? 1 : 0;
final boolean hasLeadingPlusSign = (start == 1 && chars[0] == '+');