From 77030a5e94a90cfae223acc477c216603cf3f149 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 27 Jan 2015 16:06:38 +0100 Subject: 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 --- .../org/eclipse/jgit/submodule/SubmoduleWalk.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/submodule') 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..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(); } } -- cgit v1.2.3