diff options
author | Ivan Frade <ifrade@google.com> | 2024-11-20 14:06:46 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2024-11-20 14:13:56 -0800 |
commit | 4618d19629f2097f7a5c706c109284d6466596be (patch) | |
tree | 3f2b2351ad9ce375a74b52c27da46ca8ae6a4ccf /org.eclipse.jgit.test/tst/org | |
parent | ee8a4149135284e2319cb5c64de8387a3334bcdd (diff) | |
download | jgit-4618d19629f2097f7a5c706c109284d6466596be.tar.gz jgit-4618d19629f2097f7a5c706c109284d6466596be.zip |
GitTimeParser: Fix multiple errorprone and style comments
This code came from GitDateParser and inherited these issues. It is a
good time to fix them:
* Use always {} in if and fors (eclipse guide)
* Use the more efficient EnumMap for the formatters
* variable.equals(CONSTANT) instead of CONSTANT.equals(var)
https://errorprone.info/bugpattern/YodaCondition
* private constructor to prevent instantiations of a utility classes
https://errorprone.info/bugpattern/PrivateConstructorForUtilityClass
* methods named in camelCase
* Use string.split(..., int)
https://errorprone.info/bugpattern/StringSplitter
* Initialize variable in first use
Change-Id: I0ae70ad9befc66fa9c057af135f2b0b2dab3869a
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java index e5f162d11a..a59d7bc7bb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java @@ -45,7 +45,7 @@ public class GitTimeParserBadlyFormattedTest { @DataPoints public static String[] getDataPoints() { - return new String[] { "", "1970", "3000.3000.3000", "3 yesterday ago", + return new String[] { "", ".", "...", "1970", "3000.3000.3000", "3 yesterday ago", "now yesterday ago", "yesterdays", "3.day. 2.week.ago", "day ago", "Gra Feb 21 15:35:00 2007 +0100", "Sun Feb 21 15:35:00 2007 +0100", |