diff options
author | Jonathan Nieder <jrn@google.com> | 2015-11-11 14:51:02 -0800 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2018-12-26 14:33:13 -0800 |
commit | 9895338de1c92d09fe82ec927e5ffd2da0973084 (patch) | |
tree | f2f0ac31a6a95df53a1ba35470606f60b45583e7 | |
parent | f46e223187387f50f5e09702fc033e4845bb3bf1 (diff) | |
download | jgit-9895338de1c92d09fe82ec927e5ffd2da0973084.tar.gz jgit-9895338de1c92d09fe82ec927e5ffd2da0973084.zip |
RefDatabase: Remove fallback exactRef implementation
This is simpler to implement than getRef. Make it abstract so
implementers remember to override it.
Change-Id: I5f319be1fb1206d7a0142ea939dc4e1039f850ab
Signed-off-by: Jonathan Nieder <jrn@google.com>
3 files changed, 14 insertions, 7 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java index 1c21194248..3798858414 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java @@ -95,6 +95,11 @@ public class RefDatabaseConflictingNamesTest { } @Override + public Ref exactRef(String name) throws IOException { + return null; + } + + @Override public Ref getRef(String name) throws IOException { return null; } diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index 79183a6cdd..1e18de6647 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -38,6 +38,14 @@ </message_arguments> </filter> </resource> + <resource path="src/org/eclipse/jgit/lib/RefDatabase.java" type="org.eclipse.jgit.lib.RefDatabase"> + <filter comment="class is extended by extenders but not clients of the API" id="421650549"> + <message_arguments> + <message_argument value="org.eclipse.jgit.lib.RefDatabase"/> + <message_argument value="exactRef(String)"/> + </message_arguments> + </filter> + </resource> <resource path="src/org/eclipse/jgit/revwalk/DepthWalk.java" type="org.eclipse.jgit.revwalk.DepthWalk"> <filter id="403804204"> <message_arguments> diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java index 5010a89ed5..73c7b1c613 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -290,13 +290,7 @@ public abstract class RefDatabase { * @since 4.1 */ @Nullable - public Ref exactRef(String name) throws IOException { - Ref ref = getRef(name); - if (ref == null || !name.equals(ref.getName())) { - return null; - } - return ref; - } + public abstract Ref exactRef(String name) throws IOException; /** * Read the specified references. |