From 4670a941be92a55fbaaa3b4055d444e07ffcadb0 Mon Sep 17 00:00:00 2001 From: Allon Mureinik Date: Sat, 4 Mar 2017 05:59:58 +0200 Subject: [PATCH] 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. --- .../apache/commons/lang3/ObjectUtilsTest.java | 2 +- .../commons/lang3/math/NumberUtilsTest.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java index b57ae2d45..a5f7e1a8c 100644 --- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java @@ -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")); diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java index 97f901251..e50423923 100644 --- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java @@ -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); } /**