aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java2
6 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
index 67e9a2576b..eab3b36008 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
@@ -82,7 +82,7 @@ import org.eclipse.jgit.util.FS;
* methods in this class may for example offer too much functionality or they
* offer the functionality with the wrong arguments.
*/
-public class Git {
+public class Git implements AutoCloseable {
/** The git repository this class is interacting with */
private final Repository repo;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
index 7c4776ea06..50064d52a0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
@@ -88,7 +88,7 @@ import org.eclipse.jgit.util.LongList;
* delta packed format yielding high compression of lots of object where some
* objects are similar.
*/
-public final class DfsPackFile {
+public final class DfsPackFile implements AutoCloseable {
/**
* File offset used to cache {@link #index} in {@link DfsBlockCache}.
* <p>
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
index 306a0d3896..ffe6e810bd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
@@ -89,7 +89,8 @@ import org.eclipse.jgit.util.RawParseUtils;
* delta packed format yielding high compression of lots of object where some
* objects are similar.
*/
-public class PackFile implements Iterable<PackIndex.MutableEntry> {
+public class PackFile implements Iterable<PackIndex.MutableEntry>,
+ AutoCloseable {
/** Sorts PackFiles to be most recently created to least recently created. */
public static final Comparator<PackFile> SORT = new Comparator<PackFile>() {
public int compare(final PackFile a, final PackFile b) {
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. */