From 8a8e45dd27ff4b7cad0e2624e1b2bcce8b72ef72 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 28 Apr 2024 22:46:09 +0200 Subject: [PATCH] [errorprone] Fix pattern LongLiteralLowerCaseSuffix See https://errorprone.info/bugpattern/LongLiteralLowerCaseSuffix Change-Id: I139eadef5d66dfed2952ba9e1c91b3fe83259e97 --- .../tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java | 4 ++-- .../eclipse/jgit/transport/PushCertificateIdentTest.java | 4 ++-- .../jgit/util/RawParseUtils_ParsePersonIdentTest.java | 6 +++--- tools/BUILD | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java index 82af34ded2..6872289a8b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java @@ -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()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java index f5658abceb..cee023d5a9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java @@ -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( diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java index ee3ce8d98c..355bbbab16 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java @@ -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 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", "", diff --git a/tools/BUILD b/tools/BUILD index 38c7e7fb8f..2c7fd42732 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -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", -- 2.39.5