]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] Fix pattern LongLiteralLowerCaseSuffix 16/1194016/2
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 28 Apr 2024 20:46:09 +0000 (22:46 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 29 Apr 2024 13:05:31 +0000 (15:05 +0200)
See https://errorprone.info/bugpattern/LongLiteralLowerCaseSuffix

Change-Id: I139eadef5d66dfed2952ba9e1c91b3fe83259e97

org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java
tools/BUILD

index 82af34ded2d3ffcd23d6d3257616f649503f2b21..6872289a8b0f7076de33a3399cd3dd5db2bc690f 100644 (file)
@@ -153,9 +153,9 @@ public class RevCommitParseTest extends RepositoryTestCase {
                        c.parseCanonical(rw, b.toString().getBytes(UTF_8));
                }
                assertEquals(
-                               new PersonIdent("", "a_u_thor@example.com", 1218123387000l, 7),
+                               new PersonIdent("", "a_u_thor@example.com", 1218123387000L, 7),
                                c.getAuthorIdent());
-               assertEquals(new PersonIdent("", "", 1218123390000l, -5),
+               assertEquals(new PersonIdent("", "", 1218123390000L, -5),
                                c.getCommitterIdent());
        }
 
index f5658abceb4cbc2538509fbc9b197226550c948b..cee023d5a95efe45b7ddc1de1f889ca3f9e9a2b9 100644 (file)
@@ -73,7 +73,7 @@ public class PushCertificateIdentTest {
        @Test
        public void fuzzyCasesMatchPersonIdent() throws Exception {
                // See RawParseUtils_ParsePersonIdentTest#testParsePersonIdent_fuzzyCases()
-               Date when = new Date(1234567890000l);
+               Date when = new Date(1234567890000L);
                TimeZone tz = TimeZone.getTimeZone("GMT-7");
 
                assertMatchesPersonIdent(
@@ -89,7 +89,7 @@ public class PushCertificateIdentTest {
        @Test
        public void incompleteCasesMatchPersonIdent() throws Exception {
                // See RawParseUtils_ParsePersonIdentTest#testParsePersonIdent_incompleteCases()
-               Date when = new Date(1234567890000l);
+               Date when = new Date(1234567890000L);
                TimeZone tz = TimeZone.getTimeZone("GMT-7");
 
                assertMatchesPersonIdent(
index ee3ce8d98ccc0bf1708b81b251c91665c47d4218..355bbbab16aa9ca87278624b7fb236a2b3d2572e 100644 (file)
@@ -22,7 +22,7 @@ public class RawParseUtils_ParsePersonIdentTest {
 
        @Test
        public void testParsePersonIdent_legalCases() {
-               final Date when = new Date(1234567890000l);
+               final Date when = new Date(1234567890000L);
                final TimeZone tz = TimeZone.getTimeZone("GMT-7");
 
                assertPersonIdent("Me <me@example.com> 1234567890 -0700",
@@ -50,7 +50,7 @@ public class RawParseUtils_ParsePersonIdentTest {
 
        @Test
        public void testParsePersonIdent_fuzzyCases() {
-               final Date when = new Date(1234567890000l);
+               final Date when = new Date(1234567890000L);
                final TimeZone tz = TimeZone.getTimeZone("GMT-7");
 
                assertPersonIdent(
@@ -64,7 +64,7 @@ public class RawParseUtils_ParsePersonIdentTest {
 
        @Test
        public void testParsePersonIdent_incompleteCases() {
-               final Date when = new Date(1234567890000l);
+               final Date when = new Date(1234567890000L);
                final TimeZone tz = TimeZone.getTimeZone("GMT-7");
 
                assertPersonIdent("Me <> 1234567890 -0700", new PersonIdent("Me", "",
index 38c7e7fb8fa633d8d8da6668d7ef5114aada1a6c..2c7fd42732e2bc09ae0ba813b1795fb6917cc6f7 100644 (file)
@@ -251,7 +251,7 @@ java_package_configuration(
         "-Xep:LockOnBoxedPrimitive:ERROR",
         "-Xep:LogicalAssignment:ERROR",
         "-Xep:LongFloatConversion:ERROR",
-        "-Xep:LongLiteralLowerCaseSuffix:WARN",
+        "-Xep:LongLiteralLowerCaseSuffix:ERROR",
         "-Xep:LoopConditionChecker:ERROR",
         "-Xep:LoopOverCharArray:ERROR",
         "-Xep:LossyPrimitiveCompare:ERROR",