]> source.dussan.org Git - jgit.git/commit
GitTimeParser: Fix multiple errorprone and style comments 10/1204410/1
authorIvan Frade <ifrade@google.com>
Wed, 20 Nov 2024 22:06:46 +0000 (14:06 -0800)
committerIvan Frade <ifrade@google.com>
Wed, 20 Nov 2024 22:13:56 +0000 (14:13 -0800)
commit4618d19629f2097f7a5c706c109284d6466596be
tree3f2b2351ad9ce375a74b52c27da46ca8ae6a4ccf
parentee8a4149135284e2319cb5c64de8387a3334bcdd
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
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java
org.eclipse.jgit/src/org/eclipse/jgit/util/GitTimeParser.java