]> source.dussan.org Git - jgit.git/commit
GitTimeParser: A date parser using the java.time API 41/1204141/7
authorIvan Frade <ifrade@google.com>
Mon, 11 Nov 2024 21:13:59 +0000 (13:13 -0800)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 19 Nov 2024 10:51:03 +0000 (11:51 +0100)
commit307ef6b4b51f5f9266f6212015a9b5a1f1e75df4
treee56926dce154a4eaa8443785da8ef43bb5a675d6
parent2e5fb1fcca27565a37da542b74346f25bfd439aa
GitTimeParser: A date parser using the java.time API

Replacement of GitDateParser that uses java.time classes instead of
the obsolete Date. Updating GitDateParser would have been a mess of
deprecation and methods with confusing names, so I opted for writing a
parallel class with the new types.

Some differences:

* The new DateTimeFormatter is thread-safe, so we don't need the
LocalThread cache

* No code seems to use other locale than the default, we don't need to
cache per locale either

Change-Id: If24610a055a47702fb5b7be2fc35a7c722480ee3
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserBadlyFormattedTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitTimeParserTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java
org.eclipse.jgit/src/org/eclipse/jgit/util/GitTimeParser.java [new file with mode: 0644]