diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-01-27 11:14:22 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2015-02-09 14:11:50 +0100 |
commit | 27ae8bc65553879000ae6a687dbe3a888160da98 (patch) | |
tree | 36974dc932e9e2e3cbed2ea95c7f67244b36103d /org.eclipse.jgit/src/org/eclipse/jgit/lib | |
parent | c26bc63ef168e4da3886f376d1609b392b5651c3 (diff) | |
download | jgit-27ae8bc65553879000ae6a687dbe3a888160da98.tar.gz jgit-27ae8bc65553879000ae6a687dbe3a888160da98.zip |
Implement AutoClosable interface to support try-with-resources block
Bug: 428039
Change-Id: I41880862db5303b5bea4b2184ba7844d69c997b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib')
3 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java index 0cc51d1a52..3e77a10181 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java @@ -54,7 +54,7 @@ import org.eclipse.jgit.errors.MissingObjectException; * An object database stores one or more Git objects, indexed by their unique * {@link ObjectId}. */ -public abstract class ObjectDatabase { +public abstract class ObjectDatabase implements AutoCloseable { /** Initialize a new database instance for access. */ protected ObjectDatabase() { // Protected to force extension. 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 7fea880612..b10f8063ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -57,7 +57,7 @@ import java.util.Map; * Every {@link Repository} has a single reference database, mapping names to * the tips of the object graph contained by the {@link ObjectDatabase}. */ -public abstract class RefDatabase { +public abstract class RefDatabase implements AutoCloseable { /** * Order of prefixes to search when using non-absolute references. * <p> 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 6353a5b5f3..4ef0051503 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -99,7 +99,7 @@ import org.eclipse.jgit.util.io.SafeBufferedOutputStream; * <p> * This class is thread-safe. */ -public abstract class Repository { +public abstract class Repository implements AutoCloseable { private static final ListenerList globalListeners = new ListenerList(); /** @return the global listener list observing all events in this JVM. */ |