Browse Source

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>
stable-5.3
Jonathan Nieder 9 years ago
parent
commit
9895338de1
  1. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java
  2. 8
      org.eclipse.jgit/.settings/.api_filters
  3. 8
      org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java

@ -94,6 +94,11 @@ public class RefDatabaseConflictingNamesTest {
return false;
}
@Override
public Ref exactRef(String name) throws IOException {
return null;
}
@Override
public Ref getRef(String name) throws IOException {
return null;

8
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>

8
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.

Loading…
Cancel
Save