summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-03-09 17:47:45 -0700
committerShawn Pearce <spearce@spearce.org>2015-03-09 20:59:09 -0400
commit7ab6ffdf501e53dda33335723df783a171b7e964 (patch)
tree663754b620eb3a676d68ee7004a0814075c9ffb4
parentce3997344ecb564f2af95fd366303e2c9d70143d (diff)
downloadjgit-7ab6ffdf501e53dda33335723df783a171b7e964.tar.gz
jgit-7ab6ffdf501e53dda33335723df783a171b7e964.zip
Remove AutoCloseable from internal PackFile and friends
PackFile is held by the block cache and cannot be auto closed in a try-with-resources statement. Remove the interface as JGit does explicit management of the instances. ObjectDatabase and RefDatabase are internal details of Repository and are managed with the Repository. Marking them AutoCloseable provides no value to the library or an application using the API. Change-Id: Ibee19eadd66233e6666b601583daa1834a7778f1
-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
4 files changed, 4 insertions, 5 deletions
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 45e9fc1558..58df895b4e 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 implements AutoCloseable {
+public final class DfsPackFile {
/**
* 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 223689b0f6..eb2293874f 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,8 +89,7 @@ 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>,
- AutoCloseable {
+public class PackFile implements Iterable<PackIndex.MutableEntry> {
/** 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 3e77a10181..0cc51d1a52 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 implements AutoCloseable {
+public abstract class ObjectDatabase {
/** 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 b10f8063ac..7fea880612 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 implements AutoCloseable {
+public abstract class RefDatabase {
/**
* Order of prefixes to search when using non-absolute references.
* <p>