diff options
author | Fabio Ponciroli <ponch78@gmail.com> | 2022-02-01 16:48:14 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2022-02-02 22:43:19 +0100 |
commit | e84988f2a5ef220362b6c3a44eb33c5c8f3d0e9b (patch) | |
tree | f3f4150c40bb4a011339c182c96911ba0a513e11 | |
parent | 035d24097dacc88c54be6349234feeda7447c372 (diff) | |
download | jgit-e84988f2a5ef220362b6c3a44eb33c5c8f3d0e9b.tar.gz jgit-e84988f2a5ef220362b6c3a44eb33c5c8f3d0e9b.zip |
Replace deprecated org.eclipse.jgit.lib.RefDatabase.getRefs
The method has been deprecated since 5.0.
Use getRefsByPrefix instead.
Bug: 534731
Change-Id: I5f1cfc1fd5ae49dc7a4ed3e039f23ed785d674f6
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java index c0259f87f5..daf4382719 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java @@ -42,6 +42,8 @@ import java.util.List; import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import java.util.function.Predicate; +import java.util.function.Function; +import java.util.stream.Collectors; import org.eclipse.jgit.events.ListenerHandle; import org.eclipse.jgit.events.RefsChangedListener; @@ -1191,7 +1193,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase { } Map<String, Ref> refs = diskRepo.getRefDatabase() - .getRefs(RefDatabase.ALL); + .getRefsByPrefix(RefDatabase.ALL).stream() + .collect(Collectors.toMap(Ref::getName, Function.identity())); Ref actualHead = refs.remove(Constants.HEAD); if (actualHead != null) { String actualLeafName = actualHead.getLeaf().getName(); |