diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-01-27 16:06:38 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2015-02-09 14:11:50 +0100 |
commit | 77030a5e94a90cfae223acc477c216603cf3f149 (patch) | |
tree | f1e2ee0e77732687633ddf4aac7e60a111956ccb /org.eclipse.jgit/src/org/eclipse/jgit/blame | |
parent | 27ae8bc65553879000ae6a687dbe3a888160da98 (diff) | |
download | jgit-77030a5e94a90cfae223acc477c216603cf3f149.tar.gz jgit-77030a5e94a90cfae223acc477c216603cf3f149.zip |
Implement AutoClosable interface on classes that used release()
Implement AutoClosable and deprecate the old release() method to give
JGit consumers some time to adapt.
Bug: 428039
Change-Id: Id664a91dc5a8cf2ac401e7d87ce2e3b89e221458
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/blame')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java index e69cfa9d1c..eb64425c6c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java @@ -113,7 +113,7 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter; * the ancestor, until there are no more lines to acquire information on, or the * file's creation point is discovered in history. */ -public class BlameGenerator { +public class BlameGenerator implements AutoCloseable { private final Repository repository; private final PathFilter resultPath; @@ -937,9 +937,22 @@ public class BlameGenerator { return queue != null ? queue.sourceText : null; } - /** Release the current blame session. */ + /** + * Release the current blame session. Use {@link #close()} instead. + */ + @Deprecated public void release() { - revPool.release(); + close(); + } + + /** + * Release the current blame session. + * + * @since 4.0 + */ + @Override + public void close() { + revPool.close(); queue = null; outCandidate = null; outRegion = null; |