aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2024-11-04 15:23:47 -0800
committerIvan Frade <ifrade@google.com>2024-12-13 13:23:12 -0800
commit320a95e37d3f791b0d16ff7753bc1d7b68b0681f (patch)
treef853bb9f777bc933e8f06a5478968d7943ab2d6a /org.eclipse.jgit.test/tst/org/eclipse
parent9cf0a1f174886f844f61d056d4c3383415d27b9e (diff)
downloadjgit-320a95e37d3f791b0d16ff7753bc1d7b68b0681f.tar.gz
jgit-320a95e37d3f791b0d16ff7753bc1d7b68b0681f.zip
TestRepository: Deprecate #getDate and use #getInstant instead
Errorprone recomments to use the more modern java.time API instead of the java.util.Date family of classes. This removes all uses of TestRepository#getDate and replace them with getInstant. The method is marked as deprecated and doesn't have any other usages. Change-Id: I84ea63abf781d0d3c7c2724891fd2ef7afc2db1d
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
index 450b753d94..924703464b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
@@ -275,9 +275,9 @@ public class TestRepositoryTest {
RevCommit toPick = tr.commit()
.parent(tr.commit().create()) // Can't cherry-pick root.
.author(new PersonIdent("Cherrypick Author", "cpa@example.com",
- tr.getDate(), tr.getTimeZone()))
+ tr.getInstant(), tr.getTimeZoneId()))
.author(new PersonIdent("Cherrypick Committer", "cpc@example.com",
- tr.getDate(), tr.getTimeZone()))
+ tr.getInstant(), tr.getTimeZoneId()))
.message("message to cherry-pick")
.add("bar", "bar contents\n")
.create();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
index ec0c0e7e84..b37a19dd7a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
@@ -39,7 +39,7 @@ public abstract class RevWalkTestCase extends RepositoryTestCase {
}
protected Date getDate() {
- return util.getDate();
+ return Date.from(util.getInstant());
}
protected void tick(int secDelta) {