From 4162ad0dd335472ac145453f7fa339ab5347e675 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 23 May 2018 10:57:22 +0900 Subject: [PATCH] Repository: Deprecate the #getAllRefs method Callers should instead use getRefDatabase().getRefs(), which does not swallow the IOException. Replace @link with @code in the Javadoc of FileRepository, since linking to the deprecated method causes an error: Javadoc: The method getAllRefs() from the type Repository is deprecated Existing callers of the deprecated method are not adapted in this commit because many of them require more refactoring. They will be done in separate follow-up commits. Bug: 534731 Change-Id: Id84e70e4cd7be3d1ca1795512950c6abe3d18ffd Signed-off-by: David Pursehouse --- .../jgit/internal/storage/file/FileRepository.java | 8 ++++---- org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java index ed5cf2c9e..e280120a9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java @@ -477,7 +477,7 @@ public class FileRepository extends Repository { /** * {@inheritDoc} *

- * Objects known to exist but not expressed by {@link #getAllRefs()}. + * Objects known to exist but not expressed by {@code #getAllRefs()}. *

* When a repository borrows objects from another repository, it can * advertise that it safely has that other repository's references, without @@ -490,12 +490,12 @@ public class FileRepository extends Repository { } /** - * Objects known to exist but not expressed by {@link #getAllRefs()}. + * Objects known to exist but not expressed by {@code #getAllRefs()}. *

* When a repository borrows objects from another repository, it can * advertise that it safely has that other repository's references, without - * exposing any other details about the other repository. This may help - * a client trying to push changes avoid pushing more than it needs to. + * exposing any other details about the other repository. This may help a + * client trying to push changes avoid pushing more than it needs to. * * @param skips * Set of AlternateHandle Ids already seen diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index fa283d012..5fec5aadf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -1092,7 +1092,9 @@ public abstract class Repository implements AutoCloseable { * not point to any object yet. * * @return mutable map of all known refs (heads, tags, remotes). + * @deprecated use {@code getRefDatabase().getRefs()} instead. */ + @Deprecated @NonNull public Map getAllRefs() { try {