Remove redundant syntax

This commit is contained in:
Gary Gregory 2024-09-12 10:17:02 -04:00
parent 3739a4cd37
commit ce90d81ac2
1 changed files with 30 additions and 30 deletions

View File

@ -443,21 +443,21 @@ public class NumberUtilsTest extends AbstractLangTest {
assertEquals(new BigDecimal("1234.5"), NumberUtils.createBigDecimal("1234.5"), assertEquals(new BigDecimal("1234.5"), NumberUtils.createBigDecimal("1234.5"),
"createBigDecimal(String) failed"); "createBigDecimal(String) failed");
assertNull(NumberUtils.createBigDecimal(null), "createBigDecimal(null) failed"); assertNull(NumberUtils.createBigDecimal(null), "createBigDecimal(null) failed");
this.testCreateBigDecimalFailure(""); testCreateBigDecimalFailure("");
this.testCreateBigDecimalFailure(" "); testCreateBigDecimalFailure(" ");
this.testCreateBigDecimalFailure("\b\t\n\f\r"); testCreateBigDecimalFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateBigDecimalFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateBigDecimalFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
// sign alone not valid // sign alone not valid
this.testCreateBigDecimalFailure("-"); testCreateBigDecimalFailure("-");
// comment in NumberUtils suggests some implementations may incorrectly allow this // comment in NumberUtils suggests some implementations may incorrectly allow this
this.testCreateBigDecimalFailure("--"); testCreateBigDecimalFailure("--");
this.testCreateBigDecimalFailure("--0"); testCreateBigDecimalFailure("--0");
// sign alone not valid // sign alone not valid
this.testCreateBigDecimalFailure("+"); testCreateBigDecimalFailure("+");
// in case this was also allowed by some JVMs // in case this was also allowed by some JVMs
this.testCreateBigDecimalFailure("++"); testCreateBigDecimalFailure("++");
this.testCreateBigDecimalFailure("++0"); testCreateBigDecimalFailure("++0");
} }
protected void testCreateBigDecimalFailure(final String str) { protected void testCreateBigDecimalFailure(final String str) {
@ -469,11 +469,11 @@ public class NumberUtilsTest extends AbstractLangTest {
public void testCreateBigInteger() { public void testCreateBigInteger() {
assertEquals(new BigInteger("12345"), NumberUtils.createBigInteger("12345"), "createBigInteger(String) failed"); assertEquals(new BigInteger("12345"), NumberUtils.createBigInteger("12345"), "createBigInteger(String) failed");
assertNull(NumberUtils.createBigInteger(null), "createBigInteger(null) failed"); assertNull(NumberUtils.createBigInteger(null), "createBigInteger(null) failed");
this.testCreateBigIntegerFailure(""); testCreateBigIntegerFailure("");
this.testCreateBigIntegerFailure(" "); testCreateBigIntegerFailure(" ");
this.testCreateBigIntegerFailure("\b\t\n\f\r"); testCreateBigIntegerFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateBigIntegerFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateBigIntegerFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("0xff"), "createBigInteger(String) failed"); assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("0xff"), "createBigInteger(String) failed");
assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("0Xff"), "createBigInteger(String) failed"); assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("0Xff"), "createBigInteger(String) failed");
assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("#ff"), "createBigInteger(String) failed"); assertEquals(new BigInteger("255"), NumberUtils.createBigInteger("#ff"), "createBigInteger(String) failed");
@ -502,11 +502,11 @@ public class NumberUtilsTest extends AbstractLangTest {
public void testCreateDouble() { public void testCreateDouble() {
assertEquals(Double.valueOf("1234.5"), NumberUtils.createDouble("1234.5"), "createDouble(String) failed"); assertEquals(Double.valueOf("1234.5"), NumberUtils.createDouble("1234.5"), "createDouble(String) failed");
assertNull(NumberUtils.createDouble(null), "createDouble(null) failed"); assertNull(NumberUtils.createDouble(null), "createDouble(null) failed");
this.testCreateDoubleFailure(""); testCreateDoubleFailure("");
this.testCreateDoubleFailure(" "); testCreateDoubleFailure(" ");
this.testCreateDoubleFailure("\b\t\n\f\r"); testCreateDoubleFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateDoubleFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateDoubleFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
} }
protected void testCreateDoubleFailure(final String str) { protected void testCreateDoubleFailure(final String str) {
@ -518,11 +518,11 @@ public class NumberUtilsTest extends AbstractLangTest {
public void testCreateFloat() { public void testCreateFloat() {
assertEquals(Float.valueOf("1234.5"), NumberUtils.createFloat("1234.5"), "createFloat(String) failed"); assertEquals(Float.valueOf("1234.5"), NumberUtils.createFloat("1234.5"), "createFloat(String) failed");
assertNull(NumberUtils.createFloat(null), "createFloat(null) failed"); assertNull(NumberUtils.createFloat(null), "createFloat(null) failed");
this.testCreateFloatFailure(""); testCreateFloatFailure("");
this.testCreateFloatFailure(" "); testCreateFloatFailure(" ");
this.testCreateFloatFailure("\b\t\n\f\r"); testCreateFloatFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateFloatFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateFloatFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
} }
protected void testCreateFloatFailure(final String str) { protected void testCreateFloatFailure(final String str) {
@ -534,11 +534,11 @@ public class NumberUtilsTest extends AbstractLangTest {
public void testCreateInteger() { public void testCreateInteger() {
assertEquals(Integer.valueOf("12345"), NumberUtils.createInteger("12345"), "createInteger(String) failed"); assertEquals(Integer.valueOf("12345"), NumberUtils.createInteger("12345"), "createInteger(String) failed");
assertNull(NumberUtils.createInteger(null), "createInteger(null) failed"); assertNull(NumberUtils.createInteger(null), "createInteger(null) failed");
this.testCreateIntegerFailure(""); testCreateIntegerFailure("");
this.testCreateIntegerFailure(" "); testCreateIntegerFailure(" ");
this.testCreateIntegerFailure("\b\t\n\f\r"); testCreateIntegerFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateIntegerFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateIntegerFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
// LANG-1645 // LANG-1645
assertEquals(Integer.decode("+0xF"), NumberUtils.createInteger("+0xF")); assertEquals(Integer.decode("+0xF"), NumberUtils.createInteger("+0xF"));
} }
@ -552,11 +552,11 @@ public class NumberUtilsTest extends AbstractLangTest {
public void testCreateLong() { public void testCreateLong() {
assertEquals(Long.valueOf("12345"), NumberUtils.createLong("12345"), "createLong(String) failed"); assertEquals(Long.valueOf("12345"), NumberUtils.createLong("12345"), "createLong(String) failed");
assertNull(NumberUtils.createLong(null), "createLong(null) failed"); assertNull(NumberUtils.createLong(null), "createLong(null) failed");
this.testCreateLongFailure(""); testCreateLongFailure("");
this.testCreateLongFailure(" "); testCreateLongFailure(" ");
this.testCreateLongFailure("\b\t\n\f\r"); testCreateLongFailure("\b\t\n\f\r");
// Funky whitespaces // Funky whitespaces
this.testCreateLongFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F"); testCreateLongFailure("\u00A0\uFEFF\u000B\u000C\u001C\u001D\u001E\u001F");
// LANG-1645 // LANG-1645
assertEquals(Long.decode("+0xFFFFFFFF"), NumberUtils.createLong("+0xFFFFFFFF")); assertEquals(Long.decode("+0xFFFFFFFF"), NumberUtils.createLong("+0xFFFFFFFF"));
} }