Use uppercase L for long literals

Long literals can be specified by a lower case l (e.g., 1l) or by an
uppercase one (e.g., 1L).
This patch converts all existing long literals to use the uppercase L,
as in some terminals, the lowercase l and the 1 characters are
graphically similar, leading to possible confusions.
This commit is contained in:
Allon Mureinik 2017-03-04 05:59:58 +02:00 committed by pascalschumacher
parent 42cf674026
commit 4670a941be
2 changed files with 9 additions and 9 deletions

View File

@ -533,7 +533,7 @@ public class ObjectUtilsTest {
assertEquals("CONST(char)", (char) 3, ObjectUtils.CONST((char) 3));
assertEquals("CONST(short)", (short) 3, ObjectUtils.CONST((short) 3));
assertEquals("CONST(int)", 3, ObjectUtils.CONST(3));
assertEquals("CONST(long)", 3l, ObjectUtils.CONST(3l));
assertEquals("CONST(long)", 3L, ObjectUtils.CONST(3L));
assertEquals("CONST(float)", 3f, ObjectUtils.CONST(3f), 0);
assertEquals("CONST(double)", 3.0, ObjectUtils.CONST(3.0), 0);
assertEquals("CONST(Object)", "abc", ObjectUtils.CONST("abc"));

View File

@ -73,14 +73,14 @@ public class NumberUtilsTest {
*/
@Test
public void testToLongString() {
assertTrue("toLong(String) 1 failed", NumberUtils.toLong("12345") == 12345l);
assertTrue("toLong(String) 2 failed", NumberUtils.toLong("abc") == 0l);
assertTrue("toLong(String) 3 failed", NumberUtils.toLong("1L") == 0l);
assertTrue("toLong(String) 4 failed", NumberUtils.toLong("1l") == 0l);
assertTrue("toLong(String) 1 failed", NumberUtils.toLong("12345") == 12345L);
assertTrue("toLong(String) 2 failed", NumberUtils.toLong("abc") == 0L);
assertTrue("toLong(String) 3 failed", NumberUtils.toLong("1L") == 0L);
assertTrue("toLong(String) 4 failed", NumberUtils.toLong("1l") == 0L);
assertTrue("toLong(Long.MAX_VALUE) failed", NumberUtils.toLong(Long.MAX_VALUE+"") == Long.MAX_VALUE);
assertTrue("toLong(Long.MIN_VALUE) failed", NumberUtils.toLong(Long.MIN_VALUE+"") == Long.MIN_VALUE);
assertTrue("toLong(empty) failed", NumberUtils.toLong("") == 0l);
assertTrue("toLong(null) failed", NumberUtils.toLong(null) == 0l);
assertTrue("toLong(empty) failed", NumberUtils.toLong("") == 0L);
assertTrue("toLong(null) failed", NumberUtils.toLong(null) == 0L);
}
/**
@ -88,8 +88,8 @@ public class NumberUtilsTest {
*/
@Test
public void testToLongStringL() {
assertTrue("toLong(String,long) 1 failed", NumberUtils.toLong("12345", 5l) == 12345l);
assertTrue("toLong(String,long) 2 failed", NumberUtils.toLong("1234.5", 5l) == 5l);
assertTrue("toLong(String,long) 1 failed", NumberUtils.toLong("12345", 5L) == 12345L);
assertTrue("toLong(String,long) 2 failed", NumberUtils.toLong("1234.5", 5L) == 5L);
}
/**