]> source.dussan.org Git - jgit.git/commit
DfsGarbageCollector: #setReflogExpire with Instant instead of Date 99/1203799/3
authorIvan Frade <ifrade@google.com>
Fri, 8 Nov 2024 16:49:09 +0000 (08:49 -0800)
committerIvan Frade <ifrade@google.com>
Fri, 8 Nov 2024 23:06:16 +0000 (15:06 -0800)
commit9ea537d5c44876c12d154331c94a7ba14eaa64f8
treeef868efd39d528bba3ea88e1f2fe99fd04b99f84
parenta903ab5fa3defdef06b4eba316ef2436533416fb
DfsGarbageCollector: #setReflogExpire with Instant instead of Date

The Date API is full of major design flaws and pitfalls and should be
avoided at all costs. Prefer the java.time APIs, specifically,
java.time.Instant (for physical time) and java.time.LocalDate[Time]
(for civil time). [1]

Replace the Date with Instant in the
DfsGarbageCollector#setReflogExpire method.

[1] https://errorprone.info/bugpattern/JavaUtilDate

Change-Id: Ie98e426e63621e8bef96c31bca56aec0c8eef5a6
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java