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/submodule | |
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/submodule')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java index 5db3378b78..a01f006c4c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java @@ -76,7 +76,7 @@ import org.eclipse.jgit.util.FS; /** * Walker that visits all submodule entries found in a tree */ -public class SubmoduleWalk { +public class SubmoduleWalk implements AutoCloseable { /** * The values for the config param submodule.<name>.ignore @@ -729,8 +729,22 @@ public class SubmoduleWalk { return url != null ? getSubmoduleRemoteUrl(repository, url) : null; } - /** Release any resources used by this walker's reader. */ + /** + * Release any resources used by this walker's reader. Use {@link #close()} + * instead. + */ + @Deprecated public void release() { - walk.release(); + close(); + } + + /** + * Release any resources used by this walker's reader. + * + * @since 4.0 + */ + @Override + public void close() { + walk.close(); } } |