diff options
author | Ivan Frade <ifrade@google.com> | 2024-12-17 15:40:38 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2024-12-23 12:56:31 -0800 |
commit | fba765626899fac2e16d899551c86d4864bc1de0 (patch) | |
tree | 7d324a85db8d342daa149b4ac247338d05fc472d /org.eclipse.jgit.junit/src | |
parent | 478c91216ff1867b747bbe6cfe0c180b4e0bbdf4 (diff) | |
download | jgit-fba765626899fac2e16d899551c86d4864bc1de0.tar.gz jgit-fba765626899fac2e16d899551c86d4864bc1de0.zip |
LocalDiskRepositoryTestCase: Use java.time API to create PersonIdent
This code is using deprecated methods in the mock system reader to
invoke a deprecated constructor of PersonIdent. Both classes have now
new methods with the java.time API.
Use java.time methods to get the timestamp and timezone and build the
PersonIdent.
Change-Id: I4271d9d1d3c9128cfcedc680410448498530de88
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 407290a399..c15fc9921e 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.time.Instant; +import java.time.ZoneId; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -233,8 +234,8 @@ public abstract class LocalDiskRepositoryTestCase { */ protected void tick() { mockSystemReader.tick(5 * 60); - final long now = mockSystemReader.getCurrentTime(); - final int tz = mockSystemReader.getTimezone(now); + Instant now = mockSystemReader.now(); + ZoneId tz = mockSystemReader.getTimeZoneId(); author = new PersonIdent(author, now, tz); committer = new PersonIdent(committer, now, tz); |